diff --git a/CHANGELOG b/CHANGELOG
index aec8ac1362e2dbbf2f1e4d06a6ec6422e921b3d3..20e7a36a38c83e77511d058c8e9f459732964672 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -5,7 +5,36 @@
 Changelog
 ================================================================================
 
-Release 1.1
+Release 1.2.0
+--------------------------------------------------------------------------------
+
+* Graph optimizer has been separated from the sidechain module and can now be 
+  used for arbitrary optimization problems. Available optimization algorithms 
+  are TreePack, AStar and MonteCarlo.
+* Make it possible to distinguish between the scores of a loop towards a constant
+  environment (external scores) and the scores within the loop itself 
+  (internal scores).
+* Most scores based on pairwise interactions are now pairwise decomposable.
+* Disconnected loops at several locations can be scored at once.
+* Avoid the usage of the DSSP executable and use the OpenStructure internal
+  secondary structure assignment instead.
+* Allow to decide whether the CB atom belongs to the actual rotamer or to the
+  constant frame in sidechain optimization. This can be useful in design 
+  questions, where the identity of a rotamer is not given and you want to 
+  allow glycine or alanine.
+* The naming of the entries in the StructureDB is not strictly limited to 
+  4 letter codes anymore, arbitrary strings can be used instead.
+* Adding coordinates to the StructureDB does not require external tools anymore
+  (msms, dssp etc.), internal implementations are used instead.
+* The data that is stored in a StructureDB can be controlled at initialization,
+  everything except the sequence and the actual coordinates is optional.
+* Entries in the StructureDB can be removed again.
+* Allow to search positions of arbitrary copies in DynamicSpatialOrganizer 
+  by providing RT operators.
+* Several minor bug fixes, improvements, and speed-ups
+
+
+Release 1.1.0
 --------------------------------------------------------------------------------
 
 * Updated dependencies: need Eigen 3.3.0 and OST 1.7
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7dd378fb162fe14960ac583ef3d2c8c792996f36..f8f1e39cc62f23c259804f99dcfe3d8e91afaa36 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -16,7 +16,7 @@ include(PROMOD3)
 
 # versioning info
 set(PROMOD3_VERSION_MAJOR 1)
-set(PROMOD3_VERSION_MINOR 1)
+set(PROMOD3_VERSION_MINOR 2)
 set(PROMOD3_VERSION_PATCH 0)
 set(PROMOD3_VERSION_STRING ${PROMOD3_VERSION_MAJOR}.${PROMOD3_VERSION_MINOR})
 set(PROMOD3_VERSION_STRING ${PROMOD3_VERSION_STRING}.${PROMOD3_VERSION_PATCH})
@@ -84,9 +84,9 @@ if(NOT DISABLE_DOCUMENTATION)
   find_package(Sphinx ${PYTHON_VERSION} REQUIRED)
   set(PYTHON_DOC_URL "https://docs.python.org/${PYTHON_VERSION}")
   # set this to the URL corresponding to the version of OST you are using
-  set(OST_DOC_URL "http://www.openstructure.org/docs/dev")
+  set(OST_DOC_URL "https://www.openstructure.org/docs/dev")
 endif()
-find_package(OPENSTRUCTURE 1.7 REQUIRED 
+find_package(OPENSTRUCTURE 1.8 REQUIRED 
              COMPONENTS io mol seq seq_alg mol_alg conop img mol_mm)
 
 if(CMAKE_COMPILER_IS_GNUCXX)
@@ -126,8 +126,8 @@ set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES
 add_subdirectory(config)
 add_subdirectory(core)
 add_subdirectory(loop)
-add_subdirectory(sidechain)
 add_subdirectory(scoring)
+add_subdirectory(sidechain)
 add_subdirectory(modelling)
 add_subdirectory(scripts)
 add_subdirectory(actions)
diff --git a/actions/pm-build-model b/actions/pm-build-model
index c1d4541eed7bda1aee0fdb1ca0677455e78836c1..1dcd882c96ebdf1a5a71af4a4d4126771d8237f0 100755
--- a/actions/pm-build-model
+++ b/actions/pm-build-model
@@ -13,7 +13,6 @@ Please see the ProMod3 documentation for details on more advanced usage.
 import os
 import ost
 from ost import io, settings
-from ost.bindings import dssp
 from promod3 import modelling
 from promod3.core import pm3argparse, helper
 
@@ -38,19 +37,12 @@ if len(opts.alignments) == 1:
 elif len(opts.alignments) > 1:
     ost.LogInfo("Build " + str(len(opts.alignments)) + " models with the "+
                 "following alignments:")
-dssp_usable = True
+
 for aln in opts.alignments:
     ost.LogInfo(aln.ToString(80))
-    if dssp_usable:
-        for i in range(1, aln.GetCount()):
-            try:
-                dssp.AssignDSSP(aln.GetSequence(i).GetAttachedView())
-            except settings.FileNotFound:
-                dssp_usable = False
-                break
-if not dssp_usable:
-    ost.LogInfo("dssp binary is missing. You can get better modelling results "+
-                "if you install dssp.")
+    for i in range(1, aln.GetCount()):
+        ost.mol.alg.AssignSecStruct(aln.GetSequence(i).GetAttachedView())
+
 
 # model it
 try:
diff --git a/core/doc/CMakeLists.txt b/core/doc/CMakeLists.txt
index 5da8abe07b778967a28892705eb3e06caa6b7a55..dbef6e9d851f876a6f64690fcb1f08d58156ad45 100644
--- a/core/doc/CMakeLists.txt
+++ b/core/doc/CMakeLists.txt
@@ -5,6 +5,7 @@ helper.rst
 geometry.rst
 runtime_profiling.rst
 setcompoundschemlib.rst
+graph_minimizer.rst
 )
 
 add_doc_source(NAME core RST ${CORE_RST})
diff --git a/core/doc/graph_minimizer.rst b/core/doc/graph_minimizer.rst
new file mode 100644
index 0000000000000000000000000000000000000000..a1ddb9639f2816086ee62f64861e5e2e5b9dacb2
--- /dev/null
+++ b/core/doc/graph_minimizer.rst
@@ -0,0 +1,235 @@
+Graph Minimizer
+================================================================================
+
+.. currentmodule:: promod3.core
+
+The graph minimizer solves an energy minimization problem where we have n
+nodes :math:`N_i`, with each node having several possible solutions. 
+Every solution has a self energy :math:`E_{self}` and pairwise energies in between nodes
+are possible. The goal is to select exactly one solution per node to obtain 
+a set :math:`X=[x_1, x_2, ..., x_n]` that minimizes:
+
+.. math::
+  F(X)=\displaystyle\sum_iE_{self}(N_i[x_i]) +\displaystyle \sum_i \displaystyle \sum_{j>i}E_{pair}(N_i[x_i], N_j[x_j])
+
+
+
+.. class:: GraphMinimizer
+
+  .. method:: AddNode(self_energies) 
+
+    Adds a node to the graph. 
+
+    :param self_energies: Directly controls the number of possible solutions in that
+                          node and assigns the corresponding self energies
+    :type self_energies:  :class:`list` of :class:`float`
+
+    :returns:           The idx of the added node
+    :rtype:             :class:`int`
+
+
+  .. method:: AddEdge(node_idx_one, node_idx_two, pairwise_energies) 
+
+    Adds an edge between the specified nodes.
+
+    :param node_idx_one: Index of the first node
+    :param node_idx_two: Index of the second node
+    :param pairwise_energies: The pairwise energies that contribute to the 
+                              overall energy function. There must be a list for
+                              every possible solution in node one. All of those
+                              lists must have exactly the length of possible 
+                              solutions in node two.
+
+    :type node_idx_one: :class:`int`
+    :type node_idx_two: :class:`int`
+    :type pairwise_energies: :class:`list` of :class:`list` of :class:`float`
+
+    :returns:           The idx of the added edge
+    :rtype:             :class:`int`
+    :raises: :exc:`~exceptions.RuntimeError` if *node_idx_one* or *node_idx_two* 
+             specify non existent nodes or when *pairwise_energies* is 
+             inconsistent with the number of solutions in the specified nodes.
+
+
+  .. method:: ApplyDEE(node_idx, [e_cut=0.0])
+
+    Applies dead end elimination on one particular node and potentially
+    deactivates certain solutions. The goldstein criterion is described in 
+    [goldstein1994]_.
+
+    :param node_idx:    Node to apply dead end elimination
+    :param e_cut:       If set to
+                        0.0, the default goldstein criterion is applied =>
+                        a solution is removed if it's dominated by all other
+                        solutions in the same node. If you increase this value,
+                        a solution must be dominated by at least this **e_cut**.
+
+    :type node_idx:     :class:`int`
+    :type e_cut:        :class:`float`
+
+    :returns:           :class:`bool` whether any solution has been deactivated.
+
+
+  .. method:: ApplyEdgeDecomposition(edge_idx, epsilon)
+
+    Applies edge decomposition on one particular edge and potentially
+    deactivates it. The exact decomposition  procedure is described in 
+    [krivov2009]_.
+
+    :param edge_idx:    Edge to decompose. 
+    :param epsilon:     The energy threshold to perform edge decomposition.
+
+    :type edge_idx:     :class:`int`
+    :type epsilon:      :class:`float`
+
+
+    :returns:           :class:`bool` whether the edge has been decomposed and 
+                        deactivated 
+
+
+
+  .. method:: Prune(epsilon, [e_cut=0.0, consider_all_nodes=False])
+
+    Performs edge decomposition followed by dead end elimination in an
+    iterative manner until no changes can be observed anymore given 
+    **epsilon**.
+
+    :param epsilon:     The energy threshold to perform edge decomposition.
+    :param e_cut:       Parameter to control dead end elimination.
+    :param consider_all_nodes: Flag, wether the dead end elimination should be
+                               applied to all nodes, or only those who are
+                               connected with an edge removed by edge 
+                               decomposition. This is useful if already a Prune
+                               operation has been performed => only those nodes
+                               connected to a removed edge have the chance for
+                               successful dead end elimination.
+
+    :type epsilon:      :class:`float`
+    :type e_cut:        :class:`float`
+    :type consider_all_nodes: :class:`bool`
+                        
+
+  .. method:: Reset()
+
+    Resets the graph by undoing any pruning operation (DEE and edge decomposition)
+
+
+  .. method:: TreeSolve([max_complexity=inf, initial_epsilon=0.02])
+
+    The method solves a graph using a minimal width tree decomposition
+    approach in an iterative manner. In every iteration, the algorithm performs
+    a pruning step (DEE / Edge Decomposition) and subsequently tries to solve 
+    each connected component in the graph separately. 
+    If the number of possible enumerations in the tree constructetd from a 
+    particular connected component is is larger **max_complexity**, 
+    this component is solved in a later iteration. The algorithm iterates until 
+    all connected components are solved and steadily increases the epsilon value 
+    resulting in a more and more agressive edge decomposition.
+    Algorithm further descsribed in [krivov2009]_.
+
+    :param max_complexity: Max number of possible permutations, that have to 
+                           be enumerated in the resulting tree after tree
+                           decomposition.
+
+    :param initial_epsilon: The initial energy threshold to perform edge
+                            decomposition.
+
+    :type max_complexity: :class:`int`
+    :type initial_epsilon: :class:`float`
+
+    :returns:           A tuple with the first element being a list of indices 
+                        representing the single solutions minimizing
+                        the overall energy function.
+                        The second element is the according energy value.
+
+
+  .. method:: AStarSolve(e_thresh, [max_n=100, max_visited_nodes=100000000])
+
+    The method solves a graph using the A\* algorithm. Besides creating the
+    minimal energy solution, the function produces a maximum of **max_n**
+    solutions sorted by energy. It aborts as soon as it sees the first solution
+    with an energy difference of **e_thresh** to the optimal solution or hits
+    **max_n**. If you're only interested in the optimal solution you should use
+    the TreeSolve function since it's much faster and uses less memory.
+    There is no automatic pruning of the graph using DEE or edge decomposition, 
+    so you have to do it by yourself, otherwise you'll have a looooooong 
+    runtime or even hit the **max_visited_nodes** parameter that caps the memory
+    usage. 
+    To have a valid solution you have to take care that you set the **e_cut** 
+    parameter in the pruning function to **e_tresh**.
+    Algorithm is described in [leach1998]_.
+
+    :param e_thresh:    Maximal energy difference of a solution to the
+                        optimal solution to be considered.
+
+    :param max_n:       The maximum number of solutions that will be generated.
+
+    :param  max_visited_nodes: Caps the memory usage of the algorithm. Besides
+                               The memory used for pairwise energies and self
+                               energies, the algorithm uses about 
+                               **max_visited_nodes** * 20 bytes.
+
+
+    :type e_thresh:      :class:`float`
+    :type max_n:        :class:`int`
+    :type max_visited_nodes: :class:`int`
+
+    :returns:           A tuple with the first element being a list of 
+                        solutions. The second element is a list
+                        of energies for the according solutions.
+
+
+  .. method:: MCSolve([n=100, mc_steps=100000, start_temperature=1000.0, \\
+                       change_frequency=1000, cooling_factor=0.9, seed=0]) 
+
+    Does a total of **n** Monte Carlo runs to find low energy solutions
+    of the graph. Each run starts with a random 
+    configuration. At each of the **mc_steps** steps, a random node and
+    a random solution at that location is selected and an energy difference 
+    of that random selection relative to the current configuration is 
+    estimated. If the difference in energy is negative, the step is 
+    accepted. If not, the step is accepted with a probability given by
+    the temperature dependent Metropolis criterion
+    :math:`exp^{\left(\frac{-e_{diff}}{T}\right)}`.
+    The temperature for every run starts with **start_temperature** 
+    and is multiplied every **change_frequency** steps with **cooling_factor**
+    to achieve a simulated annealing effect.
+    There is no automatic pruning of the graph using DEE or edge decomposition,
+    you have to do that by yourself.
+    
+    :param n:           Number of Monte Carlo runs 
+    :param mc_steps:    Number of Monte Carlo steps per run
+    :param start_temperature: Start temperature for the temperature dependent
+                              Metropolis criterion
+    :param change_frequency: Number of steps the temperature stays the same
+    :param cooling_factor: Factor to multiply temperature each 
+                          **change_frequency** steps
+    :param seed:        Seed for random number generator 
+
+    :type n:            :class:`int`
+    :type mc_steps:     :class:`int`
+    :type start_temperature: :class:`float`
+    :type change_frequency: :class:`int`
+    :type cooling_factor: :class:`float`
+    :type seed:         :class:`float`
+
+    :returns:           A tuple with the first element being a list of 
+                        solutions. The second element is a list
+                        of energies for the according solutions.
+
+  .. method:: NaiveSolve()
+
+    Don't even think of using this... This function only exists for debug 
+    purposes and does the full enumeration of the solution space. 
+    It might become faster with the appropriate  
+    `techniques <https://www.youtube.com/watch?v=fQGbXmkSArs>`_.
+
+    :returns:           A tuple with the first element being a list of indices 
+                        representing the single solutions minimizing
+                        the overall energy function.
+                        The second element is the according energy value.          
+
+
+.. [goldstein1994] Goldstein RF (1994). Efficient rotamer elimination applied to protein side-chains and related spin glasses. Biophys J.
+
+.. [leach1998] Leach AR, Lemon AP (1998). Explring the conformational space of prootein side chains using dead-end elimination and the A* algorithm. Proteins.
diff --git a/core/doc/index.rst b/core/doc/index.rst
index 17f9534aea783a5b313ec58c5ba52b4b9d199fcc..2af5fca9cace92deef375d4857a1c9b55f9ec0d5 100644
--- a/core/doc/index.rst
+++ b/core/doc/index.rst
@@ -16,3 +16,4 @@ Contents:
   helper
   geometry
   runtime_profiling
+  graph_minimizer
diff --git a/core/pymod/CMakeLists.txt b/core/pymod/CMakeLists.txt
index fb24a4d09633f2657e20aa8538a90c31b85d8509..563feb76131b0461e24434761c9071ced9a47a56 100644
--- a/core/pymod/CMakeLists.txt
+++ b/core/pymod/CMakeLists.txt
@@ -2,6 +2,7 @@
 set(CORE_CPP
   export_geom.cc
   export_runtime_profiling.cc
+  export_graph_minimizer.cc
   wrap_core.cc
 )
 
diff --git a/core/pymod/export_graph_minimizer.cc b/core/pymod/export_graph_minimizer.cc
new file mode 100644
index 0000000000000000000000000000000000000000..bd301c84f7a3289d6ee1f3f9e91f8975be0718f7
--- /dev/null
+++ b/core/pymod/export_graph_minimizer.cc
@@ -0,0 +1,158 @@
+#include <boost/python.hpp>
+#include <boost/python/register_ptr_to_python.hpp>
+#include <promod3/core/graph_minimizer.hh>
+#include <promod3/core/eigen_types.hh>
+#include <promod3/core/export_helper.hh>
+#include <promod3/core/message.hh>
+
+using namespace boost::python;
+
+namespace {
+
+
+int WrapAddNode(promod3::core::GraphMinimizerPtr graph, 
+                const boost::python::list& self_energies) {
+  
+  std::vector<Real> v_self_energies;
+  promod3::core::ConvertListToVector(self_energies, v_self_energies);
+  return graph->AddNode(v_self_energies);
+}
+
+
+int WrapAddEdge(promod3::core::GraphMinimizerPtr graph, 
+                int node_idx_one, int node_idx_two,
+                const boost::python::list& pairwise_energies) {
+
+  int num_rows = boost::python::len(pairwise_energies);
+
+  if(num_rows == 0) {
+    throw promod3::Error("Pairwise energies must not be empty!");
+  }
+
+  int num_cols = len(extract<list>(pairwise_energies[0]));
+
+  promod3::core::EMatXX emat = promod3::core::EMatXX::Zero(num_rows, num_cols);
+
+  for(int i = 0; i < num_rows; ++i) {
+    list current_list = extract<list>(pairwise_energies[i]);
+    if(len(current_list) != num_cols) {
+      throw promod3::Error("All lists must have exactly the same length!");
+    }
+    for(int j = 0; j < num_cols; ++j) {
+      emat(i,j) = extract<Real>(current_list[j]);
+    }
+  }
+
+  return graph->AddEdge(node_idx_one, node_idx_two, emat);
+}
+
+
+boost::python::tuple WrapTreeSolve(promod3::core::GraphMinimizerPtr graph, 
+                                   uint64_t max_complexity,
+                                   Real initial_epsilon) {
+
+  std::pair<std::vector<int>, Real> 
+  full_solution = graph->TreeSolve(max_complexity, initial_epsilon);
+  std::vector<int> solution = full_solution.first;
+  Real energy = full_solution.second;
+  boost::python::list return_list;
+  promod3::core::AppendVectorToList(solution, return_list);
+  return boost::python::make_tuple(return_list, energy);
+}
+
+
+boost::python::tuple WrapAStarSolve(promod3::core::GraphMinimizerPtr graph,
+                                    Real e_thresh, uint max_n, 
+                                    uint max_visited_nodes) {
+
+  std::pair<std::vector<std::vector<int> >, std::vector<Real> > 
+  full_solution = graph->AStarSolve(e_thresh, max_n, max_visited_nodes);
+
+  std::vector<std::vector<int> > solutions = full_solution.first;
+  std::vector<Real> energies = full_solution.second;
+
+  boost::python::list solution_list;
+  boost::python::list energy_list;
+
+  for(uint i = 0; i < solutions.size(); ++i){
+    boost::python::list actual_solution;
+    promod3::core::AppendVectorToList(solutions[i], actual_solution);
+    solution_list.append(actual_solution);
+  }
+  promod3::core::AppendVectorToList(energies, energy_list);
+
+  return boost::python::make_tuple(solution_list, energy_list);
+}
+
+
+boost::python::tuple WrapMCSolve(promod3::core::GraphMinimizerPtr graph, int n,
+                                 int mc_steps, Real start_temperature,
+                                 int change_frequency, Real cooling_factor,
+                                 int seed) {
+
+  std::pair<std::vector<std::vector<int> >, std::vector<Real> > 
+  full_solution = graph->MCSolve(n, mc_steps, start_temperature, 
+                                 change_frequency, cooling_factor, seed);
+
+  std::vector<std::vector<int> > solutions = full_solution.first;
+  std::vector<Real> energies = full_solution.second;
+
+  boost::python::list solution_list;
+  boost::python::list energy_list;
+
+  for(uint i = 0; i < solutions.size(); ++i){
+    boost::python::list actual_solution;
+    promod3::core::AppendVectorToList(solutions[i], actual_solution);
+    solution_list.append(actual_solution);
+  }
+  promod3::core::AppendVectorToList(energies, energy_list);
+
+  return boost::python::make_tuple(solution_list, energy_list);
+}
+
+
+boost::python::tuple WrapNaiveSolve(promod3::core::GraphMinimizerPtr graph) {
+
+  std::pair<std::vector<int>, Real> 
+  full_solution = graph->NaiveSolve();
+  std::vector<int> solution = full_solution.first;
+  Real energy = full_solution.second;
+  boost::python::list return_list;
+  promod3::core::AppendVectorToList(solution, return_list);
+  return boost::python::make_tuple(return_list, energy);
+}
+
+}
+
+
+void export_graph_minimizer()
+{
+
+  class_<promod3::core::GraphMinimizer, 
+         boost::noncopyable>("GraphMinimizer", init<>())
+
+    .def("AddNode", &WrapAddNode, (arg("self_energies")))
+    .def("AddEdge", &WrapAddEdge, (arg("node_idx_one"), arg("node_idx_two"), 
+                                   arg("pairwise_energies")))
+    .def("ApplyDEE", &promod3::core::GraphMinimizer::ApplyDEE,
+                     (arg("node_idx"), arg("e_thresh")=0.0))
+    .def("ApplyEdgeDecomposition", 
+         &promod3::core::GraphMinimizer::ApplyEdgeDecomposition,
+         (arg("edge_idx"), arg("e_thresh")=0.02))
+    .def("Prune", &promod3::core::GraphMinimizer::Prune, 
+         (arg("epsilon")=0.0, arg("e_cut")=0.0, arg("consider_all_nodes")=false))
+    .def("Reset", &promod3::core::GraphMinimizer::Reset)
+    .def("TreeSolve", &WrapTreeSolve,
+         (arg("max_complexity")=std::numeric_limits<uint64_t>::max(),
+          arg("initial_epsilon")=0.02))
+    .def("AStarSolve", &WrapAStarSolve,
+         (arg("e_thresh")=1.0, arg("max_n")=100, 
+          arg("max_visited_nodes")=100000000))
+    .def("MCSolve", &WrapMCSolve,
+         (arg("n")=100, arg("mc_steps")=100000, arg("start_temperature")=1000.0,
+          arg("change_frequency")=1000, arg("cooling_factor")=0.9, arg("seed")=0))
+    .def("NaiveSolve", &WrapNaiveSolve)
+  ;  
+
+  register_ptr_to_python<promod3::core::GraphMinimizerPtr>();
+}
diff --git a/core/pymod/wrap_core.cc b/core/pymod/wrap_core.cc
index 989fe8ed9c941f8db39e0317dfa60314b2fd181f..ae1381eb24b990738ffa5c5751665f231856ff2f 100644
--- a/core/pymod/wrap_core.cc
+++ b/core/pymod/wrap_core.cc
@@ -2,9 +2,11 @@
 
 void export_geom();
 void export_runtime_profiling();
+void export_graph_minimizer();
 
 BOOST_PYTHON_MODULE(_core)
 {
   export_geom();
   export_runtime_profiling();
+  export_graph_minimizer();
 }
diff --git a/core/src/CMakeLists.txt b/core/src/CMakeLists.txt
index 83d41512144c95e10ab60c3a81160d1ac9a96bf4..a8419fd0b01c29ee9544e3c34cf5d0a2ce5c4c4e 100644
--- a/core/src/CMakeLists.txt
+++ b/core/src/CMakeLists.txt
@@ -15,6 +15,8 @@ set(CORE_HEADERS
   graph.hh
   tree.hh
   tetrahedral_polytope.hh
+  graph_minimizer.hh
+  eigen_types.hh
 )
 
 set(CORE_SOURCES
@@ -25,6 +27,7 @@ set(CORE_SOURCES
   graph.cc
   tree.cc
   tetrahedral_polytope.cc
+  graph_minimizer.cc
 )
 
 module(NAME core HEADERS ${CORE_HEADERS} SOURCES ${CORE_SOURCES}
diff --git a/core/src/dynamic_spatial_organizer.hh b/core/src/dynamic_spatial_organizer.hh
index 242de5cf2f592cb8ad2cf0f165028b794e01091f..455389667c1fd725595dad3276d308a4c7a55ffb 100644
--- a/core/src/dynamic_spatial_organizer.hh
+++ b/core/src/dynamic_spatial_organizer.hh
@@ -20,7 +20,7 @@ class SpatialOrganizerCell{
 public:
 
   SpatialOrganizerCell(): num_items_(0),
-          capacity_(32){
+          capacity_(32) {
     x_ = new Real[capacity_];
     y_ = new Real[capacity_];
     z_ = new Real[capacity_];
@@ -28,7 +28,7 @@ public:
     distance_buffer_ = new Real[capacity_];
   }
 
-  ~SpatialOrganizerCell(){
+  ~SpatialOrganizerCell() {
     delete [] x_;
     delete [] y_;
     delete [] z_;
@@ -36,14 +36,14 @@ public:
     delete [] distance_buffer_;
   }
 
-  void AddItem(ITEM* item, Real x, Real y, Real z){
+  void AddItem(ITEM* item, Real x, Real y, Real z) {
 
     int idx = this->GetIdx(item);   
-    if(idx != -1){
+    if(idx != -1) {
       throw promod3::Error("Item is already in spatial organizer cell!");
     }
 
-    if(num_items_ == capacity_){
+    if(num_items_ == capacity_) {
       capacity_ *= 2;
 
       Real* new_x = new Real[capacity_];
@@ -77,19 +77,19 @@ public:
     ++num_items_;
   }
 
-  void RemoveItem(ITEM* item){
+  void RemoveItem(ITEM* item) {
 
-    if(num_items_ == 0){
+    if(num_items_ == 0) {
       throw promod3::Error("Cannot remove item from empty spatial organizer cell!");
     }
 
     int idx = this->GetIdx(item);
    
-    if(idx == -1){
+    if(idx == -1) {
       throw promod3::Error("Cannot Remove inexistent item from spatial organizer cell!");
     }
 
-    if(idx < (num_items_-1)){
+    if(idx < (num_items_-1)) {
       int num_bytes = (num_items_-(idx+1))*sizeof(Real);
       memmove(&x_[idx],&x_[idx+1],num_bytes);
       memmove(&y_[idx],&y_[idx+1],num_bytes);
@@ -99,9 +99,9 @@ public:
     --num_items_;
   }
 
-  void ResetPos(ITEM* item, Real x, Real y, Real z){
+  void ResetPos(ITEM* item, Real x, Real y, Real z) {
     int idx = this->GetIdx(item);
-    if(idx == -1){
+    if(idx == -1) {
       throw promod3::Error("Cannot reset pos of inexistent item from spatial organizer cell!");      
     }
     x_[idx] = x;
@@ -115,15 +115,15 @@ public:
     Real dx, dy, dz;
     Real squared_cutoff = dist*dist;
 
-    for(int i = 0; i < num_items_; ++i){
+    for(int i = 0; i < num_items_; ++i) {
       dx = x_[i] - x;
       dy = y_[i] - y;
       dz = z_[i] - z; 
       distance_buffer_[i] = dx*dx + dy*dy + dz*dz;
     }
 
-    for(int i = 0; i < num_items_; ++i){
-      if(distance_buffer_[i] <= squared_cutoff){
+    for(int i = 0; i < num_items_; ++i) {
+      if(distance_buffer_[i] <= squared_cutoff) {
         result_vec.push_back(std::make_pair(pointers_[i],std::sqrt(distance_buffer_[i])));
       }
     }
@@ -132,8 +132,8 @@ public:
 private:
 
 
-  int GetIdx(ITEM* ptr){
-    for(int i = 0; i < num_items_; ++i){
+  int GetIdx(ITEM* ptr) {
+    for(int i = 0; i < num_items_; ++i) {
       if(pointers_[i] == ptr) return i;
     }
     return -1;
@@ -202,14 +202,21 @@ private:
 
 public:
 
-  DynamicSpatialOrganizer(Real delta): delta_(delta) {
-    if(delta==0.0) {
-      throw "delta cannot be zero";
+  DynamicSpatialOrganizer(Real delta,
+                          const std::vector<geom::Mat4>& transformations = 
+                          std::vector<geom::Mat4>()): delta_(delta) {
+    if(delta <= 0.0) {
+      throw "delta must be positive!";
+    }
+
+    for(uint i = 0; i < transformations.size(); ++i) {
+      geom::Mat4 inv_t = geom::Invert(transformations[i]);
+      inverted_transformations_.push_back(inv_t);
     }
   }
 
-  ~DynamicSpatialOrganizer(){
-    for(typename ItemMap::iterator i = map_.begin(); i != map_.end(); ++i){
+  ~DynamicSpatialOrganizer() {
+    for(typename ItemMap::iterator i = map_.begin(); i != map_.end(); ++i) {
       delete i->second;
     }
   }
@@ -219,7 +226,7 @@ public:
     Index indx=gen_index(pos);
     typename ItemMap::iterator it = map_.find(indx);
 
-    if(it == map_.end()){
+    if(it == map_.end()) {
       map_[indx] = new SpatialOrganizerCell<ITEM>;
       it = map_.find(indx);
     }
@@ -230,7 +237,7 @@ public:
   void Remove(ITEM* item, const geom::Vec3& pos) {
     Index indx=gen_index(pos);
     typename ItemMap::iterator i = map_.find(indx);
-    if(i != map_.end()){
+    if(i != map_.end()) {
       i->second->RemoveItem(item);
     }
     else{
@@ -238,14 +245,14 @@ public:
     }
   }
 
-  void Reset(ITEM* item, const geom::Vec3& actual_pos, const geom::Vec3& new_pos){
+  void Reset(ITEM* item, const geom::Vec3& actual_pos, const geom::Vec3& new_pos) {
     Index actual_indx=gen_index(actual_pos);
     Index new_indx=gen_index(new_pos);
-    if(actual_indx != new_indx){
+    if(actual_indx != new_indx) {
       typename ItemMap::iterator i = map_.find(actual_indx);
-      if(i != map_.end()){
+      if(i != map_.end()) {
         typename ItemMap::iterator j = map_.find(new_indx);
-        if(j == map_.end()){
+        if(j == map_.end()) {
           map_[new_indx] = new SpatialOrganizerCell<ITEM>;
           j = map_.find(new_indx);
         }
@@ -257,7 +264,7 @@ public:
     }
     else{
       typename ItemMap::iterator i = map_.find(actual_indx);
-      if(i != map_.end()){
+      if(i != map_.end()) {
         i->second->ResetPos(item,new_pos[0],new_pos[1],new_pos[2]);
       }
       else{
@@ -266,11 +273,17 @@ public:
     }
   }
 
-  WithinResult FindWithin(const geom::Vec3& pos, Real dist) const{
+  WithinResult FindWithin(const geom::Vec3& pos, Real dist, 
+                          bool clear_buffer = true) const{
+
     Index imin = gen_index(pos-geom::Vec3(dist,dist,dist));
     Index imax = gen_index(pos+geom::Vec3(dist,dist,dist));
 
-    result_buffer_.clear();
+    if(clear_buffer) {
+      result_buffer_.clear();
+    }
+
+    int first_buffer_position = result_buffer_.size();
 
     for(int wc=imin.w;wc<=imax.w;++wc) {
       for(int vc=imin.v;vc<=imax.v;++vc) {
@@ -285,18 +298,43 @@ public:
 
     WithinResult result;
 
-    if(!result_buffer_.empty()){
-      result = std::make_pair(&result_buffer_[0],result_buffer_.size());
+    if(!result_buffer_.empty()) {
+      result = std::make_pair(&result_buffer_[first_buffer_position],
+                              result_buffer_.size() - first_buffer_position);
     }
     else{
-      result = std::make_pair(static_cast<std::pair<ITEM*,Real>* >(NULL),0);   
+      result = std::make_pair(static_cast<std::pair<ITEM*,Real>* >(NULL), 0);   
     }
     return result;
   }
 
+  std::vector<WithinResult> FindWithinFull(const geom::Vec3& pos, 
+                                           Real dist) {
+
+    int n = inverted_transformations_.size();
+    std::vector<WithinResult> return_vec(n + 1);    
+
+    // do first the FindWithin on the actual non transformed positions
+    return_vec[0] = this->FindWithin(pos, dist, true);
+
+    for(int i = 0; i < n; ++i) {
+      // instead of transforming all positions in the organizer, we apply
+      // the corresponding inverted transform to the query position
+      // Thanks David Sehnal for the trick!!!
+      const geom::Mat4& t = inverted_transformations_[i];
+      Real a = t(0,0)*pos[0] + t(0,1)*pos[1] + t(0,2)*pos[2] + t(0,3);
+      Real b = t(1,0)*pos[0] + t(1,1)*pos[1] + t(1,2)*pos[2] + t(1,3);
+      Real c = t(2,0)*pos[0] + t(2,1)*pos[1] + t(2,2)*pos[2] + t(2,3);      
+      geom::Vec3 transformed_pos(a, b, c);
+      return_vec[i + 1] = this->FindWithin(transformed_pos, dist, false);
+    }
 
-  void Clear(){
-    for(typename ItemMap::iterator i = map_.begin(); i != map_.end(); ++i){
+    return return_vec;
+  }
+
+
+  void Clear() {
+    for(typename ItemMap::iterator i = map_.begin(); i != map_.end(); ++i) {
       delete i->second;
     }
     map_.clear();
@@ -304,9 +342,10 @@ public:
 
 private:
 
+  Real delta_;
+  std::vector<geom::Mat4> inverted_transformations_;
   ItemMap map_;
   mutable WithinList result_buffer_;
-  Real delta_;
 
   Index gen_index(const geom::Vec3& pos) const {
     Index nrvo(static_cast<int>(round(pos[0]/delta_)),
diff --git a/core/src/eigen_types.hh b/core/src/eigen_types.hh
new file mode 100644
index 0000000000000000000000000000000000000000..8eff20ee824802fee2c78246bcc9126a5fc48c47
--- /dev/null
+++ b/core/src/eigen_types.hh
@@ -0,0 +1,37 @@
+#ifndef PROMOD3_EIGEN_TYPES_HH
+#define PROMOD3_EIGEN_TYPES_HH
+
+#include <ost/base.hh>
+
+#include <Eigen/Dense>
+#include <Eigen/StdVector>
+
+namespace promod3 { namespace core {
+
+  // some quadratic matrices
+  typedef Eigen::Matrix<Real,3,3> EMat3;
+  typedef Eigen::Matrix<Real,4,4> EMat4;
+  typedef Eigen::Matrix<double,8,8> EMat8;
+  typedef Eigen::Matrix<double,16,16> EMat16;
+
+  typedef Eigen::Matrix<Real,3,1> EVec3;
+  typedef Eigen::Matrix<Real,4,1> EVec4;
+
+  typedef Eigen::Matrix<Real,1,3> ERVec3;
+  typedef Eigen::Matrix<Real,1,4> ERVec4;
+
+
+  // some special matrices used at various locations
+  typedef Eigen::Matrix<Real,Eigen::Dynamic,3> EMatX3;
+  typedef Eigen::Matrix<Real, Eigen::Dynamic, Eigen::Dynamic> EMatXX; 
+  typedef Eigen::Matrix<double,16,3> EMat16_3;
+
+
+  // If you want to use stl containers of fixed sized Eigentype (e.g. EMatX3)
+  // you must use a custom allocator provided by Eigen to ensure proper memory
+  // alignment (more on that in the Eigen documentation)
+  typedef std::vector<EMatX3,Eigen::aligned_allocator<EMatX3> > EMatX3List;
+
+}} // ns
+
+#endif
diff --git a/core/src/graph_minimizer.cc b/core/src/graph_minimizer.cc
new file mode 100644
index 0000000000000000000000000000000000000000..e524efc2fb53447967c9c37b2f9fc985072b1b00
--- /dev/null
+++ b/core/src/graph_minimizer.cc
@@ -0,0 +1,1848 @@
+#include <algorithm>
+#include <queue>
+#include <limits>
+#include <map>
+
+#include <promod3/core/graph_minimizer.hh>
+#include <promod3/core/tree.hh>
+#include <promod3/core/runtime_profiling.hh>
+#include <promod3/core/enumerator.hh>
+#include <promod3/core/message.hh>
+
+#include <boost/random/mersenne_twister.hpp>
+#include <boost/random/uniform_01.hpp>
+
+
+namespace{
+
+////////////////////////////////////////////////////////////////
+//FUNCTIONS AND DATA STRUCTURES FOR THE TREE SOLVING ALGORITHM//
+////////////////////////////////////////////////////////////////
+
+typedef promod3::core::TreeBag<int> TBag;
+
+// calculates a linear idx for a certain combination in the lset
+struct LSetIdxCalculator{
+
+  LSetIdxCalculator() { }
+
+  LSetIdxCalculator(const std::vector<unsigned short>& num_candidates) {
+    lset_size = num_candidates.size();
+    for(int i = 0; i < lset_size; ++i) {
+      int temp = 1;
+      for(int j = i + 1; j < lset_size; ++j) {
+        temp *= num_candidates[j];
+      }
+      idx_helper.push_back(temp);
+    }
+    idx_helper.push_back(1);
+  }
+
+  inline int GetLIdx(const std::vector<unsigned short>& indices) const {
+    int idx = 0;
+    for(int i = 0; i < lset_size; ++i) {
+      idx += idx_helper[i] * indices[i];
+    }
+    return idx;
+  }
+
+  inline int GetIdxHelper(int idx) {
+    return idx_helper[idx];
+  }
+
+  std::vector<int> idx_helper;
+  int lset_size;
+};
+
+
+struct BagData{
+
+  // members of the bag that are also present in parent bag
+  std::vector<int> lset;
+  // members of the bag that are not present in parent bag
+  std::vector<int> rset;
+
+  // number of solutions for every entry in lset/rset
+  uint num_l_combinations;
+  uint num_r_combinations;
+  std::vector<unsigned short> num_l_solutions;
+  std::vector<unsigned short> num_r_solutions;
+
+  // optimal solution in r set given a certain combination in l
+  // the index for a certain combination in l can be estimated with
+  // l_set_idx_calculator
+  // assuming an l_idx of x, the according optimal rset data starts
+  // at x * rset.size()
+  std::vector<unsigned short> optimal_rset_combination;
+
+  // the according score
+  std::vector<Real> optimal_r_score;
+
+  // calculates an index in optimal_r_combination/optimal_r_score
+  // given a certain combination in l
+  LSetIdxCalculator lset_idx_calculator;
+
+  // the bag data indices for the children attached to this bag
+  std::vector<int> children_indices;
+  int num_children;
+
+  // super complicated mapping structure of getting stuff out from the children
+  // the idea is, that we can calculate the lset idx in several steps in the
+  // enumeration procedure...
+
+  // for every child we have a vector of with indices describing the
+  // elements in the current lset being part of the childrens lset
+  std::vector<std::vector<int> > lset_child_l_indices;
+  // the number it has to be multiplied to construct the index for
+  // that particular child lset
+  std::vector<std::vector<int> > lset_child_l_index_helpers;
+  // store the size of the stuff above for every child
+  std::vector<int> num_lset_child_l;
+
+  // equivalent for the current rset
+  std::vector<std::vector<int> > rset_child_l_indices;
+  std::vector<std::vector<int> > rset_child_l_index_helpers;
+  std::vector<int> num_rset_child_l; 
+
+  // this data structure will be altered during the calculation and is a
+  // placeholder to query optimal solutions for certain lsets of the children
+  std::vector<std::vector<int> > children_l_combinations;
+
+  // self energies of the rset
+  std::vector<std::vector<Real> > r_self_energies;
+
+  // stuff for lr and rl pairwise energies
+  std::vector<promod3::core::EMatXX> lr_energies;
+  std::vector<int> lr_index_in_I;
+  std::vector<int> lr_index_in_R;
+
+  // stuff for rr pairwise energies
+  std::vector<promod3::core::EMatXX> rr_energies;
+  std::vector<int> rr_index_in_R_one;
+  std::vector<int> rr_index_in_R_two;
+}; 
+
+
+// Fills only the bare minimum of data into the BagData vector and already
+// estimates the complexity of the tree solving procedure. All other data
+// gets filled in the FillBagData function
+uint64_t FillRawBagData(const std::vector<TBag*>& traversal,
+                        const std::vector<int>& num_active_solutions,
+                        std::vector<BagData>& bag_data) {
+
+  uint64_t complexity = 0;
+
+  bag_data.clear();
+  bag_data.resize(traversal.size());
+
+  for(uint bag_idx = 0; bag_idx < traversal.size(); ++bag_idx) {
+
+    TBag* bag = traversal[bag_idx];
+    TBag* parent = traversal[bag_idx]->GetParent();
+
+    // assign rset and lset
+    if(parent == NULL) {
+      // it's the root, lets shuffle all to rset
+      bag_data[bag_idx].rset.assign(bag->members_begin(),
+                                    bag->members_end());
+    }
+    else{
+      for(TBag::const_member_iterator it = bag->members_begin(); 
+          it != bag->members_end(); ++it) {
+        if(parent->HasMember(*it)) bag_data[bag_idx].lset.push_back(*it);
+        else bag_data[bag_idx].rset.push_back(*it);
+      }
+    }
+
+    // figure out how many solutions there are
+    bag_data[bag_idx].num_l_combinations = 1;
+    bag_data[bag_idx].num_r_combinations = 1;
+
+    for(std::vector<int>::iterator i = bag_data[bag_idx].lset.begin(); 
+        i != bag_data[bag_idx].lset.end(); ++i) {
+      bag_data[bag_idx].num_l_solutions.push_back(num_active_solutions[*i]);
+      bag_data[bag_idx].num_l_combinations *= num_active_solutions[*i];
+    }
+
+    for(std::vector<int>::iterator i = bag_data[bag_idx].rset.begin(); 
+        i != bag_data[bag_idx].rset.end(); ++i) {
+      bag_data[bag_idx].num_r_solutions.push_back(num_active_solutions[*i]);
+      bag_data[bag_idx].num_r_combinations *= num_active_solutions[*i];
+    }
+
+    complexity += (bag_data[bag_idx].num_l_combinations * 
+                   bag_data[bag_idx].num_r_combinations);
+  }
+
+  return complexity;
+}  
+
+
+void FillBagData(const std::vector<TBag*>& traversal,
+                 const std::vector<promod3::core::GMNode*>& nodes,
+                 const std::vector<promod3::core::GMEdge*>& edges,
+                 const std::vector<std::pair<int, int> >& edge_indices,
+                 std::vector<BagData>& bag_data) {
+  
+  for(uint bag_idx = 0; bag_idx < traversal.size(); ++bag_idx) {
+
+    TBag* bag = traversal[bag_idx];
+    BagData& current_data = bag_data[bag_idx];
+    int current_data_lsize = current_data.lset.size();
+    int current_data_rsize = current_data.rset.size();
+
+    // allocate required space for optimal r combination for every possible lset
+    current_data.optimal_rset_combination.resize(current_data_rsize *
+                                              current_data.num_l_combinations);    
+   
+    current_data.optimal_r_score.resize(current_data.num_l_combinations);
+
+    // generate a new lset idxgenerator...
+    current_data.lset_idx_calculator = 
+    LSetIdxCalculator(current_data.num_l_solutions);
+
+    // get all the children stuff right
+    for(TBag::const_child_iterator it = bag->children_begin(); 
+        it != bag->children_end(); ++it) {
+      current_data.children_indices.push_back((*it)->GetIdx());
+    }
+    current_data.num_children = current_data.children_indices.size();
+
+    // handle current lset
+    current_data.lset_child_l_indices.resize(current_data.num_children);
+    current_data.lset_child_l_index_helpers.resize(current_data.num_children);
+    for(int i = 0; i < current_data_lsize; ++i) {
+      int val = current_data.lset[i];
+      // go through all children
+      for(int j = 0; j < current_data.num_children; ++j) {
+        int ch_idx = current_data.children_indices[j];
+        // we can be sure of the children lsets being set due to the postorder
+        // traversal of the tree
+        const std::vector<int>& child_lset = bag_data[ch_idx].lset;
+        std::vector<int>::const_iterator it = std::find(child_lset.begin(), 
+                                                        child_lset.end(), 
+                                                        val);
+        if(it != child_lset.end()) {
+          // its in the childs lset!
+          int idx_in_child_l = it - child_lset.begin();
+          current_data.lset_child_l_indices[j].push_back(i);
+          int helper = 
+          bag_data[ch_idx].lset_idx_calculator.GetIdxHelper(idx_in_child_l);
+          current_data.lset_child_l_index_helpers[j].push_back(helper);
+        }
+      }
+    }
+    for(int i = 0; i < current_data.num_children; ++i) {
+      int size = current_data.lset_child_l_indices[i].size();
+      current_data.num_lset_child_l.push_back(size);
+    }
+
+    // do the same for the rset
+    current_data.rset_child_l_indices.resize(current_data.num_children);
+    current_data.rset_child_l_index_helpers.resize(current_data.num_children);
+    for(int i = 0; i < current_data_rsize; ++i) {
+      int val = current_data.rset[i];
+      // go through all children
+      for(int j = 0; j < current_data.num_children; ++j) {
+        int ch_idx = current_data.children_indices[j];
+        // we can be sure of the children lsets being set due to the postorder
+        // traversal of the tree
+        const std::vector<int>& child_lset = bag_data[ch_idx].lset;
+        std::vector<int>::const_iterator it = std::find(child_lset.begin(), 
+                                                        child_lset.end(), 
+                                                        val);
+        if(it != child_lset.end()) {
+          // its in the childs lset!
+          int idx_in_child_l = it - child_lset.begin();
+          current_data.rset_child_l_indices[j].push_back(i);
+          int helper = 
+          bag_data[ch_idx].lset_idx_calculator.GetIdxHelper(idx_in_child_l);
+          current_data.rset_child_l_index_helpers[j].push_back(helper);
+        }
+      }
+    }
+    for(int i = 0; i < current_data.num_children; ++i) {
+      int size = current_data.rset_child_l_indices[i].size();
+      current_data.num_rset_child_l.push_back(size);
+    }
+
+    // prepare the lset combinations
+    for(std::vector<int>::iterator i = current_data.children_indices.begin();
+        i != current_data.children_indices.end(); ++i) {
+      int size = bag_data[*i].lset.size();
+      current_data.children_l_combinations.push_back(std::vector<int>(size,0));
+    }
+
+    // fill the rset self energies
+    current_data.r_self_energies.resize(current_data_rsize);
+    for(int i = 0; i < current_data_rsize; ++i) {
+      promod3::core::GMNode* n = nodes[current_data.rset[i]];
+      n->FillActiveSelfEnergies(current_data.r_self_energies[i]);
+    }
+
+    // Search for all pairs in lset / rset, that have an edge
+
+    std::vector<promod3::core::GMEdge*> lr_edges;
+
+    for(int i = 0; i < current_data_lsize; ++i) {
+      for(int j = 0; j < current_data_rsize; ++j) {
+
+        std::pair<int,int> idx_pair = std::make_pair(current_data.lset[i],
+                                                     current_data.rset[j]); 
+        std::vector<std::pair<int,int> >::const_iterator idx_it =
+        std::find(edge_indices.begin(), edge_indices.end(), idx_pair); 
+
+        if(idx_it != edge_indices.end()) {
+          int edge_idx = idx_it - edge_indices.begin();
+          lr_edges.push_back(edges[edge_idx]);
+          current_data.lr_index_in_I.push_back(i);
+          current_data.lr_index_in_R.push_back(j);
+          continue;
+        }
+        idx_pair = std::make_pair(current_data.rset[j], current_data.lset[i]); 
+        idx_it = std::find(edge_indices.begin(), edge_indices.end(), idx_pair);
+        if(idx_it != edge_indices.end()) {
+          int edge_idx = idx_it - edge_indices.begin();
+          lr_edges.push_back(edges[edge_idx]);
+          current_data.lr_index_in_I.push_back(i);
+          current_data.lr_index_in_R.push_back(j);
+        }
+      }
+    }
+
+    // fill the active energies and make sure, that the energy matrices are 
+    // organized with the lset elements being the rows and rset elements
+    // being the cols (potentially transpose)
+    current_data.lr_energies.resize(lr_edges.size());
+    for(uint i = 0; i < lr_edges.size(); ++i) {
+      lr_edges[i]->FillActiveEnergies(current_data.lr_energies[i]);
+      if(current_data.lset[current_data.lr_index_in_I[i]] > 
+         current_data.rset[current_data.lr_index_in_R[i]]) {
+        current_data.lr_energies[i].transposeInPlace();
+      }
+    }
+
+    // Search for all pairs in rset, that have an edge
+
+    std::vector<promod3::core::GMEdge*> rr_edges;
+    
+    for(int i = 0; i < current_data_rsize; ++i) {
+      for(int j = i + 1; j < current_data_rsize; ++j) {
+
+        std::pair<int,int> idx_pair = std::make_pair(current_data.rset[i],
+                                                     current_data.rset[j]); 
+        std::vector<std::pair<int,int> >::const_iterator idx_it = 
+        std::find(edge_indices.begin(), edge_indices.end(), idx_pair);
+
+        if(idx_it != edge_indices.end()) {
+          int edge_idx = idx_it - edge_indices.begin();
+          rr_edges.push_back(edges[edge_idx]);
+          current_data.rr_index_in_R_one.push_back(i);
+          current_data.rr_index_in_R_two.push_back(j);
+          continue;
+        }
+
+        idx_pair = std::make_pair(current_data.rset[j], current_data.rset[i]); 
+        idx_it = std::find(edge_indices.begin(), edge_indices.end(), idx_pair);
+        if(idx_it != edge_indices.end()) {
+          int edge_idx = idx_it - edge_indices.begin();
+          rr_edges.push_back(edges[edge_idx]);
+          current_data.rr_index_in_R_one.push_back(i);
+          current_data.rr_index_in_R_two.push_back(j);
+        }
+      }
+    }
+
+    // fill the active energies and make sure, that the energy matrices are 
+    // organized with the rset element with the lower overall index defining
+    // the rows and the other the cols
+    current_data.rr_energies.resize(rr_edges.size());
+    for(uint i = 0; i < rr_edges.size(); ++i) {
+      rr_edges[i]->FillActiveEnergies(current_data.rr_energies[i]);
+      if(current_data.rset[current_data.rr_index_in_R_one[i]] > 
+         current_data.rset[current_data.rr_index_in_R_two[i]]) {
+        current_data.rr_energies[i].transposeInPlace();
+      }
+    }
+  }
+}
+
+
+void EnumerateBagData(std::vector<BagData>& bag_data) {
+
+  for(uint bag_idx = 0; bag_idx < bag_data.size(); ++bag_idx) {
+
+    // data of the current bag
+    BagData& data = bag_data[bag_idx];
+    int rset_size = data.rset.size();
+    int num_lr_energies = data.lr_energies.size();
+    int num_rr_energies = data.rr_energies.size();
+
+    // the lset of this bag we have to enumerate
+    promod3::core::Enumerator<unsigned short> 
+    l_set_enumerator(data.num_l_solutions);
+    std::vector<unsigned short>& current_l_enum = 
+    l_set_enumerator.CurrentEnum();
+
+    int num_children = data.children_indices.size();
+    std::vector<int> partial_l_indices(num_children, 0);
+
+    do {      
+
+      partial_l_indices.assign(num_children, 0);
+      for(int j = 0; j < num_children; ++j) {
+        for(int k = 0; k < data.num_lset_child_l[j]; ++k) {
+          partial_l_indices[j] += 
+          (current_l_enum[data.lset_child_l_indices[j][k]] *
+          data.lset_child_l_index_helpers[j][k]);
+        }
+      }
+
+      promod3::core::Enumerator<unsigned short> 
+      r_set_enumerator(data.num_r_solutions);  
+      std::vector<unsigned short>& current_r_enum = 
+      r_set_enumerator.CurrentEnum();
+
+      Real score;
+      Real best_score = std::numeric_limits<Real>::max();
+      std::vector<unsigned short> best_rset = current_r_enum;
+
+      // let's find the optimal r combination given the current l combination... 
+      do {      
+
+        score = 0.0;
+
+        // sum up the r self energies
+        for(int i = 0; i < rset_size; ++i) {
+          score += data.r_self_energies[i][current_r_enum[i]];
+        }
+
+        // sum up the lr pairwise energies
+        for(int i = 0; i < num_lr_energies; ++i) {
+          score += data.lr_energies[i](current_l_enum[data.lr_index_in_I[i]],
+                                       current_r_enum[data.lr_index_in_R[i]]);
+        }
+
+        // sum up the rr pairwise energies
+        for(int i = 0; i < num_rr_energies; ++i) {
+          score += data.rr_energies[i](current_r_enum[data.rr_index_in_R_one[i]],
+                                       current_r_enum[data.rr_index_in_R_two[i]]);
+        }
+
+        for(int i = 0; i < num_children; ++i) {
+          int l_idx = partial_l_indices[i];
+          for(int j = 0; j < data.num_rset_child_l[i]; ++j) {
+            l_idx += (current_r_enum[data.rset_child_l_indices[i][j]] *
+                      data.rset_child_l_index_helpers[i][j]);
+          }
+          score += bag_data[data.children_indices[i]].optimal_r_score[l_idx];
+        }
+
+        if(score < best_score) {
+          best_score = score;
+          best_rset = current_r_enum;
+        }
+
+      } while(r_set_enumerator.Next());
+
+      int l_idx = data.lset_idx_calculator.GetLIdx(current_l_enum);
+      memcpy(&data.optimal_rset_combination[l_idx*rset_size],
+             &best_rset[0], rset_size * sizeof(unsigned short));
+      data.optimal_r_score[l_idx] = best_score;
+
+    } while(l_set_enumerator.Next());
+  } 
+}
+
+
+void CollectSolutionFromBagData(const std::vector<BagData>& bag_data,
+                                int bag_idx, std::vector<int>& solution) {
+
+  const BagData& bag = bag_data[bag_idx];
+
+  // collect the lset values from the solution
+  std::vector<unsigned short> l_solution(bag.lset.size(), 0);
+  for(uint i = 0; i < l_solution.size(); ++i) {
+    l_solution[i] = solution[bag.lset[i]];
+  }
+
+  // get the index of the ideal r_combination given that l solution
+  int r_idx = bag.lset_idx_calculator.GetLIdx(l_solution);
+  // and fill the according values into the solution
+  int rset_size = bag.rset.size();
+  int data_start_idx = r_idx * rset_size;
+  for(int i = 0; i < rset_size; ++i) {
+    solution[bag.rset[i]] = bag.optimal_rset_combination[data_start_idx+i];
+  }
+
+  // recursively call this function for all the children
+  for(std::vector<int>::const_iterator i = bag.children_indices.begin();
+      i != bag.children_indices.end(); ++i) {
+    CollectSolutionFromBagData(bag_data, *i, solution);
+  }
+}
+
+
+/////////////////////////////////////////////////////////////////
+//FUNCTIONS AND DATA STRUCTURES FOR THE ASTAR SOLVING ALGORITHM//
+/////////////////////////////////////////////////////////////////
+
+struct AStarNode{
+
+  AStarNode(uint idx, uint p_idx, unsigned short s_idx, 
+            unsigned short t_d, Real gs, Real hs): node_idx(idx),
+                                                   parent_idx(p_idx),
+                                                   solution_idx(s_idx),
+                                                   tree_depth(t_d),
+                                                   gstar(gs),
+                                                   hstar(hs) { }
+
+  uint node_idx;
+  uint parent_idx;
+  unsigned short solution_idx;
+  unsigned short tree_depth;
+  Real gstar;
+  Real hstar;
+};
+
+
+struct CompareAStarNodes{
+    bool operator() (AStarNode* a, AStarNode* b) {
+        return (a->gstar + a->hstar) > (b->gstar + b->hstar);
+    }
+};
+
+
+void ReconstructSearchTreePath(const std::vector<AStarNode>& node_array,
+                               uint start_idx, 
+                               std::vector<int>& path) {
+
+  path.resize(node_array[start_idx].tree_depth);
+  uint current_node_idx = start_idx;
+
+  while(current_node_idx != 0) {
+    path[node_array[current_node_idx].tree_depth-1] = 
+    node_array[current_node_idx].solution_idx;
+    current_node_idx = node_array[current_node_idx].parent_idx;
+  }
+}
+
+
+/////////////////////////////////////////////////////////////////
+//FUNCTIONS AND DATA STRUCTURES FOR THE MC SOLVING ALGORITHM//
+/////////////////////////////////////////////////////////////////
+
+Real GetSolutionEnergy(int node_idx, int solution_idx,
+            const std::vector<int>& current_solution,
+            const std::vector<std::vector<Real> >& self_energies,
+            const std::vector<promod3::core::EMatXX>& pairwise_energies,
+            const std::vector<std::vector<std::pair<int,int> > >& 
+            pairwise_energy_mapper) {
+
+  Real e = self_energies[node_idx][solution_idx];
+
+  const std::vector<std::pair<int, int> >& e_mapper = 
+  pairwise_energy_mapper[node_idx];
+  int num_pairwise_energies = e_mapper.size();
+
+  for(int i = 0; i < num_pairwise_energies; ++i) {
+
+    int other_node_idx = e_mapper[i].first;
+    int emat_idx = e_mapper[i].second;
+
+    if(other_node_idx > node_idx) {
+      e += pairwise_energies[emat_idx](solution_idx, 
+                                       current_solution[other_node_idx]);
+    }
+    else {
+      e += pairwise_energies[emat_idx](current_solution[other_node_idx], 
+                                       solution_idx); 
+    }
+  }
+
+  return e;
+}
+
+
+Real GetGlobalEnergy(const std::vector<int>& solution,
+               const std::vector<std::vector<Real> >& self_energies,
+               const std::vector<promod3::core::EMatXX>& pairwise_energies,
+               const std::vector<std::vector<std::pair<int, int> > >&
+               pairwise_energy_mapper) {
+
+  Real e = 0.0;
+
+  // sum up self energies
+  int num_nodes = solution.size();
+  for(int i = 0; i < num_nodes; ++i) {
+    e += self_energies[i][solution[i]];
+  }
+
+  // sum up pairwise energies
+  for(int i = 0; i < num_nodes; ++i) {
+    const std::vector<std::pair<int, int> >& e_mapper = 
+    pairwise_energy_mapper[i];
+    int num_pairwise_energies = e_mapper.size();
+    for(int j = 0; j < num_pairwise_energies; ++j) {
+      int other_node_idx = e_mapper[j].first;
+      if(other_node_idx > i) {
+        int emat_idx = e_mapper[j].second;
+        e += pairwise_energies[emat_idx](solution[i], solution[other_node_idx]);
+      }
+    }
+  }
+
+  return e;
+}
+
+
+struct SolutionSelector {
+
+  SolutionSelector(std::vector<int> num_solutions, int random_seed): 
+                                     n(num_solutions.size()),
+                                     n_solutions(num_solutions),
+                                     rng(random_seed),
+                                     zeroone(rng) { }
+
+  int SelectNode() {
+    return static_cast<int>(zeroone() * n);
+  }
+
+  int SelectSolution(int node_idx) {
+    return static_cast<int>(zeroone() * n_solutions[node_idx]);
+  }
+
+  void InitSolutionSelection(std::vector<int>& current_solution) {
+    current_solution.resize(n);
+    for(int i = 0; i < n; ++i) {
+      current_solution[i] = this->SelectSolution(i);
+    }
+  }
+
+  Real GetRandomNumber() {
+    return zeroone();
+  }
+
+  int n;
+  std::vector<int> n_solutions;
+  boost::mt19937 rng;
+  boost::uniform_01<boost::mt19937&> zeroone;
+};
+
+} // anon ns
+
+namespace promod3{ namespace core{
+
+GMEdge::GMEdge(uint index, 
+               GMNode* node_a, 
+               GMNode* node_b,  
+               const EMatXX& emat): index_(index),
+                                    active_(true) {
+
+  if(node_a->GetNumSolutions() != static_cast<uint>(emat.rows())) {
+    throw promod3::Error("Number of solutions in node_a must be number "
+                         "of rows in emat!");
+  }
+
+  if(node_b->GetNumSolutions() != static_cast<uint>(emat.cols())) {
+    throw promod3::Error("Number of solutions in node_b must be number "
+                         "of cols in emat!");
+  }
+
+  if(node_a->GetIndex() == node_b->GetIndex()) {
+    throw promod3::Error("Cant Initialize GMEdge with the same GMNode Twice!");
+  }
+
+  // node_1 is by definition the one with the lower index
+  if(node_a->GetIndex() < node_b->GetIndex()) {
+    node1_ = node_a;
+    node2_ = node_b;
+    emat_ = emat;
+  }
+  else {
+    node1_ = node_b;
+    node2_ = node_a;
+    emat_ = emat.transpose();
+  }
+}
+
+
+void GMEdge::Reset() {
+  active_ = true;
+}
+
+
+bool GMEdge::Decompose(Real thresh) {
+
+  if(!active_) return false;
+
+  Real summed_e = 0.0;
+  uint m = node1_->GetNumActiveSolutions();
+  uint n = node2_->GetNumActiveSolutions();
+
+  for(GMNode::iterator i = node1_->active_solutions_begin();
+      i != node1_->active_solutions_end(); ++i) {
+    for(GMNode::iterator j = node2_->active_solutions_begin();
+        j != node2_->active_solutions_end(); ++j) {
+      summed_e += emat_(*i, *j);
+    }
+  }
+
+  Real avg_value = summed_e/(2*n*m);
+
+  std::vector<Real> ak(m);
+  std::vector<Real> bl(n);
+
+  uint m_counter = 0;
+  for(GMNode::iterator i = node1_->active_solutions_begin();
+      i != node1_->active_solutions_end(); ++i) {
+    summed_e = 0.0;
+    for(GMNode::iterator j = node2_->active_solutions_begin();
+        j != node2_->active_solutions_end(); ++j) {
+      summed_e += emat_(*i, *j);
+    }
+    ak[m_counter] = summed_e/n - avg_value;
+    ++m_counter;
+  }
+
+  uint n_counter = 0;
+  for(GMNode::iterator i = node2_->active_solutions_begin();
+      i != node2_->active_solutions_end(); ++i) {
+    summed_e = 0.0;
+    for(GMNode::iterator j = node1_->active_solutions_begin();
+        j != node1_->active_solutions_end(); ++j) {
+      summed_e += emat_(*j, *i);
+    }
+    bl[n_counter] = summed_e/m - avg_value;
+
+    // we directly check, whether any of the energy approximations
+    // related to *i is above the thresh and don't evaluate the rest
+    // if not necessary
+    m_counter = 0;
+    for(GMNode::iterator j = node1_->active_solutions_begin();
+        j != node1_->active_solutions_end(); ++j) {
+      if(std::abs(emat_(*j, *i) - ak[m_counter] - bl[n_counter]) > thresh) { 
+        return false;
+      }
+      ++m_counter;
+    }
+    ++n_counter;
+  }
+
+  // it ran through! This edge can be decomposed!
+
+  int counter = 0;
+  for(GMNode::iterator j = node1_->active_solutions_begin(); 
+    j != node1_->active_solutions_end(); ++j, ++counter) {
+    node1_->AddValue(*j, ak[counter]);
+  }
+
+  counter = 0;
+  for(GMNode::iterator j = node2_->active_solutions_begin(); 
+      j != node2_->active_solutions_end(); ++j, ++counter) {
+    node2_->AddValue(*j, bl[counter]);
+  }
+
+  this->Deactivate();
+  node1_->RemoveFromActiveEdges(this);
+  node2_->RemoveFromActiveEdges(this);
+
+  return true;
+}
+
+
+Real GMEdge::EMinDiff(const GMNode* node_ptr, uint idx1, uint idx2) const {
+
+  Real min_e = std::numeric_limits<Real>::max();
+
+  if(node_ptr == node1_) {
+    for(GMNode::const_iterator i = node2_->active_solutions_begin();
+        i != node2_->active_solutions_end(); ++i) {
+      min_e = std::min(min_e, emat_(idx1, *i) - emat_(idx2, *i));
+    }
+    return min_e;
+  }
+  else if(node_ptr == node2_) {
+    for(GMNode::const_iterator i = node1_->active_solutions_begin();
+        i != node1_->active_solutions_end(); ++i) {
+      min_e = std::min(min_e, emat_(*i, idx1) - emat_(*i, idx2));
+    }
+    return min_e;
+  }
+
+  throw promod3::Error("Cannot evaluate Node which is unconnected to the edge "
+                       "of interest!");
+}
+
+
+void GMEdge::FillActiveEnergies(EMatXX& emat) const {
+
+  int idx1 = 0;
+  int idx2 = 0;
+  emat = EMatXX::Zero(node1_->GetNumActiveSolutions(), 
+                      node2_->GetNumActiveSolutions());
+
+  for(GMNode::const_iterator i = node1_->active_solutions_begin();
+      i != node1_->active_solutions_end(); ++i, ++idx1) {
+    idx2 = 0;
+    for(GMNode::const_iterator j = node2_->active_solutions_begin();
+        j != node2_->active_solutions_end(); ++j, ++idx2) {
+      emat(idx1, idx2) = emat_(*i, *j);
+    }
+  }
+}
+
+
+GMNode* GMEdge::GetOtherNode(GMNode* node) {
+  if(node == node1_) return node2_;
+  if(node == node2_) return node1_;
+  throw promod3::Error("Node does not belong to edge!");
+}
+
+
+GMNode::GMNode(uint index, 
+               const std::vector<Real>& self_energies): 
+                                        index_(index),
+                                        active_(true),
+                                        self_energies_(self_energies),
+                                        original_self_energies_(self_energies) {
+
+  for(uint i = 0; i < self_energies_.size(); ++i) {
+    active_solutions_.push_back(i);
+  }
+
+  this->FillSortedActiveSolutions();
+}
+
+
+void GMNode::Reset() {
+
+  active_ = true;
+  self_energies_ = original_self_energies_;
+
+  // clear everything
+  active_solutions_.clear();
+  active_edges_.clear();
+
+  // and refill
+  for(uint i = 0; i < self_energies_.size(); ++i) {
+    active_solutions_.push_back(i);
+  }
+  this->FillSortedActiveSolutions();
+  
+
+  for(uint i = 0; i < edges_.size(); ++i) {
+    active_edges_.push_back(i);
+  }
+
+  for(std::vector<GMEdge*>::iterator i = edges_.begin(); 
+      i != edges_.end(); ++i) { 
+    (*i)->Reset();
+  }
+}
+
+
+void GMNode::Deactivate(int index) {
+
+  if(!active_) {
+    return;
+  }
+
+  active_ = false;
+
+  // if the given index is -1 (default), we simply search for the
+  // the solution with the lowest self energy as the last active solution,
+  // a.k.a. the solution for this node.
+  // In all other cases we take the solution at given index.
+  if(index == -1) {
+    // lets first figure out which is the lowest energy
+    // solution and set it to the only active one
+    Real e_min = std::numeric_limits<Real>::max();
+    index = 0;
+    for(uint i = 0; i < active_solutions_.size(); ++i) {
+      if(self_energies_[active_solutions_[i]] < e_min) {
+        e_min = self_energies_[active_solutions_[i]];
+        index = active_solutions_[i];
+      }
+    }
+  }
+
+  active_solutions_.resize(1);
+  active_solutions_[0] = index;
+
+  sorted_active_solutions_.resize(1);
+  sorted_active_solutions_[0] = index;
+  
+  // deactivate all edges connected to this node
+  for(iterator i = this->active_edges_begin(); 
+      i != this->active_edges_end(); ++i) {
+    GMNode* other = edges_[*i]->GetOtherNode(this);
+    other->RemoveFromActiveEdges(edges_[*i]);
+    edges_[*i]->Deactivate();
+  } 
+  active_edges_.clear();
+}
+
+
+void GMNode::AddEdge(GMEdge* edge) {
+  active_edges_.push_back(edges_.size());
+  edges_.push_back(edge);
+}
+
+
+void GMNode::AddValue(uint node_idx, Real val) {
+  self_energies_[node_idx] += val;
+}
+
+
+void GMNode::RemoveFromActiveEdges(GMEdge* edge) {
+
+  for(uint i = 0; i < edges_.size(); ++i) {
+    if(edge == edges_[i]) {
+      iterator it = std::find(active_edges_.begin(), active_edges_.end(), i);
+      if(it != active_edges_.end()) active_edges_.erase(it);
+    }
+  }
+}
+
+
+bool GMNode::DEE(Real e_cut) {
+
+  if(active_solutions_.size() <= 1) return false;
+
+  bool something_happened = false; 
+  Real sum;
+  int solution_to_eliminate = sorted_active_solutions_.size()-1;
+
+  while(solution_to_eliminate >= 0) {
+
+    for(int i = 0; i < static_cast<int>(sorted_active_solutions_.size()); ++i) {
+
+      if(i == solution_to_eliminate) continue;
+
+      sum = 
+      self_energies_[sorted_active_solutions_[solution_to_eliminate]] -
+      self_energies_[sorted_active_solutions_[i]];
+
+      for(iterator j = this->active_edges_.begin(); 
+          j != this->active_edges_.end(); ++j) {
+        sum += 
+        edges_[*j]->EMinDiff(this,
+                    sorted_active_solutions_[solution_to_eliminate],
+                    sorted_active_solutions_[i]);
+      }
+
+      if(sum >= e_cut) {
+        
+        something_happened = true;
+        std::vector<uint>::iterator it = 
+        std::find(active_solutions_.begin(), active_solutions_.end(),
+                  sorted_active_solutions_[solution_to_eliminate]);
+        active_solutions_.erase(it);
+        sorted_active_solutions_.erase(sorted_active_solutions_.begin() + 
+                                       solution_to_eliminate);
+        break;
+      }
+    }
+    --solution_to_eliminate;
+  }
+
+  return something_happened;
+}
+
+
+void GMNode::FillActiveSelfEnergies(std::vector<Real>& self_energies) const {
+
+  self_energies.resize(active_solutions_.size());
+
+  for(uint i = 0; i < active_solutions_.size(); ++i) {
+    self_energies[i] = self_energies_[active_solutions_[i]];
+  }
+}
+
+
+void GMNode::FillSortedActiveSolutions() {
+
+  if(active_solutions_.size() != self_energies_.size()) {
+    throw promod3::Error("Can only sort active solutions when ALL solutions "
+                         "are active!");
+  }
+
+  std::vector<std::pair<Real, uint> > temp;
+  for(uint i = 0; i < self_energies_.size(); ++i) {
+    temp.push_back(std::make_pair(self_energies_[i], i));
+  }
+  std::sort(temp.begin(), temp.end());
+
+  sorted_active_solutions_.clear();
+  for(uint i = 0; i < temp.size(); ++i) {
+    sorted_active_solutions_.push_back(temp[i].second);
+  }
+}
+
+
+GraphMinimizer::~GraphMinimizer() {
+
+  for(uint i = 0; i < nodes_.size(); ++i) {
+    delete nodes_[i];
+  }
+
+  for(uint i = 0; i < edges_.size(); ++i) {
+    delete edges_[i];
+  }  
+}
+
+
+int GraphMinimizer::AddNode(const std::vector<Real>& self_energies) {
+
+  int node_idx = nodes_.size();
+  nodes_.push_back(new GMNode(node_idx, self_energies));
+  return node_idx;
+}
+
+
+int GraphMinimizer::AddEdge(uint node_idx_one, uint node_idx_two,
+                            const EMatXX& emat) {
+
+  if(node_idx_one >= nodes_.size() || node_idx_two >= nodes_.size()) {
+    throw promod3::Error("Invalid node idx provided!");
+  }
+
+  int edge_idx = edges_.size();
+  // check for valid energy matrix happens in GMEdge constructor
+  edges_.push_back(new GMEdge(edge_idx, nodes_[node_idx_one],
+                              nodes_[node_idx_two], emat));
+
+  // the edge also has to be added to the nodes
+  nodes_[node_idx_one]->AddEdge(edges_.back());
+  nodes_[node_idx_two]->AddEdge(edges_.back());
+
+  return edge_idx;
+}
+
+
+bool GraphMinimizer::ApplyDEE(uint idx, Real e_thresh) {
+
+  if(idx >= nodes_.size()) {
+    throw promod3::Error("Invalid Index observed when applying DEE!");
+  }
+
+  return nodes_[idx]->DEE(e_thresh);
+}
+
+
+bool GraphMinimizer::ApplyEdgeDecomposition(uint idx, Real e_thresh) {
+
+  if(idx >= edges_.size()) {
+    throw promod3::Error("Invalid Index observed when applying Edge "
+                         "Decomposition!");
+  }
+
+  return edges_[idx]->Decompose(e_thresh);
+}
+
+
+void GraphMinimizer::Prune(Real epsilon, Real e_cut, bool consider_all_nodes) {
+
+  // nodes/edges, where something happened
+  std::vector<bool> hot_edges(edges_.size(),true);
+  std::vector<bool> hot_nodes;
+  if(consider_all_nodes)hot_nodes.resize(nodes_.size(),true);   
+  else hot_nodes.resize(nodes_.size(),false);
+
+  bool something_happened = true;
+  while(something_happened) {
+    something_happened = false;
+    // let's first do edge decomposition
+    for(uint i = 0; i < hot_edges.size(); ++i) {
+      if(!hot_edges[i]) continue;
+      if(this->ApplyEdgeDecomposition(i, epsilon)) {
+        // let's set the status hot to the nodes connected by the
+        // edge
+        hot_nodes[edges_[i]->GetNode1()->GetIndex()] = true;
+        hot_nodes[edges_[i]->GetNode2()->GetIndex()] = true;
+        something_happened = true;
+      }
+      // either nothing happened, or successfully decomposed...
+      // edge is not hot anymore
+      hot_edges[i] = false;
+    }
+    // let's do DEE
+    for(uint i = 0; i < hot_nodes.size(); ++i) {
+      if(!hot_nodes[i]) continue;
+      if(this->ApplyDEE(i, e_cut)) {
+        // let's set the status hot to the edges, as well as other
+        // nodes connected to that node
+        for(GMNode::iterator j = nodes_[i]->active_edges_begin();
+            j != nodes_[i]->active_edges_end(); ++j) {
+          GMEdge* current_edge = nodes_[i]->GetEdge(*j);
+          hot_edges[current_edge->GetIndex()] = true;
+          // one of the following connected node is the checked node
+          // itself... will be set to false again...
+          hot_nodes[current_edge->GetNode1()->GetIndex()] = true;
+          hot_nodes[current_edge->GetNode2()->GetIndex()] = true;
+        }
+        something_happened = true;
+      }
+      // either nothing happened, or successful DEE...
+      // node is not hot anymore
+      hot_nodes[i] = false;
+    }
+  }
+}
+
+
+void GraphMinimizer::Reset() {
+
+  for(std::vector<GMNode*>::iterator i = nodes_.begin(); 
+      i != nodes_.end(); ++i) {
+    (*i)->Reset();
+  }
+  for(std::vector<GMEdge*>::iterator i = edges_.begin(); 
+      i != edges_.end(); ++i) {
+    (*i)->Reset();
+  }
+}
+
+
+promod3::core::Graph GraphMinimizer::ToRawGraph() const {
+
+  promod3::core::Graph raw_graph(nodes_.size());
+  std::map<GMNode*, int> ptr_mapper;
+  for(uint i = 0; i < nodes_.size(); ++i) {
+    ptr_mapper[nodes_[i]] = i;
+  }
+  for(std::vector<GMEdge*>::const_iterator i = edges_.begin(); 
+      i != edges_.end(); ++i) {
+    if((*i)->IsActive()) {
+      int idx_one = ptr_mapper[(*i)->GetNode1()];
+      int idx_two = ptr_mapper[(*i)->GetNode2()];
+      raw_graph.Connect(idx_one,idx_two);
+    }
+  }
+  return raw_graph;
+}
+
+
+bool GraphMinimizer::HasActiveNodes() const {
+
+  for(uint i = 0; i < nodes_.size(); ++i) {
+    if(nodes_[i]->IsActive()) {
+      return true;
+    }
+  }
+
+  return false;
+}
+
+
+std::pair<std::vector<int>, Real> 
+GraphMinimizer::TreeSolve(uint64_t max_complexity, Real initial_epsilon) {
+
+  core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
+                                "GraphMinimizer::TreeSolve", 2);
+
+  // all nodes must be active in the beginning
+  for(std::vector<GMNode*>::iterator i = nodes_.begin(); 
+      i != nodes_.end(); ++i) {
+    if(!(*i)->IsActive()) {
+      String err = "All nodes of graph must be active for TreeSolving.";
+      err += " Either construct a new graph or reset the current one!";
+      throw promod3::Error(err);
+    }
+  }
+
+  std::vector<int> overall_solution(nodes_.size(), 0);
+  Real overall_energy = 0.0;
+
+  // handle the case where graph is empty
+  if(nodes_.empty()) {
+    return std::make_pair(overall_solution, overall_energy);
+  }
+
+  // handle the case where graph only contains one item
+  if(nodes_.size() == 1) {
+    nodes_[0]->Deactivate();
+    overall_solution[0] = nodes_[0]->GetOverallIndex(0); 
+    overall_energy += nodes_[0]->GetSelfEnergy(overall_solution[0]);
+    return std::make_pair(overall_solution, overall_energy);
+  }
+
+  bool first_iteration = true;
+  
+  while(this->HasActiveNodes()) {
+
+    this->Prune(initial_epsilon, 0.0, first_iteration);
+
+    // build raw graph and extract connected components
+    promod3::core::Graph raw_graph = this->ToRawGraph();
+
+    // generate the connected components
+    std::vector<std::vector<int> > connected_components;
+    raw_graph.ConnectedComponents(connected_components);
+    
+    // solve the connected components seperately if the according
+    // complexity is feasible
+
+    for(uint component_idx = 0; component_idx < connected_components.size();
+        ++component_idx) {
+
+      const std::vector<int>& component = connected_components[component_idx];
+
+      if(component.size() == 1) {
+        if(nodes_[component[0]]->IsActive()) {
+          // note, that lowest energy solution will be the only active one upon
+          // calling Deactivate
+          nodes_[component[0]]->Deactivate();
+          int overall_idx = nodes_[component[0]]->GetOverallIndex(0);          
+          overall_solution[component[0]] = overall_idx;
+          overall_energy += nodes_[component[0]]->GetSelfEnergy(overall_idx);
+        }
+        continue;
+      }
+
+      // create initial data required to solve the enumeration problem
+      std::vector<int> num_active_solutions(component.size());
+      for(uint i = 0; i < component.size(); ++i) {
+        // Check, whether any of the nodes has too many solutions
+        // (due to memory reasons we use unsigned shorts as solution 
+        //  identifier in the tree solving algorithms)
+        if(nodes_[component[i]]->GetNumActiveSolutions() > 
+           std::numeric_limits<unsigned short>::max()) {
+          std::stringstream ss;
+          ss << "Due to technical reasons the maximum number of solutions per ";
+          ss << "position is limited to ";
+          ss << std::numeric_limits<unsigned short>::max();
+          ss << ". Observed a location with ";
+          ss << nodes_[component[i]]->GetNumActiveSolutions();
+          ss << " solutions. Either use less solutions or perform more pruning";
+          ss << " operations before using the TreeSolve algorithm.";
+          throw promod3::Error(ss.str());
+        }
+        num_active_solutions[i] = nodes_[component[i]]->GetNumActiveSolutions(); 
+      }
+
+      promod3::core::Graph component_graph = raw_graph.SubGraph(component);
+
+      TBag* component_tree = 
+      promod3::core::GenerateMinimalWidthTree(component_graph);
+
+      // generate post order traversal of previously constructed tree
+      std::vector<TBag*> traversal = 
+      promod3::core::PostOrderTraversal(component_tree);
+
+      // this only fills some initial data, that is required to estimate
+      // the complexity to solve this component
+      std::vector<BagData> bag_data;
+      uint64_t component_complexity = FillRawBagData(traversal,
+                                                     num_active_solutions,
+                                                     bag_data);
+
+      // check whether complexity of current connected component is solvable...
+      // if not, we simply perform another iteration of pruning.
+      if(component_complexity > max_complexity) {
+        if(initial_epsilon <= 0.0) {
+          std::stringstream ss;
+          ss << "One of the connected components in the GraphMinimizer ";
+          ss << "reaches a complexity of "<< component_complexity;
+          ss << ", which is above the max_complexity of "<<max_complexity;
+          ss << ". The idea is to prune more and more aggressively by ";
+          ss << "multiplying the initial_epsilon value by a factor of 2. ";
+          ss << "Your initial_epsilon is "<<initial_epsilon;
+          ss << ", the complexity of this connected ";
+          ss << "component will therefore never fall below max_complexity. ";
+          ss << "To successfully solve the Graph you either have to ";
+          ss << "give initial_epsilon a value above 0.0 or increase ";
+          ss << "max_complexity";
+          throw promod3::Error(ss.str());
+        }
+        continue;
+      }
+
+      // The complexity is low enough... let's fill remaining data and
+      // solve it! GOGOGO!
+
+      std::vector<GMNode*> component_nodes;
+      std::vector<GMEdge*> component_edges;
+      std::vector<std::pair<int, int> > component_edge_indices;
+
+      for(uint i = 0; i < component.size(); ++i) {
+        component_nodes.push_back(nodes_[component[i]]);
+      }
+
+      for(uint i = 0; i < edges_.size(); ++i) {
+        
+        GMEdge* edge = edges_[i];
+
+        // is the edge active?
+        if(!edge->IsActive()) continue;
+
+        // does it affect the current component?
+        int a = edge->GetNode1()->GetIndex();
+        int b = edge->GetNode2()->GetIndex();
+
+        std::vector<int>::const_iterator a_it = std::find(component.begin(), 
+                                                          component.end(), a);
+        if(a_it == component.end()) continue; // it's not part of the component
+
+        std::vector<int>::const_iterator b_it = std::find(component.begin(), 
+                                                          component.end(), b);
+        if(b_it == component.end()) continue; // it's not part of the component
+
+        int a_in_component = a_it - component.begin();
+        int b_in_component = b_it - component.begin();
+
+        component_edges.push_back(edge);
+        component_edge_indices.push_back(std::make_pair(a_in_component,
+                                                        b_in_component));
+      }
+
+      // let's fill in remaining data (energies and stuff)
+      FillBagData(traversal, component_nodes, component_edges, 
+                  component_edge_indices, bag_data);      
+
+      // let's do the whole enumeration game
+      EnumerateBagData(bag_data);
+
+      // let's get the solution out
+      std::vector<int> component_solution(component.size(), 0);
+      CollectSolutionFromBagData(bag_data, bag_data.size() - 1, 
+                                 component_solution);
+
+      overall_energy += bag_data.back().optimal_r_score[0];
+
+      // alter the graph accordingly
+      for(uint i = 0; i < component.size(); ++i) {
+        uint overall_idx = 
+        nodes_[component[i]]->GetOverallIndex(component_solution[i]);
+        nodes_[component[i]]->Deactivate(overall_idx);
+        overall_solution[component[i]] = overall_idx;
+      }
+    }
+
+    first_iteration = false;
+    initial_epsilon *= 2;
+  }
+
+  return std::make_pair(overall_solution, overall_energy);
+}
+
+
+std::pair<std::vector<std::vector<int> >, std::vector<Real> > 
+GraphMinimizer::AStarSolve(Real e_thresh, uint max_n, uint max_visited_nodes) {
+
+  core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
+                                "GraphMinimizer::AStarSolve", 2);
+
+  // all nodes must be active in the beginning
+  for(std::vector<GMNode*>::iterator i = nodes_.begin();
+      i != nodes_.end(); ++i) {
+    if(!(*i)->IsActive()) {
+      String err = "All nodes of graph must be active for AStarSolving.";
+      err += " Either construct a new graph or reset the current one!";
+      throw promod3::Error(err);
+    }
+  }
+
+  // e_thresh and max_n must be positive
+  if(e_thresh < 0.0) throw promod3::Error("e_thresh must be positive!");
+  if(max_n <= 0) throw promod3::Error("max_n must be positive!");
+  
+  std::vector<std::vector<int> > solutions;
+  std::vector<Real> solution_energies;
+  int num_graph_nodes = nodes_.size();
+  int num_graph_edges = edges_.size();
+
+  // handle the case where graph is empty
+  if(num_graph_nodes == 0) {
+    return std::make_pair(solutions, solution_energies);
+  }
+
+  // handle the case where graph only contains one item
+  if(num_graph_nodes == 1) {
+
+    uint num_active_solutions = nodes_[0]->GetNumActiveSolutions();
+    if(num_active_solutions == 0) {
+      return std::make_pair(solutions, solution_energies);
+    }
+
+    std::vector<std::pair<Real, int> > sorted_solutions;
+    sorted_solutions.reserve(num_active_solutions);
+    std::vector<Real> active_energies;
+    nodes_[0]->FillActiveSelfEnergies(active_energies);
+    for(uint i = 0; i < num_active_solutions; ++i) {
+      sorted_solutions.push_back(std::make_pair(active_energies[i], i));
+    }
+    std::sort(sorted_solutions.begin(), sorted_solutions.end());
+    Real emin = sorted_solutions[0].first;
+    for(uint i = 0; i < std::min(max_n, num_active_solutions); ++i) {
+      if((sorted_solutions[i].first - emin) > e_thresh || 
+         solutions.size() >= max_n) {
+        break;
+      }
+      int overall_idx = nodes_[0]->GetOverallIndex(sorted_solutions[i].second);
+      solutions.push_back(std::vector<int>(1, overall_idx));
+      solution_energies.push_back(sorted_solutions[i].first);
+    }
+    return std::make_pair(solutions, solution_energies);
+  }
+
+  // extract the energies of the active solutions
+  std::vector<int> num_active_solutions(nodes_.size());
+  std::vector<std::vector<Real> > self_energies(nodes_.size());
+
+  for(int i = 0; i < num_graph_nodes; ++i) {
+    num_active_solutions[i] = nodes_[i]->GetNumActiveSolutions();
+  }
+
+  for(int i = 0; i < num_graph_nodes; ++i) {
+    nodes_[i]->FillActiveSelfEnergies(self_energies[i]);
+  }
+
+  // pairwise energies are stored a bit more complicated...
+  // One vector per node.
+  // Every element in that vector contains the index to another node with LOWER
+  // idx and the corresponding energy matrix
+  std::vector<std::vector<std::pair<int, EMatXX> > > 
+  pairwise_energies(num_graph_nodes);
+  std::vector<int> num_pairwise_energies(num_graph_nodes);
+
+  // to avoid too many reallocations and copying of the eigen matrices, we
+  // build up a temporary data structure first  
+  std::vector<std::vector<std::pair<int, GMEdge*> > > temp(num_graph_nodes);
+
+  for(int i = 0; i < num_graph_edges; ++i) {
+    if(edges_[i]->IsActive()) {
+      GMEdge* edge = edges_[i];
+      int a = edge->GetNode1()->GetIndex();
+      int b = edge->GetNode2()->GetIndex();
+
+      // b is larger...
+      temp[b].push_back(std::make_pair(a, edge));
+    }
+  } 
+
+  for(int i = 0; i < num_graph_nodes; ++i) {
+    int n = temp[i].size();
+    num_pairwise_energies[i] = n;
+    pairwise_energies[i].resize(n);
+    for(int j = 0; j < n; ++j) {
+      pairwise_energies[i][j].first = temp[i][j].first;
+      temp[i][j].second->FillActiveEnergies(pairwise_energies[i][j].second);
+    }
+  }
+
+  // following data structure is a precalculation to increase the speed
+  // of hstar calculation...
+
+  // for every every position there is a vector for every solution at 
+  // that position. Every element in that vector contains the minimal 
+  // energy towards every position that comes before, zero if no 
+  // interaction is observed
+  std::vector<std::vector<std::vector<Real> > > 
+  min_pairwise_e_before(num_graph_nodes, std::vector<std::vector<Real> >());
+
+  for(int i = 0; i < num_graph_nodes; ++i) {
+    min_pairwise_e_before[i].resize(num_active_solutions[i]);
+    for(int j = 0; j < num_active_solutions[i]; ++j) {
+      min_pairwise_e_before[i][j].assign(i,0.0);
+      for(int k = 0; k < num_pairwise_energies[i]; ++k) {
+
+        int other_node = pairwise_energies[i][k].first;
+        const EMatXX& emat = pairwise_energies[i][k].second; 
+        
+        Real e_min = std::numeric_limits<Real>::max();
+        for(int l = 0; l < num_active_solutions[other_node]; ++l) {
+          e_min = std::min(e_min, emat(l, j));
+        }
+
+        min_pairwise_e_before[i][j][other_node] = e_min;
+      }
+    }
+  }
+
+  // Data structures to hold the visited nodes and sort them in a priority queue
+  std::priority_queue<AStarNode*,std::vector<AStarNode*>,CompareAStarNodes> 
+  node_queue;
+  std::vector<AStarNode> node_array;
+  // we already have to reserve node_array, since we deal with pointers
+  // to it and reallocations are a bit bad in these cases...
+  node_array.reserve(max_visited_nodes);
+
+  // we first add the root node with g* = 0.0 and h* = max_real
+  node_array.push_back(AStarNode(0, 0, 0, 0, 0.0, 
+                                 std::numeric_limits<Real>::max()));
+
+  node_queue.push(&node_array[0]);
+  Real min_energy = std::numeric_limits<Real>::max();
+
+  while(!node_queue.empty()) {
+
+    AStarNode* current_node = node_queue.top();
+    node_queue.pop();
+
+    std::vector<int> path;
+    ReconstructSearchTreePath(node_array, current_node->node_idx, path);
+
+    if(current_node->tree_depth >= num_graph_nodes) {
+      // it is a solution!!!!!
+      Real fstar = current_node->gstar; //note, that hstar must be zero...
+      if(solutions.empty()) {
+        // it's the first solution and therefore the GMEC
+        // (Global Minimum Energy Conformation Fuck Yeah...)
+        min_energy = fstar;
+      }
+      else{
+        // there is at least one solution around! let's check whether
+        // the current solution is within e_thresh
+        if(fstar - min_energy > e_thresh) break;
+      }
+
+      // let's add it
+      solutions.push_back(path);
+      solution_energies.push_back(fstar);
+
+      // check whether we have enough solutions
+      if(solutions.size() >= max_n) break; 
+
+      continue;
+    }
+
+    // current node has to be expanded 
+    // => new node for every single solution in node
+
+    // we first check whether we become bigger than max_visited_nodes
+    if(node_array.size() + num_active_solutions[current_node->tree_depth] > 
+       max_visited_nodes) {
+      throw promod3::Error("Reached max_visited_nodes => increase this"
+                           "parameter or reduce the problem size!");
+    }
+
+    // following variables will be the same for all expaned nodes
+    int pos_in_graph = current_node->tree_depth;
+    uint parent_idx = current_node->node_idx;
+    unsigned short tree_depth = current_node->tree_depth + 1;
+
+    // We already add an element to the path for the node to be expaned.
+    // This saves an if in the hstar calculation
+    path.push_back(0);
+
+    for(int solution_idx = 0; solution_idx < num_active_solutions[pos_in_graph];
+        ++solution_idx) {
+
+      // set the hacky last element of the path
+      path.back() = solution_idx;
+
+      // variable specific for expanded node
+      uint node_idx = node_array.size();
+      Real gstar = current_node->gstar;
+      Real hstar = 0.0;
+
+      // we still need to adapt the energy values (gstar and hstar)
+
+      // in case of gstar we have to add the self energy of the current
+      // solution and the pairwise energy towards all previous solutions in
+      // the path towards this node
+
+      // let's add the self energy
+      gstar += self_energies[pos_in_graph][solution_idx];
+
+      // let's add all pairwise energies towards the already set solutions
+      for(int i = 0; i < num_pairwise_energies[pos_in_graph]; ++i) {
+        int other_node = pairwise_energies[pos_in_graph][i].first;
+        const EMatXX& emat = pairwise_energies[pos_in_graph][i].second;
+        gstar += emat(path[other_node], solution_idx);
+      }
+
+      // in case of hstar we have to add the minimal pairwise energy towards
+      // all nodes still to be determined
+      int last_path_idx = path.size()-1;
+      for(int non_set_pos_idx = pos_in_graph + 1; 
+          non_set_pos_idx < num_graph_nodes; ++non_set_pos_idx) {
+
+        Real min_e = std::numeric_limits<Real>::max();
+
+        // iterate over all possible solutions at position non_set_pos_idx
+        for(int i = 0; i < num_active_solutions[non_set_pos_idx]; ++i) {
+
+          // start with its self energy
+          Real actual_e = self_energies[non_set_pos_idx][i];
+
+          // add all pairwise energies towards solutions that have already been
+          // set in this path, the according minimal energy that could be 
+          // achieved respectively
+          for(int j = 0; j < num_pairwise_energies[non_set_pos_idx]; ++j) {
+            int other_node = pairwise_energies[non_set_pos_idx][j].first;
+            if(other_node <= last_path_idx) {
+              // add the energy to the already determined energy from the path
+              const EMatXX& emat = pairwise_energies[non_set_pos_idx][j].second;
+              actual_e += emat(path[other_node], i);
+            }
+            else{
+              // add the minimal possible energy...
+              actual_e += min_pairwise_e_before[non_set_pos_idx][i][other_node];
+            }
+          }
+          min_e = std::min(min_e, actual_e);
+        }
+        hstar += min_e;
+      }
+
+      node_array.push_back(AStarNode(node_idx, parent_idx,
+                                     solution_idx, tree_depth, gstar,
+                                     hstar));
+
+      // it's all done, we finally have to insert it into the priority queue
+      node_queue.push(&node_array[node_idx]);
+    }
+  }
+
+  // the solutions are relative to the active solutions, we still have to 
+  // translate them into overall indices
+  for(uint i = 0; i < solutions.size(); ++i) {
+    for(uint j = 0; j < solutions[i].size(); ++j) {
+      solutions[i][j] = nodes_[j]->GetOverallIndex(solutions[i][j]);
+    }
+  } 
+
+  return std::make_pair(solutions, solution_energies);
+}
+
+
+std::pair<std::vector<std::vector<int> >, std::vector<Real> > 
+GraphMinimizer::MCSolve(int n, int mc_steps, Real start_temperature, 
+                        int change_frequency, Real cooling_factor, int seed) {
+
+  core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
+                                "GraphMinimizer::MCSolve", 2);
+
+  // all nodes must be active in the beginning
+  for(std::vector<GMNode*>::iterator i = nodes_.begin();
+      i != nodes_.end(); ++i) {
+    if(!(*i)->IsActive()) {
+      String err = "All nodes of graph must be active for MCSolving.";
+      err += " Either construct a new graph or reset the current one!";
+      throw promod3::Error(err);
+    }
+  }
+
+  std::vector<std::vector<int> > solutions;
+  std::vector<Real> solution_energies;
+  int num_graph_nodes = nodes_.size();
+  int num_graph_edges = edges_.size();
+
+  // handle the case where graph is empty
+  if(num_graph_nodes == 0) {
+    throw promod3::Error("Cannot run MCSolve on an empty Graph!");
+  }
+
+  // extract the number of active solutions and the self energies 
+  // of all the nodes
+  std::vector<int> num_active_solutions(num_graph_nodes);
+  std::vector<std::vector<Real> > self_energies(num_graph_nodes);
+  for(int i = 0; i < num_graph_nodes; ++i) {
+    nodes_[i]->FillActiveSelfEnergies(self_energies[i]);
+    num_active_solutions[i] = self_energies[i].size();
+  }
+
+  // a vector for every node... every vector contains pairs describing the
+  // interactions towards other nodes. 
+  // first pair element: idx to OTHER node
+  // second pair element: idx to energy mat
+  std::vector<std::vector<std::pair<int, int> > > pairwise_energy_mapper;
+  pairwise_energy_mapper.resize(num_graph_nodes);
+  std::vector<GMEdge*> active_edges;
+
+  // buildup the pairwise_energy_mapper
+  for(int i = 0; i < num_graph_edges; ++i) {
+    GMEdge* edge = edges_[i];
+    if(edge->IsActive()) {
+      int n1_idx = edge->GetNode1()->GetIndex();
+      int n2_idx = edge->GetNode2()->GetIndex();
+      int edge_idx = active_edges.size();
+      pairwise_energy_mapper[n1_idx].push_back(std::make_pair(n2_idx, edge_idx));
+      pairwise_energy_mapper[n2_idx].push_back(std::make_pair(n1_idx, edge_idx));
+      active_edges.push_back(edge);
+    }  
+  }
+
+  // fill the actual energies
+  int num_active_edges = active_edges.size();
+  std::vector<EMatXX> pairwise_energies(num_active_edges);
+  for(int i = 0; i < num_active_edges; ++i) {
+    active_edges[i]->FillActiveEnergies(pairwise_energies[i]);
+  } 
+
+  // temporary object to perform a sorting by energy in the end
+  std::vector<std::pair<Real, int> > sorting_vector;
+
+  // let the sampling begin!
+  SolutionSelector solution_selector(num_active_solutions, seed);
+
+  for(int trajectory_idx = 0; trajectory_idx < n; ++trajectory_idx) {
+  
+    std::vector<int> current_solution;
+    solution_selector.InitSolutionSelection(current_solution);
+    Real temperature = start_temperature / cooling_factor;
+
+    for(int current_step = 0; current_step < mc_steps; ++current_step) {
+
+      if (current_step % change_frequency == 0) {
+        temperature *= cooling_factor;
+      }
+
+      int node_idx = solution_selector.SelectNode();
+      int solution_idx = current_solution[node_idx];
+      int proposed_solution_idx = solution_selector.SelectSolution(node_idx);
+
+      Real e_current = GetSolutionEnergy(node_idx, solution_idx, 
+                                         current_solution, self_energies, 
+                                         pairwise_energies, 
+                                         pairwise_energy_mapper);
+
+      Real e_new = GetSolutionEnergy(node_idx, proposed_solution_idx, 
+                                     current_solution, self_energies, 
+                                     pairwise_energies, pairwise_energy_mapper);
+
+      Real e_diff = e_new - e_current;
+
+      if (e_diff < Real(0.0)) {
+        current_solution[node_idx] = proposed_solution_idx;
+      }
+      else {
+        Real acceptance_probability = std::exp(-e_diff/temperature);
+        if (solution_selector.GetRandomNumber() < acceptance_probability) {
+          current_solution[node_idx] = proposed_solution_idx;
+        }
+      }
+    }
+
+    // the trajectory solution!!!
+    Real e = GetGlobalEnergy(current_solution, self_energies, pairwise_energies,
+                             pairwise_energy_mapper);
+    solution_energies.push_back(e); 
+    solutions.push_back(current_solution);
+    sorting_vector.push_back(std::make_pair(e, trajectory_idx));
+  }
+  
+  // the solutions are relative to the active solutions, we still have to 
+  // translate them into overall indices
+  for(int i = 0; i < n; ++i) {
+    for(int j = 0; j < num_graph_nodes; ++j) {
+      solutions[i][j] = nodes_[j]->GetOverallIndex(solutions[i][j]);
+    }
+  }
+
+  // perform a final sorting by energy
+  std::sort(sorting_vector.begin(), sorting_vector.end());
+  std::vector<std::vector<int> > sorted_solutions(n);
+  std::vector<Real> sorted_solution_energies(n);
+  for(int i = 0; i < n; ++i) {
+    sorted_solutions[i] = solutions[sorting_vector[i].second];
+    sorted_solution_energies[i] = solution_energies[sorting_vector[i].second];
+  }
+
+  return std::make_pair(sorted_solutions, sorted_solution_energies);
+}
+
+
+std::pair<std::vector<int>, Real> GraphMinimizer::NaiveSolve() {
+
+  core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
+                                "GraphMinimizer::NaiveSolve", 2);
+
+  // all nodes must be active in the beginning
+  for(std::vector<GMNode*>::iterator i = nodes_.begin();
+      i != nodes_.end(); ++i) {
+    if(!(*i)->IsActive()) {
+      String err = "All nodes of graph must be active for NaiveSolving.";
+      err += " Either construct a new graph or reset the current one!";
+      throw promod3::Error(err);
+    }
+  }
+
+  int num_graph_nodes = nodes_.size();
+  int num_graph_edges = edges_.size();
+
+  // handle the case where graph is empty
+  if(num_graph_nodes == 0) {
+    throw promod3::Error("Cannot run NaiveSolve on an empty Graph!");
+  }
+
+  // extract the number of active solutions and the self energies 
+  // of all the nodes
+  std::vector<unsigned short> num_active_solutions(num_graph_nodes);
+  std::vector<std::vector<Real> > self_energies(num_graph_nodes);
+  for(int i = 0; i < num_graph_nodes; ++i) {
+    nodes_[i]->FillActiveSelfEnergies(self_energies[i]);
+    int active_solutions = self_energies[i].size();
+    if(active_solutions > std::numeric_limits<unsigned short>::max()) {
+      std::stringstream ss;
+      ss << "Due to technical reasons there must be no nodes with more than ";
+      ss << active_solutions << " possible solutions in NaiveSolve!";
+      throw promod3::Error(ss.str());
+    }
+    num_active_solutions[i] = active_solutions;
+  }
+
+  std::vector<EMatXX> pairwise_energies;
+  std::vector<GMEdge*> active_edges;
+  std::vector<std::pair<int,int> > pairwise_energy_indices;
+
+  for(int i = 0; i < num_graph_edges; ++i) {
+    GMEdge* edge = edges_[i];
+    if(edge->IsActive()) {
+      int n1_idx = edge->GetNode1()->GetIndex();
+      int n2_idx = edge->GetNode2()->GetIndex();
+      pairwise_energy_indices.push_back(std::make_pair(n1_idx, n2_idx));
+      active_edges.push_back(edge);
+    }
+  }
+
+  int num_pairwise_energies = active_edges.size(); 
+  pairwise_energies.resize(num_pairwise_energies);
+  for(int i = 0; i < num_pairwise_energies; ++i) {
+    active_edges[i]->FillActiveEnergies(pairwise_energies[i]);
+  }
+
+  // This is the most stupid piece of code I ever wrote... SLOOOOOOOW
+  promod3::core::Enumerator<unsigned short> enumerator(num_active_solutions);
+  std::vector<unsigned short>& current_solution = enumerator.CurrentEnum();
+
+  Real best_energy = std::numeric_limits<Real>::max();
+  std::vector<unsigned short> best_solution = current_solution;
+
+  do {
+
+    Real current_energy = 0.0;
+
+    // sum up the internal energies
+    for(int i = 0; i < num_graph_nodes; ++i) {
+      current_energy += self_energies[i][current_solution[i]];
+    }
+
+    for(int i = 0; i < num_pairwise_energies; ++i) {
+      int n1_idx = pairwise_energy_indices[i].first;
+      int n2_idx = pairwise_energy_indices[i].second;
+      current_energy += pairwise_energies[i](current_solution[n1_idx], 
+                                             current_solution[n2_idx]);
+    }
+
+    if(current_energy < best_energy) {
+      best_energy = current_energy;
+      best_solution = current_solution;
+    }
+
+  } while(enumerator.Next());
+
+  // the solution is relative to the active solution, we still have to 
+  // translate them into overall indices
+  std::vector<int> final_solution(num_graph_nodes);
+  for(int i = 0; i < num_graph_nodes; ++i) {
+    final_solution[i] = nodes_[i]->GetOverallIndex(best_solution[i]);
+  }
+
+  return std::make_pair(final_solution, best_energy);
+}
+
+}} // ns
diff --git a/core/src/graph_minimizer.hh b/core/src/graph_minimizer.hh
new file mode 100644
index 0000000000000000000000000000000000000000..410cc21d0eb4664f1b6c8ef70e4b7caf6ec6535b
--- /dev/null
+++ b/core/src/graph_minimizer.hh
@@ -0,0 +1,178 @@
+#ifndef PROMOD3_GRAPH_MINIMIZER_HH
+#define PROMOD3_GRAPH_MINIMIZER_HH
+
+#include <vector>
+#include <limits.h>
+
+#include <boost/shared_ptr.hpp>
+
+#include <ost/base.hh>
+#include <ost/stdint.hh>
+
+#include <promod3/core/eigen_types.hh>
+#include <promod3/core/graph.hh>
+
+
+namespace promod3 { namespace core {
+
+class GMEdge;
+class GMNode;
+class GraphMinimizer;
+
+typedef boost::shared_ptr<GraphMinimizer> GraphMinimizerPtr;
+
+class GMEdge {
+
+public:
+  GMEdge(uint index, GMNode* node_a, GMNode* node_b, const EMatXX& emat);
+
+  void Reset();
+
+  void Deactivate() {active_ = false; };
+
+  bool IsActive() const { return active_; }
+
+  uint GetIndex() const { return index_; }
+
+  bool Decompose(Real thresh);
+
+  Real GetPairwiseEnergy(uint i, uint j) const { return emat_(i, j); }
+
+  GMNode* GetNode1() const { return node1_; }
+
+  GMNode* GetNode2() const { return node2_; }
+
+  GMNode* GetOtherNode(GMNode* node);
+
+  // resolves the expression  min_x(EPair(idx1,x)-EPair(idx2,x))
+  // in the DEE formalism, where x only considers the active
+  // solutions from the OTHER node than node_ptr
+  Real EMinDiff(const GMNode* node_ptr, uint idx1, uint idx2) const;
+
+  void FillActiveEnergies(EMatXX& emat) const;
+
+private:
+  uint index_;
+  bool active_;
+  GMNode* node1_;
+  GMNode* node2_;
+  EMatXX emat_;
+};
+
+class GMNode {
+
+public:
+  GMNode(uint index, const std::vector<Real>& self_energies);
+
+  void Reset();
+
+  void Deactivate(int index = -1);
+
+  bool IsActive() const { return active_; }
+
+  uint GetIndex() const { return index_; }
+
+  void AddEdge(GMEdge* edge);
+
+  GMEdge* GetEdge(uint idx) const { return edges_.at(idx); }
+
+  void RemoveFromActiveEdges(GMEdge* edge);
+
+  void AddValue(uint node_idx, Real val);
+
+  bool DEE(Real e_cut = 0.0);
+
+  uint GetOverallIndex(uint active_index) const { 
+                               return active_solutions_.at(active_index); }
+
+  size_t GetNumActiveSolutions() const { return active_solutions_.size(); }
+
+  size_t GetNumActiveEdges() const { return active_edges_.size(); }
+
+  size_t GetNumSolutions() const { return self_energies_.size(); }
+
+  size_t GetNumEdges() const { return edges_.size(); }
+
+  Real GetSelfEnergy(uint index) const { return self_energies_[index]; }
+
+  void FillActiveSelfEnergies(std::vector<Real>& self_energies) const;
+
+  typedef std::vector<uint>::const_iterator const_iterator;
+  typedef std::vector<uint>::iterator iterator;
+  
+  iterator active_solutions_begin() { return active_solutions_.begin(); }
+  iterator active_solutions_end() { return active_solutions_.end(); }
+  iterator active_edges_begin() { return active_edges_.begin(); }
+  iterator active_edges_end() { return active_edges_.end(); }
+
+  const_iterator active_solutions_begin() const { 
+                                            return active_solutions_.begin(); }
+  const_iterator active_solutions_end() const { 
+                                            return active_solutions_.end(); }
+  const_iterator active_edges_begin() const { return active_edges_.begin(); }
+  const_iterator active_edges_end() const { return active_edges_.end(); }
+
+private:
+
+  void FillSortedActiveSolutions();
+
+  uint index_;
+  bool active_;
+  std::vector<Real> self_energies_;
+  std::vector<Real> original_self_energies_;
+  std::vector<uint> active_solutions_;
+  std::vector<uint> sorted_active_solutions_;
+  std::vector<uint> active_edges_;
+  std::vector<GMEdge*> edges_;
+};
+
+
+class GraphMinimizer {
+
+public:
+
+  GraphMinimizer() { }
+
+  virtual ~GraphMinimizer();
+
+  int AddNode(const std::vector<Real>& self_energies);
+
+  int AddEdge(uint node_idx_one, uint node_idx_two, const EMatXX& emat);
+
+  bool ApplyDEE(uint node_idx, Real e_thresh = 0.0);
+
+  bool ApplyEdgeDecomposition(uint edge_idx, Real e_tresh);
+
+  void Prune(Real epsilon, Real e_cut = 0.0, bool consider_all_nodes = true);
+
+  void Reset();
+
+  promod3::core::Graph ToRawGraph() const;
+
+  bool HasActiveNodes() const;
+
+  std::pair<std::vector<int>, Real> 
+  TreeSolve(uint64_t max_complexity = std::numeric_limits<uint64_t>::max(),
+            Real intial_epsilon = 0.02);
+
+  std::pair<std::vector<std::vector<int> >, std::vector<Real> > 
+  AStarSolve(Real e_thresh, uint max_n = 100, 
+             uint max_visited_nodes = 100000000);
+
+  std::pair<std::vector<std::vector<int> >, std::vector<Real> > 
+  MCSolve(int n = 10, int mc_steps = 1000, Real start_temperature = 100.0, 
+          int change_frequency = 100, Real cooling_factor = 0.9, 
+          int seed = 0);
+
+  // Don't complain when it takes ages...
+  std::pair<std::vector<int>, Real> NaiveSolve();
+
+private:
+
+  std::vector<GMNode*> nodes_;
+  std::vector<GMEdge*> edges_;
+};
+
+}} // ns
+
+#endif
diff --git a/core/src/superpose.cc b/core/src/superpose.cc
index 597fa69c5b814409e923ce3a60b7e1f8bfd0cd2c..717b9de6b7fb06794fa42412ce072d3d69c93a9a 100644
--- a/core/src/superpose.cc
+++ b/core/src/superpose.cc
@@ -1,4 +1,6 @@
 #include <promod3/core/superpose.hh>
+#include <Eigen/SVD>
+#include <Eigen/Geometry>
 #include <map>
 
 namespace{
diff --git a/core/src/superpose.hh b/core/src/superpose.hh
index 8e9839c9575695d1fdc8520250cba9f9b02223e1..8a3fdcec3b0c4d4e8e3ce13c7bdce1ef286304d1 100644
--- a/core/src/superpose.hh
+++ b/core/src/superpose.hh
@@ -4,26 +4,14 @@
 #include <ost/geom/vecmat3_op.hh>
 #include <ost/geom/mat4.hh>
 #include <ost/tri_matrix.hh>
-#include <promod3/core/message.hh>
 
-#include <Eigen/SVD>
-#include <Eigen/Geometry>
-#include <Eigen/StdVector>
+#include <promod3/core/eigen_types.hh>
+#include <promod3/core/message.hh>
 
 #include <vector>
 
 namespace promod3 { namespace core {
 
-typedef Eigen::Matrix<Real,3,3> EMat3;
-typedef Eigen::Matrix<Real,3,1> EVec3;
-typedef Eigen::Matrix<Real,1,3> ERVec3;
-typedef Eigen::Matrix<Real,Eigen::Dynamic,3> EMatX3;
-
-// If you want to use stl containers of fixed sized Eigentype (e.g. EMatX3)
-// you must use a custom allocator provided by Eigen to ensure proper memory
-// alignment (more on that in the Eigen documentation)
-typedef std::vector<EMatX3,Eigen::aligned_allocator<EMatX3> > EMatX3List;
-
 // Following functions are intended to be used by other code. Fill the eigen
 // matrices by themselves to avoid shouffling around too much data.
 // NOTE: the EMatX3 objects get altered inside some of these functions!
diff --git a/core/src/tetrahedral_polytope.cc b/core/src/tetrahedral_polytope.cc
index 041c8104e9a32999a293b104ae675f54076699d3..576ab1fd82093f5c4c0c8cc6a18f8c987577796d 100644
--- a/core/src/tetrahedral_polytope.cc
+++ b/core/src/tetrahedral_polytope.cc
@@ -129,6 +129,10 @@ void TetrahedralPolytopeTree::ResetTree(const std::vector<Real>& x,
     indices[i] = i;
   }
 
+  if(num_leaf_nodes_ == 0) {
+    return; // tree is empty... we don't even have to call Generate
+  }
+
   root_node_ = this->Generate(x, y, z, indices);
 }
 
diff --git a/core/src/tetrahedral_polytope.hh b/core/src/tetrahedral_polytope.hh
index 705640dbb1ff8ad69584bec32a7073e81d8b0da6..3a2863b2854aaca9f2eee184c5fa9a8260d3125e 100644
--- a/core/src/tetrahedral_polytope.hh
+++ b/core/src/tetrahedral_polytope.hh
@@ -95,11 +95,19 @@ public:
                  const std::vector<Real>& radii);
 
   bool Overlap(const TetrahedralPolytope& other) const{
-    return nodes_[root_node_].Overlap(other);
+    if(num_leaf_nodes_ == 0) {
+      return false;
+    } else {
+      return nodes_[root_node_].Overlap(other);
+    }
   }
 
   bool Overlap(const TetrahedralPolytopeTree& other) const{
-    return nodes_[root_node_].Overlap(other.nodes_[other.root_node_]);
+    if(num_leaf_nodes_ == 0 || other.num_leaf_nodes_ == 0) {
+      return false;
+    } else {
+      return nodes_[root_node_].Overlap(other.nodes_[other.root_node_]);
+    }
   }
 
   void OverlappingPolytopes(const TetrahedralPolytopeTree& other,
@@ -108,6 +116,10 @@ public:
     ScopedTimerPtr prof = StaticRuntimeProfiler::StartScoped(
                             "TetrahedralPolytopeTree::OverlappingPolytopes", 2);
 
+    if(num_leaf_nodes_ == 0 || other.num_leaf_nodes_ == 0) {
+      return; // no overlaps...
+    }
+
     TraverseTree(other, root_node_, other.root_node_, overlap);
   }
 
diff --git a/core/tests/CMakeLists.txt b/core/tests/CMakeLists.txt
index 0794903226604ba639ff96afb174875e2f233045..b7eebec0e86b04939ab02ac83281e74ac17ab1ef 100644
--- a/core/tests/CMakeLists.txt
+++ b/core/tests/CMakeLists.txt
@@ -4,6 +4,7 @@ set(CORE_UNIT_TESTS
   test_pm3argparse.py
   test_check_io.cc
   test_portable_binary.cc
+  test_graph_minimizer.cc
   tests.cc
 )
 
diff --git a/core/tests/test_graph_minimizer.cc b/core/tests/test_graph_minimizer.cc
new file mode 100644
index 0000000000000000000000000000000000000000..7a52ae53b6e1cc49eab7cab236c3a9b304c9b589
--- /dev/null
+++ b/core/tests/test_graph_minimizer.cc
@@ -0,0 +1,105 @@
+#include <promod3/core/eigen_types.hh>
+#include <promod3/core/graph_minimizer.hh>
+#define BOOST_TEST_DYN_LINK
+#include <boost/test/unit_test.hpp>
+#include <boost/test/auto_unit_test.hpp>
+
+#include <ost/base.hh>
+#include <vector>
+#include <stdlib.h> 
+
+BOOST_AUTO_TEST_SUITE( core );
+
+using namespace promod3::core;
+
+
+GraphMinimizerPtr GenerateTestGraph() {
+
+  // setup a simple graph that can naively be enumerated
+
+  std::srand(0);
+  GraphMinimizerPtr graph(new GraphMinimizer);  
+  std::vector<int> num_solutions;
+
+  num_solutions.push_back(3);
+  num_solutions.push_back(5);
+  num_solutions.push_back(2);
+  num_solutions.push_back(8);
+  num_solutions.push_back(3);
+  num_solutions.push_back(5);
+
+  std::vector<std::pair<int, int> > edges;
+  edges.push_back(std::make_pair(0,1));
+  edges.push_back(std::make_pair(0,3));
+  edges.push_back(std::make_pair(0,4));
+  edges.push_back(std::make_pair(0,5));
+  edges.push_back(std::make_pair(1,2));
+  edges.push_back(std::make_pair(2,3));
+  edges.push_back(std::make_pair(2,4));
+  edges.push_back(std::make_pair(3,1));
+  edges.push_back(std::make_pair(4,5));
+  edges.push_back(std::make_pair(5,1));
+
+
+  for(uint i = 0; i < num_solutions.size(); ++i) {
+
+    std::vector<Real> self_energies;
+    for(int j = 0; j < num_solutions[i]; ++j) {
+      self_energies.push_back(static_cast<Real>(std::rand()) / RAND_MAX);
+    }
+
+    graph->AddNode(self_energies);
+  }
+
+  for(uint i = 0; i < edges.size(); ++i) {
+    EMatXX emat = EMatXX::Random(num_solutions[edges[i].first],
+                                 num_solutions[edges[i].second]);
+    graph->AddEdge(edges[i].first, edges[i].second, emat);
+  }
+
+  return graph;
+}
+
+
+BOOST_AUTO_TEST_CASE(test_graph_minimizer) {
+
+  // simple test to at least run all solving algorithms once
+
+  GraphMinimizerPtr graph = GenerateTestGraph();
+
+  std::pair<std::vector<int>, Real> naive_solution = graph->NaiveSolve();
+  graph->Reset();
+
+  std::pair<std::vector<int>, Real> tree_solution = graph->TreeSolve();
+  graph->Reset();
+
+  std::pair<std::vector<std::vector<int> >, std::vector<Real> > astar_solution = 
+  graph->AStarSolve(10.0);
+  graph->Reset();
+
+  std::pair<std::vector<std::vector<int> >, std::vector<Real> > mc_solution = 
+  graph->MCSolve();
+
+  // the solutions and coresponding energies in naive, tree and astar must be 
+  // the same
+
+  BOOST_CHECK(naive_solution.first == tree_solution.first);
+  BOOST_CHECK(naive_solution.first == astar_solution.first[0]);
+
+  BOOST_CHECK_CLOSE(naive_solution.second, tree_solution.second, Real(1e-3));
+  BOOST_CHECK_CLOSE(naive_solution.second, astar_solution.second[0], Real(1e-3));
+
+  // check, whether the energies in the astar solution are sorted
+
+  for(uint i = 1; i < astar_solution.second.size(); ++i) {
+    BOOST_CHECK(astar_solution.second[i] >= astar_solution.second[i-1]);
+  }
+
+  // check, whether the energies in the mc solution are sorted
+
+  for(uint i = 1; i < mc_solution.second.size(); ++i) {
+    BOOST_CHECK(mc_solution.second[i] >= mc_solution.second[i-1]);
+  }
+}
+
+BOOST_AUTO_TEST_SUITE_END();
diff --git a/doc/buildsystem.rst b/doc/buildsystem.rst
index 4bb192686d60b60c60d52e9c0e8fb56b3334a91e..a601d619b695a46a2f15352e312e4bdaf91ab90f 100644
--- a/doc/buildsystem.rst
+++ b/doc/buildsystem.rst
@@ -143,11 +143,11 @@ safely delete the whole source folder.
 .. |qmean| replace:: QMEAN
 .. |eigen3| replace:: Eigen 3
 .. |openmm| replace:: OpenMM
-.. _qmean: http://swissmodel.expasy.org/qmean/cgi/index.cgi?
-.. _ost_l: http://www.OpenStructure.org
+.. _qmean: https://swissmodel.expasy.org/qmean/
+.. _ost_l: https://www.OpenStructure.org
 .. _cmake: https://cmake.org/
 .. _python: https://www.python.org/
-.. _boost: http://www.boost.org/
+.. _boost: https://www.boost.org/
 .. _eigen3: http://eigen.tuxfamily.org/index.php?title=Main_Page
 .. _openmm: http://openmm.org
 
diff --git a/doc/conf.py.in b/doc/conf.py.in
index 3453b6e9740f3b71777b6143d5e918808fd030a3..1219c73e05d9a4047ac23d72dcc449f8581265eb 100644
--- a/doc/conf.py.in
+++ b/doc/conf.py.in
@@ -59,7 +59,7 @@ master_doc = 'index'
 
 # General information about the project.
 project = u'ProMod3'
-copyright = u'2017, ProMod3 authors'# pylint: disable=redefined-builtin
+copyright = u'2018, ProMod3 authors'# pylint: disable=redefined-builtin
 
 # The version info for the project you're documenting, acts as replacement for
 # |version| and |release|, also used in various other places throughout the
@@ -288,7 +288,7 @@ rst_epilog = """
 .. |boost| replace:: Boost
 .. |git| replace:: Git
 .. |C++| replace:: C++
-.. _ost_s: http://www.OpenStructure.org
+.. _ost_s: https://www.OpenStructure.org
 .. _nameattr: @PYTHON_DOC_URL@/library/__main__.html
 .. _mainattr: @PYTHON_DOC_URL@/library/__main__.html
 .. _descattr: @PYTHON_DOC_URL@/library/argparse.html#description
diff --git a/doc/contributing.rst b/doc/contributing.rst
index 832af70cc2e46a71d3850967a075a8f423ece6d8..ae3c842c641522624e55d208c51e6a146773a033 100644
--- a/doc/contributing.rst
+++ b/doc/contributing.rst
@@ -201,7 +201,7 @@ sporting a single monolithic :file:`test_sidechain_reconstruction.py`.
 |python| code is evaluated using its own :py_docs:`unit testing framework
 <library/unittest.html>` with a little help from |ost_s|_ (|C++| uses the
 |boost| `Test Library
-<http://www.boost.org/doc/libs/1_47_0/libs/test/doc/html/index.html>`_). The
+<https://www.boost.org/doc/libs/1_53_0/libs/test/doc/html/index.html>`_). The
 basic scheme is to import your module, subclass :class:`unittest.TestCase` and
 make the whole file runnable as script using the most common |nameattr|_
 attribute. As an example we test the 
@@ -477,7 +477,7 @@ repository comes with a top-level :file:`doc` directory.
 
 While you should not spend to much time thinking about how to format
 documentation, here is a helpful list of standard formatters:
-http://sphinx-doc.org/markup/inline.html
+http://sphinx-doc.org/en/stable/markup/inline.html
 
 If you write new functionality for |project|, or fix bugs, feel free to extend
 the :file:`CHANGELOG` file. It will be automatically pulled into the
diff --git a/doc/html/_modules/index.html b/doc/html/_modules/index.html
index d3d433139b3918ebe25756b2ec513617ee1d0c4c..6964cf96734a79a1c9de4932da5588a9924935da 100644
--- a/doc/html/_modules/index.html
+++ b/doc/html/_modules/index.html
@@ -6,7 +6,7 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
-    <title>Overview: module code &mdash; ProMod3 1.1.0 documentation</title>
+    <title>Overview: module code &mdash; ProMod3 1.2.0 documentation</title>
     
     <link rel="stylesheet" href="../_static/alabaster.css" type="text/css" />
     <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
@@ -14,7 +14,7 @@
     <script type="text/javascript">
       var DOCUMENTATION_OPTIONS = {
         URL_ROOT:    '../',
-        VERSION:     '1.1.0',
+        VERSION:     '1.2.0',
         COLLAPSE_INDEX: false,
         FILE_SUFFIX: '.html',
         HAS_SOURCE:  true
@@ -23,13 +23,15 @@
     <script type="text/javascript" src="../_static/jquery.js"></script>
     <script type="text/javascript" src="../_static/underscore.js"></script>
     <script type="text/javascript" src="../_static/doctools.js"></script>
-    <link rel="top" title="ProMod3 1.1.0 documentation" href="../index.html" />
+    <link rel="top" title="ProMod3 1.2.0 documentation" href="../index.html" />
    
+  <link rel="stylesheet" href="../_static/custom.css" type="text/css" />
   
-  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
 
   </head>
-  <body role="document">  
+  <body role="document">
+  
 
     <div class="document">
       <div class="documentwrapper">
@@ -37,22 +39,26 @@
           <div class="body" role="main">
             
   <h1>All modules for which code is available</h1>
-<ul><li><a href="AllAtomEnv.html">AllAtomEnv</a></li>
+<ul><li><a href="AllAtomClashScorer.html">AllAtomClashScorer</a></li>
+<li><a href="AllAtomEnv.html">AllAtomEnv</a></li>
 <li><a href="AllAtomInteractionScorer.html">AllAtomInteractionScorer</a></li>
 <li><a href="AllAtomOverallScorer.html">AllAtomOverallScorer</a></li>
 <li><a href="AllAtomPackingScorer.html">AllAtomPackingScorer</a></li>
 <li><a href="AllAtomPositions.html">AllAtomPositions</a></li>
 <li><a href="AllAtomRelaxer.html">AllAtomRelaxer</a></li>
+<li><a href="AllAtomScorer.html">AllAtomScorer</a></li>
 <li><a href="AminoAcidLookup.html">AminoAcidLookup</a></li>
 <li><a href="BBDepRotamerLib.html">BBDepRotamerLib</a></li>
 <li><a href="BackboneList.html">BackboneList</a></li>
 <li><a href="BackboneOverallScorer.html">BackboneOverallScorer</a></li>
 <li><a href="BackboneRelaxer.html">BackboneRelaxer</a></li>
 <li><a href="BackboneScoreEnv.html">BackboneScoreEnv</a></li>
+<li><a href="BackboneScorer.html">BackboneScorer</a></li>
 <li><a href="CBPackingScorer.html">CBPackingScorer</a></li>
 <li><a href="CBetaScorer.html">CBetaScorer</a></li>
 <li><a href="CCD.html">CCD</a></li>
 <li><a href="CCDCloser.html">CCDCloser</a></li>
+<li><a href="ClashScorer.html">ClashScorer</a></li>
 <li><a href="DirtyCCDCloser.html">DirtyCCDCloser</a></li>
 <li><a href="DiscoContainer.html">DiscoContainer</a></li>
 <li><a href="ExponentialCooler.html">ExponentialCooler</a></li>
@@ -66,13 +72,14 @@
 <li><a href="FrameResidue.html">FrameResidue</a></li>
 <li><a href="FullGapExtender.html">FullGapExtender</a></li>
 <li><a href="GapExtender.html">GapExtender</a></li>
+<li><a href="GraphMinimizer.html">GraphMinimizer</a></li>
 <li><a href="HBondScorer.html">HBondScorer</a></li>
 <li><a href="KIC.html">KIC</a></li>
 <li><a href="KICCloser.html">KICCloser</a></li>
-<li><a href="LinearScorer.html">LinearScorer</a></li>
 <li><a href="LoopCandidates.html">LoopCandidates</a></li>
 <li><a href="MmSystemCreator.html">MmSystemCreator</a></li>
 <li><a href="ModellingHandle.html">ModellingHandle</a></li>
+<li><a href="PairwiseScorer.html">PairwiseScorer</a></li>
 <li><a href="Particle.html">Particle</a></li>
 <li><a href="PhiPsiSampler.html">PhiPsiSampler</a></li>
 <li><a href="PsipredPrediction.html">PsipredPrediction</a></li>
@@ -132,9 +139,6 @@
       <input type="hidden" name="check_keywords" value="yes" />
       <input type="hidden" name="area" value="default" />
     </form>
-    <p class="searchtip" style="font-size: 90%">
-    Enter search terms or a module, class or function name.
-    </p>
 </div>
 <script type="text/javascript">$('#searchbox').show(0);</script>
         </div>
@@ -142,11 +146,11 @@
       <div class="clearer"></div>
     </div>
     <div class="footer">
-      &copy;2017, ProMod3 authors.
+      &copy;2018, ProMod3 authors.
       
       |
-      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a>
-      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.6</a>
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.4.1</a>
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
       
     </div>
 
diff --git a/doc/html/_modules/promod3.html b/doc/html/_modules/promod3.html
index 26f55e3abbf5e32a066e3b2d6749959bc84d1c91..140c70b9d3e7b6edc1001cd57344d3a21c5babd7 100644
--- a/doc/html/_modules/promod3.html
+++ b/doc/html/_modules/promod3.html
@@ -6,7 +6,7 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
-    <title>promod3 &mdash; ProMod3 1.1.0 documentation</title>
+    <title>promod3 &mdash; ProMod3 1.2.0 documentation</title>
     
     <link rel="stylesheet" href="../_static/alabaster.css" type="text/css" />
     <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
@@ -14,7 +14,7 @@
     <script type="text/javascript">
       var DOCUMENTATION_OPTIONS = {
         URL_ROOT:    '../',
-        VERSION:     '1.1.0',
+        VERSION:     '1.2.0',
         COLLAPSE_INDEX: false,
         FILE_SUFFIX: '.html',
         HAS_SOURCE:  true
@@ -23,14 +23,16 @@
     <script type="text/javascript" src="../_static/jquery.js"></script>
     <script type="text/javascript" src="../_static/underscore.js"></script>
     <script type="text/javascript" src="../_static/doctools.js"></script>
-    <link rel="top" title="ProMod3 1.1.0 documentation" href="../index.html" />
+    <link rel="top" title="ProMod3 1.2.0 documentation" href="../index.html" />
     <link rel="up" title="Module code" href="index.html" />
    
+  <link rel="stylesheet" href="../_static/custom.css" type="text/css" />
   
-  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
 
   </head>
-  <body role="document">  
+  <body role="document">
+  
 
     <div class="document">
       <div class="documentwrapper">
@@ -38,22 +40,22 @@
           <div class="body" role="main">
             
   <h1>Source code for promod3</h1><div class="highlight"><pre>
-<span class="c"># enable access to loop and modelling via &quot;import promod3&quot;</span>
+<span></span><span class="c1"># enable access to loop and modelling via &quot;import promod3&quot;</span>
 <span class="kn">import</span> <span class="nn">promod3.core</span>
 <span class="kn">import</span> <span class="nn">promod3.sidechain</span>
 <span class="kn">import</span> <span class="nn">promod3.loop</span>
 <span class="kn">import</span> <span class="nn">promod3.scoring</span>
 <span class="kn">import</span> <span class="nn">promod3.modelling</span>
 
-<span class="c"># load compounds library</span>
-<span class="c"># That way we do not need to call our scripts with the OST starter and are more</span>
-<span class="c"># flexible.</span>
+<span class="c1"># load compounds library</span>
+<span class="c1"># That way we do not need to call our scripts with the OST starter and are more</span>
+<span class="c1"># flexible.</span>
 <span class="kn">import</span> <span class="nn">os</span>
 <span class="kn">import</span> <span class="nn">ost</span>
 <span class="kn">from</span> <span class="nn">ost</span> <span class="kn">import</span> <span class="n">conop</span>
 <span class="kn">from</span> <span class="nn">ost</span> <span class="kn">import</span> <span class="n">io</span>
 
-<div class="viewcode-block" id="SetCompoundsChemlib"><a class="viewcode-back" href="../core/setcompoundschemlib.html#promod3.SetCompoundsChemlib">[docs]</a><span class="k">def</span> <span class="nf">SetCompoundsChemlib</span><span class="p">(</span><span class="n">path_to_chemlib</span><span class="o">=</span><span class="s">&quot;/users/staff/bioz/taurielg/GT/Code/ost/build/stage/share/openstructure/compounds.chemlib&quot;</span><span class="p">):</span>
+<div class="viewcode-block" id="SetCompoundsChemlib"><a class="viewcode-back" href="../core/setcompoundschemlib.html#promod3.SetCompoundsChemlib">[docs]</a><span class="k">def</span> <span class="nf">SetCompoundsChemlib</span><span class="p">(</span><span class="n">path_to_chemlib</span><span class="o">=</span><span class="s2">&quot;/home/taurielg/GT/Code/ost/build/stage/share/openstructure/compounds.chemlib&quot;</span><span class="p">):</span>
     <span class="sd">&quot;&quot;&quot;SetCompoundsChemlib(path_to_chemlib)</span>
 <span class="sd">    Load a compounds library. Does not return anything, the library is just</span>
 <span class="sd">    enabled globally.</span>
@@ -62,58 +64,58 @@
 <span class="sd">    :type path_to_chemlib: :class:`str`</span>
 <span class="sd">    &quot;&quot;&quot;</span>
     <span class="k">if</span> <span class="ow">not</span> <span class="n">path_to_chemlib</span> <span class="ow">or</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">path_to_chemlib</span><span class="p">):</span>
-        <span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s">&quot;Invalid path to chemlib &#39;&quot;</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">path_to_chemlib</span><span class="p">)</span>
-                           <span class="o">+</span> <span class="s">&quot;&#39; specified!</span><span class="se">\n</span><span class="s">A compounds library must either be &quot;</span>
-                           <span class="o">+</span> <span class="s">&quot;set at compile-time (&#39;compounds.chemlib&#39; file in &quot;</span>
-                           <span class="o">+</span> <span class="s">&quot;$OST_ROOT/share or below) or set in OST with &quot;</span>
-                           <span class="o">+</span> <span class="s">&quot;ost.conop.SetDefaultLib before importing any &quot;</span>
-                           <span class="o">+</span> <span class="s">&quot;promod3 module!&quot;</span><span class="p">)</span>
+        <span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s2">&quot;Invalid path to chemlib &#39;&quot;</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">path_to_chemlib</span><span class="p">)</span>
+                           <span class="o">+</span> <span class="s2">&quot;&#39; specified!</span><span class="se">\n</span><span class="s2">A compounds library must either be &quot;</span>
+                           <span class="o">+</span> <span class="s2">&quot;set at compile-time (&#39;compounds.chemlib&#39; file in &quot;</span>
+                           <span class="o">+</span> <span class="s2">&quot;$OST_ROOT/share or below) or set in OST with &quot;</span>
+                           <span class="o">+</span> <span class="s2">&quot;ost.conop.SetDefaultLib before importing any &quot;</span>
+                           <span class="o">+</span> <span class="s2">&quot;promod3 module!&quot;</span><span class="p">)</span>
     <span class="n">compound_lib_path</span> <span class="o">=</span> <span class="n">path_to_chemlib</span>
     <span class="n">compound_lib</span> <span class="o">=</span> <span class="n">conop</span><span class="o">.</span><span class="n">CompoundLib</span><span class="o">.</span><span class="n">Load</span><span class="p">(</span><span class="n">compound_lib_path</span><span class="p">)</span>
     <span class="n">conop</span><span class="o">.</span><span class="n">SetDefaultLib</span><span class="p">(</span><span class="n">compound_lib</span><span class="p">)</span>
-    <span class="n">io</span><span class="o">.</span><span class="n">profiles</span><span class="p">[</span><span class="s">&#39;DEFAULT&#39;</span><span class="p">]</span><span class="o">.</span><span class="n">processor</span> <span class="o">=</span> <span class="n">conop</span><span class="o">.</span><span class="n">RuleBasedProcessor</span><span class="p">(</span><span class="n">compound_lib</span><span class="p">)</span>
-</div>
+    <span class="n">io</span><span class="o">.</span><span class="n">profiles</span><span class="p">[</span><span class="s1">&#39;DEFAULT&#39;</span><span class="p">]</span><span class="o">.</span><span class="n">processor</span> <span class="o">=</span> <span class="n">conop</span><span class="o">.</span><span class="n">RuleBasedProcessor</span><span class="p">(</span><span class="n">compound_lib</span><span class="p">)</span></div>
+
 <span class="k">def</span> <span class="nf">GetProMod3SharedDataPath</span><span class="p">():</span>
     <span class="sd">&quot;&quot;&quot;Get path to the shared data folder. Used for binaries.</span>
 <span class="sd">    Returns None if not set.</span>
 <span class="sd">    &quot;&quot;&quot;</span>
-    <span class="k">return</span> <span class="n">os</span><span class="o">.</span><span class="n">getenv</span><span class="p">(</span><span class="s">&quot;PROMOD3_SHARED_DATA_PATH&quot;</span><span class="p">)</span>
+    <span class="k">return</span> <span class="n">os</span><span class="o">.</span><span class="n">getenv</span><span class="p">(</span><span class="s2">&quot;PROMOD3_SHARED_DATA_PATH&quot;</span><span class="p">)</span>
 
 <span class="k">def</span> <span class="nf">SetProMod3SharedDataPath</span><span class="p">(</span><span class="n">path</span><span class="p">):</span>
     <span class="sd">&quot;&quot;&quot;Set path to the shared data folder. Used for binaries.&quot;&quot;&quot;</span>
-    <span class="n">os</span><span class="o">.</span><span class="n">environ</span><span class="p">[</span><span class="s">&quot;PROMOD3_SHARED_DATA_PATH&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">path</span>
+    <span class="n">os</span><span class="o">.</span><span class="n">environ</span><span class="p">[</span><span class="s2">&quot;PROMOD3_SHARED_DATA_PATH&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">path</span>
 
-<span class="c"># check if we already have an OST PrefixPath</span>
+<span class="c1"># check if we already have an OST PrefixPath</span>
 <span class="k">try</span><span class="p">:</span>
     <span class="n">ost</span><span class="o">.</span><span class="n">GetSharedDataPath</span><span class="p">()</span>
 <span class="k">except</span> <span class="ne">RuntimeError</span><span class="p">,</span> <span class="n">rt_err</span><span class="p">:</span>
-    <span class="n">ost</span><span class="o">.</span><span class="n">SetPrefixPath</span><span class="p">(</span><span class="s">&quot;/users/staff/bioz/taurielg/GT/Code/ost/build/stage&quot;</span><span class="p">)</span>
+    <span class="n">ost</span><span class="o">.</span><span class="n">SetPrefixPath</span><span class="p">(</span><span class="s2">&quot;/home/taurielg/GT/Code/ost/build/stage&quot;</span><span class="p">)</span>
 <span class="k">except</span><span class="p">:</span>
     <span class="k">raise</span>
 
-<span class="c"># check if we do have a compounds library</span>
+<span class="c1"># check if we do have a compounds library</span>
 <span class="k">if</span> <span class="ow">not</span> <span class="n">conop</span><span class="o">.</span><span class="n">GetDefaultLib</span><span class="p">():</span>
     <span class="n">SetCompoundsChemlib</span><span class="p">()</span>
 
-<span class="c"># ensure that PROMOD3_SHARED_DATA_PATH env. var. set and override if needed</span>
+<span class="c1"># ensure that PROMOD3_SHARED_DATA_PATH env. var. set and override if needed</span>
 <span class="k">if</span> <span class="n">GetProMod3SharedDataPath</span><span class="p">()</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span>
-    <span class="c"># module_path = PROMOD3_ROOT/lib64/python2.7/site-packages/promod3</span>
+    <span class="c1"># module_path = PROMOD3_ROOT/lib64/python2.7/site-packages/promod3</span>
     <span class="n">module_path</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">dirname</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">abspath</span><span class="p">(</span><span class="n">__file__</span><span class="p">))</span>
-    <span class="c"># get PROMOD3_ROOT</span>
+    <span class="c1"># get PROMOD3_ROOT</span>
     <span class="n">promod3_lib</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">dirname</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">dirname</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">dirname</span><span class="p">(</span><span class="n">module_path</span><span class="p">)))</span>
     <span class="n">promod3_root</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">dirname</span><span class="p">(</span><span class="n">promod3_lib</span><span class="p">)</span>
-    <span class="n">SetProMod3SharedDataPath</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">promod3_root</span><span class="p">,</span> <span class="s">&quot;share&quot;</span><span class="p">,</span> <span class="s">&quot;promod3&quot;</span><span class="p">))</span>
+    <span class="n">SetProMod3SharedDataPath</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">promod3_root</span><span class="p">,</span> <span class="s2">&quot;share&quot;</span><span class="p">,</span> <span class="s2">&quot;promod3&quot;</span><span class="p">))</span>
 
-<span class="c"># set version</span>
-<span class="n">__version__</span> <span class="o">=</span> <span class="s">&quot;1.1.0&quot;</span>
-<span class="n">__version_extended__</span> <span class="o">=</span> <span class="s">&quot;1.1.0 (release-1.1|ed199a7)&quot;</span>
+<span class="c1"># set version</span>
+<span class="n">__version__</span> <span class="o">=</span> <span class="s2">&quot;1.2.0&quot;</span>
+<span class="n">__version_extended__</span> <span class="o">=</span> <span class="s2">&quot;1.2.0 (release-1.2.0|d086aed)&quot;</span>
 
-<span class="n">__all__</span> <span class="o">=</span> <span class="p">(</span><span class="s">&#39;SetCompoundsChemlib&#39;</span><span class="p">,</span> <span class="s">&#39;GetProMod3SharedDataPath&#39;</span><span class="p">,</span>
-           <span class="s">&#39;SetProMod3SharedDataPath&#39;</span><span class="p">)</span>
+<span class="n">__all__</span> <span class="o">=</span> <span class="p">(</span><span class="s1">&#39;SetCompoundsChemlib&#39;</span><span class="p">,</span> <span class="s1">&#39;GetProMod3SharedDataPath&#39;</span><span class="p">,</span>
+           <span class="s1">&#39;SetProMod3SharedDataPath&#39;</span><span class="p">)</span>
 
-<span class="c">#  LocalWords:  OST os ost conop io SetCompoundsChemlib CHEMLIB param chemlib</span>
-<span class="c">#  LocalWords:  str SetDefaultLib RuleBasedProcessor PrefixPath RuntimeError</span>
-<span class="c">#  LocalWords:  GetSharedDataPath SetPrefixPath GetDefaultLib</span>
+<span class="c1">#  LocalWords:  OST os ost conop io SetCompoundsChemlib CHEMLIB param chemlib</span>
+<span class="c1">#  LocalWords:  str SetDefaultLib RuleBasedProcessor PrefixPath RuntimeError</span>
+<span class="c1">#  LocalWords:  GetSharedDataPath SetPrefixPath GetDefaultLib</span>
 </pre></div>
 
           </div>
@@ -137,9 +139,6 @@
       <input type="hidden" name="check_keywords" value="yes" />
       <input type="hidden" name="area" value="default" />
     </form>
-    <p class="searchtip" style="font-size: 90%">
-    Enter search terms or a module, class or function name.
-    </p>
 </div>
 <script type="text/javascript">$('#searchbox').show(0);</script>
         </div>
@@ -147,11 +146,11 @@
       <div class="clearer"></div>
     </div>
     <div class="footer">
-      &copy;2017, ProMod3 authors.
+      &copy;2018, ProMod3 authors.
       
       |
-      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a>
-      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.6</a>
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.4.1</a>
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
       
     </div>
 
diff --git a/doc/html/_modules/promod3/core/helper.html b/doc/html/_modules/promod3/core/helper.html
index cf69dc55340fc739cdb0373cb30c01f8600762f0..2266f1a35bc7f1a3cb8be03cbadf869949896d0b 100644
--- a/doc/html/_modules/promod3/core/helper.html
+++ b/doc/html/_modules/promod3/core/helper.html
@@ -6,7 +6,7 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
-    <title>promod3.core.helper &mdash; ProMod3 1.1.0 documentation</title>
+    <title>promod3.core.helper &mdash; ProMod3 1.2.0 documentation</title>
     
     <link rel="stylesheet" href="../../../_static/alabaster.css" type="text/css" />
     <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
@@ -14,7 +14,7 @@
     <script type="text/javascript">
       var DOCUMENTATION_OPTIONS = {
         URL_ROOT:    '../../../',
-        VERSION:     '1.1.0',
+        VERSION:     '1.2.0',
         COLLAPSE_INDEX: false,
         FILE_SUFFIX: '.html',
         HAS_SOURCE:  true
@@ -23,14 +23,16 @@
     <script type="text/javascript" src="../../../_static/jquery.js"></script>
     <script type="text/javascript" src="../../../_static/underscore.js"></script>
     <script type="text/javascript" src="../../../_static/doctools.js"></script>
-    <link rel="top" title="ProMod3 1.1.0 documentation" href="../../../index.html" />
+    <link rel="top" title="ProMod3 1.2.0 documentation" href="../../../index.html" />
     <link rel="up" title="promod3" href="../../promod3.html" />
    
+  <link rel="stylesheet" href="../../../_static/custom.css" type="text/css" />
   
-  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
 
   </head>
-  <body role="document">  
+  <body role="document">
+  
 
     <div class="document">
       <div class="documentwrapper">
@@ -38,7 +40,7 @@
           <div class="body" role="main">
             
   <h1>Source code for promod3.core.helper</h1><div class="highlight"><pre>
-<span class="sd">&quot;&quot;&quot;</span>
+<span></span><span class="sd">&quot;&quot;&quot;</span>
 <span class="sd">Uncategorised functions which may come handy at several places.</span>
 <span class="sd">&quot;&quot;&quot;</span>
 
@@ -61,8 +63,8 @@
 <span class="sd">    :returns: No return value, exits script with value ``exit_status``.</span>
 <span class="sd">    &#39;&#39;&#39;</span>
     <span class="n">ost</span><span class="o">.</span><span class="n">LogError</span><span class="p">(</span><span class="n">msg</span><span class="p">)</span>
-    <span class="n">sys</span><span class="o">.</span><span class="n">exit</span><span class="p">(</span><span class="n">exit_status</span><span class="p">)</span>
-</div>
+    <span class="n">sys</span><span class="o">.</span><span class="n">exit</span><span class="p">(</span><span class="n">exit_status</span><span class="p">)</span></div>
+
 <div class="viewcode-block" id="FileExists"><a class="viewcode-back" href="../../../core/helper.html#promod3.core.helper.FileExists">[docs]</a><span class="k">def</span> <span class="nf">FileExists</span><span class="p">(</span><span class="n">prefix</span><span class="p">,</span> <span class="n">exit_status</span><span class="p">,</span> <span class="n">filename</span><span class="p">):</span>
     <span class="sd">&#39;&#39;&#39;</span>
 <span class="sd">    Checks if a file exists, terminates if not. The error message displayed is</span>
@@ -83,9 +85,9 @@
 <span class="sd">              is missing.</span>
 <span class="sd">    &#39;&#39;&#39;</span>
     <span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">filename</span><span class="p">):</span>
-        <span class="n">MsgErrorAndExit</span><span class="p">(</span><span class="s">&#39;</span><span class="si">%s</span><span class="s"> file does not exist: </span><span class="si">%s</span><span class="se">\n</span><span class="s">&#39;</span> <span class="o">%</span> <span class="p">(</span><span class="n">prefix</span><span class="p">,</span> <span class="n">filename</span><span class="p">),</span>
-                        <span class="n">exit_status</span><span class="p">)</span>
-</div>
+        <span class="n">MsgErrorAndExit</span><span class="p">(</span><span class="s1">&#39;</span><span class="si">%s</span><span class="s1"> file does not exist: </span><span class="si">%s</span><span class="se">\n</span><span class="s1">&#39;</span> <span class="o">%</span> <span class="p">(</span><span class="n">prefix</span><span class="p">,</span> <span class="n">filename</span><span class="p">),</span>
+                        <span class="n">exit_status</span><span class="p">)</span></div>
+
 <div class="viewcode-block" id="FileGzip"><a class="viewcode-back" href="../../../core/helper.html#promod3.core.helper.FileGzip">[docs]</a><span class="k">def</span> <span class="nf">FileGzip</span><span class="p">(</span><span class="n">prefix</span><span class="p">,</span> <span class="n">exit_status</span><span class="p">,</span> <span class="n">filename</span><span class="p">,</span> <span class="n">allowed</span><span class="o">=</span><span class="bp">True</span><span class="p">):</span>
     <span class="sd">&#39;&#39;&#39;</span>
 <span class="sd">    See if a file is gzipped or not. This is basically done by checking for a</span>
@@ -113,14 +115,14 @@
 <span class="sd">    &#39;&#39;&#39;</span>
     <span class="n">_</span><span class="p">,</span> <span class="n">fileext</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">splitext</span><span class="p">(</span><span class="n">filename</span><span class="p">)</span>
     <span class="n">is_gz</span> <span class="o">=</span> <span class="bp">False</span>
-    <span class="k">if</span> <span class="n">fileext</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span> <span class="o">==</span> <span class="s">&#39;.gz&#39;</span><span class="p">:</span>
+    <span class="k">if</span> <span class="n">fileext</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span> <span class="o">==</span> <span class="s1">&#39;.gz&#39;</span><span class="p">:</span>
         <span class="n">is_gz</span> <span class="o">=</span> <span class="bp">True</span>
         <span class="k">if</span> <span class="ow">not</span> <span class="n">allowed</span><span class="p">:</span>
-            <span class="n">MsgErrorAndExit</span><span class="p">(</span><span class="s">&#39;</span><span class="si">%s</span><span class="s"> file in Gzip not supported: </span><span class="si">%s</span><span class="s">. &#39;</span> <span class="o">%</span> <span class="p">(</span><span class="n">prefix</span><span class="p">,</span>
+            <span class="n">MsgErrorAndExit</span><span class="p">(</span><span class="s1">&#39;</span><span class="si">%s</span><span class="s1"> file in Gzip not supported: </span><span class="si">%s</span><span class="s1">. &#39;</span> <span class="o">%</span> <span class="p">(</span><span class="n">prefix</span><span class="p">,</span>
                                                                      <span class="n">filename</span><span class="p">),</span>
                             <span class="n">exit_status</span><span class="p">)</span>
-    <span class="k">return</span> <span class="n">is_gz</span>
-</div>
+    <span class="k">return</span> <span class="n">is_gz</span></div>
+
 <div class="viewcode-block" id="FileExtension"><a class="viewcode-back" href="../../../core/helper.html#promod3.core.helper.FileExtension">[docs]</a><span class="k">def</span> <span class="nf">FileExtension</span><span class="p">(</span><span class="n">prefix</span><span class="p">,</span> <span class="n">exit_status</span><span class="p">,</span> <span class="n">filename</span><span class="p">,</span> <span class="n">extensions</span><span class="p">,</span> <span class="n">gzip</span><span class="o">=</span><span class="bp">False</span><span class="p">):</span>
     <span class="sd">&#39;&#39;&#39;</span>
 <span class="sd">    Checks a file to carry a known extension given by a list of strings. Since</span>
@@ -158,22 +160,22 @@
 <span class="sd">    &#39;&#39;&#39;</span>
     <span class="n">pfilename</span><span class="p">,</span> <span class="n">fileext</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">splitext</span><span class="p">(</span><span class="n">filename</span><span class="p">)</span>
     <span class="n">is_gz</span> <span class="o">=</span> <span class="bp">False</span>
-    <span class="k">if</span> <span class="n">fileext</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span> <span class="o">==</span> <span class="s">&#39;.gz&#39;</span><span class="p">:</span>
+    <span class="k">if</span> <span class="n">fileext</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span> <span class="o">==</span> <span class="s1">&#39;.gz&#39;</span><span class="p">:</span>
         <span class="n">is_gz</span> <span class="o">=</span> <span class="bp">True</span>
         <span class="n">pfilename</span><span class="p">,</span> <span class="n">fileext</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">splitext</span><span class="p">(</span><span class="n">pfilename</span><span class="p">)</span>
         <span class="k">if</span> <span class="ow">not</span> <span class="n">gzip</span><span class="p">:</span>
-            <span class="n">extension_string</span> <span class="o">=</span> <span class="s">&#39;, &#39;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">extensions</span><span class="p">)</span>
-            <span class="n">MsgErrorAndExit</span><span class="p">(</span><span class="s">&#39;</span><span class="si">%s</span><span class="s"> file extension not supported: </span><span class="si">%s</span><span class="s">. &#39;</span> <span class="o">%</span><span class="p">(</span><span class="n">prefix</span><span class="p">,</span>
+            <span class="n">extension_string</span> <span class="o">=</span> <span class="s1">&#39;, &#39;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">extensions</span><span class="p">)</span>
+            <span class="n">MsgErrorAndExit</span><span class="p">(</span><span class="s1">&#39;</span><span class="si">%s</span><span class="s1"> file extension not supported: </span><span class="si">%s</span><span class="s1">. &#39;</span> <span class="o">%</span><span class="p">(</span><span class="n">prefix</span><span class="p">,</span>
                                                                       <span class="n">filename</span><span class="p">)</span><span class="o">+</span>
-                            <span class="s">&#39;Allowed extensions are: </span><span class="si">%s</span><span class="se">\n</span><span class="s">&#39;</span> <span class="o">%</span> <span class="n">extension_string</span><span class="p">,</span>
+                            <span class="s1">&#39;Allowed extensions are: </span><span class="si">%s</span><span class="se">\n</span><span class="s1">&#39;</span> <span class="o">%</span> <span class="n">extension_string</span><span class="p">,</span>
                             <span class="n">exit_status</span><span class="p">)</span>
-    <span class="k">if</span> <span class="n">fileext</span> <span class="o">==</span> <span class="s">&#39;&#39;</span><span class="p">:</span>
-        <span class="n">extension_string</span> <span class="o">=</span> <span class="s">&#39;, &#39;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">extensions</span><span class="p">)</span>
+    <span class="k">if</span> <span class="n">fileext</span> <span class="o">==</span> <span class="s1">&#39;&#39;</span><span class="p">:</span>
+        <span class="n">extension_string</span> <span class="o">=</span> <span class="s1">&#39;, &#39;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">extensions</span><span class="p">)</span>
         <span class="k">if</span> <span class="n">gzip</span><span class="p">:</span>
-            <span class="n">extension_string</span> <span class="o">+=</span> <span class="s">&#39;, &#39;</span> <span class="o">+</span> <span class="s">&#39;.gz, &#39;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">extensions</span><span class="p">)</span> <span class="o">+</span> <span class="s">&#39;.gz&#39;</span>
-            <span class="n">MsgErrorAndExit</span><span class="p">(</span><span class="s">&#39;</span><span class="si">%s</span><span class="s"> file extension not supported: </span><span class="si">%s</span><span class="s">. &#39;</span> <span class="o">%</span><span class="p">(</span><span class="n">prefix</span><span class="p">,</span>
+            <span class="n">extension_string</span> <span class="o">+=</span> <span class="s1">&#39;, &#39;</span> <span class="o">+</span> <span class="s1">&#39;.gz, &#39;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">extensions</span><span class="p">)</span> <span class="o">+</span> <span class="s1">&#39;.gz&#39;</span>
+            <span class="n">MsgErrorAndExit</span><span class="p">(</span><span class="s1">&#39;</span><span class="si">%s</span><span class="s1"> file extension not supported: </span><span class="si">%s</span><span class="s1">. &#39;</span> <span class="o">%</span><span class="p">(</span><span class="n">prefix</span><span class="p">,</span>
                                                                       <span class="n">filename</span><span class="p">)</span><span class="o">+</span>
-                            <span class="s">&#39;Allowed extensions are: </span><span class="si">%s</span><span class="se">\n</span><span class="s">&#39;</span> <span class="o">%</span> <span class="n">extension_string</span><span class="p">,</span>
+                            <span class="s1">&#39;Allowed extensions are: </span><span class="si">%s</span><span class="se">\n</span><span class="s1">&#39;</span> <span class="o">%</span> <span class="n">extension_string</span><span class="p">,</span>
                             <span class="n">exit_status</span><span class="p">)</span>
     <span class="n">fileext</span> <span class="o">=</span> <span class="n">fileext</span><span class="p">[</span><span class="mi">1</span><span class="p">:]</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span>
     <span class="k">for</span> <span class="n">ext</span> <span class="ow">in</span> <span class="n">extensions</span><span class="p">:</span>
@@ -182,21 +184,21 @@
                 <span class="k">return</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">basename</span><span class="p">(</span><span class="n">pfilename</span><span class="p">),</span> <span class="n">fileext</span><span class="p">,</span> <span class="n">is_gz</span>
             <span class="k">else</span><span class="p">:</span>
                 <span class="k">return</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">basename</span><span class="p">(</span><span class="n">pfilename</span><span class="p">),</span> <span class="n">fileext</span>
-    <span class="n">extension_string</span> <span class="o">=</span> <span class="s">&#39;, &#39;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">extensions</span><span class="p">)</span>
+    <span class="n">extension_string</span> <span class="o">=</span> <span class="s1">&#39;, &#39;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">extensions</span><span class="p">)</span>
     <span class="k">if</span> <span class="n">gzip</span><span class="p">:</span>
-        <span class="n">extension_string</span> <span class="o">+=</span> <span class="s">&#39;, &#39;</span> <span class="o">+</span> <span class="s">&#39;.gz, &#39;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">extensions</span><span class="p">)</span> <span class="o">+</span> <span class="s">&#39;.gz&#39;</span>
-    <span class="n">MsgErrorAndExit</span><span class="p">(</span><span class="s">&#39;</span><span class="si">%s</span><span class="s"> file extension not supported: </span><span class="si">%s</span><span class="s">. &#39;</span> <span class="o">%</span> <span class="p">(</span><span class="n">prefix</span><span class="p">,</span>
+        <span class="n">extension_string</span> <span class="o">+=</span> <span class="s1">&#39;, &#39;</span> <span class="o">+</span> <span class="s1">&#39;.gz, &#39;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">extensions</span><span class="p">)</span> <span class="o">+</span> <span class="s1">&#39;.gz&#39;</span>
+    <span class="n">MsgErrorAndExit</span><span class="p">(</span><span class="s1">&#39;</span><span class="si">%s</span><span class="s1"> file extension not supported: </span><span class="si">%s</span><span class="s1">. &#39;</span> <span class="o">%</span> <span class="p">(</span><span class="n">prefix</span><span class="p">,</span>
                                                                <span class="n">filename</span><span class="p">)</span><span class="o">+</span>
-                    <span class="s">&#39;Allowed extensions are: </span><span class="si">%s</span><span class="se">\n</span><span class="s">&#39;</span> <span class="o">%</span> <span class="n">extension_string</span><span class="p">,</span>
-                    <span class="n">exit_status</span><span class="p">)</span>
-</div>
+                    <span class="s1">&#39;Allowed extensions are: </span><span class="si">%s</span><span class="se">\n</span><span class="s1">&#39;</span> <span class="o">%</span> <span class="n">extension_string</span><span class="p">,</span>
+                    <span class="n">exit_status</span><span class="p">)</span></div>
+
 <span class="n">__all__</span> <span class="o">=</span> <span class="p">(</span>
-    <span class="s">&#39;MsgErrorAndExit&#39;</span><span class="p">,</span>
-    <span class="s">&#39;FileExists&#39;</span><span class="p">,</span>
-    <span class="s">&#39;FileExtension&#39;</span><span class="p">,</span>
+    <span class="s1">&#39;MsgErrorAndExit&#39;</span><span class="p">,</span>
+    <span class="s1">&#39;FileExists&#39;</span><span class="p">,</span>
+    <span class="s1">&#39;FileExtension&#39;</span><span class="p">,</span>
 <span class="p">)</span>
 
-<span class="c">#  LocalWords:  gzipped gz param str gzip bool</span>
+<span class="c1">#  LocalWords:  gzipped gz param str gzip bool</span>
 </pre></div>
 
           </div>
@@ -222,9 +224,6 @@
       <input type="hidden" name="check_keywords" value="yes" />
       <input type="hidden" name="area" value="default" />
     </form>
-    <p class="searchtip" style="font-size: 90%">
-    Enter search terms or a module, class or function name.
-    </p>
 </div>
 <script type="text/javascript">$('#searchbox').show(0);</script>
         </div>
@@ -232,11 +231,11 @@
       <div class="clearer"></div>
     </div>
     <div class="footer">
-      &copy;2017, ProMod3 authors.
+      &copy;2018, ProMod3 authors.
       
       |
-      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a>
-      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.6</a>
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.4.1</a>
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
       
     </div>
 
diff --git a/doc/html/_modules/promod3/core/pm3argparse.html b/doc/html/_modules/promod3/core/pm3argparse.html
index a7e1be3fbe452bb61a94591e499bba82eefce2f9..e10fff03f913d8b7779021287b59d397b5f58634 100644
--- a/doc/html/_modules/promod3/core/pm3argparse.html
+++ b/doc/html/_modules/promod3/core/pm3argparse.html
@@ -6,7 +6,7 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
-    <title>promod3.core.pm3argparse &mdash; ProMod3 1.1.0 documentation</title>
+    <title>promod3.core.pm3argparse &mdash; ProMod3 1.2.0 documentation</title>
     
     <link rel="stylesheet" href="../../../_static/alabaster.css" type="text/css" />
     <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
@@ -14,7 +14,7 @@
     <script type="text/javascript">
       var DOCUMENTATION_OPTIONS = {
         URL_ROOT:    '../../../',
-        VERSION:     '1.1.0',
+        VERSION:     '1.2.0',
         COLLAPSE_INDEX: false,
         FILE_SUFFIX: '.html',
         HAS_SOURCE:  true
@@ -23,14 +23,16 @@
     <script type="text/javascript" src="../../../_static/jquery.js"></script>
     <script type="text/javascript" src="../../../_static/underscore.js"></script>
     <script type="text/javascript" src="../../../_static/doctools.js"></script>
-    <link rel="top" title="ProMod3 1.1.0 documentation" href="../../../index.html" />
+    <link rel="top" title="ProMod3 1.2.0 documentation" href="../../../index.html" />
     <link rel="up" title="promod3" href="../../promod3.html" />
    
+  <link rel="stylesheet" href="../../../_static/custom.css" type="text/css" />
   
-  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
 
   </head>
-  <body role="document">  
+  <body role="document">
+  
 
     <div class="document">
       <div class="documentwrapper">
@@ -38,7 +40,7 @@
           <div class="body" role="main">
             
   <h1>Source code for promod3.core.pm3argparse</h1><div class="highlight"><pre>
-<span class="sd">&quot;&quot;&quot;</span>
+<span></span><span class="sd">&quot;&quot;&quot;</span>
 <span class="sd">Extensions for the argparse module.</span>
 <span class="sd">&quot;&quot;&quot;</span>
 
@@ -47,9 +49,9 @@
 <span class="kn">import</span> <span class="nn">os</span>
 <span class="kn">import</span> <span class="nn">gzip</span>
 <span class="kn">import</span> <span class="nn">tempfile</span>
-<span class="c">#try:</span>
-<span class="c">#    import ujson as json</span>
-<span class="c">#except ImportError:</span>
+<span class="c1">#try:</span>
+<span class="c1">#    import ujson as json</span>
+<span class="c1">#except ImportError:</span>
 <span class="kn">import</span> <span class="nn">json</span>
 
 <span class="kn">import</span> <span class="nn">ost</span>
@@ -66,9 +68,9 @@
         <span class="n">unzip_str</span> <span class="o">=</span> <span class="n">zip_fh</span><span class="o">.</span><span class="n">read</span><span class="p">()</span>
         <span class="n">zip_fh</span><span class="o">.</span><span class="n">close</span><span class="p">()</span>
     <span class="k">except</span> <span class="ne">IOError</span><span class="p">,</span> <span class="n">ioe</span><span class="p">:</span>
-        <span class="n">helper</span><span class="o">.</span><span class="n">MsgErrorAndExit</span><span class="p">(</span><span class="n">msg_prefix</span> <span class="o">+</span> <span class="s">&quot; gzip file &#39;&quot;</span> <span class="o">+</span> <span class="n">filename</span> <span class="o">+</span>
-                               <span class="s">&quot;&#39; cannot be opened: &quot;</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">ioe</span><span class="p">),</span> <span class="mi">14</span><span class="p">)</span>
-    <span class="n">unzip_file</span> <span class="o">=</span> <span class="n">tempfile</span><span class="o">.</span><span class="n">NamedTemporaryFile</span><span class="p">(</span><span class="n">mode</span><span class="o">=</span><span class="s">&#39;w&#39;</span><span class="p">,</span> <span class="n">suffix</span><span class="o">=</span><span class="n">suffix</span><span class="p">)</span>
+        <span class="n">helper</span><span class="o">.</span><span class="n">MsgErrorAndExit</span><span class="p">(</span><span class="n">msg_prefix</span> <span class="o">+</span> <span class="s2">&quot; gzip file &#39;&quot;</span> <span class="o">+</span> <span class="n">filename</span> <span class="o">+</span>
+                               <span class="s2">&quot;&#39; cannot be opened: &quot;</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">ioe</span><span class="p">),</span> <span class="mi">14</span><span class="p">)</span>
+    <span class="n">unzip_file</span> <span class="o">=</span> <span class="n">tempfile</span><span class="o">.</span><span class="n">NamedTemporaryFile</span><span class="p">(</span><span class="n">mode</span><span class="o">=</span><span class="s1">&#39;w&#39;</span><span class="p">,</span> <span class="n">suffix</span><span class="o">=</span><span class="n">suffix</span><span class="p">)</span>
     <span class="n">unzip_file</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">unzip_str</span><span class="p">)</span>
     <span class="n">unzip_file</span><span class="o">.</span><span class="n">flush</span><span class="p">()</span>
     <span class="k">return</span> <span class="n">unzip_file</span>
@@ -77,22 +79,22 @@
     <span class="sd">&#39;&#39;&#39;Check a key/value in a sequence exists and is of certain type.</span>
 <span class="sd">    &#39;&#39;&#39;</span>
     <span class="k">if</span> <span class="n">key_name</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">json_aln</span><span class="p">[</span><span class="n">seqtype</span><span class="p">]</span><span class="o">.</span><span class="n">keys</span><span class="p">():</span>
-        <span class="n">helper</span><span class="o">.</span><span class="n">MsgErrorAndExit</span><span class="p">(</span><span class="s">&quot;JSON &#39;alignmentlist&#39; &#39;</span><span class="si">%s</span><span class="s">&#39; &quot;</span> <span class="o">%</span> <span class="n">seqtype</span><span class="o">+</span>
-                               <span class="s">&quot;from &#39;</span><span class="si">%s</span><span class="s">&#39; is &quot;</span> <span class="o">%</span> <span class="n">json_source</span><span class="o">+</span>
-                               <span class="s">&quot;missing the &#39;</span><span class="si">%s</span><span class="s">&#39; key&quot;</span> <span class="o">%</span> <span class="n">key_name</span><span class="p">,</span> <span class="mi">27</span><span class="p">)</span>
+        <span class="n">helper</span><span class="o">.</span><span class="n">MsgErrorAndExit</span><span class="p">(</span><span class="s2">&quot;JSON &#39;alignmentlist&#39; &#39;</span><span class="si">%s</span><span class="s2">&#39; &quot;</span> <span class="o">%</span> <span class="n">seqtype</span><span class="o">+</span>
+                               <span class="s2">&quot;from &#39;</span><span class="si">%s</span><span class="s2">&#39; is &quot;</span> <span class="o">%</span> <span class="n">json_source</span><span class="o">+</span>
+                               <span class="s2">&quot;missing the &#39;</span><span class="si">%s</span><span class="s2">&#39; key&quot;</span> <span class="o">%</span> <span class="n">key_name</span><span class="p">,</span> <span class="mi">27</span><span class="p">)</span>
     <span class="n">altype</span> <span class="o">=</span> <span class="nb">type</span><span class="p">(</span><span class="n">json_aln</span><span class="p">[</span><span class="n">seqtype</span><span class="p">][</span><span class="n">key_name</span><span class="p">])</span>
 
     <span class="k">if</span> <span class="n">val_type</span> <span class="ow">is</span> <span class="nb">str</span> <span class="ow">or</span> <span class="n">val_type</span> <span class="ow">is</span> <span class="nb">unicode</span><span class="p">:</span>
         <span class="k">if</span> <span class="ow">not</span> <span class="p">(</span><span class="n">altype</span> <span class="ow">is</span> <span class="nb">unicode</span> <span class="ow">or</span> <span class="n">altype</span> <span class="ow">is</span> <span class="nb">str</span><span class="p">):</span>
-            <span class="n">helper</span><span class="o">.</span><span class="n">MsgErrorAndExit</span><span class="p">(</span><span class="s">&quot;JSON &#39;alignmentlist&#39; &#39;</span><span class="si">%s</span><span class="s">&#39; &quot;</span> <span class="o">%</span> <span class="n">seqtype</span><span class="o">+</span>
-                                   <span class="s">&quot;&#39;</span><span class="si">%s</span><span class="s">&#39; from&quot;</span> <span class="o">%</span> <span class="n">key_name</span><span class="o">+</span>
-                                   <span class="s">&quot;&#39;</span><span class="si">%s</span><span class="s">&#39; is not a &quot;</span> <span class="o">%</span> <span class="n">json_source</span><span class="o">+</span>
-                                   <span class="s">&quot;</span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="nb">str</span><span class="p">(</span><span class="n">val_type</span><span class="p">),</span> <span class="mi">28</span><span class="p">)</span>
+            <span class="n">helper</span><span class="o">.</span><span class="n">MsgErrorAndExit</span><span class="p">(</span><span class="s2">&quot;JSON &#39;alignmentlist&#39; &#39;</span><span class="si">%s</span><span class="s2">&#39; &quot;</span> <span class="o">%</span> <span class="n">seqtype</span><span class="o">+</span>
+                                   <span class="s2">&quot;&#39;</span><span class="si">%s</span><span class="s2">&#39; from&quot;</span> <span class="o">%</span> <span class="n">key_name</span><span class="o">+</span>
+                                   <span class="s2">&quot;&#39;</span><span class="si">%s</span><span class="s2">&#39; is not a &quot;</span> <span class="o">%</span> <span class="n">json_source</span><span class="o">+</span>
+                                   <span class="s2">&quot;</span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="nb">str</span><span class="p">(</span><span class="n">val_type</span><span class="p">),</span> <span class="mi">28</span><span class="p">)</span>
     <span class="k">elif</span> <span class="ow">not</span> <span class="n">altype</span> <span class="ow">is</span> <span class="n">val_type</span><span class="p">:</span>
-        <span class="n">helper</span><span class="o">.</span><span class="n">MsgErrorAndExit</span><span class="p">(</span><span class="s">&quot;JSON &#39;alignmentlist&#39; &#39;</span><span class="si">%s</span><span class="s">&#39; &quot;</span> <span class="o">%</span> <span class="n">seqtype</span><span class="o">+</span>
-                               <span class="s">&quot;&#39;</span><span class="si">%s</span><span class="s">&#39; from&quot;</span> <span class="o">%</span> <span class="n">key_name</span><span class="o">+</span>
-                               <span class="s">&quot;&#39;</span><span class="si">%s</span><span class="s">&#39; is not a &quot;</span> <span class="o">%</span> <span class="n">json_source</span><span class="o">+</span>
-                               <span class="s">&quot;</span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="nb">str</span><span class="p">(</span><span class="n">val_type</span><span class="p">),</span> <span class="mi">28</span><span class="p">)</span>
+        <span class="n">helper</span><span class="o">.</span><span class="n">MsgErrorAndExit</span><span class="p">(</span><span class="s2">&quot;JSON &#39;alignmentlist&#39; &#39;</span><span class="si">%s</span><span class="s2">&#39; &quot;</span> <span class="o">%</span> <span class="n">seqtype</span><span class="o">+</span>
+                               <span class="s2">&quot;&#39;</span><span class="si">%s</span><span class="s2">&#39; from&quot;</span> <span class="o">%</span> <span class="n">key_name</span><span class="o">+</span>
+                               <span class="s2">&quot;&#39;</span><span class="si">%s</span><span class="s2">&#39; is not a &quot;</span> <span class="o">%</span> <span class="n">json_source</span><span class="o">+</span>
+                               <span class="s2">&quot;</span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="nb">str</span><span class="p">(</span><span class="n">val_type</span><span class="p">),</span> <span class="mi">28</span><span class="p">)</span>
 
 <span class="k">def</span> <span class="nf">_GetAlnFromJSON</span><span class="p">(</span><span class="n">json_object</span><span class="p">,</span> <span class="n">json_source</span><span class="p">):</span>
     <span class="sd">&quot;&quot;&quot;Create alignments from a JSON object.</span>
@@ -100,49 +102,49 @@
 <span class="sd">    Iterate the alignments in a JSON object and deliver OST alignments via the</span>
 <span class="sd">    yield operator.</span>
 <span class="sd">    &quot;&quot;&quot;</span>
-    <span class="c"># alignments are stored via the &#39;alignmentlist&#39; key</span>
-    <span class="k">if</span> <span class="s">&#39;alignmentlist&#39;</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">json_object</span><span class="o">.</span><span class="n">keys</span><span class="p">():</span>
-        <span class="n">helper</span><span class="o">.</span><span class="n">MsgErrorAndExit</span><span class="p">(</span><span class="s">&quot;JSON object from &#39;</span><span class="si">%s</span><span class="s">&#39; does not &quot;</span> <span class="o">%</span> <span class="n">json_source</span><span class="o">+</span>
-                               <span class="s">&quot;provide an &#39;alignmentlist&#39; key.&quot;</span><span class="p">,</span> <span class="mi">21</span><span class="p">)</span>
-    <span class="c"># alignments come as lists, to enable hetero oligos</span>
-    <span class="k">if</span> <span class="ow">not</span> <span class="nb">type</span><span class="p">(</span><span class="n">json_object</span><span class="p">[</span><span class="s">&#39;alignmentlist&#39;</span><span class="p">])</span> <span class="ow">is</span> <span class="nb">list</span><span class="p">:</span>
-        <span class="n">helper</span><span class="o">.</span><span class="n">MsgErrorAndExit</span><span class="p">(</span><span class="s">&quot;JSON object from &#39;</span><span class="si">%s</span><span class="s">&#39; does not&quot;</span> <span class="o">%</span> <span class="n">json_source</span><span class="o">+</span>
-                               <span class="s">&quot;provide a list behind &#39;alignmentlist&#39;.&quot;</span><span class="p">,</span> <span class="mi">24</span><span class="p">)</span>
-    <span class="c"># take the alignments apart, each alignment is a dictionary</span>
-    <span class="k">for</span> <span class="n">json_aln</span> <span class="ow">in</span> <span class="n">json_object</span><span class="p">[</span><span class="s">&#39;alignmentlist&#39;</span><span class="p">]:</span>
-        <span class="c"># json_aln needs to be a dictionary</span>
+    <span class="c1"># alignments are stored via the &#39;alignmentlist&#39; key</span>
+    <span class="k">if</span> <span class="s1">&#39;alignmentlist&#39;</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">json_object</span><span class="o">.</span><span class="n">keys</span><span class="p">():</span>
+        <span class="n">helper</span><span class="o">.</span><span class="n">MsgErrorAndExit</span><span class="p">(</span><span class="s2">&quot;JSON object from &#39;</span><span class="si">%s</span><span class="s2">&#39; does not &quot;</span> <span class="o">%</span> <span class="n">json_source</span><span class="o">+</span>
+                               <span class="s2">&quot;provide an &#39;alignmentlist&#39; key.&quot;</span><span class="p">,</span> <span class="mi">21</span><span class="p">)</span>
+    <span class="c1"># alignments come as lists, to enable hetero oligos</span>
+    <span class="k">if</span> <span class="ow">not</span> <span class="nb">type</span><span class="p">(</span><span class="n">json_object</span><span class="p">[</span><span class="s1">&#39;alignmentlist&#39;</span><span class="p">])</span> <span class="ow">is</span> <span class="nb">list</span><span class="p">:</span>
+        <span class="n">helper</span><span class="o">.</span><span class="n">MsgErrorAndExit</span><span class="p">(</span><span class="s2">&quot;JSON object from &#39;</span><span class="si">%s</span><span class="s2">&#39; does not&quot;</span> <span class="o">%</span> <span class="n">json_source</span><span class="o">+</span>
+                               <span class="s2">&quot;provide a list behind &#39;alignmentlist&#39;.&quot;</span><span class="p">,</span> <span class="mi">24</span><span class="p">)</span>
+    <span class="c1"># take the alignments apart, each alignment is a dictionary</span>
+    <span class="k">for</span> <span class="n">json_aln</span> <span class="ow">in</span> <span class="n">json_object</span><span class="p">[</span><span class="s1">&#39;alignmentlist&#39;</span><span class="p">]:</span>
+        <span class="c1"># json_aln needs to be a dictionary</span>
         <span class="k">if</span> <span class="ow">not</span> <span class="nb">type</span><span class="p">(</span><span class="n">json_aln</span><span class="p">)</span> <span class="ow">is</span> <span class="nb">dict</span><span class="p">:</span>
-            <span class="n">helper</span><span class="o">.</span><span class="n">MsgErrorAndExit</span><span class="p">(</span><span class="s">&quot;JSON &#39;alignmentlist&#39; member from &quot;</span><span class="o">+</span>
-                                   <span class="s">&quot;&#39;</span><span class="si">%s</span><span class="s">&#39; is not a &#39; &quot;</span> <span class="o">%</span>  <span class="n">json_source</span><span class="o">+</span>
-                                   <span class="s">&quot; dictionary: </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">json_aln</span><span class="p">,</span> <span class="mi">25</span><span class="p">)</span>
-        <span class="c"># an alignment has a &#39;target&#39; and a &#39;template&#39; dictionary</span>
-        <span class="c"># each of them has a &#39;name&#39; and a &#39;seqres&#39; pair</span>
-        <span class="k">for</span> <span class="n">flav</span> <span class="ow">in</span> <span class="p">[</span><span class="s">&#39;target&#39;</span><span class="p">,</span> <span class="s">&#39;template&#39;</span><span class="p">]:</span>
+            <span class="n">helper</span><span class="o">.</span><span class="n">MsgErrorAndExit</span><span class="p">(</span><span class="s2">&quot;JSON &#39;alignmentlist&#39; member from &quot;</span><span class="o">+</span>
+                                   <span class="s2">&quot;&#39;</span><span class="si">%s</span><span class="s2">&#39; is not a &#39; &quot;</span> <span class="o">%</span>  <span class="n">json_source</span><span class="o">+</span>
+                                   <span class="s2">&quot; dictionary: </span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="n">json_aln</span><span class="p">,</span> <span class="mi">25</span><span class="p">)</span>
+        <span class="c1"># an alignment has a &#39;target&#39; and a &#39;template&#39; dictionary</span>
+        <span class="c1"># each of them has a &#39;name&#39; and a &#39;seqres&#39; pair</span>
+        <span class="k">for</span> <span class="n">flav</span> <span class="ow">in</span> <span class="p">[</span><span class="s1">&#39;target&#39;</span><span class="p">,</span> <span class="s1">&#39;template&#39;</span><span class="p">]:</span>
             <span class="k">if</span> <span class="n">flav</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">json_aln</span><span class="o">.</span><span class="n">keys</span><span class="p">():</span>
-                <span class="n">helper</span><span class="o">.</span><span class="n">MsgErrorAndExit</span><span class="p">(</span><span class="s">&quot;JSON &#39;alignmentlist&#39; from &quot;</span><span class="o">+</span>
-                                       <span class="s">&quot;&#39;</span><span class="si">%s</span><span class="s">&#39; does not &quot;</span> <span class="o">%</span> <span class="n">json_source</span><span class="o">+</span>
-                                       <span class="s">&quot;provide a &#39;</span><span class="si">%s</span><span class="s">&#39; key.&quot;</span> <span class="o">%</span> <span class="n">flav</span><span class="p">,</span> <span class="mi">22</span><span class="p">)</span>
-            <span class="c"># check sequence to be dictionary</span>
+                <span class="n">helper</span><span class="o">.</span><span class="n">MsgErrorAndExit</span><span class="p">(</span><span class="s2">&quot;JSON &#39;alignmentlist&#39; from &quot;</span><span class="o">+</span>
+                                       <span class="s2">&quot;&#39;</span><span class="si">%s</span><span class="s2">&#39; does not &quot;</span> <span class="o">%</span> <span class="n">json_source</span><span class="o">+</span>
+                                       <span class="s2">&quot;provide a &#39;</span><span class="si">%s</span><span class="s2">&#39; key.&quot;</span> <span class="o">%</span> <span class="n">flav</span><span class="p">,</span> <span class="mi">22</span><span class="p">)</span>
+            <span class="c1"># check sequence to be dictionary</span>
             <span class="k">if</span> <span class="ow">not</span> <span class="nb">type</span><span class="p">(</span><span class="n">json_aln</span><span class="p">[</span><span class="n">flav</span><span class="p">])</span> <span class="ow">is</span> <span class="nb">dict</span><span class="p">:</span>
-                <span class="n">helper</span><span class="o">.</span><span class="n">MsgErrorAndExit</span><span class="p">(</span><span class="s">&quot;JSON &#39;alignmentlist&#39; &#39;</span><span class="si">%s</span><span class="s">&#39; from&quot;</span> <span class="o">%</span> <span class="n">flav</span><span class="o">+</span>
-                                       <span class="s">&quot;&#39;</span><span class="si">%s</span><span class="s">&#39; is not a &quot;</span> <span class="o">%</span> <span class="n">json_source</span><span class="o">+</span>
-                                       <span class="s">&quot;dictionary: </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">json_aln</span><span class="p">[</span><span class="n">flav</span><span class="p">],</span> <span class="mi">26</span><span class="p">)</span>
-            <span class="c"># check for keys needed by both sequences:</span>
-            <span class="k">for</span> <span class="n">aln_key</span> <span class="ow">in</span> <span class="p">[</span><span class="s">&#39;name&#39;</span><span class="p">,</span> <span class="s">&#39;seqres&#39;</span><span class="p">]:</span>
+                <span class="n">helper</span><span class="o">.</span><span class="n">MsgErrorAndExit</span><span class="p">(</span><span class="s2">&quot;JSON &#39;alignmentlist&#39; &#39;</span><span class="si">%s</span><span class="s2">&#39; from&quot;</span> <span class="o">%</span> <span class="n">flav</span><span class="o">+</span>
+                                       <span class="s2">&quot;&#39;</span><span class="si">%s</span><span class="s2">&#39; is not a &quot;</span> <span class="o">%</span> <span class="n">json_source</span><span class="o">+</span>
+                                       <span class="s2">&quot;dictionary: </span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="n">json_aln</span><span class="p">[</span><span class="n">flav</span><span class="p">],</span> <span class="mi">26</span><span class="p">)</span>
+            <span class="c1"># check for keys needed by both sequences:</span>
+            <span class="k">for</span> <span class="n">aln_key</span> <span class="ow">in</span> <span class="p">[</span><span class="s1">&#39;name&#39;</span><span class="p">,</span> <span class="s1">&#39;seqres&#39;</span><span class="p">]:</span>
                 <span class="n">_CheckJSONAlnSeqKeyType</span><span class="p">(</span><span class="n">aln_key</span><span class="p">,</span> <span class="nb">str</span><span class="p">,</span> <span class="n">json_aln</span><span class="p">,</span> <span class="n">flav</span><span class="p">,</span>
                                         <span class="n">json_source</span><span class="p">)</span>
-        <span class="n">_CheckJSONAlnSeqKeyType</span><span class="p">(</span><span class="s">&#39;offset&#39;</span><span class="p">,</span> <span class="nb">int</span><span class="p">,</span> <span class="n">json_aln</span><span class="p">,</span> <span class="s">&#39;template&#39;</span><span class="p">,</span>
+        <span class="n">_CheckJSONAlnSeqKeyType</span><span class="p">(</span><span class="s1">&#39;offset&#39;</span><span class="p">,</span> <span class="nb">int</span><span class="p">,</span> <span class="n">json_aln</span><span class="p">,</span> <span class="s1">&#39;template&#39;</span><span class="p">,</span>
                                 <span class="n">json_source</span><span class="p">)</span>
-        <span class="c"># create and yield alignment</span>
-        <span class="n">trg_name</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="n">json_aln</span><span class="p">[</span><span class="s">&#39;target&#39;</span><span class="p">][</span><span class="s">&#39;name&#39;</span><span class="p">])</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span>
-        <span class="n">trg_seq</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="n">json_aln</span><span class="p">[</span><span class="s">&#39;target&#39;</span><span class="p">][</span><span class="s">&#39;seqres&#39;</span><span class="p">])</span>
-        <span class="n">tpl_name</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="n">json_aln</span><span class="p">[</span><span class="s">&#39;template&#39;</span><span class="p">][</span><span class="s">&#39;name&#39;</span><span class="p">])</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span>
-        <span class="n">tpl_seq</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="n">json_aln</span><span class="p">[</span><span class="s">&#39;template&#39;</span><span class="p">][</span><span class="s">&#39;seqres&#39;</span><span class="p">])</span>
+        <span class="c1"># create and yield alignment</span>
+        <span class="n">trg_name</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="n">json_aln</span><span class="p">[</span><span class="s1">&#39;target&#39;</span><span class="p">][</span><span class="s1">&#39;name&#39;</span><span class="p">])</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span>
+        <span class="n">trg_seq</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="n">json_aln</span><span class="p">[</span><span class="s1">&#39;target&#39;</span><span class="p">][</span><span class="s1">&#39;seqres&#39;</span><span class="p">])</span>
+        <span class="n">tpl_name</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="n">json_aln</span><span class="p">[</span><span class="s1">&#39;template&#39;</span><span class="p">][</span><span class="s1">&#39;name&#39;</span><span class="p">])</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span>
+        <span class="n">tpl_seq</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="n">json_aln</span><span class="p">[</span><span class="s1">&#39;template&#39;</span><span class="p">][</span><span class="s1">&#39;seqres&#39;</span><span class="p">])</span>
         <span class="n">new_aln</span> <span class="o">=</span> <span class="n">seq</span><span class="o">.</span><span class="n">CreateAlignment</span><span class="p">(</span><span class="n">seq</span><span class="o">.</span><span class="n">CreateSequence</span><span class="p">(</span><span class="n">trg_name</span><span class="p">,</span> <span class="n">trg_seq</span><span class="p">),</span>
                                       <span class="n">seq</span><span class="o">.</span><span class="n">CreateSequence</span><span class="p">(</span><span class="n">tpl_name</span><span class="p">,</span> <span class="n">tpl_seq</span><span class="p">))</span>
-        <span class="n">new_aln</span><span class="o">.</span><span class="n">SetSequenceRole</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="s">&#39;TARGET&#39;</span><span class="p">)</span>
-        <span class="n">new_aln</span><span class="o">.</span><span class="n">SetSequenceRole</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="s">&#39;TEMPLATE&#39;</span><span class="p">)</span>
-        <span class="n">new_aln</span><span class="o">.</span><span class="n">SetSequenceOffset</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="n">json_aln</span><span class="p">[</span><span class="s">&#39;template&#39;</span><span class="p">][</span><span class="s">&#39;offset&#39;</span><span class="p">])</span>
+        <span class="n">new_aln</span><span class="o">.</span><span class="n">SetSequenceRole</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="s1">&#39;TARGET&#39;</span><span class="p">)</span>
+        <span class="n">new_aln</span><span class="o">.</span><span class="n">SetSequenceRole</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="s1">&#39;TEMPLATE&#39;</span><span class="p">)</span>
+        <span class="n">new_aln</span><span class="o">.</span><span class="n">SetSequenceOffset</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="n">json_aln</span><span class="p">[</span><span class="s1">&#39;template&#39;</span><span class="p">][</span><span class="s1">&#39;offset&#39;</span><span class="p">])</span>
         <span class="k">yield</span> <span class="n">new_aln</span>
 
 <span class="k">def</span> <span class="nf">_GetJSONOBject</span><span class="p">(</span><span class="n">json_input</span><span class="p">):</span>
@@ -158,28 +160,28 @@
 
 <span class="sd">    As returnvalue we only use JSON objects.</span>
 <span class="sd">    &quot;&quot;&quot;</span>
-    <span class="k">if</span> <span class="n">json_input</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">!=</span> <span class="s">&#39;{&#39;</span><span class="p">:</span>
-        <span class="n">helper</span><span class="o">.</span><span class="n">FileExists</span><span class="p">(</span><span class="s">&quot;JSON Alignment&quot;</span><span class="p">,</span> <span class="mi">12</span><span class="p">,</span> <span class="n">json_input</span><span class="p">)</span>
-        <span class="n">is_gz</span> <span class="o">=</span> <span class="n">helper</span><span class="o">.</span><span class="n">FileGzip</span><span class="p">(</span><span class="s">&quot;JSON alignment&quot;</span><span class="p">,</span> <span class="mi">13</span><span class="p">,</span> <span class="n">json_input</span><span class="p">)</span>
+    <span class="k">if</span> <span class="n">json_input</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">!=</span> <span class="s1">&#39;{&#39;</span><span class="p">:</span>
+        <span class="n">helper</span><span class="o">.</span><span class="n">FileExists</span><span class="p">(</span><span class="s2">&quot;JSON Alignment&quot;</span><span class="p">,</span> <span class="mi">12</span><span class="p">,</span> <span class="n">json_input</span><span class="p">)</span>
+        <span class="n">is_gz</span> <span class="o">=</span> <span class="n">helper</span><span class="o">.</span><span class="n">FileGzip</span><span class="p">(</span><span class="s2">&quot;JSON alignment&quot;</span><span class="p">,</span> <span class="mi">13</span><span class="p">,</span> <span class="n">json_input</span><span class="p">)</span>
         <span class="n">readfile</span> <span class="o">=</span> <span class="n">json_input</span>
         <span class="k">if</span> <span class="n">is_gz</span><span class="p">:</span>
-            <span class="n">unzip_file</span> <span class="o">=</span> <span class="n">_TmpForGZip</span><span class="p">(</span><span class="n">json_input</span><span class="p">,</span> <span class="s">&#39;.json&#39;</span><span class="p">,</span> <span class="s">&quot;JSON alignment&quot;</span><span class="p">)</span>
+            <span class="n">unzip_file</span> <span class="o">=</span> <span class="n">_TmpForGZip</span><span class="p">(</span><span class="n">json_input</span><span class="p">,</span> <span class="s1">&#39;.json&#39;</span><span class="p">,</span> <span class="s2">&quot;JSON alignment&quot;</span><span class="p">)</span>
             <span class="n">readfile</span> <span class="o">=</span> <span class="n">unzip_file</span><span class="o">.</span><span class="n">name</span>
         <span class="k">try</span><span class="p">:</span>
             <span class="n">jfh</span> <span class="o">=</span> <span class="nb">open</span><span class="p">(</span><span class="n">readfile</span><span class="p">)</span>
         <span class="k">except</span> <span class="ne">IOError</span><span class="p">,</span> <span class="n">ioe</span><span class="p">:</span>
-            <span class="n">helper</span><span class="o">.</span><span class="n">MsgErrorAndExit</span><span class="p">(</span><span class="s">&quot;&#39;--json&#39; file &#39;</span><span class="si">%s</span><span class="s">&#39; &quot;</span> <span class="o">%</span> <span class="n">json_input</span><span class="o">+</span>
-                                   <span class="s">&quot;can not be processed: </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">ioe</span><span class="o">.</span><span class="n">strerror</span><span class="p">,</span>
+            <span class="n">helper</span><span class="o">.</span><span class="n">MsgErrorAndExit</span><span class="p">(</span><span class="s2">&quot;&#39;--json&#39; file &#39;</span><span class="si">%s</span><span class="s2">&#39; &quot;</span> <span class="o">%</span> <span class="n">json_input</span><span class="o">+</span>
+                                   <span class="s2">&quot;can not be processed: </span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="n">ioe</span><span class="o">.</span><span class="n">strerror</span><span class="p">,</span>
                                    <span class="mi">19</span><span class="p">)</span>
         <span class="k">except</span><span class="p">:</span>
             <span class="k">raise</span>
         <span class="k">try</span><span class="p">:</span>
             <span class="n">json_object</span> <span class="o">=</span> <span class="n">json</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="n">jfh</span><span class="p">)</span>
         <span class="k">except</span> <span class="ne">ValueError</span><span class="p">,</span> <span class="n">vae</span><span class="p">:</span>
-            <span class="k">if</span> <span class="n">vae</span><span class="o">.</span><span class="n">message</span> <span class="o">==</span> <span class="s">&#39;No JSON object could be decoded&#39;</span><span class="p">:</span>
-                <span class="n">helper</span><span class="o">.</span><span class="n">MsgErrorAndExit</span><span class="p">(</span><span class="s">&quot;&#39;--json&#39; file &#39;</span><span class="si">%s</span><span class="s">&#39; could &quot;</span> <span class="o">%</span> <span class="n">json_input</span><span class="o">+</span>
-                                       <span class="s">&quot;not be processed into a JSON object, &quot;</span><span class="o">+</span>
-                                       <span class="s">&quot;probably it&#39;s empty.&quot;</span><span class="p">,</span> <span class="mi">20</span><span class="p">)</span>
+            <span class="k">if</span> <span class="n">vae</span><span class="o">.</span><span class="n">message</span> <span class="o">==</span> <span class="s1">&#39;No JSON object could be decoded&#39;</span><span class="p">:</span>
+                <span class="n">helper</span><span class="o">.</span><span class="n">MsgErrorAndExit</span><span class="p">(</span><span class="s2">&quot;&#39;--json&#39; file &#39;</span><span class="si">%s</span><span class="s2">&#39; could &quot;</span> <span class="o">%</span> <span class="n">json_input</span><span class="o">+</span>
+                                       <span class="s2">&quot;not be processed into a JSON object, &quot;</span><span class="o">+</span>
+                                       <span class="s2">&quot;probably it&#39;s empty.&quot;</span><span class="p">,</span> <span class="mi">20</span><span class="p">)</span>
             <span class="k">else</span><span class="p">:</span>
                 <span class="k">raise</span>
         <span class="k">except</span><span class="p">:</span>
@@ -189,121 +191,121 @@
         <span class="k">try</span><span class="p">:</span>
             <span class="n">json_object</span> <span class="o">=</span> <span class="n">json</span><span class="o">.</span><span class="n">loads</span><span class="p">(</span><span class="n">json_input</span><span class="p">)</span>
         <span class="k">except</span> <span class="ne">ValueError</span><span class="p">,</span> <span class="n">vae</span><span class="p">:</span>
-            <span class="n">helper</span><span class="o">.</span><span class="n">MsgErrorAndExit</span><span class="p">(</span><span class="s">&quot;&#39;--json&#39; string &#39;</span><span class="si">%s</span><span class="s">&#39; &quot;</span> <span class="o">%</span> <span class="n">json_input</span><span class="o">+</span>\
-                                   <span class="s">&quot;could not be decoded: </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">vae</span><span class="o">.</span><span class="n">message</span><span class="p">,</span> <span class="mi">23</span><span class="p">)</span>
+            <span class="n">helper</span><span class="o">.</span><span class="n">MsgErrorAndExit</span><span class="p">(</span><span class="s2">&quot;&#39;--json&#39; string &#39;</span><span class="si">%s</span><span class="s2">&#39; &quot;</span> <span class="o">%</span> <span class="n">json_input</span><span class="o">+</span>\
+                                   <span class="s2">&quot;could not be decoded: </span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="n">vae</span><span class="o">.</span><span class="n">message</span><span class="p">,</span> <span class="mi">23</span><span class="p">)</span>
     <span class="k">return</span> <span class="n">json_object</span>
 
 <span class="k">def</span> <span class="nf">_FetchAlnFromFile</span><span class="p">(</span><span class="n">seqfile</span><span class="p">,</span> <span class="n">allow_multitemplate</span><span class="p">,</span> <span class="n">format</span><span class="p">):</span>
     <span class="sd">&quot;&quot;&quot;Read alignment from seqfile and return it.&quot;&quot;&quot;</span>
-    <span class="n">argstr</span> <span class="o">=</span> <span class="s">&quot;&#39;--&quot;</span> <span class="o">+</span> <span class="n">format</span> <span class="o">+</span> <span class="s">&quot; &quot;</span> <span class="o">+</span> <span class="n">seqfile</span> <span class="o">+</span> <span class="s">&quot;&#39;&quot;</span>
-    <span class="n">helper</span><span class="o">.</span><span class="n">FileExists</span><span class="p">(</span><span class="s">&quot;Alignment&quot;</span><span class="p">,</span> <span class="mi">12</span><span class="p">,</span> <span class="n">seqfile</span><span class="p">)</span>
-    <span class="c"># checking if alignment file has &#39;gz&#39; extension</span>
-    <span class="n">is_gz</span> <span class="o">=</span> <span class="n">helper</span><span class="o">.</span><span class="n">FileGzip</span><span class="p">(</span><span class="s">&quot;Alignment&quot;</span><span class="p">,</span> <span class="mi">13</span><span class="p">,</span> <span class="n">seqfile</span><span class="p">)</span>
-    <span class="c"># loading the alignment, switch for gzip</span>
+    <span class="n">argstr</span> <span class="o">=</span> <span class="s2">&quot;&#39;--&quot;</span> <span class="o">+</span> <span class="n">format</span> <span class="o">+</span> <span class="s2">&quot; &quot;</span> <span class="o">+</span> <span class="n">seqfile</span> <span class="o">+</span> <span class="s2">&quot;&#39;&quot;</span>
+    <span class="n">helper</span><span class="o">.</span><span class="n">FileExists</span><span class="p">(</span><span class="s2">&quot;Alignment&quot;</span><span class="p">,</span> <span class="mi">12</span><span class="p">,</span> <span class="n">seqfile</span><span class="p">)</span>
+    <span class="c1"># checking if alignment file has &#39;gz&#39; extension</span>
+    <span class="n">is_gz</span> <span class="o">=</span> <span class="n">helper</span><span class="o">.</span><span class="n">FileGzip</span><span class="p">(</span><span class="s2">&quot;Alignment&quot;</span><span class="p">,</span> <span class="mi">13</span><span class="p">,</span> <span class="n">seqfile</span><span class="p">)</span>
+    <span class="c1"># loading the alignment, switch for gzip</span>
     <span class="n">readfile</span> <span class="o">=</span> <span class="n">seqfile</span>
     <span class="k">if</span> <span class="n">is_gz</span><span class="p">:</span>
-        <span class="n">unzip_file</span> <span class="o">=</span> <span class="n">_TmpForGZip</span><span class="p">(</span><span class="n">seqfile</span><span class="p">,</span> <span class="s">&#39;.fas&#39;</span><span class="p">,</span> <span class="s">&quot;Alignment&quot;</span><span class="p">)</span>
+        <span class="n">unzip_file</span> <span class="o">=</span> <span class="n">_TmpForGZip</span><span class="p">(</span><span class="n">seqfile</span><span class="p">,</span> <span class="s1">&#39;.fas&#39;</span><span class="p">,</span> <span class="s2">&quot;Alignment&quot;</span><span class="p">)</span>
         <span class="n">readfile</span> <span class="o">=</span> <span class="n">unzip_file</span><span class="o">.</span><span class="n">name</span>
     <span class="k">try</span><span class="p">:</span>
         <span class="n">aln</span> <span class="o">=</span> <span class="n">io</span><span class="o">.</span><span class="n">LoadAlignment</span><span class="p">(</span><span class="n">readfile</span><span class="p">,</span> <span class="n">format</span><span class="o">=</span><span class="n">format</span><span class="p">)</span>
-    <span class="k">except</span> <span class="ne">Exception</span><span class="p">,</span> <span class="n">exc</span><span class="p">:</span> <span class="c">#pylint: disable=broad-except</span>
-        <span class="k">if</span> <span class="n">exc</span><span class="o">.</span><span class="n">message</span> <span class="ow">in</span> <span class="p">[</span><span class="s">&#39;Bad FASTA file: File is empty&#39;</span><span class="p">,</span>
-                           <span class="s">&#39;Bad CLUSTAL file: File is empty&#39;</span><span class="p">]:</span>
-            <span class="n">helper</span><span class="o">.</span><span class="n">MsgErrorAndExit</span><span class="p">(</span><span class="n">argstr</span> <span class="o">+</span>  <span class="s">&quot; refers to an empty file or &quot;</span> <span class="o">+</span>
-                                   <span class="s">&quot;its in the wrong format.&quot;</span><span class="p">,</span> <span class="mi">15</span><span class="p">)</span>
+    <span class="k">except</span> <span class="ne">Exception</span><span class="p">,</span> <span class="n">exc</span><span class="p">:</span> <span class="c1">#pylint: disable=broad-except</span>
+        <span class="k">if</span> <span class="n">exc</span><span class="o">.</span><span class="n">message</span> <span class="ow">in</span> <span class="p">[</span><span class="s1">&#39;Bad FASTA file: File is empty&#39;</span><span class="p">,</span>
+                           <span class="s1">&#39;Bad CLUSTAL file: File is empty&#39;</span><span class="p">]:</span>
+            <span class="n">helper</span><span class="o">.</span><span class="n">MsgErrorAndExit</span><span class="p">(</span><span class="n">argstr</span> <span class="o">+</span>  <span class="s2">&quot; refers to an empty file or &quot;</span> <span class="o">+</span>
+                                   <span class="s2">&quot;its in the wrong format.&quot;</span><span class="p">,</span> <span class="mi">15</span><span class="p">)</span>
         <span class="k">else</span><span class="p">:</span>
-            <span class="n">helper</span><span class="o">.</span><span class="n">MsgErrorAndExit</span><span class="p">(</span><span class="n">argstr</span> <span class="o">+</span> <span class="s">&quot;: error when reading alignment &quot;</span><span class="o">+</span>
-                                   <span class="s">&quot;file: &quot;</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">exc</span><span class="p">),</span> <span class="mi">18</span><span class="p">)</span>
+            <span class="n">helper</span><span class="o">.</span><span class="n">MsgErrorAndExit</span><span class="p">(</span><span class="n">argstr</span> <span class="o">+</span> <span class="s2">&quot;: error when reading alignment &quot;</span><span class="o">+</span>
+                                   <span class="s2">&quot;file: &quot;</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">exc</span><span class="p">),</span> <span class="mi">18</span><span class="p">)</span>
     <span class="k">finally</span><span class="p">:</span>
         <span class="k">if</span> <span class="n">is_gz</span><span class="p">:</span>
             <span class="n">unzip_file</span><span class="o">.</span><span class="n">close</span><span class="p">()</span>
-    <span class="c"># checking the alignment</span>
+    <span class="c1"># checking the alignment</span>
     <span class="k">if</span> <span class="n">aln</span><span class="o">.</span><span class="n">GetCount</span><span class="p">()</span> <span class="o">==</span> <span class="mi">1</span><span class="p">:</span>
-        <span class="n">helper</span><span class="o">.</span><span class="n">MsgErrorAndExit</span><span class="p">(</span><span class="n">argstr</span> <span class="o">+</span> <span class="s">&quot; points to an alignment with only &quot;</span> <span class="o">+</span>
-                               <span class="s">&quot;1 sequence.&quot;</span><span class="p">,</span> <span class="mi">16</span><span class="p">)</span>
+        <span class="n">helper</span><span class="o">.</span><span class="n">MsgErrorAndExit</span><span class="p">(</span><span class="n">argstr</span> <span class="o">+</span> <span class="s2">&quot; points to an alignment with only &quot;</span> <span class="o">+</span>
+                               <span class="s2">&quot;1 sequence.&quot;</span><span class="p">,</span> <span class="mi">16</span><span class="p">)</span>
     <span class="k">if</span> <span class="n">aln</span><span class="o">.</span><span class="n">GetCount</span><span class="p">()</span> <span class="o">&gt;</span> <span class="mi">2</span> <span class="ow">and</span> <span class="ow">not</span> <span class="n">allow_multitemplate</span><span class="p">:</span>
-        <span class="n">helper</span><span class="o">.</span><span class="n">MsgErrorAndExit</span><span class="p">(</span><span class="n">argstr</span> <span class="o">+</span> <span class="s">&quot; points to an alignment with more &quot;</span> <span class="o">+</span>
-                               <span class="s">&quot;than 2 sequences and we do not allow this.&quot;</span><span class="p">,</span> <span class="mi">16</span><span class="p">)</span>
-    <span class="c"># identify target</span>
+        <span class="n">helper</span><span class="o">.</span><span class="n">MsgErrorAndExit</span><span class="p">(</span><span class="n">argstr</span> <span class="o">+</span> <span class="s2">&quot; points to an alignment with more &quot;</span> <span class="o">+</span>
+                               <span class="s2">&quot;than 2 sequences and we do not allow this.&quot;</span><span class="p">,</span> <span class="mi">16</span><span class="p">)</span>
+    <span class="c1"># identify target</span>
     <span class="n">target_idx</span> <span class="o">=</span> <span class="o">-</span><span class="mi">1</span>
     <span class="n">sequences</span> <span class="o">=</span> <span class="p">[(</span><span class="n">s</span><span class="o">.</span><span class="n">name</span><span class="o">.</span><span class="n">strip</span><span class="p">(),</span><span class="n">s</span><span class="o">.</span><span class="n">string</span><span class="p">)</span> <span class="k">for</span> <span class="n">s</span> <span class="ow">in</span> <span class="n">aln</span><span class="o">.</span><span class="n">sequences</span><span class="p">]</span>
     <span class="k">for</span> <span class="n">i</span><span class="p">,</span><span class="n">s</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">sequences</span><span class="p">):</span>
-        <span class="k">if</span> <span class="n">s</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span> <span class="ow">in</span> <span class="p">[</span><span class="s">&#39;trg&#39;</span><span class="p">,</span> <span class="s">&#39;target&#39;</span><span class="p">]:</span>
+        <span class="k">if</span> <span class="n">s</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span> <span class="ow">in</span> <span class="p">[</span><span class="s1">&#39;trg&#39;</span><span class="p">,</span> <span class="s1">&#39;target&#39;</span><span class="p">]:</span>
             <span class="k">if</span> <span class="n">target_idx</span> <span class="o">&gt;=</span> <span class="mi">0</span><span class="p">:</span>
-                <span class="n">helper</span><span class="o">.</span><span class="n">MsgErrorAndExit</span><span class="p">(</span><span class="n">argstr</span> <span class="o">+</span> <span class="s">&quot;: multiple targets found!&quot;</span><span class="p">,</span> <span class="mi">17</span><span class="p">)</span>
+                <span class="n">helper</span><span class="o">.</span><span class="n">MsgErrorAndExit</span><span class="p">(</span><span class="n">argstr</span> <span class="o">+</span> <span class="s2">&quot;: multiple targets found!&quot;</span><span class="p">,</span> <span class="mi">17</span><span class="p">)</span>
             <span class="n">target_idx</span> <span class="o">=</span> <span class="n">i</span>
-    <span class="c"># reshuffle</span>
+    <span class="c1"># reshuffle</span>
     <span class="k">if</span> <span class="n">target_idx</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">:</span>
         <span class="n">sequences</span><span class="o">.</span><span class="n">insert</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">sequences</span><span class="p">[</span><span class="n">target_idx</span><span class="p">])</span>
         <span class="k">del</span> <span class="n">sequences</span><span class="p">[</span><span class="n">target_idx</span><span class="o">+</span><span class="mi">1</span><span class="p">]</span>
-    <span class="c"># generate alignment</span>
+    <span class="c1"># generate alignment</span>
     <span class="n">new_aln</span> <span class="o">=</span> <span class="n">seq</span><span class="o">.</span><span class="n">CreateAlignment</span><span class="p">()</span>
     <span class="k">for</span> <span class="n">s</span> <span class="ow">in</span> <span class="n">sequences</span><span class="p">:</span>
         <span class="n">new_aln</span><span class="o">.</span><span class="n">AddSequence</span><span class="p">(</span><span class="n">seq</span><span class="o">.</span><span class="n">CreateSequence</span><span class="p">(</span><span class="n">s</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">s</span><span class="p">[</span><span class="mi">1</span><span class="p">]))</span>
-    <span class="n">new_aln</span><span class="o">.</span><span class="n">SetSequenceRole</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="s">&#39;TARGET&#39;</span><span class="p">)</span>
+    <span class="n">new_aln</span><span class="o">.</span><span class="n">SetSequenceRole</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="s1">&#39;TARGET&#39;</span><span class="p">)</span>
     <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="n">new_aln</span><span class="o">.</span><span class="n">GetCount</span><span class="p">()):</span>
-        <span class="n">new_aln</span><span class="o">.</span><span class="n">SetSequenceRole</span><span class="p">(</span><span class="n">i</span><span class="p">,</span> <span class="s">&#39;TEMPLATE&#39;</span><span class="p">)</span>
+        <span class="n">new_aln</span><span class="o">.</span><span class="n">SetSequenceRole</span><span class="p">(</span><span class="n">i</span><span class="p">,</span> <span class="s1">&#39;TEMPLATE&#39;</span><span class="p">)</span>
 
     <span class="k">return</span> <span class="n">new_aln</span>
 
 <span class="k">def</span> <span class="nf">_LoadPDB</span><span class="p">(</span><span class="n">filename</span><span class="p">):</span>
     <span class="sd">&quot;&quot;&quot;Load PDB file from filename and return it.&quot;&quot;&quot;</span>
-    <span class="n">argstr</span> <span class="o">=</span> <span class="s">&quot;&#39;--pdb &quot;</span> <span class="o">+</span> <span class="n">filename</span> <span class="o">+</span> <span class="s">&quot;&#39;&quot;</span>
-    <span class="n">helper</span><span class="o">.</span><span class="n">FileExists</span><span class="p">(</span><span class="s">&quot;PDB Structure&quot;</span><span class="p">,</span> <span class="mi">32</span><span class="p">,</span> <span class="n">filename</span><span class="p">)</span>
+    <span class="n">argstr</span> <span class="o">=</span> <span class="s2">&quot;&#39;--pdb &quot;</span> <span class="o">+</span> <span class="n">filename</span> <span class="o">+</span> <span class="s2">&quot;&#39;&quot;</span>
+    <span class="n">helper</span><span class="o">.</span><span class="n">FileExists</span><span class="p">(</span><span class="s2">&quot;PDB Structure&quot;</span><span class="p">,</span> <span class="mi">32</span><span class="p">,</span> <span class="n">filename</span><span class="p">)</span>
     <span class="k">try</span><span class="p">:</span>
         <span class="n">ent</span> <span class="o">=</span> <span class="n">io</span><span class="o">.</span><span class="n">LoadPDB</span><span class="p">(</span><span class="n">filename</span><span class="p">)</span>
-    <span class="k">except</span> <span class="ne">Exception</span><span class="p">,</span> <span class="n">exc</span><span class="p">:</span> <span class="c">#pylint: disable=broad-except</span>
-        <span class="n">helper</span><span class="o">.</span><span class="n">MsgErrorAndExit</span><span class="p">(</span><span class="n">argstr</span> <span class="o">+</span> <span class="s">&quot;: failure to parse PDB file: &quot;</span> <span class="o">+</span>
+    <span class="k">except</span> <span class="ne">Exception</span><span class="p">,</span> <span class="n">exc</span><span class="p">:</span> <span class="c1">#pylint: disable=broad-except</span>
+        <span class="n">helper</span><span class="o">.</span><span class="n">MsgErrorAndExit</span><span class="p">(</span><span class="n">argstr</span> <span class="o">+</span> <span class="s2">&quot;: failure to parse PDB file: &quot;</span> <span class="o">+</span>
                                <span class="nb">str</span><span class="p">(</span><span class="n">exc</span><span class="p">),</span> <span class="mi">33</span><span class="p">)</span>
     <span class="k">return</span> <span class="n">ent</span>
 
 <span class="k">def</span> <span class="nf">_LoadEntity</span><span class="p">(</span><span class="n">filename</span><span class="p">):</span>
     <span class="sd">&quot;&quot;&quot;Load generic structure file from filename and return it.&quot;&quot;&quot;</span>
-    <span class="n">argstr</span> <span class="o">=</span> <span class="s">&quot;&#39;--entity &quot;</span> <span class="o">+</span> <span class="n">filename</span> <span class="o">+</span> <span class="s">&quot;&#39;&quot;</span>
-    <span class="n">helper</span><span class="o">.</span><span class="n">FileExists</span><span class="p">(</span><span class="s">&quot;Structure&quot;</span><span class="p">,</span> <span class="mi">32</span><span class="p">,</span> <span class="n">filename</span><span class="p">)</span>
+    <span class="n">argstr</span> <span class="o">=</span> <span class="s2">&quot;&#39;--entity &quot;</span> <span class="o">+</span> <span class="n">filename</span> <span class="o">+</span> <span class="s2">&quot;&#39;&quot;</span>
+    <span class="n">helper</span><span class="o">.</span><span class="n">FileExists</span><span class="p">(</span><span class="s2">&quot;Structure&quot;</span><span class="p">,</span> <span class="mi">32</span><span class="p">,</span> <span class="n">filename</span><span class="p">)</span>
     <span class="k">try</span><span class="p">:</span>
         <span class="n">ent</span> <span class="o">=</span> <span class="n">io</span><span class="o">.</span><span class="n">LoadEntity</span><span class="p">(</span><span class="n">filename</span><span class="p">)</span>
-    <span class="k">except</span> <span class="ne">Exception</span><span class="p">,</span> <span class="n">exc</span><span class="p">:</span> <span class="c">#pylint: disable=broad-except</span>
-        <span class="k">if</span> <span class="n">exc</span><span class="o">.</span><span class="n">message</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s">&#39;no suitable entity io handler found&#39;</span><span class="p">):</span>
-            <span class="n">helper</span><span class="o">.</span><span class="n">MsgErrorAndExit</span><span class="p">(</span><span class="n">argstr</span> <span class="o">+</span> <span class="s">&quot;: not a supported format &quot;</span> <span class="o">+</span>
+    <span class="k">except</span> <span class="ne">Exception</span><span class="p">,</span> <span class="n">exc</span><span class="p">:</span> <span class="c1">#pylint: disable=broad-except</span>
+        <span class="k">if</span> <span class="n">exc</span><span class="o">.</span><span class="n">message</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s1">&#39;no suitable entity io handler found&#39;</span><span class="p">):</span>
+            <span class="n">helper</span><span class="o">.</span><span class="n">MsgErrorAndExit</span><span class="p">(</span><span class="n">argstr</span> <span class="o">+</span> <span class="s2">&quot;: not a supported format &quot;</span> <span class="o">+</span>
                                    <span class="nb">str</span><span class="p">(</span><span class="n">exc</span><span class="p">),</span> <span class="mi">34</span><span class="p">)</span>
         <span class="k">else</span><span class="p">:</span>
-            <span class="n">helper</span><span class="o">.</span><span class="n">MsgErrorAndExit</span><span class="p">(</span><span class="n">argstr</span> <span class="o">+</span> <span class="s">&quot;: failure to parse PDB file: &quot;</span> <span class="o">+</span>
+            <span class="n">helper</span><span class="o">.</span><span class="n">MsgErrorAndExit</span><span class="p">(</span><span class="n">argstr</span> <span class="o">+</span> <span class="s2">&quot;: failure to parse PDB file: &quot;</span> <span class="o">+</span>
                                    <span class="nb">str</span><span class="p">(</span><span class="n">exc</span><span class="p">),</span> <span class="mi">33</span><span class="p">)</span>
     <span class="k">return</span> <span class="n">ent</span>
 
 <span class="k">def</span> <span class="nf">_GetChains</span><span class="p">(</span><span class="n">structures</span><span class="p">,</span> <span class="n">structure_sources</span><span class="p">):</span>
     <span class="sd">&quot;&quot;&quot;Get chain id to entity view (single chain) mapping (dict).&quot;&quot;&quot;</span>
-    <span class="c"># IDs: (file_base = base file name with no extensions)</span>
-    <span class="c"># - file_base.chain_name</span>
-    <span class="c"># - file_base (iff only one chain in file)</span>
-    <span class="c"># - chain_name (iff only one file)</span>
-    <span class="c"># - note: single entry with key &#39;UNIQUE&#39; created if only one chain in total!</span>
+    <span class="c1"># IDs: (file_base = base file name with no extensions)</span>
+    <span class="c1"># - file_base.chain_name</span>
+    <span class="c1"># - file_base (iff only one chain in file)</span>
+    <span class="c1"># - chain_name (iff only one file)</span>
+    <span class="c1"># - note: single entry with key &#39;UNIQUE&#39; created if only one chain in total!</span>
     <span class="n">chain_entities</span> <span class="o">=</span> <span class="nb">dict</span><span class="p">()</span>
     <span class="n">single_file</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="n">structure_sources</span><span class="p">)</span> <span class="o">==</span> <span class="mi">1</span>
-    <span class="c"># parse structures</span>
+    <span class="c1"># parse structures</span>
     <span class="k">for</span> <span class="n">file_name</span><span class="p">,</span> <span class="n">ent</span> <span class="ow">in</span> <span class="nb">zip</span><span class="p">(</span><span class="n">structure_sources</span><span class="p">,</span> <span class="n">structures</span><span class="p">):</span>
-        <span class="c"># get pure file name with no extension</span>
+        <span class="c1"># get pure file name with no extension</span>
         <span class="n">file_base</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">basename</span><span class="p">(</span><span class="n">file_name</span><span class="p">)</span>
         <span class="n">file_split</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">splitext</span><span class="p">(</span><span class="n">file_base</span><span class="p">)</span>
-        <span class="k">if</span> <span class="n">file_split</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="o">==</span> <span class="s">&#39;.gz&#39;</span><span class="p">:</span>
+        <span class="k">if</span> <span class="n">file_split</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="o">==</span> <span class="s1">&#39;.gz&#39;</span><span class="p">:</span>
             <span class="n">file_base</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">splitext</span><span class="p">(</span><span class="n">file_split</span><span class="p">[</span><span class="mi">0</span><span class="p">])[</span><span class="mi">0</span><span class="p">]</span>
         <span class="k">else</span><span class="p">:</span>
             <span class="n">file_base</span> <span class="o">=</span> <span class="n">file_split</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
-        <span class="c"># get chainnames</span>
-        <span class="n">prot</span> <span class="o">=</span> <span class="n">ent</span><span class="o">.</span><span class="n">Select</span><span class="p">(</span><span class="s">&quot;peptide=True&quot;</span><span class="p">)</span>
+        <span class="c1"># get chainnames</span>
+        <span class="n">prot</span> <span class="o">=</span> <span class="n">ent</span><span class="o">.</span><span class="n">Select</span><span class="p">(</span><span class="s2">&quot;peptide=True&quot;</span><span class="p">)</span>
         <span class="n">single_chain</span> <span class="o">=</span> <span class="n">prot</span><span class="o">.</span><span class="n">chain_count</span> <span class="o">==</span> <span class="mi">1</span>
         <span class="n">chain_names</span> <span class="o">=</span> <span class="p">[</span><span class="n">ch</span><span class="o">.</span><span class="n">name</span> <span class="k">for</span> <span class="n">ch</span> <span class="ow">in</span> <span class="n">prot</span><span class="o">.</span><span class="n">chains</span><span class="p">]</span>
-        <span class="c"># fill dict</span>
+        <span class="c1"># fill dict</span>
         <span class="k">if</span> <span class="n">single_file</span> <span class="ow">and</span> <span class="n">single_chain</span><span class="p">:</span>
-            <span class="n">chain_entities</span><span class="p">[</span><span class="s">&#39;UNIQUE&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">prot</span>
+            <span class="n">chain_entities</span><span class="p">[</span><span class="s1">&#39;UNIQUE&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">prot</span>
         <span class="k">elif</span> <span class="n">single_chain</span><span class="p">:</span>
-            <span class="n">chain_entities</span><span class="p">[</span><span class="n">file_base</span> <span class="o">+</span> <span class="s">&#39;.&#39;</span> <span class="o">+</span> <span class="n">chain_names</span><span class="p">[</span><span class="mi">0</span><span class="p">]]</span> <span class="o">=</span> <span class="n">prot</span>
+            <span class="n">chain_entities</span><span class="p">[</span><span class="n">file_base</span> <span class="o">+</span> <span class="s1">&#39;.&#39;</span> <span class="o">+</span> <span class="n">chain_names</span><span class="p">[</span><span class="mi">0</span><span class="p">]]</span> <span class="o">=</span> <span class="n">prot</span>
             <span class="n">chain_entities</span><span class="p">[</span><span class="n">file_base</span><span class="p">]</span> <span class="o">=</span> <span class="n">prot</span>
         <span class="k">else</span><span class="p">:</span>
             <span class="k">for</span> <span class="n">chain_name</span> <span class="ow">in</span> <span class="n">chain_names</span><span class="p">:</span>
-                <span class="n">ch_ent</span> <span class="o">=</span> <span class="n">prot</span><span class="o">.</span><span class="n">Select</span><span class="p">(</span><span class="s">&quot;cname=&quot;</span> <span class="o">+</span> <span class="n">chain_name</span><span class="p">)</span>
-                <span class="n">chain_entities</span><span class="p">[</span><span class="n">file_base</span> <span class="o">+</span> <span class="s">&#39;.&#39;</span> <span class="o">+</span> <span class="n">chain_name</span><span class="p">]</span> <span class="o">=</span> <span class="n">ch_ent</span>
+                <span class="n">ch_ent</span> <span class="o">=</span> <span class="n">prot</span><span class="o">.</span><span class="n">Select</span><span class="p">(</span><span class="s2">&quot;cname=&quot;</span> <span class="o">+</span> <span class="n">chain_name</span><span class="p">)</span>
+                <span class="n">chain_entities</span><span class="p">[</span><span class="n">file_base</span> <span class="o">+</span> <span class="s1">&#39;.&#39;</span> <span class="o">+</span> <span class="n">chain_name</span><span class="p">]</span> <span class="o">=</span> <span class="n">ch_ent</span>
                 <span class="k">if</span> <span class="n">single_file</span><span class="p">:</span>
                     <span class="n">chain_entities</span><span class="p">[</span><span class="n">chain_name</span><span class="p">]</span> <span class="o">=</span> <span class="n">ch_ent</span>
     <span class="k">return</span> <span class="n">chain_entities</span>
@@ -312,34 +314,34 @@
     <span class="sd">&quot;&quot;&quot;Attach views to tpl. sequences in aln according to sequence names.&quot;&quot;&quot;</span>
     <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="n">aln</span><span class="o">.</span><span class="n">GetCount</span><span class="p">()):</span>
         <span class="n">seq_name</span> <span class="o">=</span> <span class="n">aln</span><span class="o">.</span><span class="n">GetSequence</span><span class="p">(</span><span class="n">i</span><span class="p">)</span><span class="o">.</span><span class="n">GetName</span><span class="p">()</span>
-        <span class="c"># extract offset</span>
-        <span class="n">my_split</span> <span class="o">=</span> <span class="n">seq_name</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s">&#39;|&#39;</span><span class="p">)</span>
+        <span class="c1"># extract offset</span>
+        <span class="n">my_split</span> <span class="o">=</span> <span class="n">seq_name</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s1">&#39;|&#39;</span><span class="p">)</span>
         <span class="n">tpl_id</span> <span class="o">=</span> <span class="n">my_split</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span>
         <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">my_split</span><span class="p">)</span> <span class="o">==</span> <span class="mi">2</span> <span class="ow">and</span> <span class="n">my_split</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span><span class="o">.</span><span class="n">isdigit</span><span class="p">():</span>
-            <span class="c"># set offset</span>
+            <span class="c1"># set offset</span>
             <span class="n">tpl_offset</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">my_split</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">strip</span><span class="p">())</span>
-            <span class="c"># mismatch with existing one?</span>
+            <span class="c1"># mismatch with existing one?</span>
             <span class="n">old_offset</span> <span class="o">=</span> <span class="n">aln</span><span class="o">.</span><span class="n">GetSequenceOffset</span><span class="p">(</span><span class="n">i</span><span class="p">)</span>
             <span class="k">if</span> <span class="n">old_offset</span> <span class="o">&gt;</span> <span class="mi">0</span> <span class="ow">and</span> <span class="n">old_offset</span> <span class="o">!=</span> <span class="n">tpl_offset</span><span class="p">:</span>
-                <span class="n">helper</span><span class="o">.</span><span class="n">MsgErrorAndExit</span><span class="p">(</span><span class="s">&quot;Inconsistent offsets between seq. name&quot;</span><span class="o">+</span>
-                                       <span class="s">&quot; and seq. in alignment for &quot;</span> <span class="o">+</span> <span class="n">seq_name</span><span class="p">,</span>
+                <span class="n">helper</span><span class="o">.</span><span class="n">MsgErrorAndExit</span><span class="p">(</span><span class="s2">&quot;Inconsistent offsets between seq. name&quot;</span><span class="o">+</span>
+                                       <span class="s2">&quot; and seq. in alignment for &quot;</span> <span class="o">+</span> <span class="n">seq_name</span><span class="p">,</span>
                                        <span class="mi">42</span><span class="p">)</span>
             <span class="k">else</span><span class="p">:</span>
                 <span class="n">aln</span><span class="o">.</span><span class="n">SetSequenceOffset</span><span class="p">(</span><span class="n">i</span><span class="p">,</span> <span class="n">tpl_offset</span><span class="p">)</span>
         <span class="k">elif</span> <span class="nb">len</span><span class="p">(</span><span class="n">my_split</span><span class="p">)</span> <span class="o">==</span> <span class="mi">2</span> <span class="ow">and</span> <span class="ow">not</span> <span class="n">my_split</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span><span class="o">.</span><span class="n">isdigit</span><span class="p">():</span>
-            <span class="n">helper</span><span class="o">.</span><span class="n">MsgErrorAndExit</span><span class="p">(</span><span class="s">&quot;Non-integer offset defined in seq. name &quot;</span><span class="o">+</span>
+            <span class="n">helper</span><span class="o">.</span><span class="n">MsgErrorAndExit</span><span class="p">(</span><span class="s2">&quot;Non-integer offset defined in seq. name &quot;</span><span class="o">+</span>
                                    <span class="n">seq_name</span><span class="p">,</span> <span class="mi">43</span><span class="p">)</span>
         <span class="k">elif</span> <span class="nb">len</span><span class="p">(</span><span class="n">my_split</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">2</span><span class="p">:</span>
-            <span class="n">helper</span><span class="o">.</span><span class="n">MsgErrorAndExit</span><span class="p">(</span><span class="s">&quot;Too many &#39;|&#39; in seq. name &quot;</span> <span class="o">+</span> <span class="n">seq_name</span><span class="p">,</span> <span class="mi">44</span><span class="p">)</span>
-        <span class="c"># identify chain and attach view</span>
+            <span class="n">helper</span><span class="o">.</span><span class="n">MsgErrorAndExit</span><span class="p">(</span><span class="s2">&quot;Too many &#39;|&#39; in seq. name &quot;</span> <span class="o">+</span> <span class="n">seq_name</span><span class="p">,</span> <span class="mi">44</span><span class="p">)</span>
+        <span class="c1"># identify chain and attach view</span>
         <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">chain_entities</span><span class="p">)</span> <span class="o">==</span> <span class="mi">1</span><span class="p">:</span>
-            <span class="n">aln</span><span class="o">.</span><span class="n">AttachView</span><span class="p">(</span><span class="n">i</span><span class="p">,</span> <span class="n">chain_entities</span><span class="p">[</span><span class="s">&#39;UNIQUE&#39;</span><span class="p">]</span><span class="o">.</span><span class="n">CreateFullView</span><span class="p">())</span>
+            <span class="n">aln</span><span class="o">.</span><span class="n">AttachView</span><span class="p">(</span><span class="n">i</span><span class="p">,</span> <span class="n">chain_entities</span><span class="p">[</span><span class="s1">&#39;UNIQUE&#39;</span><span class="p">]</span><span class="o">.</span><span class="n">CreateFullView</span><span class="p">())</span>
         <span class="k">elif</span> <span class="n">chain_entities</span><span class="o">.</span><span class="n">has_key</span><span class="p">(</span><span class="n">tpl_id</span><span class="p">):</span>
             <span class="n">aln</span><span class="o">.</span><span class="n">AttachView</span><span class="p">(</span><span class="n">i</span><span class="p">,</span> <span class="n">chain_entities</span><span class="p">[</span><span class="n">tpl_id</span><span class="p">]</span><span class="o">.</span><span class="n">CreateFullView</span><span class="p">())</span>
         <span class="k">else</span><span class="p">:</span>
-            <span class="n">helper</span><span class="o">.</span><span class="n">MsgErrorAndExit</span><span class="p">(</span><span class="s">&quot;Could not find chain with ID &quot;</span> <span class="o">+</span> <span class="n">tpl_id</span> <span class="o">+</span>
-                                   <span class="s">&quot; (should be &lt;FILE&gt;.&lt;CHAIN&gt;) to attach to&quot;</span><span class="o">+</span>
-                                   <span class="s">&quot; sequence named &quot;</span> <span class="o">+</span> <span class="n">seq_name</span><span class="p">,</span> <span class="mi">45</span><span class="p">)</span>
+            <span class="n">helper</span><span class="o">.</span><span class="n">MsgErrorAndExit</span><span class="p">(</span><span class="s2">&quot;Could not find chain with ID &quot;</span> <span class="o">+</span> <span class="n">tpl_id</span> <span class="o">+</span>
+                                   <span class="s2">&quot; (should be &lt;FILE&gt;.&lt;CHAIN&gt;) to attach to&quot;</span><span class="o">+</span>
+                                   <span class="s2">&quot; sequence named &quot;</span> <span class="o">+</span> <span class="n">seq_name</span><span class="p">,</span> <span class="mi">45</span><span class="p">)</span>
 
 <div class="viewcode-block" id="PM3ArgumentParser"><a class="viewcode-back" href="../../../core/pm3argparse.html#promod3.core.pm3argparse.PM3ArgumentParser">[docs]</a><span class="k">class</span> <span class="nc">PM3ArgumentParser</span><span class="p">(</span><span class="n">argparse</span><span class="o">.</span><span class="n">ArgumentParser</span><span class="p">):</span>
     <span class="sd">&quot;&quot;&quot;</span>
@@ -385,10 +387,10 @@
                                          <span class="n">formatter_class</span><span class="o">=</span>\
                                          <span class="n">argparse</span><span class="o">.</span><span class="n">RawDescriptionHelpFormatter</span><span class="p">)</span>
         <span class="bp">self</span><span class="o">.</span><span class="n">action</span> <span class="o">=</span> <span class="n">action</span>
-        <span class="bp">self</span><span class="o">.</span><span class="n">activate</span> <span class="o">=</span> <span class="nb">set</span><span class="p">()</span>
-</div>
+        <span class="bp">self</span><span class="o">.</span><span class="n">activate</span> <span class="o">=</span> <span class="nb">set</span><span class="p">()</span></div>
+
     <span class="k">def</span> <span class="nf">_print_message</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">message</span><span class="p">,</span> <span class="nb">file</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
-        <span class="c">#pylint: disable=redefined-builtin</span>
+        <span class="c1">#pylint: disable=redefined-builtin</span>
         <span class="sd">&quot;&quot;&quot;</span>
 <span class="sd">        This is like a welcome message to the &quot;country of bad style&quot;... we are</span>
 <span class="sd">        overwriting a &quot;_&quot; function from the parent-class. Those guys should not</span>
@@ -397,7 +399,7 @@
 <span class="sd">        &quot;&quot;&quot;</span>
         <span class="k">if</span> <span class="n">message</span><span class="p">:</span>
             <span class="n">no_nl_msg</span> <span class="o">=</span> <span class="n">message</span>
-            <span class="k">if</span> <span class="n">message</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span> <span class="o">==</span> <span class="s">&#39;</span><span class="se">\n</span><span class="s">&#39;</span><span class="p">:</span>
+            <span class="k">if</span> <span class="n">message</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span> <span class="o">==</span> <span class="s1">&#39;</span><span class="se">\n</span><span class="s1">&#39;</span><span class="p">:</span>
                 <span class="n">no_nl_msg</span> <span class="o">=</span> <span class="n">message</span><span class="p">[:</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span>
             <span class="k">if</span> <span class="nb">file</span> <span class="ow">is</span> <span class="bp">None</span> <span class="ow">or</span> <span class="nb">file</span> <span class="ow">is</span> <span class="n">sys</span><span class="o">.</span><span class="n">stderr</span><span class="p">:</span>
                 <span class="n">ost</span><span class="o">.</span><span class="n">LogError</span><span class="p">(</span><span class="n">no_nl_msg</span><span class="p">)</span>
@@ -424,8 +426,8 @@
         <span class="bp">self</span><span class="o">.</span><span class="n">parse_args</span><span class="p">(</span><span class="n">args</span><span class="o">=</span><span class="n">args</span><span class="p">,</span> <span class="n">namespace</span><span class="o">=</span><span class="n">opts</span><span class="p">)</span>
 
         <span class="n">opts</span><span class="o">.</span><span class="n">PostProcess</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">activate</span><span class="p">)</span>
-        <span class="k">return</span> <span class="n">opts</span>
-</div>
+        <span class="k">return</span> <span class="n">opts</span></div>
+
 <div class="viewcode-block" id="PM3ArgumentParser.AssembleParser"><a class="viewcode-back" href="../../../core/pm3argparse.html#promod3.core.pm3argparse.PM3ArgumentParser.AssembleParser">[docs]</a>    <span class="k">def</span> <span class="nf">AssembleParser</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
         <span class="sd">&quot;&quot;&quot;</span>
 <span class="sd">        When adding options via the :meth:`Add*` methods, call this after you</span>
@@ -434,11 +436,11 @@
 <span class="sd">        :meth:`AssembleParser` will put everything in place, in the right order</span>
 <span class="sd">        and with the right constraints.</span>
 <span class="sd">        &quot;&quot;&quot;</span>
-        <span class="k">if</span> <span class="s">&#39;ALIGNMENT&#39;</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">activate</span><span class="p">:</span>
+        <span class="k">if</span> <span class="s1">&#39;ALIGNMENT&#39;</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">activate</span><span class="p">:</span>
             <span class="bp">self</span><span class="o">.</span><span class="n">_AssembleAlignment</span><span class="p">()</span>
-        <span class="k">if</span> <span class="s">&#39;STRUCTURE&#39;</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">activate</span><span class="p">:</span>
-            <span class="bp">self</span><span class="o">.</span><span class="n">_AssembleStructure</span><span class="p">()</span>
-</div>
+        <span class="k">if</span> <span class="s1">&#39;STRUCTURE&#39;</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">activate</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">_AssembleStructure</span><span class="p">()</span></div>
+
 <div class="viewcode-block" id="PM3ArgumentParser.AddAlignment"><a class="viewcode-back" href="../../../core/pm3argparse.html#promod3.core.pm3argparse.PM3ArgumentParser.AddAlignment">[docs]</a>    <span class="k">def</span> <span class="nf">AddAlignment</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">allow_multitemplate</span><span class="o">=</span><span class="bp">False</span><span class="p">):</span>
         <span class="sd">&quot;&quot;&quot;Commandline options for alignments.</span>
 
@@ -507,10 +509,10 @@
 <span class="sd">        * 28 - JSON  object &#39;alignmentlist&#39; &#39;target&#39;/&#39;template&#39; has a value of</span>
 <span class="sd">          wrong type</span>
 <span class="sd">        &quot;&quot;&quot;</span>
-        <span class="bp">self</span><span class="o">.</span><span class="n">activate</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="s">&#39;ALIGNMENT&#39;</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">activate</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="s1">&#39;ALIGNMENT&#39;</span><span class="p">)</span>
         <span class="k">if</span> <span class="n">allow_multitemplate</span><span class="p">:</span>
-            <span class="bp">self</span><span class="o">.</span><span class="n">activate</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="s">&#39;ALLOW_MULTITEMPLATE&#39;</span><span class="p">)</span>
-</div>
+            <span class="bp">self</span><span class="o">.</span><span class="n">activate</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="s1">&#39;ALLOW_MULTITEMPLATE&#39;</span><span class="p">)</span></div>
+
 <div class="viewcode-block" id="PM3ArgumentParser.AddStructure"><a class="viewcode-back" href="../../../core/pm3argparse.html#promod3.core.pm3argparse.PM3ArgumentParser.AddStructure">[docs]</a>    <span class="k">def</span> <span class="nf">AddStructure</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">attach_views</span><span class="o">=</span><span class="bp">False</span><span class="p">):</span>
         <span class="sd">&quot;&quot;&quot;Commandline options for structures.</span>
 
@@ -568,52 +570,52 @@
 <span class="sd">        * 44 - too many &quot;|&quot; in seq. name</span>
 <span class="sd">        * 45 - chain to attach to sequence could not be identified</span>
 <span class="sd">        &quot;&quot;&quot;</span>
-        <span class="bp">self</span><span class="o">.</span><span class="n">activate</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="s">&#39;STRUCTURE&#39;</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">activate</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="s1">&#39;STRUCTURE&#39;</span><span class="p">)</span>
         <span class="k">if</span> <span class="n">attach_views</span><span class="p">:</span>
-            <span class="bp">self</span><span class="o">.</span><span class="n">activate</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="s">&#39;ATTACH_VIEWS&#39;</span><span class="p">)</span>
-</div>
+            <span class="bp">self</span><span class="o">.</span><span class="n">activate</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="s1">&#39;ATTACH_VIEWS&#39;</span><span class="p">)</span></div>
+
     <span class="k">def</span> <span class="nf">_AssembleAlignment</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
         <span class="sd">&quot;&quot;&quot;Actually add alignment arguments/options.&quot;&quot;&quot;</span>
         <span class="n">aln_grp</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">add_mutually_exclusive_group</span><span class="p">(</span><span class="n">required</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>
-        <span class="c"># fasta input</span>
-        <span class="n">aln_grp</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">&#39;-f&#39;</span><span class="p">,</span> <span class="s">&#39;--fasta&#39;</span><span class="p">,</span> <span class="n">metavar</span><span class="o">=</span><span class="p">(</span><span class="s">&#39;&lt;FILE&gt;&#39;</span><span class="p">),</span>
-                             <span class="n">help</span><span class="o">=</span><span class="s">&#39;Target-template alignment in FASTA format. &#39;</span><span class="o">+</span>
-                             <span class="s">&#39;Target sequence is either named &quot;trg&quot; or &#39;</span><span class="o">+</span>
-                             <span class="s">&#39;&quot;target&quot; or the first sequence is used. &#39;</span><span class="o">+</span>
-                             <span class="s">&#39;File can be plain or gzipped.&#39;</span><span class="p">,</span>
-                             <span class="n">action</span><span class="o">=</span><span class="s">&#39;append&#39;</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="nb">list</span><span class="p">())</span>
-        <span class="c"># clustal input</span>
-        <span class="n">aln_grp</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">&#39;-c&#39;</span><span class="p">,</span> <span class="s">&#39;--clustal&#39;</span><span class="p">,</span> <span class="n">metavar</span><span class="o">=</span><span class="p">(</span><span class="s">&#39;&lt;FILE&gt;&#39;</span><span class="p">),</span>
-                             <span class="n">help</span><span class="o">=</span><span class="s">&#39;Target-template alignment in CLUSTAL format. &#39;</span><span class="o">+</span>
-                             <span class="s">&#39;Target sequence is either named &quot;trg&quot; or &#39;</span><span class="o">+</span>
-                             <span class="s">&#39;&quot;target&quot; or the first sequence is used. &#39;</span><span class="o">+</span>
-                             <span class="s">&#39;File can be plain or gzipped.&#39;</span><span class="p">,</span>
-                             <span class="n">action</span><span class="o">=</span><span class="s">&#39;append&#39;</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="nb">list</span><span class="p">())</span>
-        <span class="c"># JSON input</span>
-        <span class="n">aln_grp</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">&#39;-j&#39;</span><span class="p">,</span> <span class="s">&#39;--json&#39;</span><span class="p">,</span> <span class="n">metavar</span><span class="o">=</span><span class="s">&#39;&lt;OBJECT&gt;|&lt;FILE&gt;&#39;</span><span class="p">,</span>
-                             <span class="n">help</span><span class="o">=</span><span class="s">&#39;Alignments provided as JSON file/object. &#39;</span><span class="o">+</span>
-                             <span class="s">&#39;File can be plain or gzipped.&#39;</span><span class="p">,</span>
-                             <span class="n">action</span><span class="o">=</span><span class="s">&#39;append&#39;</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="nb">list</span><span class="p">())</span>
+        <span class="c1"># fasta input</span>
+        <span class="n">aln_grp</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s1">&#39;-f&#39;</span><span class="p">,</span> <span class="s1">&#39;--fasta&#39;</span><span class="p">,</span> <span class="n">metavar</span><span class="o">=</span><span class="p">(</span><span class="s1">&#39;&lt;FILE&gt;&#39;</span><span class="p">),</span>
+                             <span class="n">help</span><span class="o">=</span><span class="s1">&#39;Target-template alignment in FASTA format. &#39;</span><span class="o">+</span>
+                             <span class="s1">&#39;Target sequence is either named &quot;trg&quot; or &#39;</span><span class="o">+</span>
+                             <span class="s1">&#39;&quot;target&quot; or the first sequence is used. &#39;</span><span class="o">+</span>
+                             <span class="s1">&#39;File can be plain or gzipped.&#39;</span><span class="p">,</span>
+                             <span class="n">action</span><span class="o">=</span><span class="s1">&#39;append&#39;</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="nb">list</span><span class="p">())</span>
+        <span class="c1"># clustal input</span>
+        <span class="n">aln_grp</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s1">&#39;-c&#39;</span><span class="p">,</span> <span class="s1">&#39;--clustal&#39;</span><span class="p">,</span> <span class="n">metavar</span><span class="o">=</span><span class="p">(</span><span class="s1">&#39;&lt;FILE&gt;&#39;</span><span class="p">),</span>
+                             <span class="n">help</span><span class="o">=</span><span class="s1">&#39;Target-template alignment in CLUSTAL format. &#39;</span><span class="o">+</span>
+                             <span class="s1">&#39;Target sequence is either named &quot;trg&quot; or &#39;</span><span class="o">+</span>
+                             <span class="s1">&#39;&quot;target&quot; or the first sequence is used. &#39;</span><span class="o">+</span>
+                             <span class="s1">&#39;File can be plain or gzipped.&#39;</span><span class="p">,</span>
+                             <span class="n">action</span><span class="o">=</span><span class="s1">&#39;append&#39;</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="nb">list</span><span class="p">())</span>
+        <span class="c1"># JSON input</span>
+        <span class="n">aln_grp</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s1">&#39;-j&#39;</span><span class="p">,</span> <span class="s1">&#39;--json&#39;</span><span class="p">,</span> <span class="n">metavar</span><span class="o">=</span><span class="s1">&#39;&lt;OBJECT&gt;|&lt;FILE&gt;&#39;</span><span class="p">,</span>
+                             <span class="n">help</span><span class="o">=</span><span class="s1">&#39;Alignments provided as JSON file/object. &#39;</span><span class="o">+</span>
+                             <span class="s1">&#39;File can be plain or gzipped.&#39;</span><span class="p">,</span>
+                             <span class="n">action</span><span class="o">=</span><span class="s1">&#39;append&#39;</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="nb">list</span><span class="p">())</span>
 
     <span class="k">def</span> <span class="nf">_AssembleStructure</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
         <span class="sd">&quot;&quot;&quot;Actually add structure arguments/options.&quot;&quot;&quot;</span>
         <span class="n">aln_grp</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">add_mutually_exclusive_group</span><span class="p">(</span><span class="n">required</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>
-        <span class="c"># pdb input</span>
-        <span class="n">aln_grp</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">&#39;-p&#39;</span><span class="p">,</span> <span class="s">&#39;--pdb&#39;</span><span class="p">,</span> <span class="n">metavar</span><span class="o">=</span><span class="p">(</span><span class="s">&#39;&lt;FILE&gt;&#39;</span><span class="p">),</span>
-                             <span class="n">help</span><span class="o">=</span><span class="s">&#39;Structure in PDB format. &#39;</span><span class="o">+</span>
-                             <span class="s">&#39;File can be plain or gzipped.&#39;</span><span class="p">,</span>
-                             <span class="n">action</span><span class="o">=</span><span class="s">&#39;append&#39;</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="nb">list</span><span class="p">())</span>
-        <span class="c"># any OST entity</span>
-        <span class="n">aln_grp</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">&#39;-e&#39;</span><span class="p">,</span> <span class="s">&#39;--entity&#39;</span><span class="p">,</span> <span class="n">metavar</span><span class="o">=</span><span class="p">(</span><span class="s">&#39;&lt;FILE&gt;&#39;</span><span class="p">),</span>
-                             <span class="n">help</span><span class="o">=</span><span class="s">&quot;Structure in any format readable by OST&#39;s &quot;</span><span class="o">+</span>
-                             <span class="s">&quot;io.LoadEntity method. Format is chosen by file &quot;</span><span class="o">+</span>
-                             <span class="s">&quot;ending. Recognized File Extensions: .ent, .pdb, &quot;</span><span class="o">+</span>
-                             <span class="s">&quot;.ent.gz, .pdb.gz, .cif, .cif.gz.&quot;</span><span class="p">,</span>
-                             <span class="n">action</span><span class="o">=</span><span class="s">&#39;append&#39;</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="nb">list</span><span class="p">())</span>
-</div>
+        <span class="c1"># pdb input</span>
+        <span class="n">aln_grp</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s1">&#39;-p&#39;</span><span class="p">,</span> <span class="s1">&#39;--pdb&#39;</span><span class="p">,</span> <span class="n">metavar</span><span class="o">=</span><span class="p">(</span><span class="s1">&#39;&lt;FILE&gt;&#39;</span><span class="p">),</span>
+                             <span class="n">help</span><span class="o">=</span><span class="s1">&#39;Structure in PDB format. &#39;</span><span class="o">+</span>
+                             <span class="s1">&#39;File can be plain or gzipped.&#39;</span><span class="p">,</span>
+                             <span class="n">action</span><span class="o">=</span><span class="s1">&#39;append&#39;</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="nb">list</span><span class="p">())</span>
+        <span class="c1"># any OST entity</span>
+        <span class="n">aln_grp</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s1">&#39;-e&#39;</span><span class="p">,</span> <span class="s1">&#39;--entity&#39;</span><span class="p">,</span> <span class="n">metavar</span><span class="o">=</span><span class="p">(</span><span class="s1">&#39;&lt;FILE&gt;&#39;</span><span class="p">),</span>
+                             <span class="n">help</span><span class="o">=</span><span class="s2">&quot;Structure in any format readable by OST&#39;s &quot;</span><span class="o">+</span>
+                             <span class="s2">&quot;io.LoadEntity method. Format is chosen by file &quot;</span><span class="o">+</span>
+                             <span class="s2">&quot;ending. Recognized File Extensions: .ent, .pdb, &quot;</span><span class="o">+</span>
+                             <span class="s2">&quot;.ent.gz, .pdb.gz, .cif, .cif.gz.&quot;</span><span class="p">,</span>
+                             <span class="n">action</span><span class="o">=</span><span class="s1">&#39;append&#39;</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="nb">list</span><span class="p">())</span></div>
+
 <span class="k">class</span> <span class="nc">PM3OptionsNamespace</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
-    <span class="c"># class will grow, so for the moment pylint is ignored</span>
-    <span class="c">#pylint: disable=too-few-public-methods</span>
+    <span class="c1"># class will grow, so for the moment pylint is ignored</span>
+    <span class="c1">#pylint: disable=too-few-public-methods</span>
     <span class="sd">&quot;&quot;&quot;Output of :meth:`PM3ArgumentParser.Parse`.</span>
 
 <span class="sd">    Like output of :meth:`argparse.ArgumentParser.parse_args` with additional</span>
@@ -624,31 +626,31 @@
 
     <span class="k">def</span> <span class="nf">PostProcess</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">activated</span><span class="p">):</span>
         <span class="sd">&quot;&quot;&quot;Post processing of activated option packs.&quot;&quot;&quot;</span>
-        <span class="bp">self</span><span class="o">.</span><span class="n">allow_multitemplate</span> <span class="o">=</span> <span class="s">&#39;ALLOW_MULTITEMPLATE&#39;</span> <span class="ow">in</span> <span class="n">activated</span>
-        <span class="k">if</span> <span class="s">&#39;ALIGNMENT&#39;</span> <span class="ow">in</span> <span class="n">activated</span><span class="p">:</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">allow_multitemplate</span> <span class="o">=</span> <span class="s1">&#39;ALLOW_MULTITEMPLATE&#39;</span> <span class="ow">in</span> <span class="n">activated</span>
+        <span class="k">if</span> <span class="s1">&#39;ALIGNMENT&#39;</span> <span class="ow">in</span> <span class="n">activated</span><span class="p">:</span>
             <span class="bp">self</span><span class="o">.</span><span class="n">_PostProcessAlignment</span><span class="p">()</span>
-        <span class="k">if</span> <span class="s">&#39;STRUCTURE&#39;</span> <span class="ow">in</span> <span class="n">activated</span><span class="p">:</span>
+        <span class="k">if</span> <span class="s1">&#39;STRUCTURE&#39;</span> <span class="ow">in</span> <span class="n">activated</span><span class="p">:</span>
             <span class="bp">self</span><span class="o">.</span><span class="n">_PostProcessStructure</span><span class="p">()</span>
-        <span class="k">if</span> <span class="s">&#39;ATTACH_VIEWS&#39;</span> <span class="ow">in</span> <span class="n">activated</span><span class="p">:</span>
+        <span class="k">if</span> <span class="s1">&#39;ATTACH_VIEWS&#39;</span> <span class="ow">in</span> <span class="n">activated</span><span class="p">:</span>
             <span class="bp">self</span><span class="o">.</span><span class="n">_AttachViews</span><span class="p">()</span>
 
     <span class="k">def</span> <span class="nf">_PostProcessAlignment</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
-        <span class="c">#pylint: disable=no-member</span>
-        <span class="c">#pylint: disable=attribute-defined-outside-init</span>
+        <span class="c1">#pylint: disable=no-member</span>
+        <span class="c1">#pylint: disable=attribute-defined-outside-init</span>
         <span class="sd">&quot;&quot;&quot;Get alignments from command line input.&quot;&quot;&quot;</span>
         <span class="bp">self</span><span class="o">.</span><span class="n">aln_sources</span> <span class="o">=</span> <span class="nb">list</span><span class="p">()</span>
         <span class="bp">self</span><span class="o">.</span><span class="n">alignments</span> <span class="o">=</span> <span class="n">seq</span><span class="o">.</span><span class="n">AlignmentList</span><span class="p">()</span>
-        <span class="c"># parse fasta files</span>
+        <span class="c1"># parse fasta files</span>
         <span class="k">for</span> <span class="n">src</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">fasta</span><span class="p">:</span>
-            <span class="n">new_aln</span> <span class="o">=</span> <span class="n">_FetchAlnFromFile</span><span class="p">(</span><span class="n">src</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">allow_multitemplate</span><span class="p">,</span> <span class="s">&quot;fasta&quot;</span><span class="p">)</span>
+            <span class="n">new_aln</span> <span class="o">=</span> <span class="n">_FetchAlnFromFile</span><span class="p">(</span><span class="n">src</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">allow_multitemplate</span><span class="p">,</span> <span class="s2">&quot;fasta&quot;</span><span class="p">)</span>
             <span class="bp">self</span><span class="o">.</span><span class="n">alignments</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">new_aln</span><span class="p">)</span>
             <span class="bp">self</span><span class="o">.</span><span class="n">aln_sources</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">src</span><span class="p">)</span>
-        <span class="c"># parse clustal files</span>
+        <span class="c1"># parse clustal files</span>
         <span class="k">for</span> <span class="n">src</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">clustal</span><span class="p">:</span>
-            <span class="n">new_aln</span> <span class="o">=</span> <span class="n">_FetchAlnFromFile</span><span class="p">(</span><span class="n">src</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">allow_multitemplate</span><span class="p">,</span> <span class="s">&quot;clustal&quot;</span><span class="p">)</span>
+            <span class="n">new_aln</span> <span class="o">=</span> <span class="n">_FetchAlnFromFile</span><span class="p">(</span><span class="n">src</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">allow_multitemplate</span><span class="p">,</span> <span class="s2">&quot;clustal&quot;</span><span class="p">)</span>
             <span class="bp">self</span><span class="o">.</span><span class="n">alignments</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">new_aln</span><span class="p">)</span>
             <span class="bp">self</span><span class="o">.</span><span class="n">aln_sources</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">src</span><span class="p">)</span>
-        <span class="c"># parse JSON input</span>
+        <span class="c1"># parse JSON input</span>
         <span class="k">for</span> <span class="n">src</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">json</span><span class="p">:</span>
             <span class="n">json_obj</span> <span class="o">=</span> <span class="n">_GetJSONOBject</span><span class="p">(</span><span class="n">src</span><span class="p">)</span>
             <span class="k">for</span> <span class="n">aln</span> <span class="ow">in</span> <span class="n">_GetAlnFromJSON</span><span class="p">(</span><span class="n">json_obj</span><span class="p">,</span> <span class="n">src</span><span class="p">):</span>
@@ -656,41 +658,41 @@
             <span class="bp">self</span><span class="o">.</span><span class="n">aln_sources</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">src</span><span class="p">)</span>
 
     <span class="k">def</span> <span class="nf">_PostProcessStructure</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
-        <span class="c">#pylint: disable=attribute-defined-outside-init</span>
+        <span class="c1">#pylint: disable=attribute-defined-outside-init</span>
         <span class="sd">&quot;&quot;&quot;Get structures from command line input.&quot;&quot;&quot;</span>
         <span class="bp">self</span><span class="o">.</span><span class="n">structures</span> <span class="o">=</span> <span class="nb">list</span><span class="p">()</span>
         <span class="bp">self</span><span class="o">.</span><span class="n">structure_sources</span> <span class="o">=</span> <span class="nb">list</span><span class="p">()</span>
-        <span class="c"># parse pdb files</span>
+        <span class="c1"># parse pdb files</span>
         <span class="k">for</span> <span class="n">src</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">pdb</span><span class="p">:</span>
             <span class="bp">self</span><span class="o">.</span><span class="n">structures</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">_LoadPDB</span><span class="p">(</span><span class="n">src</span><span class="p">))</span>
             <span class="bp">self</span><span class="o">.</span><span class="n">structure_sources</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">src</span><span class="p">)</span>
-        <span class="c"># parse generic structures</span>
+        <span class="c1"># parse generic structures</span>
         <span class="k">for</span> <span class="n">src</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">entity</span><span class="p">:</span>
             <span class="bp">self</span><span class="o">.</span><span class="n">structures</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">_LoadEntity</span><span class="p">(</span><span class="n">src</span><span class="p">))</span>
             <span class="bp">self</span><span class="o">.</span><span class="n">structure_sources</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">src</span><span class="p">)</span>
 
     <span class="k">def</span> <span class="nf">_AttachViews</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
         <span class="sd">&quot;&quot;&quot;Attach views to tpl. sequences according to sequence names.&quot;&quot;&quot;</span>
-        <span class="k">if</span> <span class="ow">not</span> <span class="p">(</span><span class="nb">hasattr</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="s">&#39;structures&#39;</span><span class="p">)</span> <span class="ow">and</span> <span class="nb">hasattr</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="s">&#39;alignments&#39;</span><span class="p">)):</span>
-            <span class="n">helper</span><span class="o">.</span><span class="n">MsgErrorAndExit</span><span class="p">(</span><span class="s">&quot;Need to have structures and alignments to &quot;</span><span class="o">+</span>
-                                   <span class="s">&quot;attach views.&quot;</span><span class="p">,</span> <span class="mi">41</span><span class="p">)</span>
-        <span class="c"># get chain id to entity view (single chain) mapping (dict)</span>
+        <span class="k">if</span> <span class="ow">not</span> <span class="p">(</span><span class="nb">hasattr</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="s1">&#39;structures&#39;</span><span class="p">)</span> <span class="ow">and</span> <span class="nb">hasattr</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="s1">&#39;alignments&#39;</span><span class="p">)):</span>
+            <span class="n">helper</span><span class="o">.</span><span class="n">MsgErrorAndExit</span><span class="p">(</span><span class="s2">&quot;Need to have structures and alignments to &quot;</span><span class="o">+</span>
+                                   <span class="s2">&quot;attach views.&quot;</span><span class="p">,</span> <span class="mi">41</span><span class="p">)</span>
+        <span class="c1"># get chain id to entity view (single chain) mapping (dict)</span>
         <span class="n">chain_entities</span> <span class="o">=</span> <span class="n">_GetChains</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">structures</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">structure_sources</span><span class="p">)</span>
-        <span class="c"># go through all templates in all alignments</span>
+        <span class="c1"># go through all templates in all alignments</span>
         <span class="k">for</span> <span class="n">aln</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">alignments</span><span class="p">:</span>
             <span class="n">_AttachViewsToAln</span><span class="p">(</span><span class="n">aln</span><span class="p">,</span> <span class="n">chain_entities</span><span class="p">)</span>
 
 
-<span class="c">#  LocalWords:  param attr prog argparse ArgumentParser bool sys os init str</span>
-<span class="c">#  LocalWords:  progattr descattr argpinit argv formatter meth args namespace</span>
-<span class="c">#  LocalWords:  ArgumentDefaultsHelpFormatter sysargv AssembleParser fasta io</span>
-<span class="c">#  LocalWords:  metavar trg tpl FastA gzip tempfile ost promod aln stderr src</span>
-<span class="c">#  LocalWords:  AssembleTrgTplAln CreateSequence SetSequenceOffset LogError</span>
-<span class="c">#  LocalWords:  LogScript OptionsNamespace PostProcess AssembleAlignment JSON</span>
-<span class="c">#  LocalWords:  AddAlignment AlignmentList SEQNAME whitespaces nargs trgname</span>
-<span class="c">#  LocalWords:  PostProcessAlignment startswith seqfile elif MsgErrorAndExit</span>
-<span class="c">#  LocalWords:  len FileExists gz FileGzip readfile fh NamedTemporaryFile fas</span>
-<span class="c">#  LocalWords:  LoadAlignment exc GetCount fst GetSequence snd</span>
+<span class="c1">#  LocalWords:  param attr prog argparse ArgumentParser bool sys os init str</span>
+<span class="c1">#  LocalWords:  progattr descattr argpinit argv formatter meth args namespace</span>
+<span class="c1">#  LocalWords:  ArgumentDefaultsHelpFormatter sysargv AssembleParser fasta io</span>
+<span class="c1">#  LocalWords:  metavar trg tpl FastA gzip tempfile ost promod aln stderr src</span>
+<span class="c1">#  LocalWords:  AssembleTrgTplAln CreateSequence SetSequenceOffset LogError</span>
+<span class="c1">#  LocalWords:  LogScript OptionsNamespace PostProcess AssembleAlignment JSON</span>
+<span class="c1">#  LocalWords:  AddAlignment AlignmentList SEQNAME whitespaces nargs trgname</span>
+<span class="c1">#  LocalWords:  PostProcessAlignment startswith seqfile elif MsgErrorAndExit</span>
+<span class="c1">#  LocalWords:  len FileExists gz FileGzip readfile fh NamedTemporaryFile fas</span>
+<span class="c1">#  LocalWords:  LoadAlignment exc GetCount fst GetSequence snd</span>
 </pre></div>
 
           </div>
@@ -716,9 +718,6 @@
       <input type="hidden" name="check_keywords" value="yes" />
       <input type="hidden" name="area" value="default" />
     </form>
-    <p class="searchtip" style="font-size: 90%">
-    Enter search terms or a module, class or function name.
-    </p>
 </div>
 <script type="text/javascript">$('#searchbox').show(0);</script>
         </div>
@@ -726,11 +725,11 @@
       <div class="clearer"></div>
     </div>
     <div class="footer">
-      &copy;2017, ProMod3 authors.
+      &copy;2018, ProMod3 authors.
       
       |
-      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a>
-      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.6</a>
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.4.1</a>
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
       
     </div>
 
diff --git a/doc/html/_modules/promod3/modelling/_closegaps.html b/doc/html/_modules/promod3/modelling/_closegaps.html
index fa180db91e0932f68fa4b7ad39facb3667f5385f..85c8c033bdc62ac51dc8c0529b0e2ca2ad5f1f0f 100644
--- a/doc/html/_modules/promod3/modelling/_closegaps.html
+++ b/doc/html/_modules/promod3/modelling/_closegaps.html
@@ -6,7 +6,7 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
-    <title>promod3.modelling._closegaps &mdash; ProMod3 1.1.0 documentation</title>
+    <title>promod3.modelling._closegaps &mdash; ProMod3 1.2.0 documentation</title>
     
     <link rel="stylesheet" href="../../../_static/alabaster.css" type="text/css" />
     <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
@@ -14,7 +14,7 @@
     <script type="text/javascript">
       var DOCUMENTATION_OPTIONS = {
         URL_ROOT:    '../../../',
-        VERSION:     '1.1.0',
+        VERSION:     '1.2.0',
         COLLAPSE_INDEX: false,
         FILE_SUFFIX: '.html',
         HAS_SOURCE:  true
@@ -23,14 +23,16 @@
     <script type="text/javascript" src="../../../_static/jquery.js"></script>
     <script type="text/javascript" src="../../../_static/underscore.js"></script>
     <script type="text/javascript" src="../../../_static/doctools.js"></script>
-    <link rel="top" title="ProMod3 1.1.0 documentation" href="../../../index.html" />
+    <link rel="top" title="ProMod3 1.2.0 documentation" href="../../../index.html" />
     <link rel="up" title="promod3" href="../../promod3.html" />
    
+  <link rel="stylesheet" href="../../../_static/custom.css" type="text/css" />
   
-  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
 
   </head>
-  <body role="document">  
+  <body role="document">
+  
 
     <div class="document">
       <div class="documentwrapper">
@@ -38,90 +40,95 @@
           <div class="body" role="main">
             
   <h1>Source code for promod3.modelling._closegaps</h1><div class="highlight"><pre>
-<span class="sd">&#39;&#39;&#39;High-level functionality for modelling module to close gaps. Added in the</span>
+<span></span><span class="sd">&#39;&#39;&#39;High-level functionality for modelling module to close gaps. Added in the</span>
 <span class="sd">__init__.py file. To be used directly by passing a ModellingHandle instance</span>
 <span class="sd">as argument.</span>
 <span class="sd">&#39;&#39;&#39;</span>
 
-<span class="c"># internal</span>
+<span class="c1"># internal</span>
 <span class="kn">from</span> <span class="nn">promod3</span> <span class="kn">import</span> <span class="n">loop</span><span class="p">,</span> <span class="n">core</span><span class="p">,</span> <span class="n">scoring</span>
 <span class="kn">from</span> <span class="nn">_modelling</span> <span class="kn">import</span> <span class="o">*</span>
 <span class="kn">from</span> <span class="nn">_ring_punches</span> <span class="kn">import</span> <span class="o">*</span>
 <span class="kn">from</span> <span class="nn">_reconstruct_sidechains</span> <span class="kn">import</span> <span class="o">*</span>
-<span class="c"># external</span>
+<span class="c1"># external</span>
 <span class="kn">import</span> <span class="nn">ost</span>
 <span class="kn">import</span> <span class="nn">sys</span>
 
-<span class="c">###############################################################################</span>
-<span class="c"># loop candidate selection setup</span>
+<span class="c1">###############################################################################</span>
+<span class="c1"># loop candidate selection setup</span>
 <span class="k">def</span> <span class="nf">_GetBestLC</span><span class="p">(</span><span class="n">mhandle</span><span class="p">,</span> <span class="n">loop_candidates</span><span class="p">,</span> <span class="n">start_resnum</span><span class="p">,</span> <span class="n">chain_idx</span><span class="p">,</span>
-               <span class="n">db_scores</span><span class="p">,</span> <span class="n">max_num_all_atom</span><span class="o">=</span><span class="mi">0</span><span class="p">):</span>
-    <span class="c"># returns (min_idx, min_score)</span>
+               <span class="n">db_scores</span><span class="p">,</span> <span class="n">max_num_all_atom</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">length_dep_weights</span><span class="o">=</span><span class="bp">False</span><span class="p">):</span>
+    <span class="c1"># returns (min_idx, min_score)</span>
 
-    <span class="c"># dummy check</span>
+    <span class="c1"># dummy check</span>
     <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">loop_candidates</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span>
-        <span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s">&quot;Need at least 1 candidate to choose from!&quot;</span><span class="p">)</span>
+        <span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s2">&quot;Need at least 1 candidate to choose from!&quot;</span><span class="p">)</span>
     
-    <span class="c"># setup weights</span>
+    <span class="c1"># setup weights</span>
     <span class="n">with_db</span> <span class="o">=</span> <span class="p">(</span><span class="ow">not</span> <span class="n">db_scores</span><span class="o">.</span><span class="n">IsEmpty</span><span class="p">())</span>
     <span class="n">with_aa</span> <span class="o">=</span> <span class="p">(</span><span class="n">max_num_all_atom</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span>
-    <span class="n">weights</span> <span class="o">=</span> <span class="n">ScoringWeights</span><span class="o">.</span><span class="n">GetWeights</span><span class="p">(</span><span class="n">with_db</span><span class="p">,</span> <span class="n">with_aa</span><span class="p">)</span>
+    <span class="n">weights</span> <span class="o">=</span> <span class="n">ScoringWeights</span><span class="o">.</span><span class="n">GetWeights</span><span class="p">(</span><span class="n">with_db</span><span class="p">,</span> <span class="n">with_aa</span><span class="p">,</span> 
+                                        <span class="n">length_dep_weights</span><span class="p">,</span> 
+                                        <span class="nb">len</span><span class="p">(</span><span class="n">loop_candidates</span><span class="p">[</span><span class="mi">0</span><span class="p">]))</span>
 
-    <span class="c"># setup all scores object (we collect needed scores there)</span>
-    <span class="n">all_scores</span> <span class="o">=</span> <span class="n">db_scores</span><span class="o">.</span><span class="n">Copy</span><span class="p">()</span>  <span class="c"># copy to avoid changing db_scores</span>
+    <span class="c1"># setup all scores object (we collect needed scores there)</span>
+    <span class="n">all_scores</span> <span class="o">=</span> <span class="n">db_scores</span><span class="o">.</span><span class="n">Copy</span><span class="p">()</span>  <span class="c1"># copy to avoid changing db_scores</span>
 
-    <span class="c"># add backbone scores</span>
-    <span class="n">loop_candidates</span><span class="o">.</span><span class="n">CalculateBackboneScores</span><span class="p">(</span><span class="n">all_scores</span><span class="p">,</span> <span class="n">mhandle</span><span class="o">.</span><span class="n">backbone_scorer</span><span class="p">,</span>
+    <span class="c1"># add backbone scores</span>
+    <span class="n">loop_candidates</span><span class="o">.</span><span class="n">CalculateBackboneScores</span><span class="p">(</span><span class="n">all_scores</span><span class="p">,</span> <span class="n">mhandle</span><span class="p">,</span>
                                             <span class="n">start_resnum</span><span class="p">,</span> <span class="n">chain_idx</span><span class="p">)</span>
 
-    <span class="c"># add all atom scores?</span>
+    <span class="c1"># add all atom scores?</span>
     <span class="k">if</span> <span class="n">with_aa</span><span class="p">:</span>
-        <span class="c"># get best ones based on previous scores</span>
-        <span class="n">non_aa_weights</span> <span class="o">=</span> <span class="n">ScoringWeights</span><span class="o">.</span><span class="n">GetWeights</span><span class="p">(</span><span class="n">with_db</span><span class="p">,</span> <span class="bp">False</span><span class="p">)</span>
+        <span class="c1"># get best ones based on previous scores</span>
+        <span class="n">non_aa_weights</span> <span class="o">=</span> <span class="n">ScoringWeights</span><span class="o">.</span><span class="n">GetWeights</span><span class="p">(</span><span class="n">with_db</span><span class="p">,</span> <span class="bp">False</span><span class="p">,</span> 
+                                                   <span class="n">length_dep_weights</span><span class="p">,</span>
+                                                   <span class="nb">len</span><span class="p">(</span><span class="n">loop_candidates</span><span class="p">[</span><span class="mi">0</span><span class="p">]))</span>
+
         <span class="n">non_aa_scores</span> <span class="o">=</span> <span class="n">all_scores</span><span class="o">.</span><span class="n">LinearCombine</span><span class="p">(</span><span class="n">non_aa_weights</span><span class="p">)</span>
         <span class="n">arg_sorted_scores</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">([(</span><span class="n">v</span><span class="p">,</span><span class="n">i</span><span class="p">)</span> <span class="k">for</span> <span class="n">i</span><span class="p">,</span><span class="n">v</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">non_aa_scores</span><span class="p">)])</span>
         <span class="n">min_indices</span> <span class="o">=</span> <span class="p">[</span><span class="n">i</span> <span class="k">for</span> <span class="n">v</span><span class="p">,</span><span class="n">i</span> <span class="ow">in</span> <span class="n">arg_sorted_scores</span><span class="p">[:</span><span class="n">max_num_all_atom</span><span class="p">]]</span>
-        <span class="c"># extract relevant loop candidates and scores</span>
+        <span class="c1"># extract relevant loop candidates and scores</span>
         <span class="n">aa_loop_candidates</span> <span class="o">=</span> <span class="n">loop_candidates</span><span class="o">.</span><span class="n">Extract</span><span class="p">(</span><span class="n">min_indices</span><span class="p">)</span>
         <span class="n">all_scores</span> <span class="o">=</span> <span class="n">all_scores</span><span class="o">.</span><span class="n">Extract</span><span class="p">(</span><span class="n">min_indices</span><span class="p">)</span>
-        <span class="c"># add all atom scores</span>
+        <span class="c1"># add all atom scores</span>
         <span class="n">aa_loop_candidates</span><span class="o">.</span><span class="n">CalculateAllAtomScores</span><span class="p">(</span><span class="n">all_scores</span><span class="p">,</span> <span class="n">mhandle</span><span class="p">,</span>
                                                   <span class="n">start_resnum</span><span class="p">,</span> <span class="n">chain_idx</span><span class="p">)</span>
 
-    <span class="c"># get / return best</span>
+    <span class="c1"># get / return best</span>
     <span class="n">scores</span> <span class="o">=</span> <span class="n">all_scores</span><span class="o">.</span><span class="n">LinearCombine</span><span class="p">(</span><span class="n">weights</span><span class="p">)</span>
     <span class="n">min_score</span> <span class="o">=</span> <span class="nb">min</span><span class="p">(</span><span class="n">scores</span><span class="p">)</span>
     <span class="n">min_idx</span> <span class="o">=</span> <span class="n">scores</span><span class="o">.</span><span class="n">index</span><span class="p">(</span><span class="n">min_score</span><span class="p">)</span>
-    <span class="c"># translate to original indexing for all atom</span>
+    <span class="c1"># translate to original indexing for all atom</span>
     <span class="k">if</span> <span class="n">with_aa</span><span class="p">:</span>
         <span class="n">min_idx</span> <span class="o">=</span> <span class="n">min_indices</span><span class="p">[</span><span class="n">min_idx</span><span class="p">]</span>
     <span class="k">return</span> <span class="p">(</span><span class="n">min_idx</span><span class="p">,</span> <span class="n">min_score</span><span class="p">)</span>
 
-<span class="c">###############################################################################</span>
-<span class="c"># helper functions</span>
+<span class="c1">###############################################################################</span>
+<span class="c1"># helper functions</span>
 <span class="k">def</span> <span class="nf">_GetGapExtender</span><span class="p">(</span><span class="n">mhandle</span><span class="p">,</span> <span class="n">actual_gap</span><span class="p">,</span> <span class="n">use_scoring_extender</span><span class="p">,</span>
                     <span class="n">use_full_extender</span><span class="p">,</span> <span class="n">max_length</span><span class="o">=-</span><span class="mi">1</span><span class="p">):</span>
-    <span class="c"># DO NOT USE full ext. with max_len = -1 as this can use LOTS of memory</span>
+    <span class="c1"># DO NOT USE full ext. with max_len = -1 as this can use LOTS of memory</span>
     <span class="k">if</span> <span class="n">use_full_extender</span> <span class="ow">and</span> <span class="n">max_length</span> <span class="o">&lt;</span> <span class="mi">0</span><span class="p">:</span>
-        <span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s">&quot;Cannot use neg. max_length with full extender!&quot;</span><span class="p">)</span>
-    <span class="c"># return appropriate gap extender</span>
+        <span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s2">&quot;Cannot use neg. max_length with full extender!&quot;</span><span class="p">)</span>
+    <span class="c1"># return appropriate gap extender</span>
     <span class="n">actual_chain_idx</span> <span class="o">=</span> <span class="n">actual_gap</span><span class="o">.</span><span class="n">GetChainIndex</span><span class="p">()</span>
     <span class="k">if</span> <span class="n">use_scoring_extender</span><span class="p">:</span>
-        <span class="c"># get extender_penalties (note: changes as gaps filled)</span>
+        <span class="c1"># get extender_penalties (note: changes as gaps filled)</span>
         <span class="n">extender_penalties</span> <span class="o">=</span> <span class="p">[</span><span class="mf">0.0</span><span class="p">]</span> <span class="o">*</span> <span class="nb">len</span><span class="p">(</span><span class="n">mhandle</span><span class="o">.</span><span class="n">seqres</span><span class="p">[</span><span class="n">actual_chain_idx</span><span class="p">])</span>
         <span class="k">for</span> <span class="n">r</span> <span class="ow">in</span> <span class="n">mhandle</span><span class="o">.</span><span class="n">model</span><span class="o">.</span><span class="n">chains</span><span class="p">[</span><span class="n">actual_chain_idx</span><span class="p">]</span><span class="o">.</span><span class="n">residues</span><span class="p">:</span>
             <span class="k">if</span> <span class="n">r</span><span class="o">.</span><span class="n">GetSecStructure</span><span class="p">()</span><span class="o">.</span><span class="n">IsHelical</span><span class="p">()</span> <span class="ow">or</span> \
                <span class="n">r</span><span class="o">.</span><span class="n">GetSecStructure</span><span class="p">()</span><span class="o">.</span><span class="n">IsExtended</span><span class="p">():</span>
                 <span class="n">num</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">GetNumber</span><span class="p">()</span><span class="o">.</span><span class="n">GetNum</span><span class="p">()</span>
                 <span class="n">extender_penalties</span><span class="p">[</span><span class="n">num</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span> <span class="o">=</span> <span class="mf">1.0</span>
-        <span class="c"># setup scoring extender</span>
+        <span class="c1"># setup scoring extender</span>
         <span class="k">if</span> <span class="n">use_full_extender</span><span class="p">:</span>
             <span class="k">return</span> <span class="n">ScoringGapExtender</span><span class="p">(</span><span class="n">actual_gap</span><span class="p">,</span> <span class="mf">0.8</span><span class="p">,</span>
                                       <span class="n">extender_penalties</span><span class="p">,</span>
                                       <span class="n">mhandle</span><span class="o">.</span><span class="n">seqres</span><span class="p">[</span><span class="n">actual_chain_idx</span><span class="p">],</span>
                                       <span class="n">max_length</span><span class="p">)</span>
         <span class="k">else</span><span class="p">:</span>
-            <span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s">&quot;Cannot use ScoringGapExtender w/o max_length.&quot;</span><span class="p">)</span>
+            <span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s2">&quot;Cannot use ScoringGapExtender w/o max_length.&quot;</span><span class="p">)</span>
     <span class="k">else</span><span class="p">:</span>
         <span class="k">if</span> <span class="n">use_full_extender</span><span class="p">:</span>
             <span class="k">return</span> <span class="n">FullGapExtender</span><span class="p">(</span><span class="n">actual_gap</span><span class="p">,</span>
@@ -132,24 +139,25 @@
                                <span class="n">mhandle</span><span class="o">.</span><span class="n">seqres</span><span class="p">[</span><span class="n">actual_chain_idx</span><span class="p">])</span>
 
 <span class="k">def</span> <span class="nf">_ResolveLogInfo</span><span class="p">(</span><span class="n">gap_orig</span><span class="p">,</span> <span class="n">optimal_gap</span><span class="p">,</span> <span class="n">n_candidates</span><span class="p">,</span> <span class="n">with_db</span><span class="p">,</span> <span class="n">with_aa</span><span class="p">):</span>
-    <span class="c"># helper for consistent logging...</span>
-    <span class="n">scor_str</span> <span class="o">=</span> <span class="s">&quot;BB&quot;</span>
+    <span class="c1"># helper for consistent logging...</span>
+    <span class="n">scor_str</span> <span class="o">=</span> <span class="s2">&quot;BB&quot;</span>
     <span class="k">if</span> <span class="n">with_db</span><span class="p">:</span>
-        <span class="n">scor_str</span> <span class="o">+=</span> <span class="s">&quot;_DB&quot;</span>
+        <span class="n">scor_str</span> <span class="o">+=</span> <span class="s2">&quot;_DB&quot;</span>
     <span class="k">if</span> <span class="n">with_aa</span><span class="p">:</span>
-        <span class="n">scor_str</span> <span class="o">+=</span> <span class="s">&quot;_AA&quot;</span>
-    <span class="n">ost</span><span class="o">.</span><span class="n">LogInfo</span><span class="p">(</span><span class="s">&quot;Resolved </span><span class="si">%s</span><span class="s"> by filling </span><span class="si">%s</span><span class="s"> (</span><span class="si">%d</span><span class="s"> candidates, </span><span class="si">%s</span><span class="s">)&quot;</span> <span class="o">%</span> \
+        <span class="n">scor_str</span> <span class="o">+=</span> <span class="s2">&quot;_AA&quot;</span>
+    <span class="n">ost</span><span class="o">.</span><span class="n">LogInfo</span><span class="p">(</span><span class="s2">&quot;Resolved </span><span class="si">%s</span><span class="s2"> by filling </span><span class="si">%s</span><span class="s2"> (</span><span class="si">%d</span><span class="s2"> candidates, </span><span class="si">%s</span><span class="s2">)&quot;</span> <span class="o">%</span> \
                 <span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">gap_orig</span><span class="p">),</span> <span class="nb">str</span><span class="p">(</span><span class="n">optimal_gap</span><span class="p">),</span> <span class="n">n_candidates</span><span class="p">,</span> <span class="n">scor_str</span><span class="p">))</span>
 
 <span class="k">def</span> <span class="nf">_CloseLoopFrame</span><span class="p">(</span><span class="n">mhandle</span><span class="p">,</span> <span class="n">gap_orig</span><span class="p">,</span> <span class="n">actual_candidates</span><span class="p">,</span> <span class="n">actual_extended_gaps</span><span class="p">,</span>
-                    <span class="n">actual_db_scores</span><span class="o">=</span><span class="p">[],</span> <span class="n">max_num_all_atom</span><span class="o">=</span><span class="mi">0</span><span class="p">):</span>
+                    <span class="n">actual_db_scores</span><span class="o">=</span><span class="p">[],</span> <span class="n">max_num_all_atom</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> 
+                    <span class="n">length_dep_weights</span><span class="o">=</span><span class="bp">False</span><span class="p">):</span>
     <span class="sd">&#39;&#39;&#39;Rank candidates with &quot;frame-approach&quot;.</span>
 <span class="sd">    All found candidates are extended prior to scoring so they match in size.</span>
 <span class="sd">    &#39;&#39;&#39;</span>
-    <span class="c"># get chain for gap</span>
+    <span class="c1"># get chain for gap</span>
     <span class="n">actual_chain_idx</span> <span class="o">=</span> <span class="n">actual_extended_gaps</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">GetChainIndex</span><span class="p">()</span>
     <span class="n">actual_chain</span> <span class="o">=</span> <span class="n">mhandle</span><span class="o">.</span><span class="n">model</span><span class="o">.</span><span class="n">chains</span><span class="p">[</span><span class="n">actual_chain_idx</span><span class="p">]</span>
-    <span class="c"># get min_res_num, max_after_resnum</span>
+    <span class="c1"># get min_res_num, max_after_resnum</span>
     <span class="n">min_before_resnum</span> <span class="o">=</span> <span class="n">sys</span><span class="o">.</span><span class="n">maxint</span>
     <span class="n">max_after_resnum</span> <span class="o">=</span> <span class="o">-</span><span class="n">sys</span><span class="o">.</span><span class="n">maxint</span><span class="o">-</span><span class="mi">1</span>
     <span class="k">for</span> <span class="n">g</span> <span class="ow">in</span> <span class="n">actual_extended_gaps</span><span class="p">:</span>
@@ -158,9 +166,9 @@
         <span class="n">max_after_resnum</span> <span class="o">=</span> <span class="nb">max</span><span class="p">(</span><span class="n">max_after_resnum</span><span class="p">,</span>
                                <span class="n">g</span><span class="o">.</span><span class="n">after</span><span class="o">.</span><span class="n">GetNumber</span><span class="p">()</span><span class="o">.</span><span class="n">GetNum</span><span class="p">())</span>
     
-    <span class="c"># all loop candidates will be scored along the full max. extension ever</span>
-    <span class="c"># reached in the search before, so we build an overall frame, where we</span>
-    <span class="c"># insert the loops</span>
+    <span class="c1"># all loop candidates will be scored along the full max. extension ever</span>
+    <span class="c1"># reached in the search before, so we build an overall frame, where we</span>
+    <span class="c1"># insert the loops</span>
     <span class="n">frame_seq</span> <span class="o">=</span> <span class="n">mhandle</span><span class="o">.</span><span class="n">seqres</span><span class="p">[</span><span class="n">actual_chain_idx</span><span class="p">]</span>\
                 <span class="p">[</span><span class="n">min_before_resnum</span><span class="o">-</span><span class="mi">1</span><span class="p">:</span><span class="n">max_after_resnum</span><span class="p">]</span>
     <span class="n">frame_backbone_list</span> <span class="o">=</span> <span class="n">loop</span><span class="o">.</span><span class="n">BackboneList</span><span class="p">(</span><span class="n">frame_seq</span><span class="p">)</span>
@@ -171,7 +179,7 @@
             <span class="n">frame_backbone_list</span><span class="o">.</span><span class="n">Set</span><span class="p">(</span><span class="n">i</span><span class="p">,</span> <span class="n">actual_res</span><span class="p">,</span> <span class="n">frame_seq</span><span class="p">[</span><span class="n">i</span><span class="p">])</span>
         <span class="n">actual_res_num</span> <span class="o">+=</span> <span class="mi">1</span>
 
-    <span class="c"># prepare loop candidates for scoring</span>
+    <span class="c1"># prepare loop candidates for scoring</span>
     <span class="n">final_loop_candidates</span> <span class="o">=</span> <span class="n">LoopCandidates</span><span class="p">(</span><span class="n">frame_seq</span><span class="p">)</span>
     <span class="n">back_mapper</span> <span class="o">=</span> <span class="nb">list</span><span class="p">()</span>
     <span class="k">for</span> <span class="n">i</span><span class="p">,</span> <span class="n">loop_candidates</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">actual_candidates</span><span class="p">):</span>
@@ -184,87 +192,88 @@
             <span class="n">final_loop_candidates</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">actual_frame_backbone_list</span><span class="p">)</span>
             <span class="n">back_mapper</span><span class="o">.</span><span class="n">append</span><span class="p">((</span><span class="n">i</span><span class="p">,</span> <span class="n">j</span><span class="p">))</span>
 
-    <span class="c"># db scores requested</span>
+    <span class="c1"># db scores requested</span>
     <span class="n">db_scores</span> <span class="o">=</span> <span class="n">ScoreContainer</span><span class="p">()</span>
     <span class="k">for</span> <span class="n">actual_scores</span> <span class="ow">in</span> <span class="n">actual_db_scores</span><span class="p">:</span>
         <span class="n">db_scores</span><span class="o">.</span><span class="n">Extend</span><span class="p">(</span><span class="n">actual_scores</span><span class="p">)</span>
     
     <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">final_loop_candidates</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">:</span>
-        <span class="c"># get best</span>
+        <span class="c1"># get best</span>
         <span class="n">min_idx</span><span class="p">,</span> <span class="n">min_score</span> <span class="o">=</span> <span class="n">_GetBestLC</span><span class="p">(</span><span class="n">mhandle</span><span class="p">,</span> <span class="n">final_loop_candidates</span><span class="p">,</span>
                                         <span class="n">min_before_resnum</span><span class="p">,</span> <span class="n">actual_chain_idx</span><span class="p">,</span>
-                                        <span class="n">db_scores</span><span class="p">,</span> <span class="n">max_num_all_atom</span><span class="p">)</span>
-        <span class="n">ost</span><span class="o">.</span><span class="n">LogVerbose</span><span class="p">(</span><span class="s">&quot;Gap </span><span class="si">%s</span><span class="s"> - </span><span class="si">%d</span><span class="s"> candidates, best (min) score </span><span class="si">%g</span><span class="s">&quot;</span> <span class="o">%</span>
+                                        <span class="n">db_scores</span><span class="p">,</span> <span class="n">max_num_all_atom</span><span class="p">,</span> 
+                                        <span class="n">length_dep_weights</span><span class="p">)</span>
+        <span class="n">ost</span><span class="o">.</span><span class="n">LogVerbose</span><span class="p">(</span><span class="s2">&quot;Gap </span><span class="si">%s</span><span class="s2"> - </span><span class="si">%d</span><span class="s2"> candidates, best (min) score </span><span class="si">%g</span><span class="s2">&quot;</span> <span class="o">%</span>
                        <span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">gap_orig</span><span class="p">),</span> <span class="nb">len</span><span class="p">(</span><span class="n">final_loop_candidates</span><span class="p">),</span> <span class="n">min_score</span><span class="p">))</span>
-        <span class="c"># resolve loop</span>
+        <span class="c1"># resolve loop</span>
         <span class="n">idx_a</span> <span class="o">=</span> <span class="n">back_mapper</span><span class="p">[</span><span class="n">min_idx</span><span class="p">][</span><span class="mi">0</span><span class="p">]</span>
         <span class="n">idx_b</span> <span class="o">=</span> <span class="n">back_mapper</span><span class="p">[</span><span class="n">min_idx</span><span class="p">][</span><span class="mi">1</span><span class="p">]</span>
         <span class="n">_ResolveLogInfo</span><span class="p">(</span><span class="n">gap_orig</span><span class="p">,</span> <span class="n">actual_extended_gaps</span><span class="p">[</span><span class="n">idx_a</span><span class="p">],</span>
                         <span class="nb">len</span><span class="p">(</span><span class="n">final_loop_candidates</span><span class="p">),</span> <span class="nb">bool</span><span class="p">(</span><span class="n">actual_db_scores</span><span class="p">),</span>
                         <span class="n">max_num_all_atom</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span>
-        <span class="c"># update model and clear gaps</span>
+        <span class="c1"># update model and clear gaps</span>
         <span class="n">bb_list</span> <span class="o">=</span> <span class="n">actual_candidates</span><span class="p">[</span><span class="n">idx_a</span><span class="p">][</span><span class="n">idx_b</span><span class="p">]</span>
         <span class="n">actual_gap</span> <span class="o">=</span> <span class="n">actual_extended_gaps</span><span class="p">[</span><span class="n">idx_a</span><span class="p">]</span>
-        <span class="c"># will return -1 if last gap removed, else next gap idx</span>
+        <span class="c1"># will return -1 if last gap removed, else next gap idx</span>
         <span class="k">return</span> <span class="n">InsertLoopClearGaps</span><span class="p">(</span><span class="n">mhandle</span><span class="p">,</span> <span class="n">bb_list</span><span class="p">,</span> <span class="n">actual_gap</span><span class="p">)</span>
     <span class="k">else</span><span class="p">:</span>
-        <span class="n">ost</span><span class="o">.</span><span class="n">LogInfo</span><span class="p">(</span><span class="s">&quot;Failed at loop insertion (</span><span class="si">%s</span><span class="s">)&quot;</span> <span class="o">%</span> <span class="nb">str</span><span class="p">(</span><span class="n">gap_orig</span><span class="p">))</span>
+        <span class="n">ost</span><span class="o">.</span><span class="n">LogInfo</span><span class="p">(</span><span class="s2">&quot;Failed at loop insertion (</span><span class="si">%s</span><span class="s2">)&quot;</span> <span class="o">%</span> <span class="nb">str</span><span class="p">(</span><span class="n">gap_orig</span><span class="p">))</span>
         <span class="k">return</span> <span class="o">-</span><span class="mi">2</span>
 
 
 <span class="k">def</span> <span class="nf">_CloseLoopBare</span><span class="p">(</span><span class="n">mhandle</span><span class="p">,</span> <span class="n">gap_orig</span><span class="p">,</span> <span class="n">actual_candidates</span><span class="p">,</span> <span class="n">actual_extended_gaps</span><span class="p">,</span>
                    <span class="n">actual_db_scores</span><span class="o">=</span><span class="p">[],</span> <span class="n">penalize_length</span><span class="o">=</span><span class="bp">True</span><span class="p">,</span>
-                   <span class="n">max_num_all_atom</span><span class="o">=</span><span class="mi">0</span><span class="p">):</span>
+                   <span class="n">max_num_all_atom</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">length_dep_weights</span><span class="o">=</span><span class="bp">False</span><span class="p">):</span>
     <span class="sd">&#39;&#39;&#39;Rank candidates directly.</span>
 <span class="sd">    All candidates are scored directly and optionally penalized for gap length.</span>
 <span class="sd">    &#39;&#39;&#39;</span>
-    <span class="c"># get chain for gap</span>
+    <span class="c1"># get chain for gap</span>
     <span class="n">actual_chain_idx</span> <span class="o">=</span> <span class="n">actual_extended_gaps</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">GetChainIndex</span><span class="p">()</span>
     
-    <span class="c"># score loops as they are</span>
-    <span class="n">min_score</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="s">&quot;inf&quot;</span><span class="p">)</span>
+    <span class="c1"># score loops as they are</span>
+    <span class="n">min_score</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="s2">&quot;inf&quot;</span><span class="p">)</span>
     <span class="n">optimal_gap</span> <span class="o">=</span> <span class="bp">None</span>
     <span class="n">optimal_candidate</span> <span class="o">=</span> <span class="bp">None</span>
     <span class="n">n_candidates</span> <span class="o">=</span> <span class="mi">0</span>
     <span class="k">for</span> <span class="n">i</span><span class="p">,</span> <span class="n">loop_candidates</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">actual_candidates</span><span class="p">):</span>
         <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">loop_candidates</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span> <span class="k">continue</span>
         <span class="n">n_candidates</span> <span class="o">+=</span> <span class="nb">len</span><span class="p">(</span><span class="n">loop_candidates</span><span class="p">)</span>
-        <span class="c"># get current best</span>
+        <span class="c1"># get current best</span>
         <span class="n">before_resnum</span> <span class="o">=</span> <span class="n">actual_extended_gaps</span><span class="p">[</span><span class="n">i</span><span class="p">]</span><span class="o">.</span><span class="n">before</span><span class="o">.</span><span class="n">GetNumber</span><span class="p">()</span><span class="o">.</span><span class="n">GetNum</span><span class="p">()</span>
         <span class="n">db_scores</span> <span class="o">=</span> <span class="n">ScoreContainer</span><span class="p">()</span>
         <span class="k">if</span> <span class="n">actual_db_scores</span><span class="p">:</span>
             <span class="n">db_scores</span> <span class="o">=</span> <span class="n">actual_db_scores</span><span class="p">[</span><span class="n">i</span><span class="p">]</span>
         <span class="n">best_idx</span><span class="p">,</span> <span class="n">score</span> <span class="o">=</span> <span class="n">_GetBestLC</span><span class="p">(</span><span class="n">mhandle</span><span class="p">,</span> <span class="n">loop_candidates</span><span class="p">,</span> <span class="n">before_resnum</span><span class="p">,</span>
                                      <span class="n">actual_chain_idx</span><span class="p">,</span> <span class="n">db_scores</span><span class="p">,</span>
-                                     <span class="n">max_num_all_atom</span><span class="p">)</span>
-        <span class="c"># compare with others</span>
+                                     <span class="n">max_num_all_atom</span><span class="p">,</span> <span class="n">length_dep_weights</span><span class="p">)</span>
+        <span class="c1"># compare with others</span>
         <span class="k">if</span> <span class="n">penalize_length</span><span class="p">:</span>
-            <span class="c"># penalized by gap length</span>
+            <span class="c1"># penalized by gap length</span>
             <span class="n">score</span> <span class="o">=</span> <span class="n">score</span> <span class="o">*</span> <span class="n">actual_extended_gaps</span><span class="p">[</span><span class="n">i</span><span class="p">]</span><span class="o">.</span><span class="n">length</span>
         <span class="k">if</span> <span class="n">score</span> <span class="o">&lt;</span> <span class="n">min_score</span><span class="p">:</span>
-            <span class="c"># keep best one</span>
+            <span class="c1"># keep best one</span>
             <span class="n">min_score</span> <span class="o">=</span> <span class="n">score</span>
             <span class="n">optimal_gap</span> <span class="o">=</span> <span class="n">actual_extended_gaps</span><span class="p">[</span><span class="n">i</span><span class="p">]</span>
             <span class="n">optimal_candidate</span> <span class="o">=</span> <span class="n">loop_candidates</span><span class="p">[</span><span class="n">best_idx</span><span class="p">]</span>
 
-    <span class="n">ost</span><span class="o">.</span><span class="n">LogVerbose</span><span class="p">(</span><span class="s">&quot;Gap </span><span class="si">%s</span><span class="s"> - </span><span class="si">%d</span><span class="s"> candidates, best (min) score </span><span class="si">%g</span><span class="s">&quot;</span> <span class="o">%</span>
+    <span class="n">ost</span><span class="o">.</span><span class="n">LogVerbose</span><span class="p">(</span><span class="s2">&quot;Gap </span><span class="si">%s</span><span class="s2"> - </span><span class="si">%d</span><span class="s2"> candidates, best (min) score </span><span class="si">%g</span><span class="s2">&quot;</span> <span class="o">%</span>
                    <span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">gap_orig</span><span class="p">),</span> <span class="n">n_candidates</span><span class="p">,</span> <span class="n">min_score</span><span class="p">))</span>
 
-    <span class="c"># finally resolve loop</span>
+    <span class="c1"># finally resolve loop</span>
     <span class="k">if</span> <span class="n">optimal_candidate</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span><span class="p">:</span>
-        <span class="c"># report</span>
+        <span class="c1"># report</span>
         <span class="n">_ResolveLogInfo</span><span class="p">(</span><span class="n">gap_orig</span><span class="p">,</span> <span class="n">optimal_gap</span><span class="p">,</span> <span class="n">n_candidates</span><span class="p">,</span>
                         <span class="nb">bool</span><span class="p">(</span><span class="n">actual_db_scores</span><span class="p">),</span> <span class="n">max_num_all_atom</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span>
-        <span class="c"># update model and clear gaps</span>
-        <span class="c"># will return -1 if last gap removed, else next gap idx</span>
+        <span class="c1"># update model and clear gaps</span>
+        <span class="c1"># will return -1 if last gap removed, else next gap idx</span>
         <span class="k">return</span> <span class="n">InsertLoopClearGaps</span><span class="p">(</span><span class="n">mhandle</span><span class="p">,</span> <span class="n">optimal_candidate</span><span class="p">,</span> <span class="n">optimal_gap</span><span class="p">)</span>
     <span class="k">else</span><span class="p">:</span>
-        <span class="n">ost</span><span class="o">.</span><span class="n">LogInfo</span><span class="p">(</span><span class="s">&quot;Failed at loop insertion (</span><span class="si">%s</span><span class="s">)&quot;</span> <span class="o">%</span> <span class="nb">str</span><span class="p">(</span><span class="n">gap_orig</span><span class="p">))</span>
+        <span class="n">ost</span><span class="o">.</span><span class="n">LogInfo</span><span class="p">(</span><span class="s2">&quot;Failed at loop insertion (</span><span class="si">%s</span><span class="s2">)&quot;</span> <span class="o">%</span> <span class="nb">str</span><span class="p">(</span><span class="n">gap_orig</span><span class="p">))</span>
         <span class="k">return</span> <span class="o">-</span><span class="mi">2</span>
 
 <span class="k">def</span> <span class="nf">_CloseLoop</span><span class="p">(</span><span class="n">mhandle</span><span class="p">,</span> <span class="n">gap_orig</span><span class="p">,</span> <span class="n">actual_candidates</span><span class="p">,</span>
                <span class="n">actual_extended_gaps</span><span class="p">,</span> <span class="n">variant</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">actual_db_scores</span><span class="o">=</span><span class="p">[],</span>
-               <span class="n">max_num_all_atom</span><span class="o">=</span><span class="mi">0</span><span class="p">):</span>
+               <span class="n">max_num_all_atom</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">length_dep_weights</span><span class="o">=</span><span class="bp">False</span><span class="p">):</span>
     <span class="sd">&#39;&#39;&#39;Choose best scoring loop candidate and close loop in mhandle.</span>
 <span class="sd">    :param gap_orig: Gap we actually wanted to close</span>
 <span class="sd">    :param actual_candidates: List of LoopCandidates</span>
@@ -276,34 +285,35 @@
 <span class="sd">    :param max_num_all_atom: Num. of all atom LC to consider</span>
 <span class="sd">    :return: gap-index as returned by ClearGaps or -2 if fail.</span>
 <span class="sd">    &#39;&#39;&#39;</span>
-    <span class="n">prof</span> <span class="o">=</span> <span class="n">core</span><span class="o">.</span><span class="n">StaticRuntimeProfiler</span><span class="o">.</span><span class="n">StartScoped</span><span class="p">(</span><span class="s">&#39;closegaps::_CloseLoop&#39;</span><span class="p">)</span>
-    <span class="c"># check consistency</span>
+    <span class="n">prof</span> <span class="o">=</span> <span class="n">core</span><span class="o">.</span><span class="n">StaticRuntimeProfiler</span><span class="o">.</span><span class="n">StartScoped</span><span class="p">(</span><span class="s1">&#39;closegaps::_CloseLoop&#39;</span><span class="p">)</span>
+    <span class="c1"># check consistency</span>
     <span class="n">N</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="n">actual_extended_gaps</span><span class="p">)</span>
     <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">actual_candidates</span><span class="p">)</span> <span class="o">!=</span> <span class="n">N</span><span class="p">:</span>
-        <span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s">&quot;Inconsistent list-lengths in _CloseLoop &quot;</span> \
-                           <span class="s">&quot;(</span><span class="si">%d</span><span class="s">, </span><span class="si">%d</span><span class="s">)&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">actual_candidates</span><span class="p">),</span> <span class="n">N</span><span class="p">))</span>
-    <span class="c"># check for empty candidate list</span>
+        <span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s2">&quot;Inconsistent list-lengths in _CloseLoop &quot;</span> \
+                           <span class="s2">&quot;(</span><span class="si">%d</span><span class="s2">, </span><span class="si">%d</span><span class="s2">)&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">actual_candidates</span><span class="p">),</span> <span class="n">N</span><span class="p">))</span>
+    <span class="c1"># check for empty candidate list</span>
     <span class="k">if</span> <span class="n">N</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span>
-        <span class="n">ost</span><span class="o">.</span><span class="n">LogInfo</span><span class="p">(</span><span class="s">&quot;Failed at loop insertion (</span><span class="si">%s</span><span class="s">)&quot;</span> <span class="o">%</span> <span class="nb">str</span><span class="p">(</span><span class="n">gap_orig</span><span class="p">))</span>
+        <span class="n">ost</span><span class="o">.</span><span class="n">LogInfo</span><span class="p">(</span><span class="s2">&quot;Failed at loop insertion (</span><span class="si">%s</span><span class="s2">)&quot;</span> <span class="o">%</span> <span class="nb">str</span><span class="p">(</span><span class="n">gap_orig</span><span class="p">))</span>
         <span class="k">return</span> <span class="o">-</span><span class="mi">2</span>
-    <span class="c"># choose variant</span>
+    <span class="c1"># choose variant</span>
     <span class="k">if</span> <span class="n">variant</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span>
         <span class="k">return</span> <span class="n">_CloseLoopFrame</span><span class="p">(</span><span class="n">mhandle</span><span class="p">,</span> <span class="n">gap_orig</span><span class="p">,</span> <span class="n">actual_candidates</span><span class="p">,</span>
                                <span class="n">actual_extended_gaps</span><span class="p">,</span> <span class="n">actual_db_scores</span><span class="p">,</span>
-                               <span class="n">max_num_all_atom</span><span class="p">)</span>
+                               <span class="n">max_num_all_atom</span><span class="p">,</span> <span class="n">length_dep_weights</span><span class="p">)</span>
     <span class="k">elif</span> <span class="n">variant</span> <span class="ow">in</span> <span class="p">[</span><span class="mi">1</span><span class="p">,</span><span class="mi">2</span><span class="p">]:</span>
         <span class="k">return</span> <span class="n">_CloseLoopBare</span><span class="p">(</span><span class="n">mhandle</span><span class="p">,</span> <span class="n">gap_orig</span><span class="p">,</span> <span class="n">actual_candidates</span><span class="p">,</span>
                               <span class="n">actual_extended_gaps</span><span class="p">,</span> <span class="n">actual_db_scores</span><span class="p">,</span>
-                              <span class="n">variant</span> <span class="o">==</span> <span class="mi">2</span><span class="p">,</span> <span class="n">max_num_all_atom</span><span class="p">)</span>
+                              <span class="n">variant</span> <span class="o">==</span> <span class="mi">2</span><span class="p">,</span> <span class="n">max_num_all_atom</span><span class="p">,</span>
+                              <span class="n">length_dep_weights</span><span class="p">)</span>
     <span class="k">else</span><span class="p">:</span>
-        <span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s">&quot;Unknown variant </span><span class="si">%d</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">variant</span><span class="p">);</span>
+        <span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s2">&quot;Unknown variant </span><span class="si">%d</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="n">variant</span><span class="p">);</span>
 
 <span class="k">def</span> <span class="nf">_InRange</span><span class="p">(</span><span class="n">gap</span><span class="p">,</span> <span class="n">chain_idx</span><span class="p">,</span> <span class="n">resnum_range</span><span class="p">):</span>
     <span class="sd">&#39;&#39;&#39;Check if gap is in range to be processed.&#39;&#39;&#39;</span>
-    <span class="c"># It is possible to specify exact ranges that should be resolved by</span>
-    <span class="c"># the chain_idx and resnum_range parameters.</span>
-    <span class="c"># Let&#39;s check whether we care for that particular gap in case of one</span>
-    <span class="c"># parameter being set.</span>
+    <span class="c1"># It is possible to specify exact ranges that should be resolved by</span>
+    <span class="c1"># the chain_idx and resnum_range parameters.</span>
+    <span class="c1"># Let&#39;s check whether we care for that particular gap in case of one</span>
+    <span class="c1"># parameter being set.</span>
     <span class="k">if</span> <span class="n">chain_idx</span> <span class="o">!=</span> <span class="bp">None</span> <span class="ow">and</span> <span class="n">gap</span><span class="o">.</span><span class="n">GetChainIndex</span><span class="p">()</span> <span class="o">!=</span> <span class="n">chain_idx</span><span class="p">:</span>
         <span class="k">return</span> <span class="bp">False</span>
     <span class="k">elif</span> <span class="n">resnum_range</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span>
@@ -316,13 +326,13 @@
         <span class="n">n_stem_num</span> <span class="o">=</span> <span class="n">gap</span><span class="o">.</span><span class="n">before</span><span class="o">.</span><span class="n">GetNumber</span><span class="p">()</span><span class="o">.</span><span class="n">GetNum</span><span class="p">()</span>
         <span class="n">c_stem_num</span> <span class="o">=</span> <span class="n">gap</span><span class="o">.</span><span class="n">after</span><span class="o">.</span><span class="n">GetNumber</span><span class="p">()</span><span class="o">.</span><span class="n">GetNum</span><span class="p">()</span>
         <span class="k">if</span> <span class="n">n_stem_num</span> <span class="o">&lt;=</span> <span class="n">resnum_range</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="ow">and</span> <span class="n">c_stem_num</span> <span class="o">&gt;=</span> <span class="n">resnum_range</span><span class="p">[</span><span class="mi">1</span><span class="p">]:</span>
-            <span class="c"># full overlap =&gt; current gap is fully enclosing range</span>
+            <span class="c1"># full overlap =&gt; current gap is fully enclosing range</span>
             <span class="k">return</span> <span class="bp">True</span>
         <span class="k">elif</span> <span class="n">n_stem_num</span> <span class="o">&gt;=</span> <span class="n">resnum_range</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="ow">and</span> <span class="n">n_stem_num</span> <span class="o">&lt;</span> <span class="n">resnum_range</span><span class="p">[</span><span class="mi">1</span><span class="p">]:</span>
-            <span class="c"># partial overlap =&gt; n-stem is within range</span>
+            <span class="c1"># partial overlap =&gt; n-stem is within range</span>
             <span class="k">return</span> <span class="bp">True</span>
         <span class="k">elif</span> <span class="n">c_stem_num</span> <span class="o">&gt;</span> <span class="n">resnum_range</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="ow">and</span> <span class="n">c_stem_num</span> <span class="o">&lt;=</span> <span class="n">resnum_range</span><span class="p">[</span><span class="mi">1</span><span class="p">]:</span>
-            <span class="c"># partial overlap =&gt; c-stem is within range</span>
+            <span class="c1"># partial overlap =&gt; c-stem is within range</span>
             <span class="k">return</span> <span class="bp">True</span>
         <span class="k">else</span><span class="p">:</span>
             <span class="k">return</span> <span class="bp">False</span>
@@ -330,13 +340,16 @@
         <span class="k">return</span> <span class="bp">True</span>
 
 <span class="k">def</span> <span class="nf">_GetMCWeights</span><span class="p">():</span>
-    <span class="c"># get weights for Monte Carlo sampling (BB only)</span>
-    <span class="k">return</span> <span class="p">{</span><span class="s">&quot;reduced&quot;</span><span class="p">:</span> <span class="mf">3.0</span><span class="p">,</span>
-            <span class="s">&quot;cb_packing&quot;</span><span class="p">:</span> <span class="mf">2.0</span><span class="p">,</span>
-            <span class="s">&quot;hbond&quot;</span><span class="p">:</span> <span class="mf">1.0</span><span class="p">,</span>
-            <span class="s">&quot;clash&quot;</span><span class="p">:</span> <span class="mf">0.05</span><span class="p">}</span>
+    <span class="c1"># get weights for Monte Carlo sampling (subset of BB only scores for super </span>
+    <span class="c1">#                                       fast sampling)</span>
+    <span class="n">bb_weights</span> <span class="o">=</span> <span class="n">ScoringWeights</span><span class="o">.</span><span class="n">GetWeights</span><span class="p">()</span>
+    <span class="n">return_weights</span> <span class="o">=</span> <span class="nb">dict</span><span class="p">()</span>
+    <span class="n">return_weights</span><span class="p">[</span><span class="s2">&quot;reduced&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">bb_weights</span><span class="p">[</span><span class="s2">&quot;reduced&quot;</span><span class="p">]</span>
+    <span class="n">return_weights</span><span class="p">[</span><span class="s2">&quot;cb_packing&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">bb_weights</span><span class="p">[</span><span class="s2">&quot;cb_packing&quot;</span><span class="p">]</span>
+    <span class="n">return_weights</span><span class="p">[</span><span class="s2">&quot;clash&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">bb_weights</span><span class="p">[</span><span class="s2">&quot;clash&quot;</span><span class="p">]</span>
+    <span class="k">return</span> <span class="n">return_weights</span>
 
-<span class="c">###############################################################################</span>
+<span class="c1">###############################################################################</span>
 
 <div class="viewcode-block" id="CloseSmallDeletions"><a class="viewcode-back" href="../../../modelling/pipeline.html#promod3.modelling.CloseSmallDeletions">[docs]</a><span class="k">def</span> <span class="nf">CloseSmallDeletions</span><span class="p">(</span><span class="n">mhandle</span><span class="p">,</span> <span class="n">max_extension</span><span class="o">=</span><span class="mi">9</span><span class="p">,</span> <span class="n">clash_thresh</span><span class="o">=</span><span class="mf">1.0</span><span class="p">,</span>
                         <span class="n">e_thresh</span><span class="o">=</span><span class="mi">200</span><span class="p">,</span> <span class="n">use_scoring_extender</span><span class="o">=</span><span class="bp">True</span><span class="p">,</span>
@@ -375,7 +388,8 @@
 <span class="sd">                                 For the scondary-structure-penalty to work,</span>
 <span class="sd">                                 the model-template must have the appropriate</span>
 <span class="sd">                                 information before :func:`BuildRawModel` is</span>
-<span class="sd">                                 called (e.g. with :mod:`ost.bindings.dssp`).</span>
+<span class="sd">                                 called (e.g. with </span>
+<span class="sd">                                 :meth:`ost.mol.alg.AssignSecStruct`).</span>
 <span class="sd">    :type use_scoring_extender:  :class:`bool`</span>
 
 <span class="sd">    :param use_full_extender: True = use :class:`FullGapExtender` instead of</span>
@@ -402,48 +416,53 @@
 <span class="sd">    :type ff_lookup:  :class:`promod3.loop.ForcefieldLookup`</span>
 <span class="sd">    &#39;&#39;&#39;</span>
 
-    <span class="n">prof_name</span> <span class="o">=</span> <span class="s">&#39;closegaps::CloseSmallDeletions&#39;</span>
+    <span class="n">prof_name</span> <span class="o">=</span> <span class="s1">&#39;closegaps::CloseSmallDeletions&#39;</span>
     <span class="n">prof</span> <span class="o">=</span> <span class="n">core</span><span class="o">.</span><span class="n">StaticRuntimeProfiler</span><span class="o">.</span><span class="n">StartScoped</span><span class="p">(</span><span class="n">prof_name</span><span class="p">)</span>
 
     <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">mhandle</span><span class="o">.</span><span class="n">gaps</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">:</span>
-        <span class="n">ost</span><span class="o">.</span><span class="n">LogInfo</span><span class="p">(</span><span class="s">&quot;Trying to close small deletions (no. of gap(s): </span><span class="si">%d</span><span class="s">).&quot;</span> \
+        <span class="n">ost</span><span class="o">.</span><span class="n">LogInfo</span><span class="p">(</span><span class="s2">&quot;Trying to close small deletions (no. of gap(s): </span><span class="si">%d</span><span class="s2">).&quot;</span> \
                     <span class="o">%</span> <span class="nb">len</span><span class="p">(</span><span class="n">mhandle</span><span class="o">.</span><span class="n">gaps</span><span class="p">))</span>
     <span class="k">else</span><span class="p">:</span>
         <span class="k">return</span>
 
-    <span class="c"># check/setup scoring</span>
+    <span class="c1"># check/setup scoring</span>
     <span class="k">if</span> <span class="ow">not</span> <span class="n">IsBackboneScoringSetUp</span><span class="p">(</span><span class="n">mhandle</span><span class="p">):</span>
         <span class="n">SetupDefaultBackboneScoring</span><span class="p">(</span><span class="n">mhandle</span><span class="p">)</span>
-    <span class="n">clash_scorer</span> <span class="o">=</span> <span class="n">mhandle</span><span class="o">.</span><span class="n">backbone_scorer</span><span class="o">.</span><span class="n">Get</span><span class="p">(</span><span class="s">&quot;clash&quot;</span><span class="p">)</span>
+
+    <span class="c1"># we&#39;re only calculating clash scores here, so we copy the default</span>
+    <span class="c1"># env and only attach a clash scorer. </span>
+    <span class="n">clash_scorer_env</span> <span class="o">=</span> <span class="n">mhandle</span><span class="o">.</span><span class="n">backbone_scorer_env</span><span class="o">.</span><span class="n">Copy</span><span class="p">()</span>
+    <span class="n">clash_scorer</span> <span class="o">=</span> <span class="n">scoring</span><span class="o">.</span><span class="n">ClashScorer</span><span class="p">()</span>
+    <span class="n">clash_scorer</span><span class="o">.</span><span class="n">AttachEnvironment</span><span class="p">(</span><span class="n">clash_scorer_env</span><span class="p">)</span>
 
     <span class="k">if</span> <span class="n">ff_lookup</span> <span class="o">==</span> <span class="bp">None</span><span class="p">:</span>
         <span class="n">ff_lookup</span> <span class="o">=</span> <span class="n">loop</span><span class="o">.</span><span class="n">ForcefieldLookup</span><span class="o">.</span><span class="n">GetDefault</span><span class="p">()</span>
 
-    <span class="c"># iterating mhandle.gaps. The number of gaps may change during the process,</span>
-    <span class="c"># hence we run by &#39;while&#39;, comparing to the updated list of gaps. If a gap</span>
-    <span class="c"># gets closed, it is deleted from mhandle.gaps, otherwise, current_gap_index</span>
-    <span class="c"># as a counter is increased.</span>
+    <span class="c1"># iterating mhandle.gaps. The number of gaps may change during the process,</span>
+    <span class="c1"># hence we run by &#39;while&#39;, comparing to the updated list of gaps. If a gap</span>
+    <span class="c1"># gets closed, it is deleted from mhandle.gaps, otherwise, current_gap_index</span>
+    <span class="c1"># as a counter is increased.</span>
     <span class="n">current_gap_index</span> <span class="o">=</span> <span class="mi">0</span>
     <span class="k">while</span> <span class="n">current_gap_index</span> <span class="o">&lt;</span> <span class="nb">len</span><span class="p">(</span><span class="n">mhandle</span><span class="o">.</span><span class="n">gaps</span><span class="p">):</span>
-        <span class="c"># in the end this determines if a gap was closed or not</span>
+        <span class="c1"># in the end this determines if a gap was closed or not</span>
         <span class="n">success</span> <span class="o">=</span> <span class="bp">False</span>
-        <span class="c"># work on a copy of the gap, if not closed in the end, no harm done</span>
+        <span class="c1"># work on a copy of the gap, if not closed in the end, no harm done</span>
         <span class="n">current_gap</span> <span class="o">=</span> <span class="n">mhandle</span><span class="o">.</span><span class="n">gaps</span><span class="p">[</span><span class="n">current_gap_index</span><span class="p">]</span><span class="o">.</span><span class="n">Copy</span><span class="p">()</span>
 
-        <span class="c"># A deletion is a gap of size 0 in the template, this means that to</span>
-        <span class="c"># transform the template sequence into the target sequence, aa&#39;s vanish,</span>
-        <span class="c"># so the target sequence has gap characters, the template not.</span>
-        <span class="c"># If we are not looking at a deletion, do nothing.</span>
+        <span class="c1"># A deletion is a gap of size 0 in the template, this means that to</span>
+        <span class="c1"># transform the template sequence into the target sequence, aa&#39;s vanish,</span>
+        <span class="c1"># so the target sequence has gap characters, the template not.</span>
+        <span class="c1"># If we are not looking at a deletion, do nothing.</span>
         <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">current_gap</span><span class="o">.</span><span class="n">seq</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span> <span class="ow">and</span> <span class="ow">not</span> <span class="n">current_gap</span><span class="o">.</span><span class="n">IsTerminal</span><span class="p">()</span>\
            <span class="ow">and</span> <span class="n">_InRange</span><span class="p">(</span><span class="n">current_gap</span><span class="p">,</span> <span class="n">chain_idx</span><span class="p">,</span> <span class="n">resnum_range</span><span class="p">):</span>
             
             <span class="n">current_chain</span> <span class="o">=</span> <span class="n">current_gap</span><span class="o">.</span><span class="n">GetChain</span><span class="p">()</span>
             <span class="n">current_chain_index</span> <span class="o">=</span> <span class="n">current_gap</span><span class="o">.</span><span class="n">GetChainIndex</span><span class="p">()</span>
 
-            <span class="c"># Try to close gap by relaxation: by checking how far we may extend</span>
-            <span class="c"># the gap, we get the backbone to be stretched. If no more extension</span>
-            <span class="c"># is possible, break out. On first successful relaxation for an</span>
-            <span class="c"># extension, we successfully stop.</span>
+            <span class="c1"># Try to close gap by relaxation: by checking how far we may extend</span>
+            <span class="c1"># the gap, we get the backbone to be stretched. If no more extension</span>
+            <span class="c1"># is possible, break out. On first successful relaxation for an</span>
+            <span class="c1"># extension, we successfully stop.</span>
             <span class="n">extender</span> <span class="o">=</span> <span class="n">_GetGapExtender</span><span class="p">(</span><span class="n">mhandle</span><span class="p">,</span> <span class="n">current_gap</span><span class="p">,</span>
                                        <span class="n">use_scoring_extender</span><span class="p">,</span>
                                        <span class="n">use_full_extender</span><span class="p">,</span>
@@ -451,8 +470,8 @@
             <span class="k">for</span> <span class="n">_</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="n">max_extension</span><span class="p">):</span>
                 <span class="k">if</span> <span class="ow">not</span> <span class="n">extender</span><span class="o">.</span><span class="n">Extend</span><span class="p">():</span>
                     <span class="k">break</span>
-                <span class="c"># gather residues for backbone relaxation, check that we get a</span>
-                <span class="c"># bunch of actual residues, otherwise jump to next extension</span>
+                <span class="c1"># gather residues for backbone relaxation, check that we get a</span>
+                <span class="c1"># bunch of actual residues, otherwise jump to next extension</span>
                 <span class="n">res_list</span> <span class="o">=</span> <span class="nb">list</span><span class="p">()</span>
                 <span class="n">n_stem_resnum</span> <span class="o">=</span> <span class="n">current_gap</span><span class="o">.</span><span class="n">before</span><span class="o">.</span><span class="n">GetNumber</span><span class="p">()</span>
                 <span class="n">c_stem_resnum</span> <span class="o">=</span> <span class="n">current_gap</span><span class="o">.</span><span class="n">after</span><span class="o">.</span><span class="n">GetNumber</span><span class="p">()</span>
@@ -467,34 +486,47 @@
                     <span class="n">idx</span> <span class="o">+=</span> <span class="mi">1</span>
                 <span class="k">if</span> <span class="ow">not</span> <span class="n">found_residues</span><span class="p">:</span>
                     <span class="k">continue</span>
-                <span class="c"># backbone relaxation, for now we allow 300 steps or stop at</span>
-                <span class="c"># max. force of 0.1</span>
+                <span class="c1"># backbone relaxation, for now we allow 300 steps or stop at</span>
+                <span class="c1"># max. force of 0.1</span>
                 <span class="n">bb_list</span> <span class="o">=</span> <span class="n">loop</span><span class="o">.</span><span class="n">BackboneList</span><span class="p">(</span><span class="n">current_gap</span><span class="o">.</span><span class="n">full_seq</span><span class="p">,</span> <span class="n">res_list</span><span class="p">)</span>
                 <span class="n">bb_relaxer</span> <span class="o">=</span> <span class="n">BackboneRelaxer</span><span class="p">(</span><span class="n">bb_list</span><span class="p">,</span> <span class="n">ff_lookup</span><span class="p">)</span>
                 <span class="n">potential_e</span> <span class="o">=</span> <span class="n">bb_relaxer</span><span class="o">.</span><span class="n">Run</span><span class="p">(</span><span class="n">bb_list</span><span class="p">,</span> <span class="mi">300</span><span class="p">,</span> <span class="mf">0.1</span><span class="p">)</span>
-                <span class="c"># check for clashes</span>
-                <span class="n">score</span> <span class="o">=</span> <span class="n">clash_scorer</span><span class="o">.</span><span class="n">CalculateScore</span><span class="p">(</span><span class="n">bb_list</span><span class="p">,</span>
-                                                    <span class="n">n_stem_resnum</span><span class="o">.</span><span class="n">GetNum</span><span class="p">(),</span>
+                <span class="c1"># check for clashes</span>
+
+                <span class="c1"># its a bit problematic since we score loops that are shifting </span>
+                <span class="c1"># around... so we perform a stash operation for each scoring step</span>
+
+                <span class="n">clash_scorer_env</span><span class="o">.</span><span class="n">Stash</span><span class="p">(</span><span class="n">n_stem_resnum</span><span class="o">.</span><span class="n">GetNum</span><span class="p">(),</span>
+                                       <span class="nb">len</span><span class="p">(</span><span class="n">bb_list</span><span class="p">),</span> <span class="n">current_chain_index</span><span class="p">)</span>
+                <span class="n">clash_scorer_env</span><span class="o">.</span><span class="n">SetEnvironment</span><span class="p">(</span><span class="n">bb_list</span><span class="p">,</span> <span class="n">n_stem_resnum</span><span class="o">.</span><span class="n">GetNum</span><span class="p">(),</span> 
+                                                <span class="n">current_chain_index</span><span class="p">)</span>
+                <span class="n">score</span> <span class="o">=</span> <span class="n">clash_scorer</span><span class="o">.</span><span class="n">CalculateScore</span><span class="p">(</span><span class="n">n_stem_resnum</span><span class="o">.</span><span class="n">GetNum</span><span class="p">(),</span>
+                                                    <span class="nb">len</span><span class="p">(</span><span class="n">bb_list</span><span class="p">),</span>
                                                     <span class="n">current_chain_index</span><span class="p">)</span>
+                <span class="n">clash_scorer_env</span><span class="o">.</span><span class="n">Pop</span><span class="p">()</span>
 
-                <span class="c"># if there is no clash and potential energy is low enough we</span>
-                <span class="c"># just solved a gap, delete it and update the scorer for the</span>
-                <span class="c"># changed model</span>
+                <span class="c1"># if there is no clash and potential energy is low enough we</span>
+                <span class="c1"># just solved a gap, delete it and update the scorer for the</span>
+                <span class="c1"># changed model</span>
                 <span class="k">if</span> <span class="n">score</span> <span class="o">&lt;</span> <span class="n">clash_thresh</span> <span class="ow">and</span> \
                    <span class="n">potential_e</span> <span class="o">&lt;</span> <span class="n">e_thresh</span> <span class="ow">and</span> \
                    <span class="n">bb_list</span><span class="o">.</span><span class="n">TransOmegaTorsions</span><span class="p">():</span>
-                    <span class="n">ost</span><span class="o">.</span><span class="n">LogInfo</span><span class="p">(</span><span class="s">&quot;Closed: </span><span class="si">%s</span><span class="s"> by relaxing </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> \
+                    <span class="n">ost</span><span class="o">.</span><span class="n">LogInfo</span><span class="p">(</span><span class="s2">&quot;Closed: </span><span class="si">%s</span><span class="s2"> by relaxing </span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> \
                                 <span class="p">(</span><span class="n">mhandle</span><span class="o">.</span><span class="n">gaps</span><span class="p">[</span><span class="n">current_gap_index</span><span class="p">],</span> <span class="n">current_gap</span><span class="p">))</span>
                     <span class="n">InsertLoopClearGaps</span><span class="p">(</span><span class="n">mhandle</span><span class="p">,</span> <span class="n">bb_list</span><span class="p">,</span> <span class="n">current_gap</span><span class="p">)</span>
+                    <span class="n">clash_scorer_env</span><span class="o">.</span><span class="n">SetEnvironment</span><span class="p">(</span><span class="n">bb_list</span><span class="p">,</span> 
+                                                    <span class="n">n_stem_resnum</span><span class="o">.</span><span class="n">GetNum</span><span class="p">(),</span> 
+                                                    <span class="n">current_chain_index</span><span class="p">)</span>
                     <span class="n">success</span> <span class="o">=</span> <span class="bp">True</span>
                     <span class="k">break</span>
 
-        <span class="c"># On closed gap, it is removed so the no. of gaps goes down by itself.</span>
-        <span class="c"># In case of no success, counter needs to be increased to jump to the</span>
-        <span class="c"># next gap.</span>
+
+        <span class="c1"># On closed gap, it is removed so the no. of gaps goes down by itself.</span>
+        <span class="c1"># In case of no success, counter needs to be increased to jump to the</span>
+        <span class="c1"># next gap.</span>
         <span class="k">if</span> <span class="ow">not</span> <span class="n">success</span><span class="p">:</span>
-            <span class="n">current_gap_index</span> <span class="o">+=</span> <span class="mi">1</span>
-</div>
+            <span class="n">current_gap_index</span> <span class="o">+=</span> <span class="mi">1</span></div>
+
 <div class="viewcode-block" id="MergeGapsByDistance"><a class="viewcode-back" href="../../../modelling/pipeline.html#promod3.modelling.MergeGapsByDistance">[docs]</a><span class="k">def</span> <span class="nf">MergeGapsByDistance</span><span class="p">(</span><span class="n">mhandle</span><span class="p">,</span> <span class="n">distance</span><span class="p">,</span> <span class="n">chain_idx</span> <span class="o">=</span> <span class="bp">None</span><span class="p">,</span> 
                         <span class="n">resnum_range</span> <span class="o">=</span> <span class="bp">None</span><span class="p">):</span>
     <span class="sd">&#39;&#39;&#39;Merge 2 neighbouring gaps by deleting residues in-between.</span>
@@ -524,54 +556,54 @@
 <span class="sd">    :type resnum_range: :class:`tuple` containing two :class:`int`</span>
 <span class="sd">    &#39;&#39;&#39;</span>
 
-    <span class="n">prof_name</span> <span class="o">=</span> <span class="s">&#39;closegaps::MergeGapsByDistance&#39;</span>
+    <span class="n">prof_name</span> <span class="o">=</span> <span class="s1">&#39;closegaps::MergeGapsByDistance&#39;</span>
     <span class="n">prof</span> <span class="o">=</span> <span class="n">core</span><span class="o">.</span><span class="n">StaticRuntimeProfiler</span><span class="o">.</span><span class="n">StartScoped</span><span class="p">(</span><span class="n">prof_name</span><span class="p">)</span>
 
     <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">mhandle</span><span class="o">.</span><span class="n">gaps</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">1</span><span class="p">:</span>
-        <span class="n">ost</span><span class="o">.</span><span class="n">LogInfo</span><span class="p">(</span><span class="s">&quot;Trying to merge </span><span class="si">%d</span><span class="s"> gap(s) with distance </span><span class="si">%d</span><span class="s">.&quot;</span> <span class="o">%</span> \
+        <span class="n">ost</span><span class="o">.</span><span class="n">LogInfo</span><span class="p">(</span><span class="s2">&quot;Trying to merge </span><span class="si">%d</span><span class="s2"> gap(s) with distance </span><span class="si">%d</span><span class="s2">.&quot;</span> <span class="o">%</span> \
                        <span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">mhandle</span><span class="o">.</span><span class="n">gaps</span><span class="p">),</span> <span class="n">distance</span><span class="p">))</span>
     <span class="k">else</span><span class="p">:</span>
         <span class="k">return</span>
 
-    <span class="c"># indicate if we merged gaps and should check for more</span>
+    <span class="c1"># indicate if we merged gaps and should check for more</span>
     <span class="n">try_again</span> <span class="o">=</span> <span class="bp">True</span>
 
-    <span class="c"># The number of gaps changes on merge, so we cannot just iterate them.</span>
-    <span class="c"># If we merged gaps, we do not know if this was the last one so try_again</span>
-    <span class="c"># is set to True. If no more gaps were merged, we stop by leaving try_again</span>
-    <span class="c"># as False.</span>
+    <span class="c1"># The number of gaps changes on merge, so we cannot just iterate them.</span>
+    <span class="c1"># If we merged gaps, we do not know if this was the last one so try_again</span>
+    <span class="c1"># is set to True. If no more gaps were merged, we stop by leaving try_again</span>
+    <span class="c1"># as False.</span>
     <span class="k">while</span> <span class="n">try_again</span><span class="p">:</span>
         <span class="n">try_again</span> <span class="o">=</span> <span class="bp">False</span>
-        <span class="c"># iterate all but the last gap, since we are always looking ahead</span>
+        <span class="c1"># iterate all but the last gap, since we are always looking ahead</span>
         <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">mhandle</span><span class="o">.</span><span class="n">gaps</span><span class="p">)</span> <span class="o">-</span> <span class="mi">1</span><span class="p">):</span>
             <span class="n">current_gap</span> <span class="o">=</span> <span class="n">mhandle</span><span class="o">.</span><span class="n">gaps</span><span class="p">[</span><span class="n">i</span><span class="p">]</span><span class="o">.</span><span class="n">Copy</span><span class="p">()</span>
             <span class="n">next_gap</span> <span class="o">=</span> <span class="n">mhandle</span><span class="o">.</span><span class="n">gaps</span><span class="p">[</span><span class="n">i</span><span class="o">+</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">Copy</span><span class="p">()</span>
-            <span class="c"># check that we are on the same chain</span>
+            <span class="c1"># check that we are on the same chain</span>
             <span class="k">if</span> <span class="n">current_gap</span><span class="o">.</span><span class="n">GetChain</span><span class="p">()</span> <span class="o">!=</span> <span class="n">next_gap</span><span class="o">.</span><span class="n">GetChain</span><span class="p">():</span>
                 <span class="k">continue</span>
-            <span class="c"># check for range (if given)</span>
+            <span class="c1"># check for range (if given)</span>
             <span class="k">if</span> <span class="ow">not</span> <span class="p">(</span><span class="n">_InRange</span><span class="p">(</span><span class="n">current_gap</span><span class="p">,</span> <span class="n">chain_idx</span><span class="p">,</span> <span class="n">resnum_range</span><span class="p">)</span> <span class="ow">and</span>\
                     <span class="n">_InRange</span><span class="p">(</span><span class="n">next_gap</span><span class="p">,</span> <span class="n">chain_idx</span><span class="p">,</span> <span class="n">resnum_range</span><span class="p">)):</span>
                 <span class="k">continue</span>
-            <span class="c"># no merging of gaps at the end AND the start :)</span>
+            <span class="c1"># no merging of gaps at the end AND the start :)</span>
             <span class="k">if</span> <span class="n">current_gap</span><span class="o">.</span><span class="n">IsNTerminal</span><span class="p">()</span> <span class="ow">and</span> <span class="n">next_gap</span><span class="o">.</span><span class="n">IsCTerminal</span><span class="p">():</span>
                 <span class="k">continue</span>
-            <span class="c"># get the distance between the gaps</span>
+            <span class="c1"># get the distance between the gaps</span>
             <span class="n">dist</span> <span class="o">=</span> <span class="n">next_gap</span><span class="o">.</span><span class="n">before</span><span class="o">.</span><span class="n">GetNumber</span><span class="p">()</span><span class="o">.</span><span class="n">GetNum</span><span class="p">()</span> \
                    <span class="o">-</span> <span class="n">current_gap</span><span class="o">.</span><span class="n">after</span><span class="o">.</span><span class="n">GetNumber</span><span class="p">()</span><span class="o">.</span><span class="n">GetNum</span><span class="p">()</span>
-            <span class="c"># NOTE: -1 can currently only happen when fixing ring punches</span>
-            <span class="c">#       in _pipeline.BuildSidechains</span>
+            <span class="c1"># NOTE: -1 can currently only happen when fixing ring punches</span>
+            <span class="c1">#       in _pipeline.BuildSidechains</span>
             <span class="k">if</span> <span class="n">dist</span> <span class="o">&lt;</span> <span class="o">-</span><span class="mi">1</span><span class="p">:</span>
-                <span class="n">ost</span><span class="o">.</span><span class="n">LogInfo</span><span class="p">(</span><span class="s">&quot;Non-sequential gaps found. Ignoring.&quot;</span><span class="p">)</span>
+                <span class="n">ost</span><span class="o">.</span><span class="n">LogInfo</span><span class="p">(</span><span class="s2">&quot;Non-sequential gaps found. Ignoring.&quot;</span><span class="p">)</span>
                 <span class="k">continue</span>
             <span class="k">if</span> <span class="n">dist</span> <span class="o">&lt;=</span> <span class="n">distance</span><span class="p">:</span>
-                <span class="c"># gaps are close enough, combine! combine!</span>
+                <span class="c1"># gaps are close enough, combine! combine!</span>
                 <span class="n">MergeGaps</span><span class="p">(</span><span class="n">mhandle</span><span class="p">,</span> <span class="n">i</span><span class="p">)</span>
-                <span class="n">ost</span><span class="o">.</span><span class="n">LogInfo</span><span class="p">(</span><span class="s">&quot;Merged gap </span><span class="si">%s</span><span class="s"> and </span><span class="si">%s</span><span class="s"> into </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> \
+                <span class="n">ost</span><span class="o">.</span><span class="n">LogInfo</span><span class="p">(</span><span class="s2">&quot;Merged gap </span><span class="si">%s</span><span class="s2"> and </span><span class="si">%s</span><span class="s2"> into </span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> \
                                <span class="p">(</span><span class="n">current_gap</span><span class="p">,</span> <span class="n">next_gap</span><span class="p">,</span> <span class="n">mhandle</span><span class="o">.</span><span class="n">gaps</span><span class="p">[</span><span class="n">i</span><span class="p">]))</span>
                 <span class="n">try_again</span> <span class="o">=</span> <span class="bp">True</span>
-                <span class="k">break</span>
-</div>
+                <span class="k">break</span></div>
+
 <div class="viewcode-block" id="FillLoopsByDatabase"><a class="viewcode-back" href="../../../modelling/pipeline.html#promod3.modelling.FillLoopsByDatabase">[docs]</a><span class="k">def</span> <span class="nf">FillLoopsByDatabase</span><span class="p">(</span><span class="n">mhandle</span><span class="p">,</span> <span class="n">fragment_db</span><span class="p">,</span> <span class="n">structure_db</span><span class="p">,</span>
                         <span class="n">torsion_sampler</span><span class="p">,</span> <span class="n">max_loops_to_search</span><span class="o">=</span><span class="mi">40</span><span class="p">,</span>
                         <span class="n">min_loops_required</span><span class="o">=</span><span class="mi">4</span><span class="p">,</span> <span class="n">max_res_extension</span><span class="o">=-</span><span class="mi">1</span><span class="p">,</span>
@@ -579,7 +611,7 @@
                         <span class="n">use_full_extender</span><span class="o">=</span><span class="bp">True</span><span class="p">,</span> <span class="n">score_variant</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span>
                         <span class="n">ring_punch_detection</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="n">chain_idx</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
                         <span class="n">resnum_range</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">max_num_all_atom</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span>
-                        <span class="n">clash_thresh</span><span class="o">=-</span><span class="mi">1</span><span class="p">):</span>
+                        <span class="n">clash_thresh</span><span class="o">=-</span><span class="mi">1</span><span class="p">,</span> <span class="n">length_dep_weights</span><span class="o">=</span><span class="bp">False</span><span class="p">):</span>
     <span class="sd">&#39;&#39;&#39;Try to fill up loops from a structural database.</span>
 
 <span class="sd">    Usually this will extend the gaps a bit to match candidates from the</span>
@@ -677,139 +709,148 @@
 <span class="sd">    :param clash_thresh: If &gt; 0, we only keep loop candidates which have a</span>
 <span class="sd">                         backbone clash score lower than this.</span>
 <span class="sd">    :type clash_thresh:  :class:`float`</span>
+
+<span class="sd">    :param length_dep_weights: :class:`ScoringWeights` provides different sets</span>
+<span class="sd">                               of weights that have been trained on different</span>
+<span class="sd">                               loop subsets. If this flag is true, the length</span>
+<span class="sd">                               dependent weights are used to select the final </span>
+<span class="sd">                               loops.</span>
+<span class="sd">    :type length_dep_weights: :class:`bool`</span>
 <span class="sd">    &#39;&#39;&#39;</span>
 
-    <span class="n">prof_name</span> <span class="o">=</span> <span class="s">&#39;closegaps::FillLoopsByDatabase&#39;</span>
+    <span class="n">prof_name</span> <span class="o">=</span> <span class="s1">&#39;closegaps::FillLoopsByDatabase&#39;</span>
     <span class="n">prof</span> <span class="o">=</span> <span class="n">core</span><span class="o">.</span><span class="n">StaticRuntimeProfiler</span><span class="o">.</span><span class="n">StartScoped</span><span class="p">(</span><span class="n">prof_name</span><span class="p">)</span>
 
     <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">mhandle</span><span class="o">.</span><span class="n">gaps</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">:</span>
-        <span class="n">ost</span><span class="o">.</span><span class="n">LogInfo</span><span class="p">(</span><span class="s">&quot;Trying to fill </span><span class="si">%d</span><span class="s"> gap(s) by database.&quot;</span> <span class="o">%</span> <span class="nb">len</span><span class="p">(</span><span class="n">mhandle</span><span class="o">.</span><span class="n">gaps</span><span class="p">))</span>
+        <span class="n">ost</span><span class="o">.</span><span class="n">LogInfo</span><span class="p">(</span><span class="s2">&quot;Trying to fill </span><span class="si">%d</span><span class="s2"> gap(s) by database.&quot;</span> <span class="o">%</span> <span class="nb">len</span><span class="p">(</span><span class="n">mhandle</span><span class="o">.</span><span class="n">gaps</span><span class="p">))</span>
     <span class="k">else</span><span class="p">:</span>
         <span class="k">return</span>
 
-    <span class="c"># check/setup scoring</span>
+    <span class="c1"># check/setup scoring</span>
     <span class="k">if</span> <span class="ow">not</span> <span class="n">IsBackboneScoringSetUp</span><span class="p">(</span><span class="n">mhandle</span><span class="p">):</span>
         <span class="n">SetupDefaultBackboneScoring</span><span class="p">(</span><span class="n">mhandle</span><span class="p">)</span>
     <span class="k">if</span> <span class="n">max_num_all_atom</span> <span class="o">&gt;</span> <span class="mi">0</span> <span class="ow">and</span> <span class="ow">not</span> <span class="n">IsAllAtomScoringSetUp</span><span class="p">(</span><span class="n">mhandle</span><span class="p">):</span>
         <span class="n">SetupDefaultAllAtomScoring</span><span class="p">(</span><span class="n">mhandle</span><span class="p">)</span>
 
-    <span class="c"># some score variants cannot deal with multiple insertions in one &quot;gap&quot;</span>
+    <span class="c1"># some score variants cannot deal with multiple insertions in one &quot;gap&quot;</span>
     <span class="n">disallow_ins_merge</span> <span class="o">=</span> <span class="p">(</span><span class="n">score_variant</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span>
-    <span class="c"># do we want DB features?</span>
+    <span class="c1"># do we want DB features?</span>
     <span class="n">add_db_features</span> <span class="o">=</span> <span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">mhandle</span><span class="o">.</span><span class="n">profiles</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span>
 
-    <span class="c"># check min_loops_required</span>
+    <span class="c1"># check min_loops_required</span>
     <span class="k">if</span> <span class="n">min_loops_required</span> <span class="o">&lt;</span> <span class="mi">0</span><span class="p">:</span>
         <span class="n">min_loops_required</span> <span class="o">=</span> <span class="n">max_loops_to_search</span>
-    <span class="c"># get biggest loop (w/o stems) stored in db</span>
+    <span class="c1"># get biggest loop (w/o stems) stored in db</span>
     <span class="n">max_db_loop_len</span> <span class="o">=</span> <span class="n">fragment_db</span><span class="o">.</span><span class="n">MaxFragLength</span><span class="p">()</span> <span class="o">-</span> <span class="mi">2</span>
 
-    <span class="c"># point to the current gap</span>
+    <span class="c1"># point to the current gap</span>
     <span class="n">gap_idx</span> <span class="o">=</span> <span class="mi">0</span>
 
-    <span class="c"># Iterate all gaps. Since the number of gaps may change, always compare to</span>
-    <span class="c"># an updated list. gap_idx is only increased when necessary, e.g. current</span>
-    <span class="c"># gap could not be removed.</span>
+    <span class="c1"># Iterate all gaps. Since the number of gaps may change, always compare to</span>
+    <span class="c1"># an updated list. gap_idx is only increased when necessary, e.g. current</span>
+    <span class="c1"># gap could not be removed.</span>
     <span class="k">while</span> <span class="n">gap_idx</span> <span class="o">&lt;</span> <span class="nb">len</span><span class="p">(</span><span class="n">mhandle</span><span class="o">.</span><span class="n">gaps</span><span class="p">)</span> <span class="ow">and</span> <span class="n">gap_idx</span> <span class="o">&gt;=</span> <span class="mi">0</span><span class="p">:</span>
 
-        <span class="c"># keep copy of original gap</span>
+        <span class="c1"># keep copy of original gap</span>
         <span class="n">gap_orig</span> <span class="o">=</span> <span class="n">mhandle</span><span class="o">.</span><span class="n">gaps</span><span class="p">[</span><span class="n">gap_idx</span><span class="p">]</span><span class="o">.</span><span class="n">Copy</span><span class="p">()</span>
         <span class="k">if</span> <span class="n">disallow_ins_merge</span><span class="p">:</span>
             <span class="n">gap_ins</span> <span class="o">=</span> <span class="n">CountEnclosedInsertions</span><span class="p">(</span><span class="n">mhandle</span><span class="p">,</span> <span class="n">gap_orig</span><span class="p">)</span>
 
-        <span class="c"># ignore terminal gaps and out-of-range (if range given)</span>
+        <span class="c1"># ignore terminal gaps and out-of-range (if range given)</span>
         <span class="k">if</span> <span class="n">gap_orig</span><span class="o">.</span><span class="n">IsTerminal</span><span class="p">()</span> \
            <span class="ow">or</span> <span class="ow">not</span> <span class="n">_InRange</span><span class="p">(</span><span class="n">gap_orig</span><span class="p">,</span> <span class="n">chain_idx</span><span class="p">,</span> <span class="n">resnum_range</span><span class="p">):</span>
             <span class="n">gap_idx</span> <span class="o">+=</span> <span class="mi">1</span>
             <span class="k">continue</span>
 
-        <span class="c">##################################</span>
-        <span class="c"># find loop candidates</span>
-        <span class="c">##################################</span>
-        <span class="c"># list of LoopCandidates to fill gap</span>
+        <span class="c1">##################################</span>
+        <span class="c1"># find loop candidates</span>
+        <span class="c1">##################################</span>
+        <span class="c1"># list of LoopCandidates to fill gap</span>
         <span class="n">actual_candidates</span> <span class="o">=</span> <span class="nb">list</span><span class="p">()</span>
-        <span class="c"># list of StructuralGap corresponding to actual_candidates</span>
+        <span class="c1"># list of StructuralGap corresponding to actual_candidates</span>
         <span class="n">actual_extended_gaps</span> <span class="o">=</span> <span class="nb">list</span><span class="p">()</span>
-        <span class="c"># list of dicts with DB specific scores</span>
-        <span class="c"># -&gt; empty if not add_db_features</span>
+        <span class="c1"># list of dicts with DB specific scores</span>
+        <span class="c1"># -&gt; empty if not add_db_features</span>
         <span class="n">actual_db_scores</span> <span class="o">=</span> <span class="nb">list</span><span class="p">()</span>
-        <span class="c"># number of loops found (stop if &gt;= max_loops_to_search)</span>
+        <span class="c1"># number of loops found (stop if &gt;= max_loops_to_search)</span>
         <span class="n">found_loops</span> <span class="o">=</span> <span class="mi">0</span>
-        <span class="c"># maximal length for this gap</span>
+        <span class="c1"># maximal length for this gap</span>
         <span class="k">if</span> <span class="n">max_res_extension</span> <span class="o">&gt;=</span> <span class="mi">0</span><span class="p">:</span>
             <span class="n">max_gap_length</span> <span class="o">=</span> <span class="nb">min</span><span class="p">(</span><span class="n">gap_orig</span><span class="o">.</span><span class="n">length</span> <span class="o">+</span> <span class="n">max_res_extension</span><span class="p">,</span>
                                  <span class="n">max_db_loop_len</span><span class="p">)</span>
         <span class="k">else</span><span class="p">:</span>
             <span class="n">max_gap_length</span> <span class="o">=</span> <span class="n">max_db_loop_len</span>
-        <span class="c"># currently extended gap and gap-extender</span>
+        <span class="c1"># currently extended gap and gap-extender</span>
         <span class="n">actual_gap</span> <span class="o">=</span> <span class="n">gap_orig</span><span class="o">.</span><span class="n">Copy</span><span class="p">()</span>
         <span class="n">actual_extender</span> <span class="o">=</span> <span class="n">_GetGapExtender</span><span class="p">(</span><span class="n">mhandle</span><span class="p">,</span> <span class="n">actual_gap</span><span class="p">,</span>
                                           <span class="n">use_scoring_extender</span><span class="p">,</span>
                                           <span class="n">use_full_extender</span><span class="p">,</span>
                                           <span class="n">max_gap_length</span><span class="p">)</span>
-        <span class="c"># iteratively extend actual_gap until we have enough loops</span>
+        <span class="c1"># iteratively extend actual_gap until we have enough loops</span>
         <span class="n">first_iteration</span> <span class="o">=</span> <span class="bp">True</span>
         <span class="k">while</span> <span class="n">actual_gap</span><span class="o">.</span><span class="n">length</span> <span class="o">&lt;=</span> <span class="n">max_gap_length</span><span class="p">:</span>
-            <span class="c"># check if we have enough</span>
+            <span class="c1"># check if we have enough</span>
             <span class="k">if</span> <span class="n">found_loops</span> <span class="o">&gt;=</span> <span class="n">max_loops_to_search</span><span class="p">:</span>
                 <span class="k">break</span>
 
-            <span class="c"># extend the gap</span>
+            <span class="c1"># extend the gap</span>
             <span class="k">if</span> <span class="ow">not</span> <span class="n">first_iteration</span><span class="p">:</span>
                 <span class="k">if</span> <span class="ow">not</span> <span class="n">actual_extender</span><span class="o">.</span><span class="n">Extend</span><span class="p">():</span>
                     <span class="k">break</span>
             <span class="n">first_iteration</span> <span class="o">=</span> <span class="bp">False</span>
 
-            <span class="c"># ensure both stems are valid</span>
+            <span class="c1"># ensure both stems are valid</span>
             <span class="n">n_stem</span> <span class="o">=</span> <span class="n">actual_gap</span><span class="o">.</span><span class="n">before</span>
             <span class="n">c_stem</span> <span class="o">=</span> <span class="n">actual_gap</span><span class="o">.</span><span class="n">after</span>
             <span class="k">if</span> <span class="ow">not</span> <span class="n">n_stem</span><span class="o">.</span><span class="n">IsValid</span><span class="p">()</span> <span class="ow">or</span> <span class="ow">not</span> <span class="n">c_stem</span><span class="o">.</span><span class="n">IsValid</span><span class="p">():</span>
                 <span class="k">break</span>
-            <span class="c"># skip if we try to merge insertions when disallowed</span>
+            <span class="c1"># skip if we try to merge insertions when disallowed</span>
             <span class="k">if</span> <span class="n">disallow_ins_merge</span> <span class="ow">and</span> \
                <span class="n">CountEnclosedInsertions</span><span class="p">(</span><span class="n">mhandle</span><span class="p">,</span> <span class="n">actual_gap</span><span class="p">)</span> <span class="o">!=</span> <span class="n">gap_ins</span><span class="p">:</span>
                 <span class="k">continue</span>
 
-            <span class="c"># get candidates for the current loop</span>
+            <span class="c1"># get candidates for the current loop</span>
             <span class="n">candidates</span> <span class="o">=</span> <span class="n">LoopCandidates</span><span class="o">.</span><span class="n">FillFromDatabase</span><span class="p">(</span>
                 <span class="n">n_stem</span><span class="p">,</span> <span class="n">c_stem</span><span class="p">,</span> <span class="n">actual_gap</span><span class="o">.</span><span class="n">full_seq</span><span class="p">,</span>
                 <span class="n">fragment_db</span><span class="p">,</span> <span class="n">structure_db</span><span class="p">,</span> <span class="n">extended_search</span><span class="p">)</span>
 
-            <span class="c"># skip gaps with no loop candidates</span>
+            <span class="c1"># skip gaps with no loop candidates</span>
             <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">candidates</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span>
                 <span class="k">continue</span>
-            <span class="c"># check for stem rmsd before ApplyCCD</span>
+            <span class="c1"># check for stem rmsd before ApplyCCD</span>
             <span class="k">if</span> <span class="n">add_db_features</span><span class="p">:</span>
                 <span class="n">db_scores</span> <span class="o">=</span> <span class="n">ScoreContainer</span><span class="p">()</span>
                 <span class="n">candidates</span><span class="o">.</span><span class="n">CalculateStemRMSDs</span><span class="p">(</span><span class="n">db_scores</span><span class="p">,</span> <span class="n">n_stem</span><span class="p">,</span> <span class="n">c_stem</span><span class="p">)</span>
-            <span class="c"># try to close loops</span>
+            <span class="c1"># try to close loops</span>
             <span class="k">try</span><span class="p">:</span>
-                <span class="c">#pylint: disable=broad-except</span>
+                <span class="c1">#pylint: disable=broad-except</span>
                 <span class="n">orig_indices</span> <span class="o">=</span> <span class="n">candidates</span><span class="o">.</span><span class="n">ApplyCCD</span><span class="p">(</span><span class="n">n_stem</span><span class="p">,</span> <span class="n">c_stem</span><span class="p">,</span>
                                                    <span class="n">torsion_sampler</span><span class="p">)</span>
                 
             <span class="k">except</span> <span class="ne">Exception</span><span class="p">:</span>
-                <span class="c"># CCD should work even if no residues exist before and/or after</span>
-                <span class="c"># the stems. If this is not desired, you should skip those gaps.</span>
-                <span class="c"># If anything else fails, the proposed gap is skipped.</span>
-                <span class="n">ost</span><span class="o">.</span><span class="n">LogWarning</span><span class="p">(</span><span class="s">&quot;ApplyCCD failure for &quot;</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">actual_gap</span><span class="p">))</span>
+                <span class="c1"># CCD should work even if no residues exist before and/or after</span>
+                <span class="c1"># the stems. If this is not desired, you should skip those gaps.</span>
+                <span class="c1"># If anything else fails, the proposed gap is skipped.</span>
+                <span class="n">ost</span><span class="o">.</span><span class="n">LogWarning</span><span class="p">(</span><span class="s2">&quot;ApplyCCD failure for &quot;</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">actual_gap</span><span class="p">))</span>
                 <span class="k">continue</span>
 
-            <span class="c"># remove clashing ones if desired</span>
+            <span class="c1"># remove clashing ones if desired</span>
             <span class="k">if</span> <span class="n">clash_thresh</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">:</span>
-                <span class="n">scorer</span> <span class="o">=</span> <span class="n">mhandle</span><span class="o">.</span><span class="n">backbone_scorer</span><span class="o">.</span><span class="n">Get</span><span class="p">(</span><span class="s">&quot;clash&quot;</span><span class="p">)</span>
+                <span class="n">clash_score_container</span> <span class="o">=</span> <span class="n">ScoreContainer</span><span class="p">()</span>
+                <span class="n">candidates</span><span class="o">.</span><span class="n">CalculateBackboneScores</span><span class="p">(</span><span class="n">clash_score_container</span><span class="p">,</span>
+                                                   <span class="n">mhandle</span><span class="p">,</span> <span class="p">[</span><span class="s2">&quot;clash&quot;</span><span class="p">],</span>
+                                                   <span class="n">n_stem</span><span class="o">.</span><span class="n">GetNumber</span><span class="p">()</span><span class="o">.</span><span class="n">GetNum</span><span class="p">(),</span>
+                                                   <span class="n">actual_gap</span><span class="o">.</span><span class="n">GetChainIndex</span><span class="p">())</span>
+                <span class="n">clash_scores</span> <span class="o">=</span> <span class="n">clash_score_container</span><span class="o">.</span><span class="n">Get</span><span class="p">(</span><span class="s2">&quot;clash&quot;</span><span class="p">)</span>
                 <span class="n">to_keep</span> <span class="o">=</span> <span class="p">[]</span>
                 <span class="k">for</span> <span class="n">i</span><span class="p">,</span> <span class="n">bb_list</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">candidates</span><span class="p">):</span>
-                    <span class="n">score</span> <span class="o">=</span> <span class="n">scorer</span><span class="o">.</span><span class="n">CalculateScore</span><span class="p">(</span><span class="n">bb_list</span><span class="p">,</span>
-                                                  <span class="n">n_stem</span><span class="o">.</span><span class="n">GetNumber</span><span class="p">()</span><span class="o">.</span><span class="n">GetNum</span><span class="p">(),</span>
-                                                  <span class="n">actual_gap</span><span class="o">.</span><span class="n">GetChainIndex</span><span class="p">())</span>
-                    <span class="k">if</span> <span class="n">score</span> <span class="o">&lt;</span> <span class="n">clash_thresh</span><span class="p">:</span>
+                    <span class="k">if</span> <span class="n">clash_scores</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">&lt;</span> <span class="n">clash_thresh</span><span class="p">:</span>
                         <span class="n">to_keep</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">i</span><span class="p">)</span>
                 <span class="n">candidates</span> <span class="o">=</span> <span class="n">candidates</span><span class="o">.</span><span class="n">Extract</span><span class="p">(</span><span class="n">to_keep</span><span class="p">)</span>
                 <span class="n">orig_indices</span> <span class="o">=</span> <span class="p">[</span><span class="n">orig_indices</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="n">to_keep</span><span class="p">]</span>
                 <span class="k">assert</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">orig_indices</span><span class="p">)</span> <span class="o">==</span> <span class="nb">len</span><span class="p">(</span><span class="n">candidates</span><span class="p">))</span>
 
-            <span class="c"># check for ring punchings</span>
+            <span class="c1"># check for ring punchings</span>
             <span class="k">if</span> <span class="n">ring_punch_detection</span> <span class="o">==</span> <span class="mi">1</span> <span class="ow">and</span> <span class="nb">len</span><span class="p">(</span><span class="n">candidates</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">:</span>
                 <span class="n">FilterCandidates</span><span class="p">(</span><span class="n">candidates</span><span class="p">,</span> <span class="n">mhandle</span><span class="o">.</span><span class="n">model</span><span class="p">,</span>
                                  <span class="n">actual_gap</span><span class="p">,</span> <span class="n">orig_indices</span><span class="p">)</span>
@@ -817,16 +858,16 @@
                 <span class="n">FilterCandidatesWithSC</span><span class="p">(</span><span class="n">candidates</span><span class="p">,</span> <span class="n">mhandle</span><span class="o">.</span><span class="n">model</span><span class="p">,</span>
                                        <span class="n">actual_gap</span><span class="p">,</span> <span class="n">orig_indices</span><span class="p">)</span>
             
-            <span class="c"># skip if no loop was successfully closed</span>
+            <span class="c1"># skip if no loop was successfully closed</span>
             <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">candidates</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span>
                 <span class="k">continue</span>
 
-            <span class="c"># deal with DB features</span>
+            <span class="c1"># deal with DB features</span>
             <span class="k">if</span> <span class="n">add_db_features</span><span class="p">:</span>
-                <span class="c"># get subset of stem rmsd scores</span>
+                <span class="c1"># get subset of stem rmsd scores</span>
                 <span class="k">assert</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">orig_indices</span><span class="p">)</span> <span class="o">==</span> <span class="nb">len</span><span class="p">(</span><span class="n">candidates</span><span class="p">))</span>
                 <span class="n">db_scores</span> <span class="o">=</span> <span class="n">db_scores</span><span class="o">.</span><span class="n">Extract</span><span class="p">(</span><span class="n">orig_indices</span><span class="p">)</span>
-                <span class="c"># add profile scores</span>
+                <span class="c1"># add profile scores</span>
                 <span class="n">prof</span> <span class="o">=</span> <span class="n">mhandle</span><span class="o">.</span><span class="n">profiles</span><span class="p">[</span><span class="n">actual_gap</span><span class="o">.</span><span class="n">GetChainIndex</span><span class="p">()]</span>
                 <span class="n">start_pos</span> <span class="o">=</span> <span class="n">n_stem</span><span class="o">.</span><span class="n">GetNumber</span><span class="p">()</span><span class="o">.</span><span class="n">GetNum</span><span class="p">()</span> <span class="o">-</span> <span class="mi">1</span>
                 <span class="n">candidates</span><span class="o">.</span><span class="n">CalculateSequenceProfileScores</span><span class="p">(</span><span class="n">db_scores</span><span class="p">,</span>
@@ -835,43 +876,44 @@
                 <span class="n">candidates</span><span class="o">.</span><span class="n">CalculateStructureProfileScores</span><span class="p">(</span><span class="n">db_scores</span><span class="p">,</span>
                                                            <span class="n">structure_db</span><span class="p">,</span>
                                                            <span class="n">prof</span><span class="p">,</span> <span class="n">start_pos</span><span class="p">)</span>
-                <span class="c"># update list</span>
+                <span class="c1"># update list</span>
                 <span class="n">actual_db_scores</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">db_scores</span><span class="p">)</span>
 
-            <span class="c"># update candidate lists</span>
+            <span class="c1"># update candidate lists</span>
             <span class="n">actual_candidates</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">candidates</span><span class="p">)</span>
             <span class="n">actual_extended_gaps</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">actual_gap</span><span class="o">.</span><span class="n">Copy</span><span class="p">())</span>
             <span class="n">found_loops</span> <span class="o">+=</span> <span class="nb">len</span><span class="p">(</span><span class="n">candidates</span><span class="p">)</span>
 
-        <span class="c"># skip if we didn&#39;t find enough</span>
+        <span class="c1"># skip if we didn&#39;t find enough</span>
         <span class="k">if</span> <span class="n">found_loops</span> <span class="o">&lt;</span> <span class="n">min_loops_required</span><span class="p">:</span>
-            <span class="n">ost</span><span class="o">.</span><span class="n">LogInfo</span><span class="p">(</span><span class="s">&quot;Failed at loop insertion (</span><span class="si">%s</span><span class="s">), only </span><span class="si">%d</span><span class="s"> candidates&quot;</span> <span class="o">%</span> \
+            <span class="n">ost</span><span class="o">.</span><span class="n">LogInfo</span><span class="p">(</span><span class="s2">&quot;Failed at loop insertion (</span><span class="si">%s</span><span class="s2">), only </span><span class="si">%d</span><span class="s2"> candidates&quot;</span> <span class="o">%</span> \
                         <span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">gap_orig</span><span class="p">),</span> <span class="n">found_loops</span><span class="p">))</span>
             <span class="n">gap_idx</span> <span class="o">+=</span> <span class="mi">1</span>
             <span class="k">continue</span>
 
-        <span class="c">##################################</span>
-        <span class="c"># close loop</span>
-        <span class="c">##################################</span>
+        <span class="c1">##################################</span>
+        <span class="c1"># close loop</span>
+        <span class="c1">##################################</span>
         <span class="n">new_idx</span> <span class="o">=</span> <span class="n">_CloseLoop</span><span class="p">(</span><span class="n">mhandle</span><span class="p">,</span> <span class="n">gap_orig</span><span class="p">,</span> <span class="n">actual_candidates</span><span class="p">,</span>
                              <span class="n">actual_extended_gaps</span><span class="p">,</span> <span class="n">score_variant</span><span class="p">,</span>
-                             <span class="n">actual_db_scores</span><span class="p">,</span> <span class="n">max_num_all_atom</span><span class="p">)</span>
+                             <span class="n">actual_db_scores</span><span class="p">,</span> <span class="n">max_num_all_atom</span><span class="p">,</span>
+                             <span class="n">length_dep_weights</span><span class="p">)</span>
         <span class="k">if</span> <span class="n">new_idx</span> <span class="o">==</span> <span class="o">-</span><span class="mi">2</span><span class="p">:</span>
-            <span class="c"># try next one if we failed</span>
+            <span class="c1"># try next one if we failed</span>
             <span class="n">gap_idx</span> <span class="o">+=</span> <span class="mi">1</span>
         <span class="k">else</span><span class="p">:</span>
-            <span class="c"># all good: fix sidechains if we&#39;re in ring-punch-mode and continue</span>
+            <span class="c1"># all good: fix sidechains if we&#39;re in ring-punch-mode and continue</span>
             <span class="k">if</span> <span class="n">ring_punch_detection</span> <span class="o">==</span> <span class="mi">2</span><span class="p">:</span>
                 <span class="n">ReconstructSidechains</span><span class="p">(</span><span class="n">mhandle</span><span class="o">.</span><span class="n">model</span><span class="p">,</span> <span class="n">keep_sidechains</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>
-            <span class="n">gap_idx</span> <span class="o">=</span> <span class="n">new_idx</span>
+            <span class="n">gap_idx</span> <span class="o">=</span> <span class="n">new_idx</span></div>
+
 
-</div>
 <div class="viewcode-block" id="FillLoopsByMonteCarlo"><a class="viewcode-back" href="../../../modelling/pipeline.html#promod3.modelling.FillLoopsByMonteCarlo">[docs]</a><span class="k">def</span> <span class="nf">FillLoopsByMonteCarlo</span><span class="p">(</span><span class="n">mhandle</span><span class="p">,</span> <span class="n">torsion_sampler</span><span class="p">,</span> <span class="n">max_loops_to_search</span><span class="o">=</span><span class="mi">6</span><span class="p">,</span>
                           <span class="n">max_extension</span><span class="o">=</span><span class="mi">30</span><span class="p">,</span> <span class="n">mc_num_loops</span><span class="o">=</span><span class="mi">2</span><span class="p">,</span> <span class="n">mc_steps</span><span class="o">=</span><span class="mi">5000</span><span class="p">,</span>
                           <span class="n">use_scoring_extender</span><span class="o">=</span><span class="bp">True</span><span class="p">,</span> <span class="n">use_full_extender</span><span class="o">=</span><span class="bp">True</span><span class="p">,</span>
                           <span class="n">score_variant</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">ring_punch_detection</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span>
                           <span class="n">fragger_handles</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">chain_idx</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
-                          <span class="n">resnum_range</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
+                          <span class="n">resnum_range</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">length_dep_weights</span><span class="o">=</span><span class="bp">False</span><span class="p">):</span>
     <span class="sd">&#39;&#39;&#39;Try to fill up loops with Monte Carlo sampling.</span>
 
 <span class="sd">    This is meant as a &quot;last-resort&quot; approach when it is not possible to fill</span>
@@ -938,89 +980,96 @@
 <span class="sd">    :param resnum_range: If not None, only gaps within this resnum range get</span>
 <span class="sd">                         processed</span>
 <span class="sd">    :type resnum_range: :class:`tuple` containing two :class:`int`</span>
+
+<span class="sd">    :param length_dep_weights: :class:`ScoringWeights` provides different sets</span>
+<span class="sd">                               of weights that have been trained on different</span>
+<span class="sd">                               loop subsets. If this flag is true, the length</span>
+<span class="sd">                               dependent weights are used to select the final </span>
+<span class="sd">                               loops.</span>
+<span class="sd">    :type length_dep_weights: :class:`bool`</span>
 <span class="sd">    &#39;&#39;&#39;</span>
 
-    <span class="n">prof_name</span> <span class="o">=</span> <span class="s">&#39;closegaps::FillLoopsByMonteCarlo&#39;</span>
+    <span class="n">prof_name</span> <span class="o">=</span> <span class="s1">&#39;closegaps::FillLoopsByMonteCarlo&#39;</span>
     <span class="n">prof</span> <span class="o">=</span> <span class="n">core</span><span class="o">.</span><span class="n">StaticRuntimeProfiler</span><span class="o">.</span><span class="n">StartScoped</span><span class="p">(</span><span class="n">prof_name</span><span class="p">)</span>
 
     <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">mhandle</span><span class="o">.</span><span class="n">gaps</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">:</span>
-        <span class="n">ost</span><span class="o">.</span><span class="n">LogInfo</span><span class="p">(</span><span class="s">&quot;Trying to fill </span><span class="si">%d</span><span class="s"> gap(s) by Monte Carlo.&quot;</span> \
+        <span class="n">ost</span><span class="o">.</span><span class="n">LogInfo</span><span class="p">(</span><span class="s2">&quot;Trying to fill </span><span class="si">%d</span><span class="s2"> gap(s) by Monte Carlo.&quot;</span> \
                     <span class="o">%</span> <span class="nb">len</span><span class="p">(</span><span class="n">mhandle</span><span class="o">.</span><span class="n">gaps</span><span class="p">))</span>
     <span class="k">else</span><span class="p">:</span>
         <span class="k">return</span>
 
-    <span class="c"># check/setup scoring</span>
+    <span class="c1"># check/setup scoring</span>
     <span class="k">if</span> <span class="ow">not</span> <span class="n">IsBackboneScoringSetUp</span><span class="p">(</span><span class="n">mhandle</span><span class="p">):</span>
         <span class="n">SetupDefaultBackboneScoring</span><span class="p">(</span><span class="n">mhandle</span><span class="p">)</span>
 
-    <span class="c"># point to the current gap</span>
+    <span class="c1"># point to the current gap</span>
     <span class="n">gap_idx</span> <span class="o">=</span> <span class="mi">0</span>
 
-    <span class="c"># Iterate all gaps. Since the number of gaps may change, always compare to</span>
-    <span class="c"># an updated list. gap_idx is only increased when necessary, e.g. current</span>
-    <span class="c"># gap could not be removed.</span>
+    <span class="c1"># Iterate all gaps. Since the number of gaps may change, always compare to</span>
+    <span class="c1"># an updated list. gap_idx is only increased when necessary, e.g. current</span>
+    <span class="c1"># gap could not be removed.</span>
     <span class="k">while</span> <span class="n">gap_idx</span> <span class="o">&lt;</span> <span class="nb">len</span><span class="p">(</span><span class="n">mhandle</span><span class="o">.</span><span class="n">gaps</span><span class="p">)</span> <span class="ow">and</span> <span class="n">gap_idx</span> <span class="o">&gt;=</span> <span class="mi">0</span><span class="p">:</span>
 
-        <span class="c"># keep copy of original gap</span>
+        <span class="c1"># keep copy of original gap</span>
         <span class="n">gap_orig</span> <span class="o">=</span> <span class="n">mhandle</span><span class="o">.</span><span class="n">gaps</span><span class="p">[</span><span class="n">gap_idx</span><span class="p">]</span><span class="o">.</span><span class="n">Copy</span><span class="p">()</span>
         <span class="k">if</span> <span class="n">score_variant</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span>
             <span class="n">gap_ins</span> <span class="o">=</span> <span class="n">CountEnclosedInsertions</span><span class="p">(</span><span class="n">mhandle</span><span class="p">,</span> <span class="n">gap_orig</span><span class="p">)</span>
 
-        <span class="c"># ignore terminal gaps and out-of-range (if range given)</span>
+        <span class="c1"># ignore terminal gaps and out-of-range (if range given)</span>
         <span class="k">if</span> <span class="n">gap_orig</span><span class="o">.</span><span class="n">IsTerminal</span><span class="p">()</span> \
            <span class="ow">or</span> <span class="ow">not</span> <span class="n">_InRange</span><span class="p">(</span><span class="n">gap_orig</span><span class="p">,</span> <span class="n">chain_idx</span><span class="p">,</span> <span class="n">resnum_range</span><span class="p">):</span>
             <span class="n">gap_idx</span> <span class="o">+=</span> <span class="mi">1</span>
             <span class="k">continue</span>
 
-        <span class="c">##################################</span>
-        <span class="c"># find loop candidates</span>
-        <span class="c">##################################</span>
-        <span class="c"># list of LoopCandidates to fill gap</span>
+        <span class="c1">##################################</span>
+        <span class="c1"># find loop candidates</span>
+        <span class="c1">##################################</span>
+        <span class="c1"># list of LoopCandidates to fill gap</span>
         <span class="n">actual_candidates</span> <span class="o">=</span> <span class="nb">list</span><span class="p">()</span>
-        <span class="c"># list of StructuralGap corresponding to actual_candidates</span>
+        <span class="c1"># list of StructuralGap corresponding to actual_candidates</span>
         <span class="n">actual_extended_gaps</span> <span class="o">=</span> <span class="nb">list</span><span class="p">()</span>
-        <span class="c"># number of loops found (stop if &gt;= max_loops_to_search)</span>
+        <span class="c1"># number of loops found (stop if &gt;= max_loops_to_search)</span>
         <span class="n">found_loops</span> <span class="o">=</span> <span class="mi">0</span>
-        <span class="c"># currently extended gap and gap-extender</span>
+        <span class="c1"># currently extended gap and gap-extender</span>
         <span class="n">actual_gap</span> <span class="o">=</span> <span class="n">gap_orig</span><span class="o">.</span><span class="n">Copy</span><span class="p">()</span>
-        <span class="c"># each extension can make it at most 1 longer...</span>
+        <span class="c1"># each extension can make it at most 1 longer...</span>
         <span class="n">max_loop_len</span> <span class="o">=</span> <span class="n">gap_orig</span><span class="o">.</span><span class="n">length</span> <span class="o">+</span> <span class="n">max_extension</span>
         <span class="n">actual_extender</span> <span class="o">=</span> <span class="n">_GetGapExtender</span><span class="p">(</span><span class="n">mhandle</span><span class="p">,</span> <span class="n">actual_gap</span><span class="p">,</span>
                                           <span class="n">use_scoring_extender</span><span class="p">,</span>
                                           <span class="n">use_full_extender</span><span class="p">,</span>
                                           <span class="n">max_loop_len</span><span class="p">)</span>
         <span class="n">actual_chain_idx</span> <span class="o">=</span> <span class="n">actual_gap</span><span class="o">.</span><span class="n">GetChainIndex</span><span class="p">()</span>
-        <span class="c"># iteratively extend actual_gap</span>
+        <span class="c1"># iteratively extend actual_gap</span>
         <span class="n">ext_step</span> <span class="o">=</span> <span class="mi">0</span>
 
         <span class="n">first_iteration</span> <span class="o">=</span> <span class="bp">True</span>
         <span class="k">while</span> <span class="n">found_loops</span> <span class="o">&lt;</span> <span class="n">max_loops_to_search</span> <span class="ow">and</span> <span class="n">ext_step</span> <span class="o">&lt;</span> <span class="n">max_extension</span><span class="p">:</span>
 
-            <span class="c"># extend the gap</span>
+            <span class="c1"># extend the gap</span>
             <span class="k">if</span> <span class="ow">not</span> <span class="n">first_iteration</span><span class="p">:</span>
                 <span class="k">if</span> <span class="ow">not</span> <span class="n">actual_extender</span><span class="o">.</span><span class="n">Extend</span><span class="p">():</span>
                     <span class="k">break</span>
             <span class="n">first_iteration</span> <span class="o">=</span> <span class="bp">False</span>
 
-            <span class="c"># make sure, that the loop seq has at least length 3</span>
+            <span class="c1"># make sure, that the loop seq has at least length 3</span>
             <span class="k">if</span> <span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">actual_gap</span><span class="o">.</span><span class="n">full_seq</span><span class="p">)</span> <span class="o">&lt;</span> <span class="mi">3</span><span class="p">):</span>
                 <span class="k">continue</span>
             <span class="n">ext_step</span> <span class="o">+=</span> <span class="mi">1</span>
             
-            <span class="c"># ensure both stems are valid</span>
+            <span class="c1"># ensure both stems are valid</span>
             <span class="k">if</span> <span class="ow">not</span> <span class="n">actual_gap</span><span class="o">.</span><span class="n">before</span><span class="o">.</span><span class="n">IsValid</span><span class="p">()</span> <span class="ow">or</span> \
                <span class="ow">not</span> <span class="n">actual_gap</span><span class="o">.</span><span class="n">after</span><span class="o">.</span><span class="n">IsValid</span><span class="p">():</span>
                 <span class="k">break</span>
-            <span class="c"># skip if we try to merge insertions with score_variant=0</span>
+            <span class="c1"># skip if we try to merge insertions with score_variant=0</span>
             <span class="k">if</span> <span class="n">score_variant</span> <span class="o">==</span> <span class="mi">0</span> <span class="ow">and</span> \
                <span class="n">CountEnclosedInsertions</span><span class="p">(</span><span class="n">mhandle</span><span class="p">,</span> <span class="n">actual_gap</span><span class="p">)</span> <span class="o">!=</span> <span class="n">gap_ins</span><span class="p">:</span>
                 <span class="k">continue</span>
 
-            <span class="c"># setup sampler, closer, scorer and cooler for MC</span>
+            <span class="c1"># setup sampler, closer, scorer and cooler for MC</span>
             <span class="k">if</span> <span class="n">fragger_handles</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span><span class="p">:</span>
                 <span class="n">fragger_handle</span> <span class="o">=</span> <span class="n">fragger_handles</span><span class="p">[</span><span class="n">actual_chain_idx</span><span class="p">]</span>
             <span class="k">try</span><span class="p">:</span>
-                <span class="c"># choose sampler</span>
+                <span class="c1"># choose sampler</span>
                 <span class="k">if</span> <span class="n">fragger_handles</span> <span class="ow">is</span> <span class="bp">None</span> <span class="ow">or</span> \
                    <span class="n">actual_gap</span><span class="o">.</span><span class="n">length</span> <span class="o">&lt;</span> <span class="n">fragger_handle</span><span class="o">.</span><span class="n">fragment_length</span><span class="p">:</span>
                     <span class="n">mc_sampler</span> <span class="o">=</span> <span class="n">PhiPsiSampler</span><span class="p">(</span><span class="n">actual_gap</span><span class="o">.</span><span class="n">full_seq</span><span class="p">,</span>
@@ -1039,66 +1088,69 @@
                 <span class="n">weights</span> <span class="o">=</span> <span class="n">_GetMCWeights</span><span class="p">()</span>
                 
                 <span class="n">mc_scorer</span> <span class="o">=</span> <span class="n">LinearScorer</span><span class="p">(</span><span class="n">mhandle</span><span class="o">.</span><span class="n">backbone_scorer</span><span class="p">,</span>
+                                         <span class="n">mhandle</span><span class="o">.</span><span class="n">backbone_scorer_env</span><span class="p">,</span>
                                          <span class="n">actual_gap</span><span class="o">.</span><span class="n">before</span><span class="o">.</span><span class="n">GetNumber</span><span class="p">()</span><span class="o">.</span><span class="n">GetNum</span><span class="p">(),</span>
+                                         <span class="nb">len</span><span class="p">(</span><span class="n">actual_gap</span><span class="o">.</span><span class="n">full_seq</span><span class="p">),</span>
                                          <span class="n">actual_chain_idx</span><span class="p">,</span> <span class="n">weights</span><span class="p">)</span>
 
                 <span class="n">start_temperature</span> <span class="o">=</span> <span class="mi">100</span>
                 <span class="n">cooling_factor</span> <span class="o">=</span> <span class="mf">0.9</span>
-                <span class="c"># the number of 109 is roughly the number of times we have to apply</span>
-                <span class="c"># a factor of 0.9 to 100 until it reaches a value of 0.001</span>
+                <span class="c1"># the number of 109 is roughly the number of times we have to apply</span>
+                <span class="c1"># a factor of 0.9 to 100 until it reaches a value of 0.001</span>
                 <span class="n">cooling_interval</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="nb">round</span><span class="p">(</span><span class="n">mc_steps</span><span class="o">/</span><span class="mf">109.0</span><span class="p">))</span>
                 <span class="n">mc_cooler</span> <span class="o">=</span> <span class="n">ExponentialCooler</span><span class="p">(</span><span class="n">cooling_interval</span><span class="p">,</span>
                                               <span class="n">start_temperature</span><span class="p">,</span>
                                               <span class="n">cooling_factor</span><span class="p">)</span>
             <span class="k">except</span><span class="p">:</span>
-                <span class="c"># something went terribly wrong...</span>
-                <span class="n">ost</span><span class="o">.</span><span class="n">LogError</span><span class="p">(</span><span class="s">&#39;Failed to set up MC components&#39;</span><span class="p">)</span>
+                <span class="c1"># something went terribly wrong...</span>
+                <span class="n">ost</span><span class="o">.</span><span class="n">LogError</span><span class="p">(</span><span class="s1">&#39;Failed to set up MC components&#39;</span><span class="p">)</span>
                 <span class="k">raise</span>
 
-            <span class="c"># try to get candidates for the current loop</span>
+            <span class="c1"># try to get candidates for the current loop</span>
             <span class="k">try</span><span class="p">:</span>
-                <span class="n">ost</span><span class="o">.</span><span class="n">LogVerbose</span><span class="p">(</span><span class="s">&quot;Firing MC for &quot;</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">actual_gap</span><span class="p">))</span>
+                <span class="n">ost</span><span class="o">.</span><span class="n">LogVerbose</span><span class="p">(</span><span class="s2">&quot;Firing MC for &quot;</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">actual_gap</span><span class="p">))</span>
                 <span class="n">candidates</span> <span class="o">=</span> <span class="n">LoopCandidates</span><span class="o">.</span><span class="n">FillFromMonteCarloSampler</span><span class="p">(</span>
                     <span class="n">actual_gap</span><span class="o">.</span><span class="n">full_seq</span><span class="p">,</span> <span class="n">mc_num_loops</span><span class="p">,</span> <span class="n">mc_steps</span><span class="p">,</span> <span class="n">mc_sampler</span><span class="p">,</span>
                     <span class="n">mc_closer</span><span class="p">,</span> <span class="n">mc_scorer</span><span class="p">,</span> <span class="n">mc_cooler</span><span class="p">)</span>
             <span class="k">except</span> <span class="ne">RuntimeError</span><span class="p">:</span>
-                <span class="c"># monte carlo cannot be initialized when the stems are too far</span>
-                <span class="c"># apart  =&gt; we need further loop extension</span>
-                <span class="n">ost</span><span class="o">.</span><span class="n">LogVerbose</span><span class="p">(</span><span class="s">&quot;Failed in setting up &quot;</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">actual_gap</span><span class="p">)</span> <span class="o">+</span> 
-                               <span class="s">&quot; stems might be too far away...&quot;</span><span class="p">)</span>
+                <span class="c1"># monte carlo cannot be initialized when the stems are too far</span>
+                <span class="c1"># apart  =&gt; we need further loop extension</span>
+                <span class="n">ost</span><span class="o">.</span><span class="n">LogVerbose</span><span class="p">(</span><span class="s2">&quot;Failed in setting up &quot;</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">actual_gap</span><span class="p">)</span> <span class="o">+</span> 
+                               <span class="s2">&quot; stems might be too far away...&quot;</span><span class="p">)</span>
                 <span class="k">continue</span>
-            <span class="c"># check for ring punchings</span>
+            <span class="c1"># check for ring punchings</span>
             <span class="k">if</span> <span class="n">ring_punch_detection</span> <span class="o">==</span> <span class="mi">1</span> <span class="ow">and</span> <span class="nb">len</span><span class="p">(</span><span class="n">candidates</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">:</span>
                 <span class="n">FilterCandidates</span><span class="p">(</span><span class="n">candidates</span><span class="p">,</span> <span class="n">mhandle</span><span class="o">.</span><span class="n">model</span><span class="p">,</span> <span class="n">actual_gap</span><span class="p">)</span>
             <span class="k">elif</span> <span class="n">ring_punch_detection</span> <span class="o">==</span> <span class="mi">2</span> <span class="ow">and</span> <span class="nb">len</span><span class="p">(</span><span class="n">candidates</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">:</span>
                 <span class="n">FilterCandidatesWithSC</span><span class="p">(</span><span class="n">candidates</span><span class="p">,</span> <span class="n">mhandle</span><span class="o">.</span><span class="n">model</span><span class="p">,</span> <span class="n">actual_gap</span><span class="p">)</span>
-            <span class="c"># skip if nothing found</span>
+            <span class="c1"># skip if nothing found</span>
             <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">candidates</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span>
                 <span class="k">continue</span>
 
-            <span class="c"># update candidate lists</span>
+            <span class="c1"># update candidate lists</span>
             <span class="n">actual_candidates</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">candidates</span><span class="p">)</span>
             <span class="n">actual_extended_gaps</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">actual_gap</span><span class="o">.</span><span class="n">Copy</span><span class="p">())</span>
             <span class="n">found_loops</span> <span class="o">+=</span> <span class="nb">len</span><span class="p">(</span><span class="n">candidates</span><span class="p">)</span>
 
-        <span class="c">##################################</span>
-        <span class="c"># close loop</span>
-        <span class="c">##################################</span>
+        <span class="c1">##################################</span>
+        <span class="c1"># close loop</span>
+        <span class="c1">##################################</span>
         <span class="n">new_idx</span> <span class="o">=</span> <span class="n">_CloseLoop</span><span class="p">(</span><span class="n">mhandle</span><span class="p">,</span> <span class="n">gap_orig</span><span class="p">,</span> <span class="n">actual_candidates</span><span class="p">,</span>
-                             <span class="n">actual_extended_gaps</span><span class="p">,</span> <span class="n">score_variant</span><span class="p">)</span>
+                             <span class="n">actual_extended_gaps</span><span class="p">,</span> <span class="n">score_variant</span><span class="p">,</span>
+                             <span class="n">length_dep_weights</span><span class="o">=</span><span class="n">length_dep_weights</span><span class="p">)</span>
         <span class="k">if</span> <span class="n">new_idx</span> <span class="o">==</span> <span class="o">-</span><span class="mi">2</span><span class="p">:</span>
-            <span class="c"># try next one if we failed</span>
+            <span class="c1"># try next one if we failed</span>
             <span class="n">gap_idx</span> <span class="o">+=</span> <span class="mi">1</span>
         <span class="k">else</span><span class="p">:</span>
-            <span class="c"># all good: fix sidechains if we&#39;re in ring-punch-mode and continue</span>
+            <span class="c1"># all good: fix sidechains if we&#39;re in ring-punch-mode and continue</span>
             <span class="k">if</span> <span class="n">ring_punch_detection</span> <span class="o">==</span> <span class="mi">2</span><span class="p">:</span>
                 <span class="n">ReconstructSidechains</span><span class="p">(</span><span class="n">mhandle</span><span class="o">.</span><span class="n">model</span><span class="p">,</span> <span class="n">keep_sidechains</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>
-            <span class="n">gap_idx</span> <span class="o">=</span> <span class="n">new_idx</span>
+            <span class="n">gap_idx</span> <span class="o">=</span> <span class="n">new_idx</span></div>
+
 
-</div>
 <div class="viewcode-block" id="CloseGaps"><a class="viewcode-back" href="../../../modelling/pipeline.html#promod3.modelling.CloseGaps">[docs]</a><span class="k">def</span> <span class="nf">CloseGaps</span><span class="p">(</span><span class="n">mhandle</span><span class="p">,</span> <span class="n">merge_distance</span><span class="o">=</span><span class="mi">4</span><span class="p">,</span> <span class="n">fragment_db</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">structure_db</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
               <span class="n">torsion_sampler</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">fragger_handles</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">chain_idx</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
-              <span class="n">resnum_range</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
+              <span class="n">resnum_range</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">length_dep_weights</span><span class="o">=</span><span class="bp">False</span><span class="p">):</span>
     <span class="sd">&#39;&#39;&#39;</span>
 <span class="sd">    Tries to close all gaps in a model, except termini. It will go through</span>
 <span class="sd">    following steps:</span>
@@ -1144,9 +1196,16 @@
 <span class="sd">    :param resnum_range: If not None, only gaps within this resnum range get</span>
 <span class="sd">                         processed.</span>
 <span class="sd">    :type resnum_range: :class:`tuple` containing two :class:`int`  </span>
+
+<span class="sd">    :param length_dep_weights: :class:`ScoringWeights` provides different sets</span>
+<span class="sd">                               of weights that have been trained on different</span>
+<span class="sd">                               loop subsets. If this flag is true, the length</span>
+<span class="sd">                               dependent weights are used to close loops with</span>
+<span class="sd">                               database / Monte Carlo.</span>
+<span class="sd">    :type length_dep_weights: :class:`bool`</span>
 <span class="sd">    &#39;&#39;&#39;</span>
 
-    <span class="c"># load stuff if needed</span>
+    <span class="c1"># load stuff if needed</span>
     <span class="k">if</span> <span class="n">fragment_db</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span>
         <span class="n">fragment_db</span> <span class="o">=</span> <span class="n">loop</span><span class="o">.</span><span class="n">LoadFragDB</span><span class="p">()</span>
     <span class="k">if</span> <span class="n">structure_db</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span>
@@ -1154,48 +1213,52 @@
     <span class="k">if</span> <span class="n">torsion_sampler</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span>
         <span class="n">torsion_sampler</span> <span class="o">=</span> <span class="n">loop</span><span class="o">.</span><span class="n">LoadTorsionSamplerCoil</span><span class="p">()</span>
 
-    <span class="c"># try to close small deletions by relaxing them</span>
+    <span class="c1"># try to close small deletions by relaxing them</span>
     <span class="n">CloseSmallDeletions</span><span class="p">(</span><span class="n">mhandle</span><span class="p">,</span> <span class="n">chain_idx</span><span class="o">=</span><span class="n">chain_idx</span><span class="p">,</span> 
                         <span class="n">resnum_range</span><span class="o">=</span><span class="n">resnum_range</span><span class="p">)</span>
 
-    <span class="c"># iteratively merge gaps of distance i and fill loops by database</span>
+    <span class="c1"># iteratively merge gaps of distance i and fill loops by database</span>
     <span class="k">for</span> <span class="n">distance</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="n">merge_distance</span><span class="p">):</span>
         <span class="n">MergeGapsByDistance</span><span class="p">(</span><span class="n">mhandle</span><span class="p">,</span> <span class="n">distance</span><span class="p">,</span> <span class="n">chain_idx</span><span class="o">=</span><span class="n">chain_idx</span><span class="p">,</span>
                             <span class="n">resnum_range</span><span class="o">=</span><span class="n">resnum_range</span><span class="p">)</span>
         <span class="n">FillLoopsByDatabase</span><span class="p">(</span><span class="n">mhandle</span><span class="p">,</span> <span class="n">fragment_db</span><span class="p">,</span> <span class="n">structure_db</span><span class="p">,</span>
                             <span class="n">torsion_sampler</span><span class="p">,</span> <span class="n">min_loops_required</span><span class="o">=-</span><span class="mi">1</span><span class="p">,</span>
                             <span class="n">max_res_extension</span><span class="o">=</span><span class="mi">6</span><span class="p">,</span> <span class="n">chain_idx</span><span class="o">=</span><span class="n">chain_idx</span><span class="p">,</span>
-                            <span class="n">resnum_range</span><span class="o">=</span><span class="n">resnum_range</span><span class="p">,</span> <span class="n">clash_thresh</span><span class="o">=</span><span class="mi">10</span><span class="p">)</span>
+                            <span class="n">resnum_range</span><span class="o">=</span><span class="n">resnum_range</span><span class="p">,</span> <span class="n">clash_thresh</span><span class="o">=</span><span class="mi">10</span><span class="p">,</span>
+                            <span class="n">length_dep_weights</span><span class="o">=</span><span class="n">length_dep_weights</span><span class="p">)</span>
         
-    <span class="c"># if above fails, try DB-fill with less restrictions</span>
+    <span class="c1"># if above fails, try DB-fill with less restrictions</span>
     <span class="n">FillLoopsByDatabase</span><span class="p">(</span><span class="n">mhandle</span><span class="p">,</span> <span class="n">fragment_db</span><span class="p">,</span> <span class="n">structure_db</span><span class="p">,</span>
                         <span class="n">torsion_sampler</span><span class="p">,</span> <span class="n">min_loops_required</span><span class="o">=-</span><span class="mi">1</span><span class="p">,</span>
                         <span class="n">chain_idx</span><span class="o">=</span><span class="n">chain_idx</span><span class="p">,</span> <span class="n">resnum_range</span><span class="o">=</span><span class="n">resnum_range</span><span class="p">,</span>
-                        <span class="n">clash_thresh</span><span class="o">=</span><span class="mi">10</span><span class="p">)</span>
+                        <span class="n">clash_thresh</span><span class="o">=</span><span class="mi">10</span><span class="p">,</span> 
+                        <span class="n">length_dep_weights</span><span class="o">=</span><span class="n">length_dep_weights</span><span class="p">)</span>
     <span class="n">FillLoopsByDatabase</span><span class="p">(</span><span class="n">mhandle</span><span class="p">,</span> <span class="n">fragment_db</span><span class="p">,</span> <span class="n">structure_db</span><span class="p">,</span>
                         <span class="n">torsion_sampler</span><span class="p">,</span> <span class="n">chain_idx</span><span class="o">=</span><span class="n">chain_idx</span><span class="p">,</span>
-                        <span class="n">resnum_range</span><span class="o">=</span><span class="n">resnum_range</span><span class="p">)</span>
+                        <span class="n">resnum_range</span><span class="o">=</span><span class="n">resnum_range</span><span class="p">,</span>
+                        <span class="n">length_dep_weights</span><span class="o">=</span><span class="n">length_dep_weights</span><span class="p">)</span>
 
-    <span class="c"># close remaining gaps by Monte Carlo</span>
+    <span class="c1"># close remaining gaps by Monte Carlo</span>
     <span class="n">FillLoopsByMonteCarlo</span><span class="p">(</span><span class="n">mhandle</span><span class="p">,</span> <span class="n">torsion_sampler</span><span class="p">,</span> 
                           <span class="n">fragger_handles</span><span class="o">=</span><span class="n">fragger_handles</span><span class="p">,</span> 
                           <span class="n">chain_idx</span><span class="o">=</span><span class="n">chain_idx</span><span class="p">,</span>
-                          <span class="n">resnum_range</span><span class="o">=</span><span class="n">resnum_range</span><span class="p">)</span>
+                          <span class="n">resnum_range</span><span class="o">=</span><span class="n">resnum_range</span><span class="p">,</span>
+                          <span class="n">length_dep_weights</span><span class="o">=</span><span class="n">length_dep_weights</span><span class="p">)</span>
 
-    <span class="c"># last resort approach to close large deletions</span>
+    <span class="c1"># last resort approach to close large deletions</span>
     <span class="n">CloseLargeDeletions</span><span class="p">(</span><span class="n">mhandle</span><span class="p">,</span> <span class="n">structure_db</span><span class="p">,</span> <span class="n">chain_idx</span><span class="o">=</span><span class="n">chain_idx</span><span class="p">,</span> 
-                        <span class="n">resnum_range</span><span class="o">=</span><span class="n">resnum_range</span><span class="p">)</span>
+                        <span class="n">resnum_range</span><span class="o">=</span><span class="n">resnum_range</span><span class="p">)</span></div>
+
+    <span class="c1"># NOTE:</span>
+    <span class="c1"># In the function above, we call :func:`FillLoopsByDatabase` multiple</span>
+    <span class="c1"># times. First, we try to close &quot;easy&quot; gaps which require few extensions</span>
+    <span class="c1"># (we wish to limit the damage we do on the template) and for which we have</span>
+    <span class="c1"># plenty of loop candidates. If some gaps cannot be closed like this, we try</span>
+    <span class="c1"># less restrictive options. This approach is helpful if neighboring gaps are</span>
+    <span class="c1"># close together and the one closer to the C-terminus is easier to close.</span>
+    <span class="c1"># Several variants were evaluated on 1752 target-template-pairs and this one</span>
+    <span class="c1"># worked best.</span>
 
-    <span class="c"># NOTE:</span>
-    <span class="c"># In the function above, we call :func:`FillLoopsByDatabase` multiple</span>
-    <span class="c"># times. First, we try to close &quot;easy&quot; gaps which require few extensions</span>
-    <span class="c"># (we wish to limit the damage we do on the template) and for which we have</span>
-    <span class="c"># plenty of loop candidates. If some gaps cannot be closed like this, we try</span>
-    <span class="c"># less restrictive options. This approach is helpful if neighboring gaps are</span>
-    <span class="c"># close together and the one closer to the C-terminus is easier to close.</span>
-    <span class="c"># Several variants were evaluated on 1752 target-template-pairs and this one</span>
-    <span class="c"># worked best.</span>
-</div>
 <div class="viewcode-block" id="ModelTermini"><a class="viewcode-back" href="../../../modelling/pipeline.html#promod3.modelling.ModelTermini">[docs]</a><span class="k">def</span> <span class="nf">ModelTermini</span><span class="p">(</span><span class="n">mhandle</span><span class="p">,</span> <span class="n">torsion_sampler</span><span class="p">,</span> <span class="n">fragger_handles</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
                  <span class="n">mc_num_loops</span><span class="o">=</span><span class="mi">20</span><span class="p">,</span> <span class="n">mc_steps</span><span class="o">=</span><span class="mi">5000</span><span class="p">):</span>
     <span class="sd">&#39;&#39;&#39;Try to model termini with Monte Carlo sampling.</span>
@@ -1230,24 +1293,24 @@
 <span class="sd">    :type mc_steps:  :class:`int`</span>
 <span class="sd">    &#39;&#39;&#39;</span>
 
-    <span class="n">prof_name</span> <span class="o">=</span> <span class="s">&#39;closegaps::ModelTermini&#39;</span>
+    <span class="n">prof_name</span> <span class="o">=</span> <span class="s1">&#39;closegaps::ModelTermini&#39;</span>
     <span class="n">prof</span> <span class="o">=</span> <span class="n">core</span><span class="o">.</span><span class="n">StaticRuntimeProfiler</span><span class="o">.</span><span class="n">StartScoped</span><span class="p">(</span><span class="n">prof_name</span><span class="p">)</span>
 
-    <span class="c"># get terminal gaps (copies as we&#39;ll clear them as we go)</span>
+    <span class="c1"># get terminal gaps (copies as we&#39;ll clear them as we go)</span>
     <span class="n">terminal_gaps</span> <span class="o">=</span> <span class="p">[</span><span class="n">g</span><span class="o">.</span><span class="n">Copy</span><span class="p">()</span> <span class="k">for</span> <span class="n">g</span> <span class="ow">in</span> <span class="n">mhandle</span><span class="o">.</span><span class="n">gaps</span> <span class="k">if</span> <span class="n">g</span><span class="o">.</span><span class="n">IsTerminal</span><span class="p">()</span> <span class="ow">and</span> <span class="n">g</span><span class="o">.</span><span class="n">length</span> <span class="o">&gt;</span> <span class="mi">1</span><span class="p">]</span>
     <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">terminal_gaps</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">:</span>
-        <span class="n">ost</span><span class="o">.</span><span class="n">LogInfo</span><span class="p">(</span><span class="s">&quot;Trying to model </span><span class="si">%d</span><span class="s"> terminal gap(s).&quot;</span> <span class="o">%</span> <span class="nb">len</span><span class="p">(</span><span class="n">terminal_gaps</span><span class="p">))</span>
+        <span class="n">ost</span><span class="o">.</span><span class="n">LogInfo</span><span class="p">(</span><span class="s2">&quot;Trying to model </span><span class="si">%d</span><span class="s2"> terminal gap(s).&quot;</span> <span class="o">%</span> <span class="nb">len</span><span class="p">(</span><span class="n">terminal_gaps</span><span class="p">))</span>
     <span class="k">else</span><span class="p">:</span>
         <span class="k">return</span>
 
-    <span class="c"># check/setup scoring</span>
+    <span class="c1"># check/setup scoring</span>
     <span class="k">if</span> <span class="ow">not</span> <span class="n">IsBackboneScoringSetUp</span><span class="p">(</span><span class="n">mhandle</span><span class="p">):</span>
         <span class="n">SetupDefaultBackboneScoring</span><span class="p">(</span><span class="n">mhandle</span><span class="p">)</span>
 
-    <span class="c"># model them</span>
+    <span class="c1"># model them</span>
     <span class="k">for</span> <span class="n">actual_gap</span> <span class="ow">in</span> <span class="n">terminal_gaps</span><span class="p">:</span>
         
-        <span class="c"># extract info</span>
+        <span class="c1"># extract info</span>
         <span class="k">if</span> <span class="n">actual_gap</span><span class="o">.</span><span class="n">IsNTerminal</span><span class="p">():</span>
             <span class="n">start_resnum</span> <span class="o">=</span> <span class="mi">1</span>
         <span class="k">else</span><span class="p">:</span>
@@ -1257,7 +1320,7 @@
         <span class="k">if</span> <span class="n">fragger_handles</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span><span class="p">:</span>
             <span class="n">fragger_handle</span> <span class="o">=</span> <span class="n">fragger_handles</span><span class="p">[</span><span class="n">actual_chain_idx</span><span class="p">]</span>
 
-        <span class="c"># choose sampler</span>
+        <span class="c1"># choose sampler</span>
         <span class="k">if</span> <span class="n">fragger_handles</span> <span class="ow">is</span> <span class="bp">None</span> <span class="ow">or</span> \
            <span class="n">actual_gap</span><span class="o">.</span><span class="n">length</span> <span class="o">&lt;</span> <span class="n">fragger_handle</span><span class="o">.</span><span class="n">fragment_length</span><span class="p">:</span>
             <span class="n">mc_sampler</span> <span class="o">=</span> <span class="n">PhiPsiSampler</span><span class="p">(</span><span class="n">actual_gap</span><span class="o">.</span><span class="n">full_seq</span><span class="p">,</span>
@@ -1268,50 +1331,51 @@
             <span class="n">mc_sampler</span> <span class="o">=</span> <span class="n">FragmentSampler</span><span class="p">(</span><span class="n">actual_gap</span><span class="o">.</span><span class="n">full_seq</span><span class="p">,</span> <span class="n">fragger_list</span><span class="p">,</span>
                                          <span class="n">init_fragments</span><span class="o">=</span><span class="mi">5</span><span class="p">)</span>
 
-        <span class="c"># choose closer</span>
+        <span class="c1"># choose closer</span>
         <span class="k">if</span> <span class="n">actual_gap</span><span class="o">.</span><span class="n">IsNTerminal</span><span class="p">():</span>
             <span class="n">mc_closer</span> <span class="o">=</span> <span class="n">NTerminalCloser</span><span class="p">(</span><span class="n">actual_gap</span><span class="o">.</span><span class="n">after</span><span class="p">)</span>
         <span class="k">else</span><span class="p">:</span>
             <span class="n">mc_closer</span> <span class="o">=</span> <span class="n">CTerminalCloser</span><span class="p">(</span><span class="n">actual_gap</span><span class="o">.</span><span class="n">before</span><span class="p">)</span>
 
-        <span class="c"># setup scorer</span>
+        <span class="c1"># setup scorer</span>
         <span class="n">weights</span> <span class="o">=</span> <span class="n">_GetMCWeights</span><span class="p">()</span>
-        <span class="n">mc_scorer</span> <span class="o">=</span> <span class="n">LinearScorer</span><span class="p">(</span><span class="n">mhandle</span><span class="o">.</span><span class="n">backbone_scorer</span><span class="p">,</span> <span class="n">start_resnum</span><span class="p">,</span>
+        <span class="n">mc_scorer</span> <span class="o">=</span> <span class="n">LinearScorer</span><span class="p">(</span><span class="n">mhandle</span><span class="o">.</span><span class="n">backbone_scorer</span><span class="p">,</span> 
+                                 <span class="n">mhandle</span><span class="o">.</span><span class="n">backbone_scorer_env</span><span class="p">,</span>
+                                 <span class="n">start_resnum</span><span class="p">,</span> <span class="nb">len</span><span class="p">(</span><span class="n">actual_gap</span><span class="o">.</span><span class="n">full_seq</span><span class="p">),</span> 
                                  <span class="n">actual_chain_idx</span><span class="p">,</span> <span class="n">weights</span><span class="p">)</span>
 
-        <span class="c"># setup cooler</span>
+        <span class="c1"># setup cooler</span>
         <span class="n">start_temperature</span> <span class="o">=</span> <span class="mi">100</span>
         <span class="n">cooling_factor</span> <span class="o">=</span> <span class="mf">0.9</span>
-        <span class="c"># the number of 109 is roughly the number of times we have to apply</span>
-        <span class="c"># a factor of 0.9 to 100 until it reaches a value of 0.001</span>
+        <span class="c1"># the number of 109 is roughly the number of times we have to apply</span>
+        <span class="c1"># a factor of 0.9 to 100 until it reaches a value of 0.001</span>
         <span class="n">cooling_interval</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="nb">round</span><span class="p">(</span><span class="n">mc_steps</span><span class="o">/</span><span class="mf">109.0</span><span class="p">))</span>
         <span class="n">mc_cooler</span> <span class="o">=</span> <span class="n">ExponentialCooler</span><span class="p">(</span><span class="n">cooling_interval</span><span class="p">,</span> <span class="n">start_temperature</span><span class="p">,</span>
                                       <span class="n">cooling_factor</span><span class="p">)</span>
 
-        <span class="c"># try to get loop candidates</span>
-        <span class="n">ost</span><span class="o">.</span><span class="n">LogVerbose</span><span class="p">(</span><span class="s">&quot;Firing MC for &quot;</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">actual_gap</span><span class="p">))</span>
+        <span class="c1"># try to get loop candidates</span>
+        <span class="n">ost</span><span class="o">.</span><span class="n">LogVerbose</span><span class="p">(</span><span class="s2">&quot;Firing MC for &quot;</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">actual_gap</span><span class="p">))</span>
         <span class="n">candidates</span> <span class="o">=</span> <span class="n">LoopCandidates</span><span class="o">.</span><span class="n">FillFromMonteCarloSampler</span><span class="p">(</span>
                 <span class="n">actual_gap</span><span class="o">.</span><span class="n">full_seq</span><span class="p">,</span> <span class="n">mc_num_loops</span><span class="p">,</span> <span class="n">mc_steps</span><span class="p">,</span> <span class="n">mc_sampler</span><span class="p">,</span>
                 <span class="n">mc_closer</span><span class="p">,</span> <span class="n">mc_scorer</span><span class="p">,</span> <span class="n">mc_cooler</span><span class="p">)</span>
 
         <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">candidates</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">:</span>
-            <span class="c"># score candidates</span>
+            <span class="c1"># score candidates</span>
             <span class="n">bb_scores</span> <span class="o">=</span> <span class="n">ScoreContainer</span><span class="p">()</span>
-            <span class="n">candidates</span><span class="o">.</span><span class="n">CalculateBackboneScores</span><span class="p">(</span><span class="n">bb_scores</span><span class="p">,</span>
-                                               <span class="n">mhandle</span><span class="o">.</span><span class="n">backbone_scorer</span><span class="p">,</span>
+            <span class="n">candidates</span><span class="o">.</span><span class="n">CalculateBackboneScores</span><span class="p">(</span><span class="n">bb_scores</span><span class="p">,</span> <span class="n">mhandle</span><span class="p">,</span>
                                                <span class="n">start_resnum</span><span class="p">,</span> <span class="n">actual_chain_idx</span><span class="p">)</span>
             <span class="n">scores</span> <span class="o">=</span> <span class="n">bb_scores</span><span class="o">.</span><span class="n">LinearCombine</span><span class="p">(</span><span class="n">ScoringWeights</span><span class="o">.</span><span class="n">GetWeights</span><span class="p">())</span>
             <span class="n">min_score</span> <span class="o">=</span> <span class="nb">min</span><span class="p">(</span><span class="n">scores</span><span class="p">)</span>
             <span class="n">min_idx</span> <span class="o">=</span> <span class="n">scores</span><span class="o">.</span><span class="n">index</span><span class="p">(</span><span class="n">min_score</span><span class="p">)</span>
-            <span class="c"># report</span>
-            <span class="n">ost</span><span class="o">.</span><span class="n">LogInfo</span><span class="p">(</span><span class="s">&quot;Resolved terminal gap </span><span class="si">%s</span><span class="s"> (</span><span class="si">%d</span><span class="s"> candidates)&quot;</span> <span class="o">%</span> \
+            <span class="c1"># report</span>
+            <span class="n">ost</span><span class="o">.</span><span class="n">LogInfo</span><span class="p">(</span><span class="s2">&quot;Resolved terminal gap </span><span class="si">%s</span><span class="s2"> (</span><span class="si">%d</span><span class="s2"> candidates)&quot;</span> <span class="o">%</span> \
                         <span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">actual_gap</span><span class="p">),</span> <span class="nb">len</span><span class="p">(</span><span class="n">candidates</span><span class="p">)))</span>
-            <span class="c"># update model and clear gap</span>
+            <span class="c1"># update model and clear gap</span>
             <span class="n">InsertLoopClearGaps</span><span class="p">(</span><span class="n">mhandle</span><span class="p">,</span> <span class="n">candidates</span><span class="p">[</span><span class="n">min_idx</span><span class="p">],</span> <span class="n">actual_gap</span><span class="p">)</span>
         <span class="k">else</span><span class="p">:</span>
-            <span class="n">ost</span><span class="o">.</span><span class="n">LogInfo</span><span class="p">(</span><span class="s">&quot;Failed to model terminal gap (</span><span class="si">%s</span><span class="s">)&quot;</span> <span class="o">%</span> <span class="nb">str</span><span class="p">(</span><span class="n">actual_gap</span><span class="p">))</span>
+            <span class="n">ost</span><span class="o">.</span><span class="n">LogInfo</span><span class="p">(</span><span class="s2">&quot;Failed to model terminal gap (</span><span class="si">%s</span><span class="s2">)&quot;</span> <span class="o">%</span> <span class="nb">str</span><span class="p">(</span><span class="n">actual_gap</span><span class="p">))</span></div>
             
-</div>
+
 <div class="viewcode-block" id="CloseLargeDeletions"><a class="viewcode-back" href="../../../modelling/pipeline.html#promod3.modelling.CloseLargeDeletions">[docs]</a><span class="k">def</span> <span class="nf">CloseLargeDeletions</span><span class="p">(</span><span class="n">mhandle</span><span class="p">,</span> <span class="n">structure_db</span><span class="p">,</span> <span class="n">linker_length</span><span class="o">=</span><span class="mi">8</span><span class="p">,</span>
                         <span class="n">num_fragments</span><span class="o">=</span><span class="mi">500</span><span class="p">,</span> <span class="n">use_scoring_extender</span><span class="o">=</span><span class="bp">True</span><span class="p">,</span>
                         <span class="n">use_full_extender</span><span class="o">=</span><span class="bp">True</span><span class="p">,</span> <span class="n">chain_idx</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
@@ -1358,51 +1422,51 @@
 <span class="sd">    :type resnum_range: :class:`tuple` containing two :class:`int`</span>
 <span class="sd">    &#39;&#39;&#39;</span>
 
-    <span class="n">prof_name</span> <span class="o">=</span> <span class="s">&#39;closegaps::CloseLargeDeletions&#39;</span>
+    <span class="n">prof_name</span> <span class="o">=</span> <span class="s1">&#39;closegaps::CloseLargeDeletions&#39;</span>
     <span class="n">prof</span> <span class="o">=</span> <span class="n">core</span><span class="o">.</span><span class="n">StaticRuntimeProfiler</span><span class="o">.</span><span class="n">StartScoped</span><span class="p">(</span><span class="n">prof_name</span><span class="p">)</span>
 
     <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">mhandle</span><span class="o">.</span><span class="n">gaps</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">:</span>
-        <span class="n">ost</span><span class="o">.</span><span class="n">LogInfo</span><span class="p">(</span><span class="s">&quot;Trying to resolve large deletions (</span><span class="si">%d</span><span class="s"> gap(s) left) by &quot;</span>
-                    <span class="s">&quot;sampling a linker region.&quot;</span> <span class="o">%</span> <span class="nb">len</span><span class="p">(</span><span class="n">mhandle</span><span class="o">.</span><span class="n">gaps</span><span class="p">))</span>
+        <span class="n">ost</span><span class="o">.</span><span class="n">LogInfo</span><span class="p">(</span><span class="s2">&quot;Trying to resolve large deletions (</span><span class="si">%d</span><span class="s2"> gap(s) left) by &quot;</span>
+                    <span class="s2">&quot;sampling a linker region.&quot;</span> <span class="o">%</span> <span class="nb">len</span><span class="p">(</span><span class="n">mhandle</span><span class="o">.</span><span class="n">gaps</span><span class="p">))</span>
     <span class="k">else</span><span class="p">:</span>
         <span class="k">return</span>
 
-    <span class="c"># check/setup scoring</span>
+    <span class="c1"># check/setup scoring</span>
     <span class="k">if</span> <span class="ow">not</span> <span class="n">IsBackboneScoringSetUp</span><span class="p">(</span><span class="n">mhandle</span><span class="p">):</span>
         <span class="n">SetupDefaultBackboneScoring</span><span class="p">(</span><span class="n">mhandle</span><span class="p">)</span>
 
-    <span class="c"># point to the current gap</span>
+    <span class="c1"># point to the current gap</span>
     <span class="n">gap_idx</span> <span class="o">=</span> <span class="mi">0</span>
 
-    <span class="c"># Iterate all gaps. Since the number of gaps may change, always compare to</span>
-    <span class="c"># an updated list. gap_idx is only increased when necessary, e.g. current</span>
-    <span class="c"># gap could not be removed.</span>
+    <span class="c1"># Iterate all gaps. Since the number of gaps may change, always compare to</span>
+    <span class="c1"># an updated list. gap_idx is only increased when necessary, e.g. current</span>
+    <span class="c1"># gap could not be removed.</span>
     <span class="k">while</span> <span class="n">gap_idx</span> <span class="o">&lt;</span> <span class="nb">len</span><span class="p">(</span><span class="n">mhandle</span><span class="o">.</span><span class="n">gaps</span><span class="p">)</span> <span class="ow">and</span> <span class="n">gap_idx</span> <span class="o">&gt;=</span> <span class="mi">0</span><span class="p">:</span>
 
-        <span class="c"># keep copy of original gap</span>
+        <span class="c1"># keep copy of original gap</span>
         <span class="n">gap_orig</span> <span class="o">=</span> <span class="n">mhandle</span><span class="o">.</span><span class="n">gaps</span><span class="p">[</span><span class="n">gap_idx</span><span class="p">]</span><span class="o">.</span><span class="n">Copy</span><span class="p">()</span>
 
-        <span class="c"># check whether we are in the desired range</span>
+        <span class="c1"># check whether we are in the desired range</span>
         <span class="k">if</span> <span class="ow">not</span> <span class="n">_InRange</span><span class="p">(</span><span class="n">gap_orig</span><span class="p">,</span> <span class="n">chain_idx</span><span class="p">,</span> <span class="n">resnum_range</span><span class="p">):</span>
             <span class="n">gap_idx</span> <span class="o">+=</span> <span class="mi">1</span>
             <span class="k">continue</span>
 
-        <span class="c"># get chain for gap</span>
+        <span class="c1"># get chain for gap</span>
         <span class="n">actual_chain_idx</span> <span class="o">=</span> <span class="n">gap_orig</span><span class="o">.</span><span class="n">GetChainIndex</span><span class="p">()</span>
         <span class="n">actual_chain</span> <span class="o">=</span> <span class="n">mhandle</span><span class="o">.</span><span class="n">model</span><span class="o">.</span><span class="n">chains</span><span class="p">[</span><span class="n">actual_chain_idx</span><span class="p">]</span>
         
-        <span class="c"># terminal gaps are not deletions...</span>
+        <span class="c1"># terminal gaps are not deletions...</span>
         <span class="k">if</span> <span class="n">gap_orig</span><span class="o">.</span><span class="n">IsTerminal</span><span class="p">():</span>
             <span class="n">gap_idx</span> <span class="o">+=</span> <span class="mi">1</span>
             <span class="k">continue</span>
 
-        <span class="c"># check if too long</span>
+        <span class="c1"># check if too long</span>
         <span class="k">if</span> <span class="n">gap_orig</span><span class="o">.</span><span class="n">length</span> <span class="o">&gt;</span> <span class="n">linker_length</span><span class="p">:</span>
             <span class="n">gap_idx</span> <span class="o">+=</span> <span class="mi">1</span>
             <span class="k">continue</span>
 
-        <span class="c"># the function only works, if there are no gaps (del. AND insert.)</span>
-        <span class="c"># towards the n-ter in the same chain, except terminal gaps.</span>
+        <span class="c1"># the function only works, if there are no gaps (del. AND insert.)</span>
+        <span class="c1"># towards the n-ter in the same chain, except terminal gaps.</span>
         <span class="n">clean_nter</span> <span class="o">=</span> <span class="bp">True</span>
         <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="n">gap_idx</span><span class="p">):</span>
             <span class="k">if</span> <span class="n">actual_chain_idx</span> <span class="o">==</span> <span class="n">mhandle</span><span class="o">.</span><span class="n">gaps</span><span class="p">[</span><span class="n">i</span><span class="p">]</span><span class="o">.</span><span class="n">GetChainIndex</span><span class="p">():</span>
@@ -1413,47 +1477,47 @@
             <span class="n">gap_idx</span> <span class="o">+=</span> <span class="mi">1</span>
             <span class="k">continue</span>
 
-        <span class="c"># extend gap to desired length</span>
+        <span class="c1"># extend gap to desired length</span>
         <span class="n">actual_gap</span> <span class="o">=</span> <span class="n">gap_orig</span><span class="o">.</span><span class="n">Copy</span><span class="p">()</span>
         <span class="n">actual_extender</span> <span class="o">=</span> <span class="n">_GetGapExtender</span><span class="p">(</span><span class="n">mhandle</span><span class="p">,</span> <span class="n">actual_gap</span><span class="p">,</span>
                                           <span class="n">use_scoring_extender</span><span class="p">,</span>
                                           <span class="n">use_full_extender</span><span class="p">,</span>
                                           <span class="n">linker_length</span><span class="p">)</span>
         <span class="k">while</span> <span class="n">actual_gap</span><span class="o">.</span><span class="n">length</span> <span class="o">&lt;</span> <span class="n">linker_length</span><span class="p">:</span>
-            <span class="c"># extend the gap</span>
+            <span class="c1"># extend the gap</span>
             <span class="k">if</span> <span class="ow">not</span> <span class="n">actual_extender</span><span class="o">.</span><span class="n">Extend</span><span class="p">():</span>
                 <span class="k">break</span>
 
-        <span class="c"># FAIL (Fragger needs at least 3 residues)</span>
+        <span class="c1"># FAIL (Fragger needs at least 3 residues)</span>
         <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">actual_gap</span><span class="o">.</span><span class="n">full_seq</span><span class="p">)</span> <span class="o">&lt;</span> <span class="mi">3</span><span class="p">:</span>
-            <span class="n">ost</span><span class="o">.</span><span class="n">LogInfo</span><span class="p">(</span><span class="s">&quot;Failed in CloseLargeDeletions (</span><span class="si">%s</span><span class="s">)&quot;</span> <span class="o">%</span> <span class="nb">str</span><span class="p">(</span><span class="n">gap_orig</span><span class="p">))</span>
+            <span class="n">ost</span><span class="o">.</span><span class="n">LogInfo</span><span class="p">(</span><span class="s2">&quot;Failed in CloseLargeDeletions (</span><span class="si">%s</span><span class="s2">)&quot;</span> <span class="o">%</span> <span class="nb">str</span><span class="p">(</span><span class="n">gap_orig</span><span class="p">))</span>
             <span class="n">gap_idx</span> <span class="o">+=</span> <span class="mi">1</span>
             <span class="k">continue</span>
         
-        <span class="c"># extract gap info</span>
+        <span class="c1"># extract gap info</span>
         <span class="n">n_stem_res</span> <span class="o">=</span> <span class="n">actual_gap</span><span class="o">.</span><span class="n">before</span>
         <span class="n">c_stem_res</span> <span class="o">=</span> <span class="n">actual_gap</span><span class="o">.</span><span class="n">after</span>
         <span class="n">n_stem_res_num</span> <span class="o">=</span> <span class="n">n_stem_res</span><span class="o">.</span><span class="n">GetNumber</span><span class="p">()</span><span class="o">.</span><span class="n">GetNum</span><span class="p">()</span>
         <span class="n">c_stem_res_num</span> <span class="o">=</span> <span class="n">c_stem_res</span><span class="o">.</span><span class="n">GetNumber</span><span class="p">()</span><span class="o">.</span><span class="n">GetNum</span><span class="p">()</span>
 
-        <span class="c"># let&#39;s find fragments!</span>
+        <span class="c1"># let&#39;s find fragments!</span>
         <span class="n">fragger</span> <span class="o">=</span> <span class="n">loop</span><span class="o">.</span><span class="n">Fragger</span><span class="p">(</span><span class="n">actual_gap</span><span class="o">.</span><span class="n">full_seq</span><span class="p">)</span>
         <span class="n">seqsim_matrix</span> <span class="o">=</span> <span class="n">ost</span><span class="o">.</span><span class="n">seq</span><span class="o">.</span><span class="n">alg</span><span class="o">.</span><span class="n">BLOSUM62</span>
         <span class="n">fragger</span><span class="o">.</span><span class="n">AddSeqSimParameters</span><span class="p">(</span><span class="mf">1.0</span><span class="p">,</span> <span class="n">seqsim_matrix</span><span class="p">)</span>
         <span class="n">fragger</span><span class="o">.</span><span class="n">Fill</span><span class="p">(</span><span class="n">structure_db</span><span class="p">,</span> <span class="mf">0.2</span><span class="p">,</span> <span class="n">num_fragments</span><span class="p">)</span>
 
-        <span class="c"># We generate two backbonelists based on residues beginning from the </span>
-        <span class="c"># n-terminus:</span>
-        <span class="c"># - bb_list: covers the full thing being sampled (incl. stuff in gap)</span>
-        <span class="c"># - initial_n_stem: n-stem residue before the fragment insertion</span>
-        <span class="c">#</span>
-        <span class="c"># After having found the ideal fragment, we cannot simply insert it into</span>
-        <span class="c"># the model, since all sidechain information would be lost.</span>
-        <span class="c"># We therefore need the initial_n_stem to store the initial N stem</span>
-        <span class="c"># positions. We can then calculate a transformation in the end and </span>
-        <span class="c"># apply it manually in the end for the according atom positions.</span>
-
-        <span class="c"># only put valid residues in bb_seq</span>
+        <span class="c1"># We generate two backbonelists based on residues beginning from the </span>
+        <span class="c1"># n-terminus:</span>
+        <span class="c1"># - bb_list: covers the full thing being sampled (incl. stuff in gap)</span>
+        <span class="c1"># - initial_n_stem: n-stem residue before the fragment insertion</span>
+        <span class="c1">#</span>
+        <span class="c1"># After having found the ideal fragment, we cannot simply insert it into</span>
+        <span class="c1"># the model, since all sidechain information would be lost.</span>
+        <span class="c1"># We therefore need the initial_n_stem to store the initial N stem</span>
+        <span class="c1"># positions. We can then calculate a transformation in the end and </span>
+        <span class="c1"># apply it manually in the end for the according atom positions.</span>
+
+        <span class="c1"># only put valid residues in bb_seq</span>
         <span class="n">first_num</span> <span class="o">=</span> <span class="n">actual_chain</span><span class="o">.</span><span class="n">residues</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">GetNumber</span><span class="p">()</span><span class="o">.</span><span class="n">GetNum</span><span class="p">()</span>
         <span class="n">bb_seq</span> <span class="o">=</span> <span class="n">mhandle</span><span class="o">.</span><span class="n">seqres</span><span class="p">[</span><span class="n">actual_chain_idx</span><span class="p">][</span><span class="n">first_num</span><span class="o">-</span><span class="mi">1</span><span class="p">:</span><span class="n">c_stem_res_num</span><span class="p">]</span>
         <span class="n">bb_list</span> <span class="o">=</span> <span class="n">loop</span><span class="o">.</span><span class="n">BackboneList</span><span class="p">(</span><span class="n">bb_seq</span><span class="p">)</span>
@@ -1464,43 +1528,45 @@
                 <span class="n">bb_list</span><span class="o">.</span><span class="n">Set</span><span class="p">(</span><span class="n">i</span><span class="p">,</span> <span class="n">actual_res</span><span class="p">,</span> <span class="n">bb_seq</span><span class="p">[</span><span class="n">i</span><span class="p">])</span>
             <span class="n">actual_res_num</span> <span class="o">+=</span> <span class="mi">1</span>
 
-        <span class="c"># define region in fragger and region before, including the n_stem of </span>
-        <span class="c"># the fragment</span>
+        <span class="c1"># define region in fragger and region before, including the n_stem of </span>
+        <span class="c1"># the fragment</span>
         <span class="n">frag_start_idx</span> <span class="o">=</span> <span class="n">n_stem_res_num</span> <span class="o">-</span> <span class="n">first_num</span>
         <span class="n">initial_n_stem</span> <span class="o">=</span> <span class="n">bb_list</span><span class="o">.</span><span class="n">Extract</span><span class="p">(</span><span class="n">frag_start_idx</span><span class="p">,</span> <span class="n">frag_start_idx</span><span class="o">+</span><span class="mi">1</span><span class="p">)</span>
 
-        <span class="c"># all fragments get now sampled and scored</span>
-        <span class="c"># the idea is to sample the fragments by moving the full part towards</span>
-        <span class="c"># the n-terminus</span>
+        <span class="c1"># all fragments get now sampled and scored</span>
+        <span class="c1"># the idea is to sample the fragments by moving the full part towards</span>
+        <span class="c1"># the n-terminus</span>
         <span class="n">closer</span> <span class="o">=</span> <span class="n">NTerminalCloser</span><span class="p">(</span><span class="n">c_stem_res</span><span class="p">)</span>
-        <span class="n">best_score</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="s">&quot;inf&quot;</span><span class="p">)</span>
+        <span class="n">best_score</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="s2">&quot;inf&quot;</span><span class="p">)</span>
         <span class="n">best_idx</span> <span class="o">=</span> <span class="mi">0</span>
-        <span class="n">scorer_weights</span> <span class="o">=</span> <span class="p">{</span><span class="s">&quot;clash&quot;</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span> <span class="s">&quot;reduced&quot;</span><span class="p">:</span> <span class="mi">1</span><span class="p">}</span>
+        <span class="n">scorer_weights</span> <span class="o">=</span> <span class="p">{</span><span class="s2">&quot;clash&quot;</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span> <span class="s2">&quot;reduced&quot;</span><span class="p">:</span> <span class="mi">1</span><span class="p">}</span>
         <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">fragger</span><span class="p">)):</span>
 
             <span class="n">bb_list</span><span class="o">.</span><span class="n">ReplaceFragment</span><span class="p">(</span><span class="n">fragger</span><span class="p">[</span><span class="n">i</span><span class="p">],</span> <span class="n">frag_start_idx</span><span class="p">,</span> <span class="bp">True</span><span class="p">)</span>
             <span class="n">closer</span><span class="o">.</span><span class="n">Close</span><span class="p">(</span><span class="n">bb_list</span><span class="p">,</span> <span class="n">bb_list</span><span class="p">)</span>
 
-            <span class="c"># a simple score gets calculated and best chosen</span>
+            <span class="c1"># a simple score gets calculated and best chosen</span>
+            <span class="n">mhandle</span><span class="o">.</span><span class="n">backbone_scorer_env</span><span class="o">.</span><span class="n">SetEnvironment</span><span class="p">(</span><span class="n">bb_list</span><span class="p">,</span> <span class="n">first_num</span><span class="p">,</span> 
+                                                       <span class="n">actual_chain_idx</span><span class="p">)</span>
             <span class="n">score</span> <span class="o">=</span> <span class="n">mhandle</span><span class="o">.</span><span class="n">backbone_scorer</span><span class="o">.</span><span class="n">CalculateLinearCombination</span><span class="p">(</span>\
-                        <span class="n">scorer_weights</span><span class="p">,</span> <span class="n">bb_list</span><span class="p">,</span> <span class="n">first_num</span><span class="p">,</span> <span class="n">actual_chain_idx</span><span class="p">)</span>
+                        <span class="n">scorer_weights</span><span class="p">,</span> <span class="n">first_num</span><span class="p">,</span> <span class="nb">len</span><span class="p">(</span><span class="n">bb_list</span><span class="p">),</span> <span class="n">actual_chain_idx</span><span class="p">)</span>
 
             <span class="k">if</span> <span class="n">score</span> <span class="o">&lt;</span> <span class="n">best_score</span><span class="p">:</span>
                 <span class="n">best_score</span> <span class="o">=</span> <span class="n">score</span>
                 <span class="n">best_idx</span> <span class="o">=</span> <span class="n">i</span>
 
-        <span class="c"># set best fragment into bb_list and </span>
+        <span class="c1"># set best fragment into bb_list and </span>
         <span class="n">fragment</span> <span class="o">=</span> <span class="n">fragger</span><span class="p">[</span><span class="n">best_idx</span><span class="p">]</span>
         <span class="n">bb_list</span><span class="o">.</span><span class="n">ReplaceFragment</span><span class="p">(</span><span class="n">fragment</span><span class="p">,</span> <span class="n">frag_start_idx</span><span class="p">,</span> <span class="bp">True</span><span class="p">)</span>
         <span class="n">closer</span><span class="o">.</span><span class="n">Close</span><span class="p">(</span><span class="n">bb_list</span><span class="p">,</span> <span class="n">bb_list</span><span class="p">)</span>
-        <span class="c"># reextract fragment, since the whole thing has undergone a </span>
-        <span class="c"># transformation</span>
+        <span class="c1"># reextract fragment, since the whole thing has undergone a </span>
+        <span class="c1"># transformation</span>
         <span class="n">fragment</span> <span class="o">=</span> <span class="n">bb_list</span><span class="o">.</span><span class="n">Extract</span><span class="p">(</span><span class="n">frag_start_idx</span><span class="p">,</span> <span class="n">frag_start_idx</span> <span class="o">+</span> 
                                                    <span class="nb">len</span><span class="p">(</span><span class="n">fragment</span><span class="p">))</span>
 
-        <span class="c"># We finally calculate the transformation from the initial positions</span>
-        <span class="c"># of all residues towards the n-terminus and apply it manually.</span>
-        <span class="c"># this is done to not loose all the sidechain information</span>
+        <span class="c1"># We finally calculate the transformation from the initial positions</span>
+        <span class="c1"># of all residues towards the n-terminus and apply it manually.</span>
+        <span class="c1"># this is done to not loose all the sidechain information</span>
         <span class="n">t</span> <span class="o">=</span> <span class="n">initial_n_stem</span><span class="o">.</span><span class="n">GetTransform</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">bb_list</span><span class="p">,</span> <span class="n">frag_start_idx</span><span class="p">)</span>
         <span class="n">ed</span> <span class="o">=</span> <span class="n">mhandle</span><span class="o">.</span><span class="n">model</span><span class="o">.</span><span class="n">EditXCS</span><span class="p">(</span><span class="n">ost</span><span class="o">.</span><span class="n">mol</span><span class="o">.</span><span class="n">BUFFERED_EDIT</span><span class="p">)</span>
         <span class="k">for</span> <span class="n">r</span> <span class="ow">in</span> <span class="n">actual_chain</span><span class="o">.</span><span class="n">residues</span><span class="p">[:</span><span class="n">frag_start_idx</span><span class="p">]:</span>
@@ -1509,26 +1575,26 @@
                 <span class="n">ed</span><span class="o">.</span><span class="n">SetAtomPos</span><span class="p">(</span><span class="n">a</span><span class="p">,</span> <span class="n">ost</span><span class="o">.</span><span class="n">geom</span><span class="o">.</span><span class="n">Vec3</span><span class="p">(</span><span class="n">new_pos</span><span class="p">))</span>
         <span class="n">ed</span><span class="o">.</span><span class="n">UpdateICS</span><span class="p">()</span>
 
-        <span class="c"># replace fragment part</span>
+        <span class="c1"># replace fragment part</span>
         <span class="n">fragment</span><span class="o">.</span><span class="n">InsertInto</span><span class="p">(</span><span class="n">actual_chain</span><span class="p">,</span> <span class="n">n_stem_res_num</span><span class="p">)</span>
 
-        <span class="c"># update score env. (manual to keep all atom sidechains)</span>
+        <span class="c1"># update score env. (manual to keep all atom sidechains)</span>
         <span class="n">mhandle</span><span class="o">.</span><span class="n">backbone_scorer_env</span><span class="o">.</span><span class="n">SetEnvironment</span><span class="p">(</span><span class="n">bb_list</span><span class="p">,</span> <span class="n">first_num</span><span class="p">,</span>
                                                    <span class="n">actual_chain_idx</span><span class="p">)</span>
-        <span class="c"># will return -1 if last gap removed</span>
+        <span class="c1"># will return -1 if last gap removed</span>
         <span class="n">gap_idx</span> <span class="o">=</span> <span class="n">ClearGaps</span><span class="p">(</span><span class="n">mhandle</span><span class="p">,</span> <span class="n">actual_gap</span><span class="p">)</span>
 
-        <span class="n">ost</span><span class="o">.</span><span class="n">LogInfo</span><span class="p">(</span><span class="s">&quot;Resolved </span><span class="si">%s</span><span class="s"> by sampling </span><span class="si">%s</span><span class="s"> as linker&quot;</span> <span class="o">%</span> \
+        <span class="n">ost</span><span class="o">.</span><span class="n">LogInfo</span><span class="p">(</span><span class="s2">&quot;Resolved </span><span class="si">%s</span><span class="s2"> by sampling </span><span class="si">%s</span><span class="s2"> as linker&quot;</span> <span class="o">%</span> \
                     <span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">gap_orig</span><span class="p">),</span> <span class="nb">str</span><span class="p">(</span><span class="n">actual_gap</span><span class="p">)))</span>
     
-    <span class="c"># reset all atom env. if it&#39;s set (changes are too drastic so we set all)</span>
+    <span class="c1"># reset all atom env. if it&#39;s set (changes are too drastic so we set all)</span>
     <span class="k">if</span> <span class="n">IsAllAtomScoringSetUp</span><span class="p">(</span><span class="n">mhandle</span><span class="p">):</span>
-        <span class="n">mhandle</span><span class="o">.</span><span class="n">all_atom_sidechain_env</span><span class="o">.</span><span class="n">SetInitialEnvironment</span><span class="p">(</span><span class="n">mhandle</span><span class="o">.</span><span class="n">model</span><span class="p">)</span>
+        <span class="n">mhandle</span><span class="o">.</span><span class="n">all_atom_sidechain_env</span><span class="o">.</span><span class="n">SetInitialEnvironment</span><span class="p">(</span><span class="n">mhandle</span><span class="o">.</span><span class="n">model</span><span class="p">)</span></div>
 
-<span class="c"># these methods will be exported into module</span></div>
-<span class="n">__all__</span> <span class="o">=</span> <span class="p">(</span><span class="s">&#39;CloseSmallDeletions&#39;</span><span class="p">,</span> <span class="s">&#39;MergeGapsByDistance&#39;</span><span class="p">,</span> <span class="s">&#39;FillLoopsByDatabase&#39;</span><span class="p">,</span>
-           <span class="s">&#39;FillLoopsByMonteCarlo&#39;</span><span class="p">,</span> <span class="s">&#39;CloseGaps&#39;</span><span class="p">,</span> <span class="s">&#39;ModelTermini&#39;</span><span class="p">,</span> 
-           <span class="s">&#39;CloseLargeDeletions&#39;</span><span class="p">)</span>
+<span class="c1"># these methods will be exported into module</span>
+<span class="n">__all__</span> <span class="o">=</span> <span class="p">(</span><span class="s1">&#39;CloseSmallDeletions&#39;</span><span class="p">,</span> <span class="s1">&#39;MergeGapsByDistance&#39;</span><span class="p">,</span> <span class="s1">&#39;FillLoopsByDatabase&#39;</span><span class="p">,</span>
+           <span class="s1">&#39;FillLoopsByMonteCarlo&#39;</span><span class="p">,</span> <span class="s1">&#39;CloseGaps&#39;</span><span class="p">,</span> <span class="s1">&#39;ModelTermini&#39;</span><span class="p">,</span> 
+           <span class="s1">&#39;CloseLargeDeletions&#39;</span><span class="p">)</span>
 </pre></div>
 
           </div>
@@ -1554,9 +1620,6 @@
       <input type="hidden" name="check_keywords" value="yes" />
       <input type="hidden" name="area" value="default" />
     </form>
-    <p class="searchtip" style="font-size: 90%">
-    Enter search terms or a module, class or function name.
-    </p>
 </div>
 <script type="text/javascript">$('#searchbox').show(0);</script>
         </div>
@@ -1564,11 +1627,11 @@
       <div class="clearer"></div>
     </div>
     <div class="footer">
-      &copy;2017, ProMod3 authors.
+      &copy;2018, ProMod3 authors.
       
       |
-      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a>
-      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.6</a>
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.4.1</a>
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
       
     </div>
 
diff --git a/doc/html/_modules/promod3/modelling/_denovo.html b/doc/html/_modules/promod3/modelling/_denovo.html
index 22a3704651712098494a0b1ca7fafa8ddac8995e..b2100964e66fb6ebbc6d9f4a3a710767ffecfc50 100644
--- a/doc/html/_modules/promod3/modelling/_denovo.html
+++ b/doc/html/_modules/promod3/modelling/_denovo.html
@@ -6,7 +6,7 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
-    <title>promod3.modelling._denovo &mdash; ProMod3 1.1.0 documentation</title>
+    <title>promod3.modelling._denovo &mdash; ProMod3 1.2.0 documentation</title>
     
     <link rel="stylesheet" href="../../../_static/alabaster.css" type="text/css" />
     <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
@@ -14,7 +14,7 @@
     <script type="text/javascript">
       var DOCUMENTATION_OPTIONS = {
         URL_ROOT:    '../../../',
-        VERSION:     '1.1.0',
+        VERSION:     '1.2.0',
         COLLAPSE_INDEX: false,
         FILE_SUFFIX: '.html',
         HAS_SOURCE:  true
@@ -23,14 +23,16 @@
     <script type="text/javascript" src="../../../_static/jquery.js"></script>
     <script type="text/javascript" src="../../../_static/underscore.js"></script>
     <script type="text/javascript" src="../../../_static/doctools.js"></script>
-    <link rel="top" title="ProMod3 1.1.0 documentation" href="../../../index.html" />
+    <link rel="top" title="ProMod3 1.2.0 documentation" href="../../../index.html" />
     <link rel="up" title="promod3" href="../../promod3.html" />
    
+  <link rel="stylesheet" href="../../../_static/custom.css" type="text/css" />
   
-  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
 
   </head>
-  <body role="document">  
+  <body role="document">
+  
 
     <div class="document">
       <div class="documentwrapper">
@@ -38,7 +40,7 @@
           <div class="body" role="main">
             
   <h1>Source code for promod3.modelling._denovo</h1><div class="highlight"><pre>
-<span class="kn">from</span> <span class="nn">promod3</span> <span class="kn">import</span> <span class="n">scoring</span><span class="p">,</span> <span class="n">loop</span>
+<span></span><span class="kn">from</span> <span class="nn">promod3</span> <span class="kn">import</span> <span class="n">scoring</span><span class="p">,</span> <span class="n">loop</span>
 <span class="kn">from</span> <span class="nn">_modelling</span> <span class="kn">import</span> <span class="o">*</span>
 
 <div class="viewcode-block" id="GenerateDeNovoTrajectories"><a class="viewcode-back" href="../../../modelling/algorithms.html#promod3.modelling.GenerateDeNovoTrajectories">[docs]</a><span class="k">def</span> <span class="nf">GenerateDeNovoTrajectories</span><span class="p">(</span><span class="n">sequence</span><span class="p">,</span> 
@@ -48,6 +50,7 @@
                                <span class="n">psipred_prediction</span> <span class="o">=</span> <span class="bp">None</span><span class="p">,</span>
                                <span class="n">fragment_handler</span> <span class="o">=</span> <span class="bp">None</span><span class="p">,</span>
                                <span class="n">scorer</span> <span class="o">=</span> <span class="bp">None</span><span class="p">,</span>
+                               <span class="n">scorer_env</span> <span class="o">=</span> <span class="bp">None</span><span class="p">,</span>
                                <span class="n">scoring_weights</span> <span class="o">=</span> <span class="bp">None</span><span class="p">):</span>
     <span class="sd">&#39;&#39;&#39;Example de novo modelling pipeline based on Fragment sampling and</span>
 <span class="sd">    backbone scoring. Take this as a starting point for more advanced</span>
@@ -87,6 +90,10 @@
 <span class="sd">                        torsion and pairwise </span>
 <span class="sd">    :type scorer:       :class:`promod3.scoring.BackboneOverallScorer`</span>
 
+<span class="sd">    :param scorer_env:  The scoring env that relates to **scorer**</span>
+<span class="sd">                        This environment will be changed! </span>
+<span class="sd">    :type scorer_env:   :class:`promod3.scoring.BackboneScoreEnv`</span>
+
 <span class="sd">    :param scoring_weights: Linear weights for different scores. If not provided,</span>
 <span class="sd">                            the output of ScoringWeights.GetWeights() is used.</span>
 <span class="sd">                            Please note, that the weights must be consistent</span>
@@ -98,44 +105,47 @@
 <span class="sd">    &#39;&#39;&#39;</span>
 
     <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">sequence</span><span class="p">)</span> <span class="o">&lt;</span> <span class="mi">9</span><span class="p">:</span>
-        <span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s">&quot;Seq too short for Denovo sampling (min length 9)&quot;</span><span class="p">)</span>
+        <span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s2">&quot;Seq too short for Denovo sampling (min length 9)&quot;</span><span class="p">)</span>
 
-    <span class="c"># check whether profile / psipred_prediction are consistent if present</span>
+    <span class="c1"># check whether profile / psipred_prediction are consistent if present</span>
     <span class="k">if</span> <span class="n">profile</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span>
       <span class="k">if</span> <span class="n">profile</span><span class="o">.</span><span class="n">sequence</span> <span class="o">!=</span> <span class="n">sequence</span><span class="p">:</span>
-          <span class="n">err</span> <span class="o">=</span> <span class="s">&quot;Sequence of profile must match input sequence!&quot;</span>
+          <span class="n">err</span> <span class="o">=</span> <span class="s2">&quot;Sequence of profile must match input sequence!&quot;</span>
           <span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="n">err</span><span class="p">)</span>
 
     <span class="k">if</span> <span class="n">psipred_prediction</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span>
         <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">sequence</span><span class="p">)</span> <span class="o">!=</span> <span class="nb">len</span><span class="p">(</span><span class="n">psipred_prediction</span><span class="p">):</span>
-            <span class="n">err</span> <span class="o">=</span> <span class="s">&quot;psipred_prediction must be consistent with the input sequence!&quot;</span>
+            <span class="n">err</span> <span class="o">=</span> <span class="s2">&quot;psipred_prediction must be consistent with the input sequence!&quot;</span>
             <span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="n">err</span><span class="p">)</span>
 
+    <span class="k">if</span> <span class="n">scorer</span> <span class="o">!=</span> <span class="bp">None</span> <span class="ow">and</span> <span class="n">scorer_env</span> <span class="o">==</span> <span class="bp">None</span><span class="p">:</span>
+      <span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s2">&quot;Must provide an environment when you provide a scorer!&quot;</span><span class="p">)</span>
+
     <span class="k">if</span> <span class="n">fragment_handler</span> <span class="o">==</span> <span class="bp">None</span><span class="p">:</span>
-        <span class="c"># we first have to build our own handler</span>
+        <span class="c1"># we first have to build our own handler</span>
         <span class="n">fragment_handler</span> <span class="o">=</span> <span class="n">modelling</span><span class="o">.</span><span class="n">FraggerHandle</span><span class="p">(</span><span class="n">sequence</span><span class="p">,</span> 
                                                    <span class="n">profile</span> <span class="o">=</span> <span class="n">profile</span><span class="p">,</span> 
                                                    <span class="n">psipred_pred</span> <span class="o">=</span> <span class="n">psipred_prediction</span><span class="p">)</span>
     <span class="n">fragger_list</span> <span class="o">=</span> <span class="n">fragment_handler</span><span class="o">.</span><span class="n">GetList</span><span class="p">()</span>
 
     <span class="k">if</span> <span class="n">scorer</span> <span class="o">==</span> <span class="bp">None</span><span class="p">:</span>
-        <span class="c"># Lets setup a scorer with empty environment</span>
+        <span class="c1"># Lets setup a scorer with empty environment</span>
         <span class="n">scorer</span> <span class="o">=</span> <span class="n">scoring</span><span class="o">.</span><span class="n">BackboneOverallScorer</span><span class="p">()</span>
         <span class="n">scorer_env</span> <span class="o">=</span> <span class="n">scoring</span><span class="o">.</span><span class="n">BackboneScoreEnv</span><span class="p">(</span><span class="n">sequence</span><span class="p">)</span>
-        <span class="n">scorer</span><span class="p">[</span><span class="s">&quot;clash&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">scoring</span><span class="o">.</span><span class="n">ClashScorer</span><span class="p">()</span>
-        <span class="n">scorer</span><span class="p">[</span><span class="s">&quot;reduced&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">scoring</span><span class="o">.</span><span class="n">LoadReducedScorer</span><span class="p">()</span>
-        <span class="n">scorer</span><span class="p">[</span><span class="s">&quot;cb_packing&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">scoring</span><span class="o">.</span><span class="n">LoadCBPackingScorer</span><span class="p">()</span>
-        <span class="n">scorer</span><span class="p">[</span><span class="s">&quot;hbond&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">scoring</span><span class="o">.</span><span class="n">LoadHBondScorer</span><span class="p">()</span>
-        <span class="n">scorer</span><span class="p">[</span><span class="s">&quot;cbeta&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">scoring</span><span class="o">.</span><span class="n">LoadCBetaScorer</span><span class="p">()</span>
-        <span class="n">scorer</span><span class="p">[</span><span class="s">&quot;torsion&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">scoring</span><span class="o">.</span><span class="n">LoadTorsionScorer</span><span class="p">()</span>
-        <span class="n">scorer</span><span class="p">[</span><span class="s">&quot;pairwise&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">scoring</span><span class="o">.</span><span class="n">PairwiseScorer</span><span class="p">()</span>
+        <span class="n">scorer</span><span class="p">[</span><span class="s2">&quot;clash&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">scoring</span><span class="o">.</span><span class="n">ClashScorer</span><span class="p">()</span>
+        <span class="n">scorer</span><span class="p">[</span><span class="s2">&quot;reduced&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">scoring</span><span class="o">.</span><span class="n">LoadReducedScorer</span><span class="p">()</span>
+        <span class="n">scorer</span><span class="p">[</span><span class="s2">&quot;cb_packing&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">scoring</span><span class="o">.</span><span class="n">LoadCBPackingScorer</span><span class="p">()</span>
+        <span class="n">scorer</span><span class="p">[</span><span class="s2">&quot;hbond&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">scoring</span><span class="o">.</span><span class="n">LoadHBondScorer</span><span class="p">()</span>
+        <span class="n">scorer</span><span class="p">[</span><span class="s2">&quot;cbeta&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">scoring</span><span class="o">.</span><span class="n">LoadCBetaScorer</span><span class="p">()</span>
+        <span class="n">scorer</span><span class="p">[</span><span class="s2">&quot;torsion&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">scoring</span><span class="o">.</span><span class="n">LoadTorsionScorer</span><span class="p">()</span>
+        <span class="n">scorer</span><span class="p">[</span><span class="s2">&quot;pairwise&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">scoring</span><span class="o">.</span><span class="n">PairwiseScorer</span><span class="p">()</span>
         <span class="n">scorer</span><span class="o">.</span><span class="n">AttachEnvironment</span><span class="p">(</span><span class="n">scorer_env</span><span class="p">)</span>
 
     <span class="k">if</span> <span class="n">scoring_weights</span> <span class="o">==</span> <span class="bp">None</span><span class="p">:</span>
         <span class="n">scoring_weights</span> <span class="o">=</span> <span class="n">ScoringWeights</span><span class="o">.</span><span class="n">GetWeights</span><span class="p">()</span>
 
-    <span class="c"># the number of 109 is roughly the number of times we have to apply</span>
-    <span class="c"># a factor of 0.9 to 100 until it reaches a value of 0.001</span>
+    <span class="c1"># the number of 109 is roughly the number of times we have to apply</span>
+    <span class="c1"># a factor of 0.9 to 100 until it reaches a value of 0.001</span>
     <span class="n">start_temperature</span> <span class="o">=</span> <span class="mi">100</span>
     <span class="n">cooling_factor</span> <span class="o">=</span> <span class="mf">0.9</span>
     <span class="n">sampling_steps</span> <span class="o">=</span> <span class="n">avg_sampling_per_position</span> <span class="o">*</span> <span class="nb">len</span><span class="p">(</span><span class="n">fragger_list</span><span class="p">)</span>
@@ -144,7 +154,8 @@
     <span class="n">mc_sampler</span> <span class="o">=</span> <span class="n">FragmentSampler</span><span class="p">(</span><span class="n">sequence</span><span class="p">,</span> <span class="n">fragger_list</span><span class="p">,</span> 
                                  <span class="n">init_fragments</span> <span class="o">=</span> <span class="mi">5</span><span class="p">)</span>
     <span class="n">mc_closer</span> <span class="o">=</span> <span class="n">DeNovoCloser</span><span class="p">()</span>
-    <span class="n">mc_scorer</span> <span class="o">=</span> <span class="n">LinearScorer</span><span class="p">(</span><span class="n">scorer</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">scoring_weights</span><span class="p">)</span>
+    <span class="n">mc_scorer</span> <span class="o">=</span> <span class="n">LinearScorer</span><span class="p">(</span><span class="n">scorer</span><span class="p">,</span> <span class="n">scorer_env</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="nb">len</span><span class="p">(</span><span class="n">sequence</span><span class="p">),</span> <span class="mi">0</span><span class="p">,</span> 
+                             <span class="n">scoring_weights</span><span class="p">)</span>
     <span class="n">mc_cooler</span> <span class="o">=</span> <span class="n">ExponentialCooler</span><span class="p">(</span><span class="n">start_temperature</span><span class="p">,</span>
                                   <span class="n">cooling_interval</span><span class="p">,</span>
                                   <span class="n">cooling_factor</span><span class="p">)</span>
@@ -182,9 +193,6 @@
       <input type="hidden" name="check_keywords" value="yes" />
       <input type="hidden" name="area" value="default" />
     </form>
-    <p class="searchtip" style="font-size: 90%">
-    Enter search terms or a module, class or function name.
-    </p>
 </div>
 <script type="text/javascript">$('#searchbox').show(0);</script>
         </div>
@@ -192,11 +200,11 @@
       <div class="clearer"></div>
     </div>
     <div class="footer">
-      &copy;2017, ProMod3 authors.
+      &copy;2018, ProMod3 authors.
       
       |
-      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a>
-      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.6</a>
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.4.1</a>
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
       
     </div>
 
diff --git a/doc/html/_modules/promod3/modelling/_fragger_handle.html b/doc/html/_modules/promod3/modelling/_fragger_handle.html
index b364e59e84bdc161277db70d4fdd6d75b428d73a..0ef683b33454d388f4ec6354c16ddeef42fc101d 100644
--- a/doc/html/_modules/promod3/modelling/_fragger_handle.html
+++ b/doc/html/_modules/promod3/modelling/_fragger_handle.html
@@ -6,7 +6,7 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
-    <title>promod3.modelling._fragger_handle &mdash; ProMod3 1.1.0 documentation</title>
+    <title>promod3.modelling._fragger_handle &mdash; ProMod3 1.2.0 documentation</title>
     
     <link rel="stylesheet" href="../../../_static/alabaster.css" type="text/css" />
     <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
@@ -14,7 +14,7 @@
     <script type="text/javascript">
       var DOCUMENTATION_OPTIONS = {
         URL_ROOT:    '../../../',
-        VERSION:     '1.1.0',
+        VERSION:     '1.2.0',
         COLLAPSE_INDEX: false,
         FILE_SUFFIX: '.html',
         HAS_SOURCE:  true
@@ -23,14 +23,16 @@
     <script type="text/javascript" src="../../../_static/jquery.js"></script>
     <script type="text/javascript" src="../../../_static/underscore.js"></script>
     <script type="text/javascript" src="../../../_static/doctools.js"></script>
-    <link rel="top" title="ProMod3 1.1.0 documentation" href="../../../index.html" />
+    <link rel="top" title="ProMod3 1.2.0 documentation" href="../../../index.html" />
     <link rel="up" title="promod3" href="../../promod3.html" />
    
+  <link rel="stylesheet" href="../../../_static/custom.css" type="text/css" />
   
-  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
 
   </head>
-  <body role="document">  
+  <body role="document">
+  
 
     <div class="document">
       <div class="documentwrapper">
@@ -38,7 +40,7 @@
           <div class="body" role="main">
             
   <h1>Source code for promod3.modelling._fragger_handle</h1><div class="highlight"><pre>
-<span class="sd">&#39;&#39;&#39;Python functionality to generate fraggers.&#39;&#39;&#39;</span>
+<span></span><span class="sd">&#39;&#39;&#39;Python functionality to generate fraggers.&#39;&#39;&#39;</span>
 
 <span class="kn">from</span> <span class="nn">promod3.loop</span> <span class="kn">import</span> <span class="o">*</span>
 <span class="kn">from</span> <span class="nn">ost.conop</span> <span class="kn">import</span> <span class="n">OneLetterCodeToResidueName</span>
@@ -60,11 +62,11 @@
     <span class="n">size_idx</span> <span class="o">=</span> <span class="n">_GetSizeIdx</span><span class="p">(</span><span class="n">frag_size</span><span class="p">)</span>
 
     <span class="k">if</span> <span class="n">weight_group</span> <span class="o">==</span> <span class="mi">1</span><span class="p">:</span>
-        <span class="c"># group one, it&#39;s only sequence similarity...</span>
+        <span class="c1"># group one, it&#39;s only sequence similarity...</span>
         <span class="k">return</span> <span class="p">[</span><span class="mf">1.0</span><span class="p">]</span>
 
     <span class="k">elif</span> <span class="n">weight_group</span> <span class="o">==</span> <span class="mi">2</span><span class="p">:</span>
-        <span class="c"># group two: [sequence_profile_weight, structure_profile_weight]</span>
+        <span class="c1"># group two: [sequence_profile_weight, structure_profile_weight]</span>
         <span class="k">if</span> <span class="n">size_idx</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span>
             <span class="k">return</span> <span class="p">[</span><span class="o">-</span><span class="mf">1.0</span><span class="p">,</span> <span class="o">-</span><span class="mf">1.404</span><span class="p">]</span>
         <span class="k">elif</span> <span class="n">size_idx</span> <span class="o">==</span> <span class="mi">1</span><span class="p">:</span>
@@ -77,7 +79,7 @@
             <span class="k">return</span> <span class="p">[</span><span class="o">-</span><span class="mf">1.0</span><span class="p">,</span> <span class="o">-</span><span class="mf">6.703</span><span class="p">]</span> 
 
     <span class="k">elif</span> <span class="n">weight_group</span> <span class="o">==</span> <span class="mi">3</span><span class="p">:</span>
-        <span class="c"># group_three: [ss_agreement_weight, torsion_weight, seqsim_weight] </span>
+        <span class="c1"># group_three: [ss_agreement_weight, torsion_weight, seqsim_weight] </span>
         <span class="k">if</span> <span class="n">size_idx</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span>
             <span class="k">return</span> <span class="p">[</span><span class="mf">1.0</span><span class="p">,</span> <span class="mf">71.467</span><span class="p">,</span> <span class="mf">2.276</span><span class="p">]</span>
         <span class="k">elif</span> <span class="n">size_idx</span> <span class="o">==</span> <span class="mi">1</span><span class="p">:</span>
@@ -90,8 +92,8 @@
             <span class="k">return</span> <span class="p">[</span><span class="mf">1.0</span><span class="p">,</span> <span class="mf">5.784</span><span class="p">,</span> <span class="mf">4.618</span><span class="p">]</span>
 
     <span class="k">elif</span> <span class="n">weight_group</span> <span class="o">==</span> <span class="mi">4</span><span class="p">:</span>
-        <span class="c"># group_four: [ss_agreement_weight, torsion_weight, </span>
-        <span class="c">#              sequence_profile_weight, structure_profile_weight]</span>
+        <span class="c1"># group_four: [ss_agreement_weight, torsion_weight, </span>
+        <span class="c1">#              sequence_profile_weight, structure_profile_weight]</span>
         <span class="k">if</span> <span class="n">size_idx</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span>
             <span class="k">return</span> <span class="p">[</span><span class="mf">1.0</span><span class="p">,</span> <span class="mf">17.219</span><span class="p">,</span> <span class="o">-</span><span class="mf">1.930</span><span class="p">,</span> <span class="o">-</span><span class="mf">3.328</span><span class="p">]</span>
         <span class="k">elif</span> <span class="n">size_idx</span> <span class="o">==</span> <span class="mi">1</span><span class="p">:</span>
@@ -226,21 +228,21 @@
                  <span class="n">torsion_sampler_coil</span> <span class="o">=</span> <span class="bp">None</span><span class="p">,</span>
                  <span class="n">torsion_sampler_helix</span> <span class="o">=</span> <span class="bp">None</span><span class="p">,</span>
                  <span class="n">torsion_sampler_extended</span> <span class="o">=</span> <span class="bp">None</span><span class="p">):</span>
-        <span class="c"># check</span>
+        <span class="c1"># check</span>
         <span class="k">if</span> <span class="n">profile</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span>
-            <span class="c"># can either be a SequenceHandle or simple string...</span>
+            <span class="c1"># can either be a SequenceHandle or simple string...</span>
             <span class="k">try</span><span class="p">:</span>
                 <span class="k">if</span> <span class="n">sequence</span><span class="o">.</span><span class="n">GetString</span><span class="p">()</span> <span class="o">!=</span> <span class="n">profile</span><span class="o">.</span><span class="n">sequence</span><span class="p">:</span>
-                    <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s">&quot;Sequence must be consistent with profile!&quot;</span><span class="p">)</span>
+                    <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s2">&quot;Sequence must be consistent with profile!&quot;</span><span class="p">)</span>
             <span class="k">except</span><span class="p">:</span>
                 <span class="k">if</span> <span class="n">sequence</span> <span class="o">!=</span> <span class="n">profile</span><span class="o">.</span><span class="n">sequence</span><span class="p">:</span>
-                    <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s">&quot;Sequence must be consistent with profile!&quot;</span><span class="p">)</span>
+                    <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s2">&quot;Sequence must be consistent with profile!&quot;</span><span class="p">)</span>
 
         <span class="k">if</span> <span class="n">psipred_pred</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span>
             <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">sequence</span><span class="p">)</span> <span class="o">!=</span> <span class="nb">len</span><span class="p">(</span><span class="n">psipred_pred</span><span class="p">):</span>
-                <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s">&quot;Sequence must be consistent with PsipredPred!&quot;</span><span class="p">)</span>
+                <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s2">&quot;Sequence must be consistent with PsipredPred!&quot;</span><span class="p">)</span>
         
-        <span class="c"># keep all objects</span>
+        <span class="c1"># keep all objects</span>
         <span class="bp">self</span><span class="o">.</span><span class="n">sequence</span> <span class="o">=</span> <span class="n">sequence</span>
         <span class="bp">self</span><span class="o">.</span><span class="n">profile</span> <span class="o">=</span> <span class="n">profile</span>
         <span class="bp">self</span><span class="o">.</span><span class="n">psipred_pred</span> <span class="o">=</span> <span class="n">psipred_pred</span>
@@ -254,7 +256,7 @@
         <span class="k">else</span><span class="p">:</span>
             <span class="bp">self</span><span class="o">.</span><span class="n">structure_db</span> <span class="o">=</span> <span class="n">structure_db</span>
 
-        <span class="c"># the torsion samplers are only required if we have a psipred prediction</span>
+        <span class="c1"># the torsion samplers are only required if we have a psipred prediction</span>
         <span class="bp">self</span><span class="o">.</span><span class="n">samplers</span> <span class="o">=</span> <span class="bp">None</span>
         <span class="bp">self</span><span class="o">.</span><span class="n">torsion_sampler_coil</span> <span class="o">=</span> <span class="bp">None</span>
         <span class="bp">self</span><span class="o">.</span><span class="n">torsion_sampler_helix</span> <span class="o">=</span> <span class="bp">None</span>
@@ -278,13 +280,13 @@
 
             <span class="bp">self</span><span class="o">.</span><span class="n">samplers</span> <span class="o">=</span> <span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">torsion_sampler_coil</span><span class="p">]</span> <span class="o">*</span> <span class="nb">len</span><span class="p">(</span><span class="n">psipred_pred</span><span class="p">)</span>
             <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">psipred_pred</span><span class="p">)):</span>
-                <span class="k">if</span> <span class="n">psipred_pred</span><span class="o">.</span><span class="n">GetPrediction</span><span class="p">(</span><span class="n">i</span><span class="p">)</span> <span class="o">==</span> <span class="s">&#39;H&#39;</span> \
+                <span class="k">if</span> <span class="n">psipred_pred</span><span class="o">.</span><span class="n">GetPrediction</span><span class="p">(</span><span class="n">i</span><span class="p">)</span> <span class="o">==</span> <span class="s1">&#39;H&#39;</span> \
                    <span class="ow">and</span> <span class="n">psipred_pred</span><span class="o">.</span><span class="n">GetConfidence</span><span class="p">(</span><span class="n">i</span><span class="p">)</span> <span class="o">&gt;=</span> <span class="mi">6</span><span class="p">:</span>
                     <span class="bp">self</span><span class="o">.</span><span class="n">samplers</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">torsion_sampler_helix</span>  
-                <span class="k">if</span> <span class="n">psipred_pred</span><span class="o">.</span><span class="n">GetPrediction</span><span class="p">(</span><span class="n">i</span><span class="p">)</span> <span class="o">==</span> <span class="s">&#39;E&#39;</span> \
+                <span class="k">if</span> <span class="n">psipred_pred</span><span class="o">.</span><span class="n">GetPrediction</span><span class="p">(</span><span class="n">i</span><span class="p">)</span> <span class="o">==</span> <span class="s1">&#39;E&#39;</span> \
                    <span class="ow">and</span> <span class="n">psipred_pred</span><span class="o">.</span><span class="n">GetConfidence</span><span class="p">(</span><span class="n">i</span><span class="p">)</span> <span class="o">&gt;=</span> <span class="mi">6</span><span class="p">:</span>
                     <span class="bp">self</span><span class="o">.</span><span class="n">samplers</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">torsion_sampler_extended</span>
-        <span class="c"># prepare map</span>
+        <span class="c1"># prepare map</span>
         <span class="bp">self</span><span class="o">.</span><span class="n">fragger_map</span> <span class="o">=</span> <span class="n">FraggerMap</span><span class="p">()</span>
 
 <div class="viewcode-block" id="FraggerHandle.Get"><a class="viewcode-back" href="../../../modelling/algorithms.html#promod3.modelling.FraggerHandle.Get">[docs]</a>    <span class="k">def</span> <span class="nf">Get</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">frag_pos</span><span class="p">):</span>
@@ -295,12 +297,12 @@
 <span class="sd">        :return: A :class:`Fragger` object.</span>
 <span class="sd">        :raises: :exc:`~exceptions.ValueError` if index out-of-bounds.</span>
 <span class="sd">        &#39;&#39;&#39;</span>
-        <span class="c"># this is for ranges (i.e. last touched index is end_pos-1)</span>
+        <span class="c1"># this is for ranges (i.e. last touched index is end_pos-1)</span>
         <span class="n">end_pos</span> <span class="o">=</span> <span class="n">frag_pos</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">fragment_length</span>
-        <span class="c"># check</span>
+        <span class="c1"># check</span>
         <span class="k">if</span> <span class="n">frag_pos</span> <span class="o">&lt;</span> <span class="mi">0</span> <span class="ow">or</span> <span class="n">end_pos</span> <span class="o">&gt;</span> <span class="nb">len</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">sequence</span><span class="p">):</span>
-            <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s">&quot;Invalid fragment position &quot;</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">frag_pos</span><span class="p">))</span>
-        <span class="c"># get</span>
+            <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s2">&quot;Invalid fragment position &quot;</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">frag_pos</span><span class="p">))</span>
+        <span class="c1"># get</span>
         <span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">fragger_map</span><span class="o">.</span><span class="n">Contains</span><span class="p">(</span><span class="n">frag_pos</span><span class="p">):</span>
 
             <span class="n">fragger</span> <span class="o">=</span> <span class="bp">None</span>
@@ -335,12 +337,12 @@
             <span class="n">fragger</span><span class="o">.</span><span class="n">Fill</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">structure_db</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">rmsd_thresh</span><span class="p">,</span>
                          <span class="bp">self</span><span class="o">.</span><span class="n">fragments_per_position</span><span class="p">)</span>
 
-            <span class="c"># keep cached</span>
+            <span class="c1"># keep cached</span>
             <span class="bp">self</span><span class="o">.</span><span class="n">fragger_map</span><span class="p">[</span><span class="n">frag_pos</span><span class="p">]</span> <span class="o">=</span> <span class="n">fragger</span>
 
-        <span class="c"># get it back</span>
-        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">fragger_map</span><span class="p">[</span><span class="n">frag_pos</span><span class="p">]</span>
-</div>
+        <span class="c1"># get it back</span>
+        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">fragger_map</span><span class="p">[</span><span class="n">frag_pos</span><span class="p">]</span></div>
+
 <div class="viewcode-block" id="FraggerHandle.GetList"><a class="viewcode-back" href="../../../modelling/algorithms.html#promod3.modelling.FraggerHandle.GetList">[docs]</a>    <span class="k">def</span> <span class="nf">GetList</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">pos_start</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">pos_end</span><span class="o">=-</span><span class="mi">1</span><span class="p">):</span>
         <span class="sd">&#39;&#39;&#39;Get List of fraggers covering sequence indices pos_start..pos_end.</span>
 
@@ -358,23 +360,23 @@
         <span class="n">fragger_list</span> <span class="o">=</span> <span class="nb">list</span><span class="p">()</span>
         <span class="k">for</span> <span class="n">frag_pos</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="n">pos_start</span><span class="p">,</span> <span class="n">pos_end</span> <span class="o">-</span> <span class="bp">self</span><span class="o">.</span><span class="n">fragment_length</span> <span class="o">+</span> <span class="mi">2</span><span class="p">):</span>
             <span class="n">fragger_list</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">Get</span><span class="p">(</span><span class="n">frag_pos</span><span class="p">))</span>
-        <span class="k">return</span> <span class="n">fragger_list</span>
-</div>
+        <span class="k">return</span> <span class="n">fragger_list</span></div>
+
 <div class="viewcode-block" id="FraggerHandle.SaveCached"><a class="viewcode-back" href="../../../modelling/algorithms.html#promod3.modelling.FraggerHandle.SaveCached">[docs]</a>    <span class="k">def</span> <span class="nf">SaveCached</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">filename</span><span class="p">):</span>
         <span class="sd">&#39;&#39;&#39;Save cached fraggers.&#39;&#39;&#39;</span>
-        <span class="bp">self</span><span class="o">.</span><span class="n">fragger_map</span><span class="o">.</span><span class="n">Save</span><span class="p">(</span><span class="n">filename</span><span class="p">)</span>
-</div>
+        <span class="bp">self</span><span class="o">.</span><span class="n">fragger_map</span><span class="o">.</span><span class="n">Save</span><span class="p">(</span><span class="n">filename</span><span class="p">)</span></div>
+
 <div class="viewcode-block" id="FraggerHandle.LoadCached"><a class="viewcode-back" href="../../../modelling/algorithms.html#promod3.modelling.FraggerHandle.LoadCached">[docs]</a>    <span class="k">def</span> <span class="nf">LoadCached</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">filename</span><span class="p">):</span>
         <span class="sd">&#39;&#39;&#39;Load fragger objects stored with :meth:`SaveCached`.</span>
 <span class="sd">        Note that here we require that the same structure db is set as was</span>
 <span class="sd">        used when `filename` was saved.&#39;&#39;&#39;</span>
-        <span class="bp">self</span><span class="o">.</span><span class="n">fragger_map</span> <span class="o">=</span> <span class="n">FraggerMap</span><span class="o">.</span><span class="n">Load</span><span class="p">(</span><span class="n">filename</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">structure_db</span><span class="p">)</span>
-</div>
+        <span class="bp">self</span><span class="o">.</span><span class="n">fragger_map</span> <span class="o">=</span> <span class="n">FraggerMap</span><span class="o">.</span><span class="n">Load</span><span class="p">(</span><span class="n">filename</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">structure_db</span><span class="p">)</span></div>
+
     <span class="k">def</span> <span class="nf">_GetAABefore</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">pos</span><span class="p">):</span>
         <span class="k">if</span> <span class="n">pos</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">:</span>
             <span class="n">olc</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">sequence</span><span class="p">[</span><span class="n">pos</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span>
         <span class="k">else</span><span class="p">:</span>
-            <span class="n">olc</span> <span class="o">=</span> <span class="s">&#39;A&#39;</span>
+            <span class="n">olc</span> <span class="o">=</span> <span class="s1">&#39;A&#39;</span>
         <span class="n">aa_before</span> <span class="o">=</span> <span class="n">OneLetterCodeToResidueName</span><span class="p">(</span><span class="n">olc</span><span class="p">)</span>
         <span class="k">return</span> <span class="n">aa_before</span>
 
@@ -382,13 +384,13 @@
         <span class="k">if</span> <span class="n">pos</span> <span class="o">&lt;</span> <span class="nb">len</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">sequence</span><span class="p">)</span> <span class="o">-</span> <span class="mi">1</span><span class="p">:</span>
             <span class="n">olc</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">sequence</span><span class="p">[</span><span class="n">pos</span> <span class="o">+</span> <span class="mi">1</span><span class="p">]</span>
         <span class="k">else</span><span class="p">:</span>
-            <span class="n">olc</span> <span class="o">=</span> <span class="s">&#39;A&#39;</span>
+            <span class="n">olc</span> <span class="o">=</span> <span class="s1">&#39;A&#39;</span>
         <span class="n">aa_after</span> <span class="o">=</span> <span class="n">OneLetterCodeToResidueName</span><span class="p">(</span><span class="n">olc</span><span class="p">)</span>
-        <span class="k">return</span> <span class="n">aa_after</span>
+        <span class="k">return</span> <span class="n">aa_after</span></div>
 
 
-<span class="c"># these methods will be exported into module</span></div>
-<span class="n">__all__</span> <span class="o">=</span> <span class="p">(</span><span class="s">&#39;FraggerHandle&#39;</span><span class="p">,)</span>
+<span class="c1"># these methods will be exported into module</span>
+<span class="n">__all__</span> <span class="o">=</span> <span class="p">(</span><span class="s1">&#39;FraggerHandle&#39;</span><span class="p">,)</span>
 </pre></div>
 
           </div>
@@ -414,9 +416,6 @@
       <input type="hidden" name="check_keywords" value="yes" />
       <input type="hidden" name="area" value="default" />
     </form>
-    <p class="searchtip" style="font-size: 90%">
-    Enter search terms or a module, class or function name.
-    </p>
 </div>
 <script type="text/javascript">$('#searchbox').show(0);</script>
         </div>
@@ -424,11 +423,11 @@
       <div class="clearer"></div>
     </div>
     <div class="footer">
-      &copy;2017, ProMod3 authors.
+      &copy;2018, ProMod3 authors.
       
       |
-      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a>
-      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.6</a>
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.4.1</a>
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
       
     </div>
 
diff --git a/doc/html/_modules/promod3/modelling/_molprobity.html b/doc/html/_modules/promod3/modelling/_molprobity.html
index 864c296f37a35cb8b8bf9fb528c6f438c7bffdad..b9441021b1cca2bd98ef90666bf96c15f20509f6 100644
--- a/doc/html/_modules/promod3/modelling/_molprobity.html
+++ b/doc/html/_modules/promod3/modelling/_molprobity.html
@@ -6,7 +6,7 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
-    <title>promod3.modelling._molprobity &mdash; ProMod3 1.1.0 documentation</title>
+    <title>promod3.modelling._molprobity &mdash; ProMod3 1.2.0 documentation</title>
     
     <link rel="stylesheet" href="../../../_static/alabaster.css" type="text/css" />
     <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
@@ -14,7 +14,7 @@
     <script type="text/javascript">
       var DOCUMENTATION_OPTIONS = {
         URL_ROOT:    '../../../',
-        VERSION:     '1.1.0',
+        VERSION:     '1.2.0',
         COLLAPSE_INDEX: false,
         FILE_SUFFIX: '.html',
         HAS_SOURCE:  true
@@ -23,14 +23,16 @@
     <script type="text/javascript" src="../../../_static/jquery.js"></script>
     <script type="text/javascript" src="../../../_static/underscore.js"></script>
     <script type="text/javascript" src="../../../_static/doctools.js"></script>
-    <link rel="top" title="ProMod3 1.1.0 documentation" href="../../../index.html" />
+    <link rel="top" title="ProMod3 1.2.0 documentation" href="../../../index.html" />
     <link rel="up" title="promod3" href="../../promod3.html" />
    
+  <link rel="stylesheet" href="../../../_static/custom.css" type="text/css" />
   
-  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
 
   </head>
-  <body role="document">  
+  <body role="document">
+  
 
     <div class="document">
       <div class="documentwrapper">
@@ -38,7 +40,7 @@
           <div class="body" role="main">
             
   <h1>Source code for promod3.modelling._molprobity</h1><div class="highlight"><pre>
-<span class="sd">&#39;&#39;&#39;Binding to external MolProbity tool to get scores.&#39;&#39;&#39;</span>
+<span></span><span class="sd">&#39;&#39;&#39;Binding to external MolProbity tool to get scores.&#39;&#39;&#39;</span>
 
 <span class="kn">import</span> <span class="nn">ost</span>
 <span class="kn">from</span> <span class="nn">ost</span> <span class="kn">import</span> <span class="n">settings</span>
@@ -84,46 +86,46 @@
 <span class="sd">    :raises: :class:`~ost.settings.FileNotFound` if the &quot;phenix.molprobity&quot;</span>
 <span class="sd">             executable is not found.</span>
 <span class="sd">    &#39;&#39;&#39;</span>
-    <span class="c"># HELPER</span>
+    <span class="c1"># HELPER</span>
     <span class="k">def</span> <span class="nf">GetStringValue</span><span class="p">(</span><span class="n">my_line</span><span class="p">):</span>
         <span class="sd">&quot;&quot;&quot;Parse line formatted as &#39; bla  = X ...&#39; and return &#39;X&#39; as string.&quot;&quot;&quot;</span>
-        <span class="k">return</span> <span class="n">my_line</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s">&#39;=&#39;</span><span class="p">)[</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s">&#39; &#39;</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span>
+        <span class="k">return</span> <span class="n">my_line</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s1">&#39;=&#39;</span><span class="p">)[</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s1">&#39; &#39;</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span>
 
-    <span class="c"># locate molprobity</span>
-    <span class="n">molprobity_exec</span> <span class="o">=</span> <span class="n">settings</span><span class="o">.</span><span class="n">Locate</span><span class="p">(</span><span class="s">&quot;phenix.molprobity&quot;</span><span class="p">,</span>
+    <span class="c1"># locate molprobity</span>
+    <span class="n">molprobity_exec</span> <span class="o">=</span> <span class="n">settings</span><span class="o">.</span><span class="n">Locate</span><span class="p">(</span><span class="s2">&quot;phenix.molprobity&quot;</span><span class="p">,</span>
                                       <span class="n">explicit_file_name</span><span class="o">=</span><span class="n">molprobity_bin</span><span class="p">,</span>
-                                      <span class="n">env_name</span><span class="o">=</span><span class="s">&#39;MOLPROBITY_EXECUTABLE&#39;</span><span class="p">)</span>
-    <span class="c"># run molprobity avoiding any file output</span>
-    <span class="n">cmd</span> <span class="o">=</span> <span class="p">[</span><span class="n">molprobity_exec</span><span class="p">,</span> <span class="n">target_pdb</span><span class="p">,</span> <span class="s">&quot;output.quiet=True&quot;</span><span class="p">,</span> \
-           <span class="s">&quot;output.coot=False&quot;</span><span class="p">,</span> <span class="s">&quot;output.probe_dots=False&quot;</span><span class="p">]</span>
+                                      <span class="n">env_name</span><span class="o">=</span><span class="s1">&#39;MOLPROBITY_EXECUTABLE&#39;</span><span class="p">)</span>
+    <span class="c1"># run molprobity avoiding any file output</span>
+    <span class="n">cmd</span> <span class="o">=</span> <span class="p">[</span><span class="n">molprobity_exec</span><span class="p">,</span> <span class="n">target_pdb</span><span class="p">,</span> <span class="s2">&quot;output.quiet=True&quot;</span><span class="p">,</span> \
+           <span class="s2">&quot;output.coot=False&quot;</span><span class="p">,</span> <span class="s2">&quot;output.probe_dots=False&quot;</span><span class="p">]</span>
     <span class="n">job</span> <span class="o">=</span> <span class="n">subprocess</span><span class="o">.</span><span class="n">Popen</span><span class="p">(</span><span class="n">cmd</span><span class="p">,</span> <span class="n">stdout</span><span class="o">=</span><span class="n">subprocess</span><span class="o">.</span><span class="n">PIPE</span><span class="p">,</span> <span class="n">stderr</span><span class="o">=</span><span class="n">subprocess</span><span class="o">.</span><span class="n">PIPE</span><span class="p">)</span>
     <span class="n">sout</span><span class="p">,</span> <span class="n">_</span> <span class="o">=</span> <span class="n">job</span><span class="o">.</span><span class="n">communicate</span><span class="p">()</span>
-    <span class="c"># parse</span>
+    <span class="c1"># parse</span>
     <span class="n">result</span> <span class="o">=</span> <span class="nb">dict</span><span class="p">()</span>
     <span class="n">first_found</span> <span class="o">=</span> <span class="bp">False</span>
     <span class="n">lines</span> <span class="o">=</span> <span class="n">sout</span><span class="o">.</span><span class="n">splitlines</span><span class="p">()</span>
     <span class="k">for</span> <span class="n">line</span> <span class="ow">in</span> <span class="n">lines</span><span class="p">:</span>
         <span class="n">my_line</span> <span class="o">=</span> <span class="n">line</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span>
-        <span class="k">if</span> <span class="n">my_line</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s">&quot;ramachandran outliers&quot;</span><span class="p">):</span>
+        <span class="k">if</span> <span class="n">my_line</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s2">&quot;ramachandran outliers&quot;</span><span class="p">):</span>
             <span class="n">first_found</span> <span class="o">=</span> <span class="bp">True</span>
-            <span class="n">result</span><span class="p">[</span><span class="s">&quot;Ramachandran outliers&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="n">GetStringValue</span><span class="p">(</span><span class="n">line</span><span class="p">))</span>
-        <span class="k">elif</span> <span class="n">first_found</span> <span class="ow">and</span> <span class="n">my_line</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s">&quot;favored&quot;</span><span class="p">):</span>
-            <span class="n">result</span><span class="p">[</span><span class="s">&quot;Ramachandran favored&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="n">GetStringValue</span><span class="p">(</span><span class="n">line</span><span class="p">))</span>
-        <span class="k">elif</span> <span class="n">first_found</span> <span class="ow">and</span> <span class="n">my_line</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s">&quot;rotamer outliers&quot;</span><span class="p">):</span>
-            <span class="n">result</span><span class="p">[</span><span class="s">&quot;Rotamer outliers&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="n">GetStringValue</span><span class="p">(</span><span class="n">line</span><span class="p">))</span>
-        <span class="k">elif</span> <span class="n">first_found</span> <span class="ow">and</span> <span class="n">my_line</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s">&quot;clashscore&quot;</span><span class="p">):</span>
-            <span class="n">result</span><span class="p">[</span><span class="s">&quot;Clashscore&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="n">GetStringValue</span><span class="p">(</span><span class="n">line</span><span class="p">))</span>
-        <span class="k">elif</span> <span class="n">first_found</span> <span class="ow">and</span> <span class="n">my_line</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s">&quot;c-beta deviations&quot;</span><span class="p">):</span>
-            <span class="n">result</span><span class="p">[</span><span class="s">&quot;C-beta deviations&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">GetStringValue</span><span class="p">(</span><span class="n">line</span><span class="p">))</span>
-        <span class="k">elif</span> <span class="n">first_found</span> <span class="ow">and</span> <span class="n">my_line</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s">&quot;molprobity score&quot;</span><span class="p">):</span>
-            <span class="n">result</span><span class="p">[</span><span class="s">&quot;MolProbity score&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="n">GetStringValue</span><span class="p">(</span><span class="n">line</span><span class="p">))</span>
-        <span class="k">elif</span> <span class="n">first_found</span> <span class="ow">and</span> <span class="n">my_line</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s">&quot;rms(bonds)&quot;</span><span class="p">):</span>
-            <span class="n">result</span><span class="p">[</span><span class="s">&quot;RMS(bonds)&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="n">GetStringValue</span><span class="p">(</span><span class="n">line</span><span class="p">))</span>
-        <span class="k">elif</span> <span class="n">first_found</span> <span class="ow">and</span> <span class="n">my_line</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s">&quot;rms(angles)&quot;</span><span class="p">):</span>
-            <span class="n">result</span><span class="p">[</span><span class="s">&quot;RMS(angles)&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="n">GetStringValue</span><span class="p">(</span><span class="n">line</span><span class="p">))</span>
-    <span class="k">return</span> <span class="n">result</span>
+            <span class="n">result</span><span class="p">[</span><span class="s2">&quot;Ramachandran outliers&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="n">GetStringValue</span><span class="p">(</span><span class="n">line</span><span class="p">))</span>
+        <span class="k">elif</span> <span class="n">first_found</span> <span class="ow">and</span> <span class="n">my_line</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s2">&quot;favored&quot;</span><span class="p">):</span>
+            <span class="n">result</span><span class="p">[</span><span class="s2">&quot;Ramachandran favored&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="n">GetStringValue</span><span class="p">(</span><span class="n">line</span><span class="p">))</span>
+        <span class="k">elif</span> <span class="n">first_found</span> <span class="ow">and</span> <span class="n">my_line</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s2">&quot;rotamer outliers&quot;</span><span class="p">):</span>
+            <span class="n">result</span><span class="p">[</span><span class="s2">&quot;Rotamer outliers&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="n">GetStringValue</span><span class="p">(</span><span class="n">line</span><span class="p">))</span>
+        <span class="k">elif</span> <span class="n">first_found</span> <span class="ow">and</span> <span class="n">my_line</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s2">&quot;clashscore&quot;</span><span class="p">):</span>
+            <span class="n">result</span><span class="p">[</span><span class="s2">&quot;Clashscore&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="n">GetStringValue</span><span class="p">(</span><span class="n">line</span><span class="p">))</span>
+        <span class="k">elif</span> <span class="n">first_found</span> <span class="ow">and</span> <span class="n">my_line</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s2">&quot;c-beta deviations&quot;</span><span class="p">):</span>
+            <span class="n">result</span><span class="p">[</span><span class="s2">&quot;C-beta deviations&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">GetStringValue</span><span class="p">(</span><span class="n">line</span><span class="p">))</span>
+        <span class="k">elif</span> <span class="n">first_found</span> <span class="ow">and</span> <span class="n">my_line</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s2">&quot;molprobity score&quot;</span><span class="p">):</span>
+            <span class="n">result</span><span class="p">[</span><span class="s2">&quot;MolProbity score&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="n">GetStringValue</span><span class="p">(</span><span class="n">line</span><span class="p">))</span>
+        <span class="k">elif</span> <span class="n">first_found</span> <span class="ow">and</span> <span class="n">my_line</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s2">&quot;rms(bonds)&quot;</span><span class="p">):</span>
+            <span class="n">result</span><span class="p">[</span><span class="s2">&quot;RMS(bonds)&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="n">GetStringValue</span><span class="p">(</span><span class="n">line</span><span class="p">))</span>
+        <span class="k">elif</span> <span class="n">first_found</span> <span class="ow">and</span> <span class="n">my_line</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s2">&quot;rms(angles)&quot;</span><span class="p">):</span>
+            <span class="n">result</span><span class="p">[</span><span class="s2">&quot;RMS(angles)&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="n">GetStringValue</span><span class="p">(</span><span class="n">line</span><span class="p">))</span>
+    <span class="k">return</span> <span class="n">result</span></div>
+
 
-</div>
 <div class="viewcode-block" id="RunMolProbityEntity"><a class="viewcode-back" href="../../../modelling/model_checking.html#promod3.modelling.RunMolProbityEntity">[docs]</a><span class="k">def</span> <span class="nf">RunMolProbityEntity</span><span class="p">(</span><span class="n">ost_ent</span><span class="p">,</span> <span class="n">molprobity_bin</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
     <span class="sd">&#39;&#39;&#39;Run molprobity from phenix on given OST entity.</span>
 <span class="sd">    </span>
@@ -132,29 +134,29 @@
 <span class="sd">    :param ost_ent: OST entity on which to do analysis.</span>
 <span class="sd">    :type ost_ent:  :class:`Entity &lt;ost.mol.EntityHandle&gt;`</span>
 <span class="sd">    &#39;&#39;&#39;</span>
-    <span class="c"># store as PDB in a tmp. file</span>
-    <span class="n">_</span><span class="p">,</span> <span class="n">tmpfile</span> <span class="o">=</span> <span class="n">tempfile</span><span class="o">.</span><span class="n">mkstemp</span><span class="p">(</span><span class="n">suffix</span><span class="o">=</span><span class="s">&#39;.pdb&#39;</span><span class="p">)</span>
+    <span class="c1"># store as PDB in a tmp. file</span>
+    <span class="n">_</span><span class="p">,</span> <span class="n">tmpfile</span> <span class="o">=</span> <span class="n">tempfile</span><span class="o">.</span><span class="n">mkstemp</span><span class="p">(</span><span class="n">suffix</span><span class="o">=</span><span class="s1">&#39;.pdb&#39;</span><span class="p">)</span>
     <span class="n">ost</span><span class="o">.</span><span class="n">PushVerbosityLevel</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
     <span class="n">ost</span><span class="o">.</span><span class="n">io</span><span class="o">.</span><span class="n">SavePDB</span><span class="p">(</span><span class="n">ost_ent</span><span class="p">,</span> <span class="n">tmpfile</span><span class="p">)</span>
     <span class="n">ost</span><span class="o">.</span><span class="n">PopVerbosityLevel</span><span class="p">()</span>
-    <span class="c"># get result</span>
+    <span class="c1"># get result</span>
     <span class="n">result</span> <span class="o">=</span> <span class="n">RunMolProbity</span><span class="p">(</span><span class="n">tmpfile</span><span class="p">,</span> <span class="n">molprobity_bin</span><span class="p">)</span>
-    <span class="c"># clean up</span>
+    <span class="c1"># clean up</span>
     <span class="n">os</span><span class="o">.</span><span class="n">remove</span><span class="p">(</span><span class="n">tmpfile</span><span class="p">)</span>
-    <span class="k">return</span> <span class="n">result</span>
-</div>
+    <span class="k">return</span> <span class="n">result</span></div>
+
 <div class="viewcode-block" id="ReportMolProbityScores"><a class="viewcode-back" href="../../../modelling/model_checking.html#promod3.modelling.ReportMolProbityScores">[docs]</a><span class="k">def</span> <span class="nf">ReportMolProbityScores</span><span class="p">(</span><span class="n">scores</span><span class="p">):</span>
     <span class="sd">&#39;&#39;&#39;Print MolProbity score and its components to LogInfo.</span>
 <span class="sd">    </span>
 <span class="sd">    :param scores: MolProbity scores as generated by :func:`RunMolProbity`.</span>
 <span class="sd">    :type scores:  :class:`dict`</span>
 <span class="sd">    &#39;&#39;&#39;</span>
-    <span class="n">ost</span><span class="o">.</span><span class="n">LogInfo</span><span class="p">(</span><span class="s">&quot;MolProbity score: &quot;</span>  <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">scores</span><span class="p">[</span><span class="s">&quot;MolProbity score&quot;</span><span class="p">]))</span>
-    <span class="n">ost</span><span class="o">.</span><span class="n">LogInfo</span><span class="p">(</span><span class="s">&quot;- Clashscore          : &quot;</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">scores</span><span class="p">[</span><span class="s">&quot;Clashscore&quot;</span><span class="p">]))</span>
-    <span class="n">ost</span><span class="o">.</span><span class="n">LogInfo</span><span class="p">(</span><span class="s">&quot;- Rotamer outliers    : &quot;</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">scores</span><span class="p">[</span><span class="s">&quot;Rotamer outliers&quot;</span><span class="p">])</span> <span class="o">+</span> <span class="s">&quot; %&quot;</span><span class="p">)</span>
-    <span class="n">ost</span><span class="o">.</span><span class="n">LogInfo</span><span class="p">(</span><span class="s">&quot;- Ramachandran favored: &quot;</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">scores</span><span class="p">[</span><span class="s">&quot;Ramachandran favored&quot;</span><span class="p">])</span> <span class="o">+</span> <span class="s">&quot; %&quot;</span><span class="p">)</span>
-</div>
-<span class="n">__all__</span> <span class="o">=</span> <span class="p">(</span><span class="s">&#39;RunMolProbity&#39;</span><span class="p">,</span> <span class="s">&#39;RunMolProbityEntity&#39;</span><span class="p">,</span> <span class="s">&#39;ReportMolProbityScores&#39;</span><span class="p">)</span>
+    <span class="n">ost</span><span class="o">.</span><span class="n">LogInfo</span><span class="p">(</span><span class="s2">&quot;MolProbity score: &quot;</span>  <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">scores</span><span class="p">[</span><span class="s2">&quot;MolProbity score&quot;</span><span class="p">]))</span>
+    <span class="n">ost</span><span class="o">.</span><span class="n">LogInfo</span><span class="p">(</span><span class="s2">&quot;- Clashscore          : &quot;</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">scores</span><span class="p">[</span><span class="s2">&quot;Clashscore&quot;</span><span class="p">]))</span>
+    <span class="n">ost</span><span class="o">.</span><span class="n">LogInfo</span><span class="p">(</span><span class="s2">&quot;- Rotamer outliers    : &quot;</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">scores</span><span class="p">[</span><span class="s2">&quot;Rotamer outliers&quot;</span><span class="p">])</span> <span class="o">+</span> <span class="s2">&quot; %&quot;</span><span class="p">)</span>
+    <span class="n">ost</span><span class="o">.</span><span class="n">LogInfo</span><span class="p">(</span><span class="s2">&quot;- Ramachandran favored: &quot;</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">scores</span><span class="p">[</span><span class="s2">&quot;Ramachandran favored&quot;</span><span class="p">])</span> <span class="o">+</span> <span class="s2">&quot; %&quot;</span><span class="p">)</span></div>
+
+<span class="n">__all__</span> <span class="o">=</span> <span class="p">(</span><span class="s1">&#39;RunMolProbity&#39;</span><span class="p">,</span> <span class="s1">&#39;RunMolProbityEntity&#39;</span><span class="p">,</span> <span class="s1">&#39;ReportMolProbityScores&#39;</span><span class="p">)</span>
 </pre></div>
 
           </div>
@@ -180,9 +182,6 @@
       <input type="hidden" name="check_keywords" value="yes" />
       <input type="hidden" name="area" value="default" />
     </form>
-    <p class="searchtip" style="font-size: 90%">
-    Enter search terms or a module, class or function name.
-    </p>
 </div>
 <script type="text/javascript">$('#searchbox').show(0);</script>
         </div>
@@ -190,11 +189,11 @@
       <div class="clearer"></div>
     </div>
     <div class="footer">
-      &copy;2017, ProMod3 authors.
+      &copy;2018, ProMod3 authors.
       
       |
-      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a>
-      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.6</a>
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.4.1</a>
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
       
     </div>
 
diff --git a/doc/html/_modules/promod3/modelling/_pipeline.html b/doc/html/_modules/promod3/modelling/_pipeline.html
index 2e1e714435baa559314bc1a202cddcfc87fe7177..3ea48e01d1e4a82180c71d72adbae5297ad85c69 100644
--- a/doc/html/_modules/promod3/modelling/_pipeline.html
+++ b/doc/html/_modules/promod3/modelling/_pipeline.html
@@ -6,7 +6,7 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
-    <title>promod3.modelling._pipeline &mdash; ProMod3 1.1.0 documentation</title>
+    <title>promod3.modelling._pipeline &mdash; ProMod3 1.2.0 documentation</title>
     
     <link rel="stylesheet" href="../../../_static/alabaster.css" type="text/css" />
     <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
@@ -14,7 +14,7 @@
     <script type="text/javascript">
       var DOCUMENTATION_OPTIONS = {
         URL_ROOT:    '../../../',
-        VERSION:     '1.1.0',
+        VERSION:     '1.2.0',
         COLLAPSE_INDEX: false,
         FILE_SUFFIX: '.html',
         HAS_SOURCE:  true
@@ -23,14 +23,16 @@
     <script type="text/javascript" src="../../../_static/jquery.js"></script>
     <script type="text/javascript" src="../../../_static/underscore.js"></script>
     <script type="text/javascript" src="../../../_static/doctools.js"></script>
-    <link rel="top" title="ProMod3 1.1.0 documentation" href="../../../index.html" />
+    <link rel="top" title="ProMod3 1.2.0 documentation" href="../../../index.html" />
     <link rel="up" title="promod3" href="../../promod3.html" />
    
+  <link rel="stylesheet" href="../../../_static/custom.css" type="text/css" />
   
-  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
 
   </head>
-  <body role="document">  
+  <body role="document">
+  
 
     <div class="document">
       <div class="documentwrapper">
@@ -38,25 +40,25 @@
           <div class="body" role="main">
             
   <h1>Source code for promod3.modelling._pipeline</h1><div class="highlight"><pre>
-<span class="sd">&#39;&#39;&#39;High-level functionality for modelling module to build pipelines. Added in </span>
+<span></span><span class="sd">&#39;&#39;&#39;High-level functionality for modelling module to build pipelines. Added in </span>
 <span class="sd">the __init__.py file. To be used directly by passing a ModellingHandle instance</span>
 <span class="sd">as argument.</span>
 <span class="sd">&#39;&#39;&#39;</span>
 
-<span class="c"># internal</span>
+<span class="c1"># internal</span>
 <span class="kn">from</span> <span class="nn">promod3</span> <span class="kn">import</span> <span class="n">loop</span><span class="p">,</span> <span class="n">sidechain</span><span class="p">,</span> <span class="n">core</span>
 <span class="kn">from</span> <span class="nn">_modelling</span> <span class="kn">import</span> <span class="o">*</span>
 <span class="kn">from</span> <span class="nn">_reconstruct_sidechains</span> <span class="kn">import</span> <span class="o">*</span>
 <span class="kn">from</span> <span class="nn">_closegaps</span> <span class="kn">import</span> <span class="o">*</span>
 <span class="kn">from</span> <span class="nn">_ring_punches</span> <span class="kn">import</span> <span class="o">*</span>
-<span class="c"># external</span>
+<span class="c1"># external</span>
 <span class="kn">import</span> <span class="nn">ost</span>
 <span class="kn">from</span> <span class="nn">ost</span> <span class="kn">import</span> <span class="n">mol</span><span class="p">,</span> <span class="n">conop</span>
 <span class="kn">from</span> <span class="nn">ost.mol</span> <span class="kn">import</span> <span class="n">mm</span>
 <span class="kn">import</span> <span class="nn">os</span><span class="o">,</span> <span class="nn">math</span>
 
-<span class="c">###############################################################################</span>
-<span class="c"># helper functions</span>
+<span class="c1">###############################################################################</span>
+<span class="c1"># helper functions</span>
 <span class="k">def</span> <span class="nf">_RemoveHydrogens</span><span class="p">(</span><span class="n">ent</span><span class="p">):</span>
     <span class="sd">&#39;&#39;&#39;Hydrogen naming depends on the force field used.</span>
 <span class="sd">    To be on the safe side, we simply remove all of them.</span>
@@ -64,7 +66,7 @@
 <span class="sd">    when rebuilding sidechains.</span>
 <span class="sd">    &#39;&#39;&#39;</span>
     <span class="n">edi</span> <span class="o">=</span> <span class="n">ent</span><span class="o">.</span><span class="n">EditXCS</span><span class="p">(</span><span class="n">mol</span><span class="o">.</span><span class="n">BUFFERED_EDIT</span><span class="p">)</span>
-    <span class="n">ha</span> <span class="o">=</span> <span class="n">ent</span><span class="o">.</span><span class="n">Select</span><span class="p">(</span><span class="s">&#39;ele=H&#39;</span><span class="p">)</span>
+    <span class="n">ha</span> <span class="o">=</span> <span class="n">ent</span><span class="o">.</span><span class="n">Select</span><span class="p">(</span><span class="s1">&#39;ele=H&#39;</span><span class="p">)</span>
     <span class="k">for</span> <span class="n">a</span> <span class="ow">in</span> <span class="n">ha</span><span class="o">.</span><span class="n">atoms</span><span class="p">:</span>
         <span class="n">edi</span><span class="o">.</span><span class="n">DeleteAtom</span><span class="p">(</span><span class="n">a</span><span class="o">.</span><span class="n">handle</span><span class="p">)</span>
     <span class="n">edi</span><span class="o">.</span><span class="n">UpdateICS</span><span class="p">()</span>
@@ -84,53 +86,53 @@
 <span class="sd">    Note: if successful, this will update ent (adding hydrogens).</span>
 <span class="sd">    Set add_heuristic_hydrogens to True for ligands.</span>
 <span class="sd">    &#39;&#39;&#39;</span>
-    <span class="c"># try all force fields in order</span>
+    <span class="c1"># try all force fields in order</span>
     <span class="k">for</span> <span class="n">i_ff</span><span class="p">,</span> <span class="n">ff</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">force_fields</span><span class="p">):</span>
         <span class="n">settings</span><span class="o">.</span><span class="n">forcefield</span> <span class="o">=</span> <span class="n">ff</span>
         <span class="k">try</span><span class="p">:</span>
-            <span class="c"># check if we need to add hydrogens heuristically</span>
+            <span class="c1"># check if we need to add hydrogens heuristically</span>
             <span class="k">if</span> <span class="n">add_heuristic_hydrogens</span><span class="p">:</span>
                 <span class="n">_AddHeuristicHydrogens</span><span class="p">(</span><span class="n">ent</span><span class="p">,</span> <span class="n">ff</span><span class="p">)</span>
-            <span class="c"># ok now we try...</span>
+            <span class="c1"># ok now we try...</span>
             <span class="n">topo</span> <span class="o">=</span> <span class="n">mm</span><span class="o">.</span><span class="n">TopologyCreator</span><span class="o">.</span><span class="n">Create</span><span class="p">(</span><span class="n">ent</span><span class="p">,</span> <span class="n">settings</span><span class="p">)</span>
         <span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">ex</span><span class="p">:</span>
-            <span class="c"># report only for debugging</span>
-            <span class="n">ost</span><span class="o">.</span><span class="n">LogVerbose</span><span class="p">(</span><span class="s">&quot;Could not create mm topology for ff </span><span class="si">%d</span><span class="s">. </span><span class="si">%s</span><span class="s">&quot;</span> \
-                           <span class="o">%</span> <span class="p">(</span><span class="n">i_ff</span><span class="p">,</span> <span class="nb">type</span><span class="p">(</span><span class="n">ex</span><span class="p">)</span><span class="o">.</span><span class="n">__name__</span> <span class="o">+</span> <span class="s">&quot;: &quot;</span> <span class="o">+</span> <span class="n">ex</span><span class="o">.</span><span class="n">message</span><span class="p">))</span>
+            <span class="c1"># report only for debugging</span>
+            <span class="n">ost</span><span class="o">.</span><span class="n">LogVerbose</span><span class="p">(</span><span class="s2">&quot;Could not create mm topology for ff </span><span class="si">%d</span><span class="s2">. </span><span class="si">%s</span><span class="s2">&quot;</span> \
+                           <span class="o">%</span> <span class="p">(</span><span class="n">i_ff</span><span class="p">,</span> <span class="nb">type</span><span class="p">(</span><span class="n">ex</span><span class="p">)</span><span class="o">.</span><span class="n">__name__</span> <span class="o">+</span> <span class="s2">&quot;: &quot;</span> <span class="o">+</span> <span class="n">ex</span><span class="o">.</span><span class="n">message</span><span class="p">))</span>
             <span class="k">continue</span>
         <span class="k">else</span><span class="p">:</span>
-            <span class="c"># all good</span>
+            <span class="c1"># all good</span>
             <span class="k">return</span> <span class="n">topo</span>
-    <span class="c"># if we got here, nothing worked</span>
+    <span class="c1"># if we got here, nothing worked</span>
     <span class="k">return</span> <span class="bp">None</span>
 
 <span class="k">def</span> <span class="nf">_AddLigands</span><span class="p">(</span><span class="n">ent</span><span class="p">,</span> <span class="n">top</span><span class="p">,</span> <span class="n">lig_ent</span><span class="p">,</span> <span class="n">settings</span><span class="p">,</span> <span class="n">force_fields</span><span class="p">):</span>
     <span class="sd">&#39;&#39;&#39;Add ligands from lig_ent to topology top and update entity ent.&#39;&#39;&#39;</span>
-    <span class="c"># connect them first</span>
+    <span class="c1"># connect them first</span>
     <span class="n">proc</span> <span class="o">=</span> <span class="n">conop</span><span class="o">.</span><span class="n">RuleBasedProcessor</span><span class="p">(</span><span class="n">conop</span><span class="o">.</span><span class="n">GetDefaultLib</span><span class="p">())</span>
     <span class="n">proc</span><span class="o">.</span><span class="n">Process</span><span class="p">(</span><span class="n">lig_ent</span><span class="p">)</span>
     <span class="n">cur_res</span> <span class="o">=</span> <span class="n">lig_ent</span><span class="o">.</span><span class="n">residues</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
     <span class="n">lig_num</span> <span class="o">=</span> <span class="mi">1</span>
     <span class="k">while</span> <span class="n">cur_res</span><span class="o">.</span><span class="n">IsValid</span><span class="p">():</span>
-        <span class="c"># setup connected components</span>
+        <span class="c1"># setup connected components</span>
         <span class="n">cur_view</span> <span class="o">=</span> <span class="n">lig_ent</span><span class="o">.</span><span class="n">CreateEmptyView</span><span class="p">()</span>
         <span class="n">cur_view</span><span class="o">.</span><span class="n">AddResidue</span><span class="p">(</span><span class="n">cur_res</span><span class="p">,</span> <span class="n">mol</span><span class="o">.</span><span class="n">INCLUDE_ATOMS</span><span class="p">)</span>
         <span class="n">cur_res</span> <span class="o">=</span> <span class="n">cur_res</span><span class="o">.</span><span class="n">next</span>
         <span class="k">while</span> <span class="n">cur_res</span><span class="o">.</span><span class="n">IsValid</span><span class="p">()</span> <span class="ow">and</span> <span class="n">mol</span><span class="o">.</span><span class="n">InSequence</span><span class="p">(</span><span class="n">cur_res</span><span class="o">.</span><span class="n">prev</span><span class="p">,</span> <span class="n">cur_res</span><span class="p">):</span>
             <span class="n">cur_view</span><span class="o">.</span><span class="n">AddResidue</span><span class="p">(</span><span class="n">cur_res</span><span class="p">,</span> <span class="n">mol</span><span class="o">.</span><span class="n">INCLUDE_ATOMS</span><span class="p">)</span>
             <span class="n">cur_res</span> <span class="o">=</span> <span class="n">cur_res</span><span class="o">.</span><span class="n">next</span>
-        <span class="c"># try to add topology with special named chain</span>
+        <span class="c1"># try to add topology with special named chain</span>
         <span class="n">cur_ent</span> <span class="o">=</span> <span class="n">mol</span><span class="o">.</span><span class="n">CreateEntityFromView</span><span class="p">(</span><span class="n">cur_view</span><span class="p">,</span> <span class="bp">True</span><span class="p">)</span>
         <span class="n">edi</span> <span class="o">=</span> <span class="n">cur_ent</span><span class="o">.</span><span class="n">EditXCS</span><span class="p">()</span>
-        <span class="n">edi</span><span class="o">.</span><span class="n">RenameChain</span><span class="p">(</span><span class="n">cur_ent</span><span class="o">.</span><span class="n">chains</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="s">&#39;_&#39;</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">lig_num</span><span class="p">))</span>
+        <span class="n">edi</span><span class="o">.</span><span class="n">RenameChain</span><span class="p">(</span><span class="n">cur_ent</span><span class="o">.</span><span class="n">chains</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="s1">&#39;_&#39;</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">lig_num</span><span class="p">))</span>
         <span class="n">lig_num</span> <span class="o">+=</span> <span class="mi">1</span>
         <span class="n">cur_top</span> <span class="o">=</span> <span class="n">_GetTopology</span><span class="p">(</span><span class="n">cur_ent</span><span class="p">,</span> <span class="n">settings</span><span class="p">,</span> <span class="n">force_fields</span><span class="p">,</span> <span class="bp">True</span><span class="p">)</span>
         <span class="k">if</span> <span class="n">cur_top</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span>
             <span class="n">view_res_str</span> <span class="o">=</span> <span class="nb">str</span><span class="p">([</span><span class="nb">str</span><span class="p">(</span><span class="n">r</span><span class="p">)</span> <span class="k">for</span> <span class="n">r</span> <span class="ow">in</span> <span class="n">cur_view</span><span class="o">.</span><span class="n">residues</span><span class="p">])</span>
-            <span class="n">ost</span><span class="o">.</span><span class="n">LogError</span><span class="p">(</span><span class="s">&quot;Failed to add ligands &quot;</span> <span class="o">+</span> <span class="n">view_res_str</span> <span class="o">+</span> \
-                         <span class="s">&quot; for energy minimization! Skipping...&quot;</span><span class="p">)</span>
+            <span class="n">ost</span><span class="o">.</span><span class="n">LogError</span><span class="p">(</span><span class="s2">&quot;Failed to add ligands &quot;</span> <span class="o">+</span> <span class="n">view_res_str</span> <span class="o">+</span> \
+                         <span class="s2">&quot; for energy minimization! Skipping...&quot;</span><span class="p">)</span>
         <span class="k">else</span><span class="p">:</span>
-            <span class="c"># merge into main topology</span>
+            <span class="c1"># merge into main topology</span>
             <span class="n">cur_top</span><span class="o">.</span><span class="n">SetFudgeLJ</span><span class="p">(</span><span class="n">top</span><span class="o">.</span><span class="n">GetFudgeLJ</span><span class="p">())</span>
             <span class="n">cur_top</span><span class="o">.</span><span class="n">SetFudgeQQ</span><span class="p">(</span><span class="n">top</span><span class="o">.</span><span class="n">GetFudgeQQ</span><span class="p">())</span>
             <span class="n">top</span><span class="o">.</span><span class="n">Merge</span><span class="p">(</span><span class="n">ent</span><span class="p">,</span> <span class="n">cur_top</span><span class="p">,</span> <span class="n">cur_ent</span><span class="p">)</span>
@@ -141,41 +143,41 @@
 <span class="sd">    component in the ligand chain separately by evaluating the force fields in</span>
 <span class="sd">    the same order as given. Ligands without force fields are skipped.</span>
 <span class="sd">    &#39;&#39;&#39;</span>
-    <span class="n">prof</span> <span class="o">=</span> <span class="n">core</span><span class="o">.</span><span class="n">StaticRuntimeProfiler</span><span class="o">.</span><span class="n">StartScoped</span><span class="p">(</span><span class="s">&#39;pipeline::_SetupMmSimulation&#39;</span><span class="p">)</span>
+    <span class="n">prof</span> <span class="o">=</span> <span class="n">core</span><span class="o">.</span><span class="n">StaticRuntimeProfiler</span><span class="o">.</span><span class="n">StartScoped</span><span class="p">(</span><span class="s1">&#39;pipeline::_SetupMmSimulation&#39;</span><span class="p">)</span>
 
-    <span class="c"># get general settings </span>
+    <span class="c1"># get general settings </span>
     <span class="n">settings</span> <span class="o">=</span> <span class="n">mm</span><span class="o">.</span><span class="n">Settings</span><span class="p">()</span>
     <span class="n">settings</span><span class="o">.</span><span class="n">integrator</span> <span class="o">=</span> <span class="n">mm</span><span class="o">.</span><span class="n">LangevinIntegrator</span><span class="p">(</span><span class="mi">310</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mf">0.002</span><span class="p">)</span>
     <span class="n">settings</span><span class="o">.</span><span class="n">init_temperature</span> <span class="o">=</span> <span class="mi">0</span>
     <span class="n">settings</span><span class="o">.</span><span class="n">nonbonded_method</span> <span class="o">=</span> <span class="n">mm</span><span class="o">.</span><span class="n">NonbondedMethod</span><span class="o">.</span><span class="n">CutoffNonPeriodic</span>
     <span class="n">settings</span><span class="o">.</span><span class="n">keep_ff_specific_naming</span> <span class="o">=</span> <span class="bp">False</span>
     
-    <span class="c"># prepare entity with protein</span>
+    <span class="c1"># prepare entity with protein</span>
     <span class="n">_RemoveHydrogens</span><span class="p">(</span><span class="n">model</span><span class="p">)</span>
-    <span class="n">ent</span> <span class="o">=</span> <span class="n">mol</span><span class="o">.</span><span class="n">CreateEntityFromView</span><span class="p">(</span><span class="n">model</span><span class="o">.</span><span class="n">Select</span><span class="p">(</span><span class="s">&quot;cname!=&#39;_&#39;&quot;</span><span class="p">),</span> <span class="bp">True</span><span class="p">)</span>
+    <span class="n">ent</span> <span class="o">=</span> <span class="n">mol</span><span class="o">.</span><span class="n">CreateEntityFromView</span><span class="p">(</span><span class="n">model</span><span class="o">.</span><span class="n">Select</span><span class="p">(</span><span class="s2">&quot;cname!=&#39;_&#39;&quot;</span><span class="p">),</span> <span class="bp">True</span><span class="p">)</span>
     <span class="n">top</span> <span class="o">=</span> <span class="n">_GetTopology</span><span class="p">(</span><span class="n">ent</span><span class="p">,</span> <span class="n">settings</span><span class="p">,</span> <span class="n">force_fields</span><span class="p">)</span>
     <span class="k">if</span> <span class="n">top</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span>
-        <span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s">&quot;Failed to setup protein for energy minimization!&quot;</span><span class="p">)</span>
+        <span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s2">&quot;Failed to setup protein for energy minimization!&quot;</span><span class="p">)</span>
     
-    <span class="c"># prepare ligands: we reprocess them to ensure connectivity</span>
-    <span class="n">lig_ent</span> <span class="o">=</span> <span class="n">mol</span><span class="o">.</span><span class="n">CreateEntityFromView</span><span class="p">(</span><span class="n">model</span><span class="o">.</span><span class="n">Select</span><span class="p">(</span><span class="s">&quot;cname=&#39;_&#39;&quot;</span><span class="p">),</span> <span class="bp">True</span><span class="p">)</span>
+    <span class="c1"># prepare ligands: we reprocess them to ensure connectivity</span>
+    <span class="n">lig_ent</span> <span class="o">=</span> <span class="n">mol</span><span class="o">.</span><span class="n">CreateEntityFromView</span><span class="p">(</span><span class="n">model</span><span class="o">.</span><span class="n">Select</span><span class="p">(</span><span class="s2">&quot;cname=&#39;_&#39;&quot;</span><span class="p">),</span> <span class="bp">True</span><span class="p">)</span>
     <span class="k">if</span> <span class="n">lig_ent</span><span class="o">.</span><span class="n">residue_count</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">:</span>
         <span class="n">_AddLigands</span><span class="p">(</span><span class="n">ent</span><span class="p">,</span> <span class="n">top</span><span class="p">,</span> <span class="n">lig_ent</span><span class="p">,</span> <span class="n">settings</span><span class="p">,</span> <span class="n">force_fields</span><span class="p">)</span>
 
-    <span class="c"># use fast CPU platform by default</span>
-    <span class="c"># NOTE: settings.platform only relevant for mm.Simulation!</span>
+    <span class="c1"># use fast CPU platform by default</span>
+    <span class="c1"># NOTE: settings.platform only relevant for mm.Simulation!</span>
     <span class="n">settings</span><span class="o">.</span><span class="n">platform</span> <span class="o">=</span> <span class="n">mm</span><span class="o">.</span><span class="n">Platform</span><span class="o">.</span><span class="n">CPU</span>
     <span class="k">if</span> <span class="n">mm</span><span class="o">.</span><span class="n">Simulation</span><span class="o">.</span><span class="n">IsPlatformAvailable</span><span class="p">(</span><span class="n">settings</span><span class="p">):</span>
-        <span class="n">num_cpu_threads</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">getenv</span><span class="p">(</span><span class="s">&#39;PM3_OPENMM_CPU_THREADS&#39;</span><span class="p">)</span>
+        <span class="n">num_cpu_threads</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">getenv</span><span class="p">(</span><span class="s1">&#39;PM3_OPENMM_CPU_THREADS&#39;</span><span class="p">)</span>
         <span class="k">if</span> <span class="n">num_cpu_threads</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span>
-            <span class="n">settings</span><span class="o">.</span><span class="n">cpu_properties</span><span class="p">[</span><span class="s">&quot;CpuThreads&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="s">&quot;1&quot;</span>
+            <span class="n">settings</span><span class="o">.</span><span class="n">cpu_properties</span><span class="p">[</span><span class="s2">&quot;CpuThreads&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="s2">&quot;1&quot;</span>
         <span class="k">else</span><span class="p">:</span>
-            <span class="n">settings</span><span class="o">.</span><span class="n">cpu_properties</span><span class="p">[</span><span class="s">&quot;CpuThreads&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">num_cpu_threads</span>
+            <span class="n">settings</span><span class="o">.</span><span class="n">cpu_properties</span><span class="p">[</span><span class="s2">&quot;CpuThreads&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">num_cpu_threads</span>
     <span class="k">else</span><span class="p">:</span>
-        <span class="c"># switch to &quot;mm.Platform.Reference&quot; as fallback</span>
+        <span class="c1"># switch to &quot;mm.Platform.Reference&quot; as fallback</span>
         <span class="n">settings</span><span class="o">.</span><span class="n">platform</span> <span class="o">=</span> <span class="n">mm</span><span class="o">.</span><span class="n">Platform</span><span class="o">.</span><span class="n">Reference</span>
-        <span class="n">ost</span><span class="o">.</span><span class="n">LogWarning</span><span class="p">(</span><span class="s">&quot;Switched to slower reference platform of OpenMM!&quot;</span><span class="p">)</span>
-    <span class="c"># finally set up the simulation</span>
+        <span class="n">ost</span><span class="o">.</span><span class="n">LogWarning</span><span class="p">(</span><span class="s2">&quot;Switched to slower reference platform of OpenMM!&quot;</span><span class="p">)</span>
+    <span class="c1"># finally set up the simulation</span>
     <span class="n">sim</span> <span class="o">=</span> <span class="n">mm</span><span class="o">.</span><span class="n">Simulation</span><span class="p">(</span><span class="n">top</span><span class="p">,</span> <span class="n">ent</span><span class="p">,</span> <span class="n">settings</span><span class="p">)</span>
         
     <span class="k">return</span> <span class="n">sim</span>
@@ -183,24 +185,24 @@
 <span class="k">def</span> <span class="nf">_GetSimEntity</span><span class="p">(</span><span class="n">sim</span><span class="p">):</span>
     <span class="sd">&#39;&#39;&#39;Get Entity from mm sim and reverse ligand chain naming.&#39;&#39;&#39;</span>
     <span class="n">ent</span> <span class="o">=</span> <span class="n">sim</span><span class="o">.</span><span class="n">GetEntity</span><span class="p">()</span><span class="o">.</span><span class="n">Copy</span><span class="p">()</span>
-    <span class="c"># merge ligand chains into _</span>
+    <span class="c1"># merge ligand chains into _</span>
     <span class="n">ent_ed</span> <span class="o">=</span> <span class="n">ent</span><span class="o">.</span><span class="n">EditXCS</span><span class="p">(</span><span class="n">mol</span><span class="o">.</span><span class="n">BUFFERED_EDIT</span><span class="p">)</span>
     <span class="n">chain_names</span> <span class="o">=</span> <span class="p">[</span><span class="n">ch</span><span class="o">.</span><span class="n">name</span> <span class="k">for</span> <span class="n">ch</span> <span class="ow">in</span> <span class="n">ent</span><span class="o">.</span><span class="n">chains</span><span class="p">]</span>
     <span class="k">for</span> <span class="n">chain_name</span> <span class="ow">in</span> <span class="n">chain_names</span><span class="p">:</span>
-        <span class="c"># all separate ligand chains start with _</span>
-        <span class="k">if</span> <span class="n">chain_name</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">==</span> <span class="s">&#39;_&#39;</span><span class="p">:</span>
-            <span class="c"># add to chain _</span>
-            <span class="k">if</span> <span class="ow">not</span> <span class="n">ent</span><span class="o">.</span><span class="n">FindChain</span><span class="p">(</span><span class="s">&#39;_&#39;</span><span class="p">)</span><span class="o">.</span><span class="n">IsValid</span><span class="p">():</span>
-                <span class="n">ent_ed</span><span class="o">.</span><span class="n">InsertChain</span><span class="p">(</span><span class="s">&#39;_&#39;</span><span class="p">)</span>
-            <span class="n">lig_ch</span> <span class="o">=</span> <span class="n">ent</span><span class="o">.</span><span class="n">FindChain</span><span class="p">(</span><span class="s">&#39;_&#39;</span><span class="p">)</span>
+        <span class="c1"># all separate ligand chains start with _</span>
+        <span class="k">if</span> <span class="n">chain_name</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">==</span> <span class="s1">&#39;_&#39;</span><span class="p">:</span>
+            <span class="c1"># add to chain _</span>
+            <span class="k">if</span> <span class="ow">not</span> <span class="n">ent</span><span class="o">.</span><span class="n">FindChain</span><span class="p">(</span><span class="s1">&#39;_&#39;</span><span class="p">)</span><span class="o">.</span><span class="n">IsValid</span><span class="p">():</span>
+                <span class="n">ent_ed</span><span class="o">.</span><span class="n">InsertChain</span><span class="p">(</span><span class="s1">&#39;_&#39;</span><span class="p">)</span>
+            <span class="n">lig_ch</span> <span class="o">=</span> <span class="n">ent</span><span class="o">.</span><span class="n">FindChain</span><span class="p">(</span><span class="s1">&#39;_&#39;</span><span class="p">)</span>
             <span class="n">cur_ch</span> <span class="o">=</span> <span class="n">ent</span><span class="o">.</span><span class="n">FindChain</span><span class="p">(</span><span class="n">chain_name</span><span class="p">)</span>
             <span class="k">for</span> <span class="n">res</span> <span class="ow">in</span> <span class="n">cur_ch</span><span class="o">.</span><span class="n">residues</span><span class="p">:</span>
                 <span class="n">ent_ed</span><span class="o">.</span><span class="n">AppendResidue</span><span class="p">(</span><span class="n">lig_ch</span><span class="p">,</span> <span class="n">res</span><span class="p">,</span> <span class="n">deep</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>
-            <span class="c"># remove old chain</span>
+            <span class="c1"># remove old chain</span>
             <span class="n">ent_ed</span><span class="o">.</span><span class="n">DeleteChain</span><span class="p">(</span><span class="n">cur_ch</span><span class="p">)</span>
     <span class="n">ent_ed</span><span class="o">.</span><span class="n">UpdateICS</span><span class="p">()</span>
     <span class="k">return</span> <span class="n">ent</span>
-<span class="c">###############################################################################</span>
+<span class="c1">###############################################################################</span>
 
 
 <div class="viewcode-block" id="BuildSidechains"><a class="viewcode-back" href="../../../modelling/pipeline.html#promod3.modelling.BuildSidechains">[docs]</a><span class="k">def</span> <span class="nf">BuildSidechains</span><span class="p">(</span><span class="n">mhandle</span><span class="p">,</span> <span class="n">merge_distance</span><span class="o">=</span><span class="mi">4</span><span class="p">,</span> <span class="n">fragment_db</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
@@ -231,43 +233,43 @@
 <span class="sd">                            if None.</span>
 <span class="sd">    :type torsion_sampler:  :class:`~promod3.loop.TorsionSampler`</span>
 <span class="sd">    &#39;&#39;&#39;</span>
-    <span class="n">prof</span> <span class="o">=</span> <span class="n">core</span><span class="o">.</span><span class="n">StaticRuntimeProfiler</span><span class="o">.</span><span class="n">StartScoped</span><span class="p">(</span><span class="s">&#39;pipeline::BuildSidechains&#39;</span><span class="p">)</span>
-    <span class="n">ost</span><span class="o">.</span><span class="n">LogInfo</span><span class="p">(</span><span class="s">&quot;Rebuilding sidechains.&quot;</span><span class="p">)</span>
+    <span class="n">prof</span> <span class="o">=</span> <span class="n">core</span><span class="o">.</span><span class="n">StaticRuntimeProfiler</span><span class="o">.</span><span class="n">StartScoped</span><span class="p">(</span><span class="s1">&#39;pipeline::BuildSidechains&#39;</span><span class="p">)</span>
+    <span class="n">ost</span><span class="o">.</span><span class="n">LogInfo</span><span class="p">(</span><span class="s2">&quot;Rebuilding sidechains.&quot;</span><span class="p">)</span>
     <span class="n">ReconstructSidechains</span><span class="p">(</span><span class="n">mhandle</span><span class="o">.</span><span class="n">model</span><span class="p">,</span> <span class="n">keep_sidechains</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>
-    <span class="c"># check for ring punches</span>
+    <span class="c1"># check for ring punches</span>
     <span class="n">rings</span> <span class="o">=</span> <span class="n">GetRings</span><span class="p">(</span><span class="n">mhandle</span><span class="o">.</span><span class="n">model</span><span class="p">)</span>
     <span class="n">ring_punches</span> <span class="o">=</span> <span class="n">GetRingPunches</span><span class="p">(</span><span class="n">rings</span><span class="p">,</span> <span class="n">mhandle</span><span class="o">.</span><span class="n">model</span><span class="p">)</span>
-    <span class="c"># try to fix them</span>
+    <span class="c1"># try to fix them</span>
     <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">ring_punches</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">:</span>
-        <span class="n">ost</span><span class="o">.</span><span class="n">LogInfo</span><span class="p">(</span><span class="s">&quot;Trying to fix </span><span class="si">%d</span><span class="s"> ring punch(es).&quot;</span> <span class="o">%</span> <span class="nb">len</span><span class="p">(</span><span class="n">ring_punches</span><span class="p">))</span>
-        <span class="c"># backup old gaps</span>
+        <span class="n">ost</span><span class="o">.</span><span class="n">LogInfo</span><span class="p">(</span><span class="s2">&quot;Trying to fix </span><span class="si">%d</span><span class="s2"> ring punch(es).&quot;</span> <span class="o">%</span> <span class="nb">len</span><span class="p">(</span><span class="n">ring_punches</span><span class="p">))</span>
+        <span class="c1"># backup old gaps</span>
         <span class="n">old_gaps</span> <span class="o">=</span> <span class="p">[</span><span class="n">g</span><span class="o">.</span><span class="n">Copy</span><span class="p">()</span> <span class="k">for</span> <span class="n">g</span> <span class="ow">in</span> <span class="n">mhandle</span><span class="o">.</span><span class="n">gaps</span><span class="p">]</span>
-        <span class="c"># new gaps for mhandle</span>
-        <span class="c"># NOTE: we currently do not delete the punched residues here</span>
-        <span class="c">#       BUT they could be deleted when merging gaps below...</span>
+        <span class="c1"># new gaps for mhandle</span>
+        <span class="c1"># NOTE: we currently do not delete the punched residues here</span>
+        <span class="c1">#       BUT they could be deleted when merging gaps below...</span>
         <span class="n">mhandle</span><span class="o">.</span><span class="n">gaps</span> <span class="o">=</span> <span class="n">StructuralGapList</span><span class="p">()</span>
         <span class="k">for</span> <span class="n">res</span> <span class="ow">in</span> <span class="n">ring_punches</span><span class="p">:</span>
             <span class="n">mygap</span> <span class="o">=</span> <span class="n">StructuralGap</span><span class="p">(</span><span class="n">res</span><span class="o">.</span><span class="n">prev</span><span class="p">,</span> <span class="n">res</span><span class="o">.</span><span class="n">next</span><span class="p">,</span> <span class="n">res</span><span class="o">.</span><span class="n">one_letter_code</span><span class="p">)</span>
             <span class="n">mhandle</span><span class="o">.</span><span class="n">gaps</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">mygap</span><span class="p">)</span>
-        <span class="c"># load stuff if needed</span>
+        <span class="c1"># load stuff if needed</span>
         <span class="k">if</span> <span class="n">fragment_db</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span>
             <span class="n">fragment_db</span> <span class="o">=</span> <span class="n">loop</span><span class="o">.</span><span class="n">LoadFragDB</span><span class="p">()</span>
         <span class="k">if</span> <span class="n">structure_db</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span>
             <span class="n">structure_db</span> <span class="o">=</span> <span class="n">loop</span><span class="o">.</span><span class="n">LoadStructureDB</span><span class="p">()</span>
         <span class="k">if</span> <span class="n">torsion_sampler</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span>
             <span class="n">torsion_sampler</span> <span class="o">=</span> <span class="n">loop</span><span class="o">.</span><span class="n">LoadTorsionSamplerCoil</span><span class="p">()</span>
-        <span class="c"># fix it</span>
+        <span class="c1"># fix it</span>
         <span class="n">MergeGapsByDistance</span><span class="p">(</span><span class="n">mhandle</span><span class="p">,</span> <span class="n">merge_distance</span><span class="p">)</span>
         <span class="n">FillLoopsByDatabase</span><span class="p">(</span><span class="n">mhandle</span><span class="p">,</span> <span class="n">fragment_db</span><span class="p">,</span> <span class="n">structure_db</span><span class="p">,</span>
                             <span class="n">torsion_sampler</span><span class="p">,</span> <span class="n">ring_punch_detection</span><span class="o">=</span><span class="mi">2</span><span class="p">)</span>
-        <span class="c"># re-build sidechains</span>
+        <span class="c1"># re-build sidechains</span>
         <span class="n">ReconstructSidechains</span><span class="p">(</span><span class="n">mhandle</span><span class="o">.</span><span class="n">model</span><span class="p">,</span> <span class="n">keep_sidechains</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>
-        <span class="c"># restore gaps</span>
+        <span class="c1"># restore gaps</span>
         <span class="n">mhandle</span><span class="o">.</span><span class="n">gaps</span> <span class="o">=</span> <span class="n">StructuralGapList</span><span class="p">()</span>
         <span class="k">for</span> <span class="n">g</span> <span class="ow">in</span> <span class="n">old_gaps</span><span class="p">:</span>
-            <span class="n">mhandle</span><span class="o">.</span><span class="n">gaps</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">g</span><span class="p">)</span>
+            <span class="n">mhandle</span><span class="o">.</span><span class="n">gaps</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">g</span><span class="p">)</span></div>
             
-</div>
+
 <div class="viewcode-block" id="MinimizeModelEnergy"><a class="viewcode-back" href="../../../modelling/pipeline.html#promod3.modelling.MinimizeModelEnergy">[docs]</a><span class="k">def</span> <span class="nf">MinimizeModelEnergy</span><span class="p">(</span><span class="n">mhandle</span><span class="p">,</span> <span class="n">max_iterations</span><span class="o">=</span><span class="mi">12</span><span class="p">,</span> <span class="n">max_iter_sd</span><span class="o">=</span><span class="mi">20</span><span class="p">,</span>
                         <span class="n">max_iter_lbfgs</span><span class="o">=</span><span class="mi">10</span><span class="p">,</span> <span class="n">use_amber_ff</span><span class="o">=</span><span class="bp">False</span><span class="p">,</span>
                         <span class="n">extra_force_fields</span><span class="o">=</span><span class="nb">list</span><span class="p">()):</span>
@@ -311,47 +313,47 @@
 <span class="sd">    :return: The model including all oxygens as used in the minimizer.</span>
 <span class="sd">    :rtype:  :class:`Entity &lt;ost.mol.EntityHandle&gt;`</span>
 <span class="sd">    &#39;&#39;&#39;</span>
-    <span class="n">prof</span> <span class="o">=</span> <span class="n">core</span><span class="o">.</span><span class="n">StaticRuntimeProfiler</span><span class="o">.</span><span class="n">StartScoped</span><span class="p">(</span><span class="s">&#39;pipeline::MinimizeModelEnergy&#39;</span><span class="p">)</span>
-    <span class="n">ost</span><span class="o">.</span><span class="n">LogInfo</span><span class="p">(</span><span class="s">&quot;Minimize energy.&quot;</span><span class="p">)</span>
-    <span class="c"># ignore LogInfo in stereochemical problems if output up to info done</span>
+    <span class="n">prof</span> <span class="o">=</span> <span class="n">core</span><span class="o">.</span><span class="n">StaticRuntimeProfiler</span><span class="o">.</span><span class="n">StartScoped</span><span class="p">(</span><span class="s1">&#39;pipeline::MinimizeModelEnergy&#39;</span><span class="p">)</span>
+    <span class="n">ost</span><span class="o">.</span><span class="n">LogInfo</span><span class="p">(</span><span class="s2">&quot;Minimize energy.&quot;</span><span class="p">)</span>
+    <span class="c1"># ignore LogInfo in stereochemical problems if output up to info done</span>
     <span class="n">ignore_stereo_log</span> <span class="o">=</span> <span class="p">(</span><span class="n">ost</span><span class="o">.</span><span class="n">GetVerbosityLevel</span><span class="p">()</span> <span class="o">==</span> <span class="mi">3</span><span class="p">)</span>
 
-    <span class="c"># setup force fields</span>
+    <span class="c1"># setup force fields</span>
     <span class="k">if</span> <span class="n">use_amber_ff</span><span class="p">:</span>
         <span class="n">force_fields</span> <span class="o">=</span> <span class="p">[</span><span class="n">mm</span><span class="o">.</span><span class="n">LoadAMBERForcefield</span><span class="p">()]</span>
     <span class="k">else</span><span class="p">:</span>
         <span class="n">force_fields</span> <span class="o">=</span> <span class="p">[</span><span class="n">mm</span><span class="o">.</span><span class="n">LoadCHARMMForcefield</span><span class="p">()]</span>
     <span class="n">force_fields</span><span class="o">.</span><span class="n">extend</span><span class="p">(</span><span class="n">extra_force_fields</span><span class="p">)</span>
-    <span class="c"># setup mm simulation</span>
+    <span class="c1"># setup mm simulation</span>
     <span class="n">sim</span> <span class="o">=</span> <span class="n">_SetupMmSimulation</span><span class="p">(</span><span class="n">mhandle</span><span class="o">.</span><span class="n">model</span><span class="p">,</span> <span class="n">force_fields</span><span class="p">)</span>
 
-    <span class="c"># check for certain failure -&gt; we get NaN if atoms are on top each other</span>
+    <span class="c1"># check for certain failure -&gt; we get NaN if atoms are on top each other</span>
     <span class="k">if</span> <span class="n">math</span><span class="o">.</span><span class="n">isnan</span><span class="p">(</span><span class="n">sim</span><span class="o">.</span><span class="n">GetEnergy</span><span class="p">()):</span>
-        <span class="n">ost</span><span class="o">.</span><span class="n">LogError</span><span class="p">(</span><span class="s">&quot;OpenMM could not minimize energy as atoms are on top of &quot;</span>
-                     <span class="s">&quot;each other!&quot;</span><span class="p">)</span>
+        <span class="n">ost</span><span class="o">.</span><span class="n">LogError</span><span class="p">(</span><span class="s2">&quot;OpenMM could not minimize energy as atoms are on top of &quot;</span>
+                     <span class="s2">&quot;each other!&quot;</span><span class="p">)</span>
         <span class="k">return</span>
         
-    <span class="c"># settings to check for stereochemical problems</span>
+    <span class="c1"># settings to check for stereochemical problems</span>
     <span class="n">clashing_distances</span> <span class="o">=</span> <span class="n">mol</span><span class="o">.</span><span class="n">alg</span><span class="o">.</span><span class="n">DefaultClashingDistances</span><span class="p">()</span>
     <span class="n">bond_stereo_chemical_param</span> <span class="o">=</span> <span class="n">mol</span><span class="o">.</span><span class="n">alg</span><span class="o">.</span><span class="n">DefaultBondStereoChemicalParams</span><span class="p">()</span>
     <span class="n">angle_stereo_chemical_param</span> <span class="o">=</span> <span class="n">mol</span><span class="o">.</span><span class="n">alg</span><span class="o">.</span><span class="n">DefaultAngleStereoChemicalParams</span><span class="p">()</span>
 
     <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="n">max_iterations</span><span class="p">):</span>
-        <span class="c"># update atoms</span>
-        <span class="n">ost</span><span class="o">.</span><span class="n">LogInfo</span><span class="p">(</span><span class="s">&quot;Perform energy minimization &quot;</span>
-                    <span class="s">&quot;(iteration </span><span class="si">%d</span><span class="s">, energy: </span><span class="si">%g</span><span class="s">)&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">i</span><span class="o">+</span><span class="mi">1</span><span class="p">,</span> <span class="n">sim</span><span class="o">.</span><span class="n">GetEnergy</span><span class="p">()))</span>
+        <span class="c1"># update atoms</span>
+        <span class="n">ost</span><span class="o">.</span><span class="n">LogInfo</span><span class="p">(</span><span class="s2">&quot;Perform energy minimization &quot;</span>
+                    <span class="s2">&quot;(iteration </span><span class="si">%d</span><span class="s2">, energy: </span><span class="si">%g</span><span class="s2">)&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">i</span><span class="o">+</span><span class="mi">1</span><span class="p">,</span> <span class="n">sim</span><span class="o">.</span><span class="n">GetEnergy</span><span class="p">()))</span>
         <span class="n">sim</span><span class="o">.</span><span class="n">ApplySD</span><span class="p">(</span><span class="n">tolerance</span> <span class="o">=</span> <span class="mf">1.0</span><span class="p">,</span> <span class="n">max_iterations</span> <span class="o">=</span> <span class="n">max_iter_sd</span><span class="p">)</span>
         <span class="n">sim</span><span class="o">.</span><span class="n">ApplyLBFGS</span><span class="p">(</span><span class="n">tolerance</span> <span class="o">=</span> <span class="mf">1.0</span><span class="p">,</span> <span class="n">max_iterations</span> <span class="o">=</span> <span class="n">max_iter_lbfgs</span><span class="p">)</span>
         <span class="n">sim</span><span class="o">.</span><span class="n">UpdatePositions</span><span class="p">()</span>
 
-        <span class="c"># check for stereochemical problems</span>
+        <span class="c1"># check for stereochemical problems</span>
         <span class="k">if</span> <span class="n">ignore_stereo_log</span><span class="p">:</span>
             <span class="n">ost</span><span class="o">.</span><span class="n">PushVerbosityLevel</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span>
         <span class="n">temp_ent</span> <span class="o">=</span> <span class="n">sim</span><span class="o">.</span><span class="n">GetEntity</span><span class="p">()</span>
-        <span class="n">temp_ent</span> <span class="o">=</span> <span class="n">temp_ent</span><span class="o">.</span><span class="n">Select</span><span class="p">(</span><span class="s">&quot;aname!=OXT&quot;</span><span class="p">)</span>
+        <span class="n">temp_ent</span> <span class="o">=</span> <span class="n">temp_ent</span><span class="o">.</span><span class="n">Select</span><span class="p">(</span><span class="s2">&quot;aname!=OXT&quot;</span><span class="p">)</span>
         <span class="n">temp_ent_clash_filtered</span> <span class="o">=</span> <span class="n">mol</span><span class="o">.</span><span class="n">alg</span><span class="o">.</span><span class="n">FilterClashes</span><span class="p">(</span>\
                                                 <span class="n">temp_ent</span><span class="p">,</span> <span class="n">clashing_distances</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span>
-        <span class="c"># note: 10,10 parameters below are hard coded bond-/angle-tolerances</span>
+        <span class="c1"># note: 10,10 parameters below are hard coded bond-/angle-tolerances</span>
         <span class="n">temp_ent_stereo_checked</span> <span class="o">=</span> <span class="n">mol</span><span class="o">.</span><span class="n">alg</span><span class="o">.</span><span class="n">CheckStereoChemistry</span><span class="p">(</span>\
                                                 <span class="n">temp_ent_clash_filtered</span><span class="p">,</span> 
                                                 <span class="n">bond_stereo_chemical_param</span><span class="p">,</span>
@@ -359,91 +361,93 @@
                                                 <span class="mi">10</span><span class="p">,</span> <span class="mi">10</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span>
         <span class="k">if</span> <span class="n">ignore_stereo_log</span><span class="p">:</span>
             <span class="n">ost</span><span class="o">.</span><span class="n">PopVerbosityLevel</span><span class="p">()</span>
-        <span class="c"># checks above would remove bad atoms</span>
-        <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">temp_ent_stereo_checked</span><span class="o">.</span><span class="n">Select</span><span class="p">(</span><span class="s">&quot;ele!=H&quot;</span><span class="p">)</span><span class="o">.</span><span class="n">atoms</span><span class="p">)</span> \
-           <span class="o">==</span> <span class="nb">len</span><span class="p">(</span><span class="n">temp_ent</span><span class="o">.</span><span class="n">Select</span><span class="p">(</span><span class="s">&quot;ele!=H&quot;</span><span class="p">)</span><span class="o">.</span><span class="n">atoms</span><span class="p">):</span>
-            <span class="n">ost</span><span class="o">.</span><span class="n">LogInfo</span><span class="p">(</span><span class="s">&quot;No more stereo-chemical problems &quot;</span>
-                        <span class="s">&quot;-&gt; final energy: </span><span class="si">%g</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">sim</span><span class="o">.</span><span class="n">GetEnergy</span><span class="p">()))</span>
+        <span class="c1"># checks above would remove bad atoms</span>
+        <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">temp_ent_stereo_checked</span><span class="o">.</span><span class="n">Select</span><span class="p">(</span><span class="s2">&quot;ele!=H&quot;</span><span class="p">)</span><span class="o">.</span><span class="n">atoms</span><span class="p">)</span> \
+           <span class="o">==</span> <span class="nb">len</span><span class="p">(</span><span class="n">temp_ent</span><span class="o">.</span><span class="n">Select</span><span class="p">(</span><span class="s2">&quot;ele!=H&quot;</span><span class="p">)</span><span class="o">.</span><span class="n">atoms</span><span class="p">):</span>
+            <span class="n">ost</span><span class="o">.</span><span class="n">LogInfo</span><span class="p">(</span><span class="s2">&quot;No more stereo-chemical problems &quot;</span>
+                        <span class="s2">&quot;-&gt; final energy: </span><span class="si">%g</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">sim</span><span class="o">.</span><span class="n">GetEnergy</span><span class="p">()))</span>
             <span class="k">break</span>
 
-    <span class="c"># update model</span>
+    <span class="c1"># update model</span>
     <span class="n">simulation_ent</span> <span class="o">=</span> <span class="n">_GetSimEntity</span><span class="p">(</span><span class="n">sim</span><span class="p">)</span>
-    <span class="n">mhandle</span><span class="o">.</span><span class="n">model</span> <span class="o">=</span> <span class="n">mol</span><span class="o">.</span><span class="n">CreateEntityFromView</span><span class="p">(</span><span class="n">simulation_ent</span><span class="o">.</span><span class="n">Select</span><span class="p">(</span><span class="s">&quot;ele!=H&quot;</span><span class="p">),</span>
+    <span class="n">mhandle</span><span class="o">.</span><span class="n">model</span> <span class="o">=</span> <span class="n">mol</span><span class="o">.</span><span class="n">CreateEntityFromView</span><span class="p">(</span><span class="n">simulation_ent</span><span class="o">.</span><span class="n">Select</span><span class="p">(</span><span class="s2">&quot;ele!=H&quot;</span><span class="p">),</span>
                                              <span class="bp">True</span><span class="p">)</span>
-    <span class="c"># return model with hydrogens</span>
-    <span class="k">return</span> <span class="n">simulation_ent</span>
-</div>
+    <span class="c1"># return model with hydrogens</span>
+    <span class="k">return</span> <span class="n">simulation_ent</span></div>
+
 <div class="viewcode-block" id="CheckFinalModel"><a class="viewcode-back" href="../../../modelling/pipeline.html#promod3.modelling.CheckFinalModel">[docs]</a><span class="k">def</span> <span class="nf">CheckFinalModel</span><span class="p">(</span><span class="n">mhandle</span><span class="p">):</span>
     <span class="sd">&#39;&#39;&#39;Performs samity checks on final models and reports problems.</span>
 <span class="sd">    </span>
 <span class="sd">    :param mhandle: Modelling handle for which to perform checks.</span>
 <span class="sd">    :type mhandle:  :class:`ModellingHandle`</span>
 <span class="sd">    &#39;&#39;&#39;</span>
-    <span class="n">prof_name</span> <span class="o">=</span> <span class="s">&#39;pipeline::CheckFinalModel&#39;</span>
+    <span class="n">prof_name</span> <span class="o">=</span> <span class="s1">&#39;pipeline::CheckFinalModel&#39;</span>
     <span class="n">prof</span> <span class="o">=</span> <span class="n">core</span><span class="o">.</span><span class="n">StaticRuntimeProfiler</span><span class="o">.</span><span class="n">StartScoped</span><span class="p">(</span><span class="n">prof_name</span><span class="p">)</span>
-    <span class="c"># report incomplete models</span>
+    <span class="c1"># report incomplete models</span>
     <span class="k">for</span> <span class="n">chain</span> <span class="ow">in</span> <span class="n">mhandle</span><span class="o">.</span><span class="n">model</span><span class="o">.</span><span class="n">chains</span><span class="p">:</span>
         <span class="k">if</span> <span class="n">chain</span><span class="o">.</span><span class="n">residue_count</span> <span class="o">&lt;</span> <span class="mi">3</span><span class="p">:</span>
-            <span class="n">ost</span><span class="o">.</span><span class="n">LogWarning</span><span class="p">(</span><span class="s">&quot;Chain </span><span class="si">%s</span><span class="s"> of returned model contains only </span><span class="si">%d</span><span class="s"> &quot;</span>\
-                           <span class="s">&quot;residues! This typically indicates that the &quot;</span>\
-                           <span class="s">&quot;template is mostly a Calpha trace or contains &quot;</span>\
-                           <span class="s">&quot;too many D-peptides.&quot;</span>\
+            <span class="n">ost</span><span class="o">.</span><span class="n">LogWarning</span><span class="p">(</span><span class="s2">&quot;Chain </span><span class="si">%s</span><span class="s2"> of returned model contains only </span><span class="si">%d</span><span class="s2"> &quot;</span>\
+                           <span class="s2">&quot;residues! This typically indicates that the &quot;</span>\
+                           <span class="s2">&quot;template is mostly a Calpha trace or contains &quot;</span>\
+                           <span class="s2">&quot;too many D-peptides.&quot;</span>\
                            <span class="o">%</span> <span class="p">(</span><span class="n">chain</span><span class="o">.</span><span class="n">name</span><span class="p">,</span> <span class="n">chain</span><span class="o">.</span><span class="n">residue_count</span><span class="p">))</span>
     <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">mhandle</span><span class="o">.</span><span class="n">gaps</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">:</span>
-        <span class="n">ost</span><span class="o">.</span><span class="n">LogWarning</span><span class="p">(</span><span class="s">&quot;Failed to close </span><span class="si">%d</span><span class="s"> gap(s). Returning incomplete model!&quot;</span>\
+        <span class="n">ost</span><span class="o">.</span><span class="n">LogWarning</span><span class="p">(</span><span class="s2">&quot;Failed to close </span><span class="si">%d</span><span class="s2"> gap(s). Returning incomplete model!&quot;</span>\
                        <span class="o">%</span> <span class="nb">len</span><span class="p">(</span><span class="n">mhandle</span><span class="o">.</span><span class="n">gaps</span><span class="p">))</span>
     <span class="k">else</span><span class="p">:</span>
-        <span class="c"># check sequences</span>
+        <span class="c1"># check sequences</span>
         <span class="k">for</span> <span class="n">chain</span><span class="p">,</span> <span class="n">seq</span> <span class="ow">in</span> <span class="nb">zip</span><span class="p">(</span><span class="n">mhandle</span><span class="o">.</span><span class="n">model</span><span class="o">.</span><span class="n">chains</span><span class="p">,</span> <span class="n">mhandle</span><span class="o">.</span><span class="n">seqres</span><span class="p">):</span>
             <span class="n">a</span> <span class="o">=</span> <span class="n">chain</span><span class="o">.</span><span class="n">residues</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">GetNumber</span><span class="p">()</span><span class="o">.</span><span class="n">GetNum</span><span class="p">()</span>
             <span class="n">b</span> <span class="o">=</span> <span class="n">chain</span><span class="o">.</span><span class="n">residues</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">GetNumber</span><span class="p">()</span><span class="o">.</span><span class="n">GetNum</span><span class="p">()</span>
             <span class="n">expected_seq</span> <span class="o">=</span> <span class="n">seq</span><span class="p">[</span><span class="n">a</span><span class="o">-</span><span class="mi">1</span><span class="p">:</span><span class="n">b</span><span class="p">]</span>
-            <span class="n">actual_seq</span> <span class="o">=</span> <span class="s">&#39;&#39;</span><span class="o">.</span><span class="n">join</span><span class="p">([</span><span class="n">r</span><span class="o">.</span><span class="n">one_letter_code</span> <span class="k">for</span> <span class="n">r</span> <span class="ow">in</span> <span class="n">chain</span><span class="o">.</span><span class="n">residues</span><span class="p">])</span>
+            <span class="n">actual_seq</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="o">.</span><span class="n">join</span><span class="p">([</span><span class="n">r</span><span class="o">.</span><span class="n">one_letter_code</span> <span class="k">for</span> <span class="n">r</span> <span class="ow">in</span> <span class="n">chain</span><span class="o">.</span><span class="n">residues</span><span class="p">])</span>
             <span class="k">if</span> <span class="n">expected_seq</span> <span class="o">!=</span> <span class="n">actual_seq</span><span class="p">:</span>
-                <span class="n">ost</span><span class="o">.</span><span class="n">LogWarning</span><span class="p">(</span><span class="s">&quot;Sequence mismatch in chain </span><span class="si">%s</span><span class="s">!&quot;</span>\
-                               <span class="s">&quot; Expected &#39;</span><span class="si">%s</span><span class="s">&#39;. Got &#39;</span><span class="si">%s</span><span class="s">&#39;&quot;</span> \
+                <span class="n">ost</span><span class="o">.</span><span class="n">LogWarning</span><span class="p">(</span><span class="s2">&quot;Sequence mismatch in chain </span><span class="si">%s</span><span class="s2">!&quot;</span>\
+                               <span class="s2">&quot; Expected &#39;</span><span class="si">%s</span><span class="s2">&#39;. Got &#39;</span><span class="si">%s</span><span class="s2">&#39;&quot;</span> \
                                <span class="o">%</span> <span class="p">(</span><span class="n">chain</span><span class="o">.</span><span class="n">name</span><span class="p">,</span> <span class="n">expected_seq</span><span class="p">,</span> <span class="n">actual_seq</span><span class="p">))</span>
     
-    <span class="c"># report ring punchings</span>
+    <span class="c1"># report ring punchings</span>
     <span class="n">rings</span> <span class="o">=</span> <span class="n">GetRings</span><span class="p">(</span><span class="n">mhandle</span><span class="o">.</span><span class="n">model</span><span class="p">)</span>
     <span class="n">ring_punches</span> <span class="o">=</span> <span class="n">GetRingPunches</span><span class="p">(</span><span class="n">rings</span><span class="p">,</span> <span class="n">mhandle</span><span class="o">.</span><span class="n">model</span><span class="p">)</span>
     <span class="k">for</span> <span class="n">res</span> <span class="ow">in</span> <span class="n">ring_punches</span><span class="p">:</span>
-        <span class="n">ost</span><span class="o">.</span><span class="n">LogWarning</span><span class="p">(</span><span class="s">&quot;Ring of &quot;</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">res</span><span class="p">)</span> <span class="o">+</span> <span class="s">&quot; has been punched!&quot;</span><span class="p">)</span>
+        <span class="n">ost</span><span class="o">.</span><span class="n">LogWarning</span><span class="p">(</span><span class="s2">&quot;Ring of &quot;</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">res</span><span class="p">)</span> <span class="o">+</span> <span class="s2">&quot; has been punched!&quot;</span><span class="p">)</span>
     
-    <span class="c"># report stereo-chemical problems</span>
+    <span class="c1"># report stereo-chemical problems</span>
     <span class="n">ost</span><span class="o">.</span><span class="n">PushVerbosityLevel</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
     <span class="n">clashing_distances</span> <span class="o">=</span> <span class="n">mol</span><span class="o">.</span><span class="n">alg</span><span class="o">.</span><span class="n">DefaultClashingDistances</span><span class="p">()</span>
     <span class="n">bond_stereo_chemical_param</span> <span class="o">=</span> <span class="n">mol</span><span class="o">.</span><span class="n">alg</span><span class="o">.</span><span class="n">DefaultBondStereoChemicalParams</span><span class="p">()</span>
     <span class="n">angle_stereo_chemical_param</span> <span class="o">=</span> <span class="n">mol</span><span class="o">.</span><span class="n">alg</span><span class="o">.</span><span class="n">DefaultAngleStereoChemicalParams</span><span class="p">()</span>
-    <span class="c"># extract problems</span>
-    <span class="n">model_src</span> <span class="o">=</span> <span class="n">mhandle</span><span class="o">.</span><span class="n">model</span><span class="o">.</span><span class="n">Select</span><span class="p">(</span><span class="s">&quot;aname!=OXT&quot;</span><span class="p">)</span>
+    <span class="c1"># extract problems</span>
+    <span class="n">model_src</span> <span class="o">=</span> <span class="n">mhandle</span><span class="o">.</span><span class="n">model</span><span class="o">.</span><span class="n">Select</span><span class="p">(</span><span class="s2">&quot;aname!=OXT&quot;</span><span class="p">)</span>
     <span class="n">clash_info</span> <span class="o">=</span> <span class="n">mol</span><span class="o">.</span><span class="n">alg</span><span class="o">.</span><span class="n">FilterClashes</span><span class="p">(</span><span class="n">model_src</span><span class="p">,</span> <span class="n">clashing_distances</span><span class="p">)[</span><span class="mi">1</span><span class="p">]</span>
-    <span class="c"># note: 10,10 parameters below are hard coded bond-/angle-tolerances</span>
+    <span class="c1"># note: 10,10 parameters below are hard coded bond-/angle-tolerances</span>
     <span class="n">stereo_info</span> <span class="o">=</span> <span class="n">mol</span><span class="o">.</span><span class="n">alg</span><span class="o">.</span><span class="n">CheckStereoChemistry</span><span class="p">(</span><span class="n">model_src</span><span class="p">,</span>
                                                <span class="n">bond_stereo_chemical_param</span><span class="p">,</span>
                                                <span class="n">angle_stereo_chemical_param</span><span class="p">,</span>
                                                <span class="mi">10</span><span class="p">,</span> <span class="mi">10</span><span class="p">)[</span><span class="mi">1</span><span class="p">]</span>
     <span class="n">ost</span><span class="o">.</span><span class="n">PopVerbosityLevel</span><span class="p">()</span>
-    <span class="c"># set bool props in model-residues</span>
+    <span class="c1"># set bool props in model-residues</span>
     <span class="n">atoms</span> <span class="o">=</span> <span class="p">[</span><span class="n">e</span><span class="o">.</span><span class="n">GetFirstAtom</span><span class="p">()</span> <span class="k">for</span> <span class="n">e</span> <span class="ow">in</span> <span class="n">clash_info</span><span class="o">.</span><span class="n">GetClashList</span><span class="p">()]</span>\
+          <span class="o">+</span> <span class="p">[</span><span class="n">e</span><span class="o">.</span><span class="n">GetSecondAtom</span><span class="p">()</span> <span class="k">for</span> <span class="n">e</span> <span class="ow">in</span> <span class="n">clash_info</span><span class="o">.</span><span class="n">GetClashList</span><span class="p">()]</span>\
           <span class="o">+</span> <span class="p">[</span><span class="n">e</span><span class="o">.</span><span class="n">GetFirstAtom</span><span class="p">()</span> <span class="k">for</span> <span class="n">e</span> <span class="ow">in</span> <span class="n">stereo_info</span><span class="o">.</span><span class="n">GetBondViolationList</span><span class="p">()]</span>\
+          <span class="o">+</span> <span class="p">[</span><span class="n">e</span><span class="o">.</span><span class="n">GetSecondAtom</span><span class="p">()</span> <span class="k">for</span> <span class="n">e</span> <span class="ow">in</span> <span class="n">stereo_info</span><span class="o">.</span><span class="n">GetBondViolationList</span><span class="p">()]</span>\
           <span class="o">+</span> <span class="p">[</span><span class="n">e</span><span class="o">.</span><span class="n">GetSecondAtom</span><span class="p">()</span> <span class="k">for</span> <span class="n">e</span> <span class="ow">in</span> <span class="n">stereo_info</span><span class="o">.</span><span class="n">GetAngleViolationList</span><span class="p">()]</span>
     <span class="k">for</span> <span class="n">atomui</span> <span class="ow">in</span> <span class="n">atoms</span><span class="p">:</span>
         <span class="n">res</span> <span class="o">=</span> <span class="n">model_src</span><span class="o">.</span><span class="n">FindResidue</span><span class="p">(</span><span class="n">atomui</span><span class="o">.</span><span class="n">GetChainName</span><span class="p">(),</span> <span class="n">atomui</span><span class="o">.</span><span class="n">GetResNum</span><span class="p">())</span>
-        <span class="n">res</span><span class="o">.</span><span class="n">SetBoolProp</span><span class="p">(</span><span class="s">&quot;stereo_chemical_problem&quot;</span><span class="p">,</span> <span class="bp">True</span><span class="p">)</span>
-        <span class="k">if</span> <span class="n">atomui</span><span class="o">.</span><span class="n">GetAtomName</span><span class="p">()</span> <span class="ow">in</span> <span class="p">[</span><span class="s">&quot;CA&quot;</span><span class="p">,</span> <span class="s">&quot;N&quot;</span><span class="p">,</span> <span class="s">&quot;O&quot;</span><span class="p">,</span> <span class="s">&quot;C&quot;</span><span class="p">]:</span>
-            <span class="n">res</span><span class="o">.</span><span class="n">SetBoolProp</span><span class="p">(</span><span class="s">&quot;stereo_chemical_problem_backbone&quot;</span><span class="p">,</span> <span class="bp">True</span><span class="p">)</span>
-    <span class="c"># report bad residues</span>
+        <span class="n">res</span><span class="o">.</span><span class="n">SetBoolProp</span><span class="p">(</span><span class="s2">&quot;stereo_chemical_problem&quot;</span><span class="p">,</span> <span class="bp">True</span><span class="p">)</span>
+        <span class="k">if</span> <span class="n">atomui</span><span class="o">.</span><span class="n">GetAtomName</span><span class="p">()</span> <span class="ow">in</span> <span class="p">[</span><span class="s2">&quot;CA&quot;</span><span class="p">,</span> <span class="s2">&quot;N&quot;</span><span class="p">,</span> <span class="s2">&quot;O&quot;</span><span class="p">,</span> <span class="s2">&quot;C&quot;</span><span class="p">]:</span>
+            <span class="n">res</span><span class="o">.</span><span class="n">SetBoolProp</span><span class="p">(</span><span class="s2">&quot;stereo_chemical_problem_backbone&quot;</span><span class="p">,</span> <span class="bp">True</span><span class="p">)</span>
+    <span class="c1"># report bad residues</span>
     <span class="k">for</span> <span class="n">res</span> <span class="ow">in</span> <span class="n">model_src</span><span class="o">.</span><span class="n">residues</span><span class="p">:</span>
-        <span class="k">if</span> <span class="n">res</span><span class="o">.</span><span class="n">HasProp</span><span class="p">(</span><span class="s">&quot;stereo_chemical_problem_backbone&quot;</span><span class="p">)</span> <span class="ow">and</span>\
-           <span class="n">res</span><span class="o">.</span><span class="n">GetBoolProp</span><span class="p">(</span><span class="s">&quot;stereo_chemical_problem_backbone&quot;</span><span class="p">):</span>
-            <span class="n">ost</span><span class="o">.</span><span class="n">LogInfo</span><span class="p">(</span><span class="s">&quot;Stereo-chemical problem in backbone &quot;</span> <span class="o">+</span> \
-                        <span class="s">&quot;of residue &quot;</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">res</span><span class="p">))</span>
-        <span class="k">elif</span> <span class="n">res</span><span class="o">.</span><span class="n">HasProp</span><span class="p">(</span><span class="s">&quot;stereo_chemical_problem&quot;</span><span class="p">)</span> <span class="ow">and</span>\
-             <span class="n">res</span><span class="o">.</span><span class="n">GetBoolProp</span><span class="p">(</span><span class="s">&quot;stereo_chemical_problem&quot;</span><span class="p">):</span>
-            <span class="n">ost</span><span class="o">.</span><span class="n">LogInfo</span><span class="p">(</span><span class="s">&quot;Stereo-chemical problem in sidechain &quot;</span> <span class="o">+</span> \
-                        <span class="s">&quot;of residue &quot;</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">res</span><span class="p">))</span>
-</div>
+        <span class="k">if</span> <span class="n">res</span><span class="o">.</span><span class="n">HasProp</span><span class="p">(</span><span class="s2">&quot;stereo_chemical_problem_backbone&quot;</span><span class="p">)</span> <span class="ow">and</span>\
+           <span class="n">res</span><span class="o">.</span><span class="n">GetBoolProp</span><span class="p">(</span><span class="s2">&quot;stereo_chemical_problem_backbone&quot;</span><span class="p">):</span>
+            <span class="n">ost</span><span class="o">.</span><span class="n">LogInfo</span><span class="p">(</span><span class="s2">&quot;Stereo-chemical problem in backbone &quot;</span> <span class="o">+</span> \
+                        <span class="s2">&quot;of residue &quot;</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">res</span><span class="p">))</span>
+        <span class="k">elif</span> <span class="n">res</span><span class="o">.</span><span class="n">HasProp</span><span class="p">(</span><span class="s2">&quot;stereo_chemical_problem&quot;</span><span class="p">)</span> <span class="ow">and</span>\
+             <span class="n">res</span><span class="o">.</span><span class="n">GetBoolProp</span><span class="p">(</span><span class="s2">&quot;stereo_chemical_problem&quot;</span><span class="p">):</span>
+            <span class="n">ost</span><span class="o">.</span><span class="n">LogInfo</span><span class="p">(</span><span class="s2">&quot;Stereo-chemical problem in sidechain &quot;</span> <span class="o">+</span> \
+                        <span class="s2">&quot;of residue &quot;</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">res</span><span class="p">))</span></div>
+
 <div class="viewcode-block" id="BuildFromRawModel"><a class="viewcode-back" href="../../../modelling/pipeline.html#promod3.modelling.BuildFromRawModel">[docs]</a><span class="k">def</span> <span class="nf">BuildFromRawModel</span><span class="p">(</span><span class="n">mhandle</span><span class="p">,</span> <span class="n">use_amber_ff</span><span class="o">=</span><span class="bp">False</span><span class="p">,</span> <span class="n">extra_force_fields</span><span class="o">=</span><span class="nb">list</span><span class="p">()):</span>
     <span class="sd">&#39;&#39;&#39;Build a model starting with a raw model (see :func:`BuildRawModel`).</span>
 
@@ -484,46 +488,46 @@
 <span class="sd">    :return: Delivers the model as an |ost_s| entity.</span>
 <span class="sd">    :rtype: :class:`Entity &lt;ost.mol.EntityHandle&gt;`</span>
 <span class="sd">    &#39;&#39;&#39;</span>
-    <span class="n">prof_name</span> <span class="o">=</span> <span class="s">&#39;pipeline::BuildFromRawModel&#39;</span>
+    <span class="n">prof_name</span> <span class="o">=</span> <span class="s1">&#39;pipeline::BuildFromRawModel&#39;</span>
     <span class="n">prof</span> <span class="o">=</span> <span class="n">core</span><span class="o">.</span><span class="n">StaticRuntimeProfiler</span><span class="o">.</span><span class="n">StartScoped</span><span class="p">(</span><span class="n">prof_name</span><span class="p">)</span>
-    <span class="c"># ignore empty models</span>
+    <span class="c1"># ignore empty models</span>
     <span class="k">if</span> <span class="n">mhandle</span><span class="o">.</span><span class="n">model</span><span class="o">.</span><span class="n">residue_count</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span>
-        <span class="n">ost</span><span class="o">.</span><span class="n">LogError</span><span class="p">(</span><span class="s">&quot;Cannot perform modelling with an empty raw model.&quot;</span><span class="p">)</span>
+        <span class="n">ost</span><span class="o">.</span><span class="n">LogError</span><span class="p">(</span><span class="s2">&quot;Cannot perform modelling with an empty raw model.&quot;</span><span class="p">)</span>
         <span class="k">return</span> <span class="n">mhandle</span><span class="o">.</span><span class="n">model</span>
     <span class="k">else</span><span class="p">:</span>
-        <span class="n">ost</span><span class="o">.</span><span class="n">LogInfo</span><span class="p">(</span><span class="s">&quot;Starting modelling based on a raw model.&quot;</span><span class="p">)</span>
+        <span class="n">ost</span><span class="o">.</span><span class="n">LogInfo</span><span class="p">(</span><span class="s2">&quot;Starting modelling based on a raw model.&quot;</span><span class="p">)</span>
 
-    <span class="c"># a bit of setup</span>
+    <span class="c1"># a bit of setup</span>
     <span class="n">fragment_db</span> <span class="o">=</span> <span class="n">loop</span><span class="o">.</span><span class="n">LoadFragDB</span><span class="p">()</span>
     <span class="n">structure_db</span> <span class="o">=</span> <span class="n">loop</span><span class="o">.</span><span class="n">LoadStructureDB</span><span class="p">()</span>
     <span class="n">torsion_sampler</span> <span class="o">=</span> <span class="n">loop</span><span class="o">.</span><span class="n">LoadTorsionSamplerCoil</span><span class="p">()</span>
     <span class="n">merge_distance</span> <span class="o">=</span> <span class="mi">4</span>
 
-    <span class="c"># remove terminal gaps</span>
+    <span class="c1"># remove terminal gaps</span>
     <span class="n">RemoveTerminalGaps</span><span class="p">(</span><span class="n">mhandle</span><span class="p">)</span>
 
-    <span class="c"># close gaps</span>
+    <span class="c1"># close gaps</span>
     <span class="n">CloseGaps</span><span class="p">(</span><span class="n">mhandle</span><span class="p">,</span> <span class="n">merge_distance</span><span class="o">=</span><span class="n">merge_distance</span><span class="p">,</span> 
               <span class="n">fragment_db</span><span class="o">=</span><span class="n">fragment_db</span><span class="p">,</span> <span class="n">structure_db</span><span class="o">=</span><span class="n">structure_db</span><span class="p">,</span> 
               <span class="n">torsion_sampler</span><span class="o">=</span><span class="n">torsion_sampler</span><span class="p">)</span>
 
-    <span class="c"># build sidechains</span>
+    <span class="c1"># build sidechains</span>
     <span class="n">BuildSidechains</span><span class="p">(</span><span class="n">mhandle</span><span class="p">,</span> <span class="n">merge_distance</span><span class="p">,</span> <span class="n">fragment_db</span><span class="p">,</span>
                     <span class="n">structure_db</span><span class="p">,</span> <span class="n">torsion_sampler</span><span class="p">)</span>
 
-    <span class="c"># minimize energy of final model using molecular mechanics</span>
+    <span class="c1"># minimize energy of final model using molecular mechanics</span>
     <span class="n">MinimizeModelEnergy</span><span class="p">(</span><span class="n">mhandle</span><span class="p">,</span> <span class="n">use_amber_ff</span><span class="o">=</span><span class="n">use_amber_ff</span><span class="p">,</span>
                         <span class="n">extra_force_fields</span><span class="o">=</span><span class="n">extra_force_fields</span><span class="p">)</span>
 
-    <span class="c"># sanity checks</span>
+    <span class="c1"># sanity checks</span>
     <span class="n">CheckFinalModel</span><span class="p">(</span><span class="n">mhandle</span><span class="p">)</span>
 
-    <span class="c"># done</span>
-    <span class="k">return</span> <span class="n">mhandle</span><span class="o">.</span><span class="n">model</span>
+    <span class="c1"># done</span>
+    <span class="k">return</span> <span class="n">mhandle</span><span class="o">.</span><span class="n">model</span></div>
 
-<span class="c"># these methods will be exported into module</span></div>
-<span class="n">__all__</span> <span class="o">=</span> <span class="p">(</span><span class="s">&#39;BuildFromRawModel&#39;</span><span class="p">,</span> <span class="s">&#39;BuildSidechains&#39;</span><span class="p">,</span> 
-           <span class="s">&#39;MinimizeModelEnergy&#39;</span><span class="p">,</span> <span class="s">&#39;CheckFinalModel&#39;</span><span class="p">)</span>
+<span class="c1"># these methods will be exported into module</span>
+<span class="n">__all__</span> <span class="o">=</span> <span class="p">(</span><span class="s1">&#39;BuildFromRawModel&#39;</span><span class="p">,</span> <span class="s1">&#39;BuildSidechains&#39;</span><span class="p">,</span> 
+           <span class="s1">&#39;MinimizeModelEnergy&#39;</span><span class="p">,</span> <span class="s1">&#39;CheckFinalModel&#39;</span><span class="p">)</span>
 </pre></div>
 
           </div>
@@ -549,9 +553,6 @@
       <input type="hidden" name="check_keywords" value="yes" />
       <input type="hidden" name="area" value="default" />
     </form>
-    <p class="searchtip" style="font-size: 90%">
-    Enter search terms or a module, class or function name.
-    </p>
 </div>
 <script type="text/javascript">$('#searchbox').show(0);</script>
         </div>
@@ -559,11 +560,11 @@
       <div class="clearer"></div>
     </div>
     <div class="footer">
-      &copy;2017, ProMod3 authors.
+      &copy;2018, ProMod3 authors.
       
       |
-      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a>
-      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.6</a>
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.4.1</a>
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
       
     </div>
 
diff --git a/doc/html/_modules/promod3/modelling/_reconstruct_sidechains.html b/doc/html/_modules/promod3/modelling/_reconstruct_sidechains.html
index 0f4481042177f9a9f53d2889255300e5216c678c..a8840922170b8f1448c05531aba3a51c444ff34e 100644
--- a/doc/html/_modules/promod3/modelling/_reconstruct_sidechains.html
+++ b/doc/html/_modules/promod3/modelling/_reconstruct_sidechains.html
@@ -6,7 +6,7 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
-    <title>promod3.modelling._reconstruct_sidechains &mdash; ProMod3 1.1.0 documentation</title>
+    <title>promod3.modelling._reconstruct_sidechains &mdash; ProMod3 1.2.0 documentation</title>
     
     <link rel="stylesheet" href="../../../_static/alabaster.css" type="text/css" />
     <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
@@ -14,7 +14,7 @@
     <script type="text/javascript">
       var DOCUMENTATION_OPTIONS = {
         URL_ROOT:    '../../../',
-        VERSION:     '1.1.0',
+        VERSION:     '1.2.0',
         COLLAPSE_INDEX: false,
         FILE_SUFFIX: '.html',
         HAS_SOURCE:  true
@@ -23,14 +23,16 @@
     <script type="text/javascript" src="../../../_static/jquery.js"></script>
     <script type="text/javascript" src="../../../_static/underscore.js"></script>
     <script type="text/javascript" src="../../../_static/doctools.js"></script>
-    <link rel="top" title="ProMod3 1.1.0 documentation" href="../../../index.html" />
+    <link rel="top" title="ProMod3 1.2.0 documentation" href="../../../index.html" />
     <link rel="up" title="promod3" href="../../promod3.html" />
    
+  <link rel="stylesheet" href="../../../_static/custom.css" type="text/css" />
   
-  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
 
   </head>
-  <body role="document">  
+  <body role="document">
+  
 
     <div class="document">
       <div class="documentwrapper">
@@ -38,37 +40,37 @@
           <div class="body" role="main">
             
   <h1>Source code for promod3.modelling._reconstruct_sidechains</h1><div class="highlight"><pre>
-<span class="kn">from</span> <span class="nn">ost</span> <span class="kn">import</span> <span class="n">geom</span><span class="p">,</span> <span class="n">mol</span><span class="p">,</span> <span class="n">conop</span>
+<span></span><span class="kn">from</span> <span class="nn">ost</span> <span class="kn">import</span> <span class="n">geom</span><span class="p">,</span> <span class="n">mol</span><span class="p">,</span> <span class="n">conop</span>
 <span class="kn">from</span> <span class="nn">promod3</span> <span class="kn">import</span> <span class="n">core</span><span class="p">,</span> <span class="n">sidechain</span>
+<span class="kn">import</span> <span class="nn">traceback</span>
 
-<span class="c">###############################################################################</span>
-<span class="c"># helper functions</span>
+<span class="c1">###############################################################################</span>
+<span class="c1"># helper functions</span>
 <span class="k">def</span> <span class="nf">_GetRotamerIDs</span><span class="p">(</span><span class="n">res_list</span><span class="p">):</span>
     <span class="sd">&#39;&#39;&#39;Return list (length = len(res_list)) of rotamer IDs for all residues.&#39;&#39;&#39;</span>
     <span class="n">rotamer_ids</span> <span class="o">=</span> <span class="p">[</span><span class="n">sidechain</span><span class="o">.</span><span class="n">ALA</span><span class="p">]</span> <span class="o">*</span> <span class="nb">len</span><span class="p">(</span><span class="n">res_list</span><span class="p">)</span>
     <span class="k">for</span> <span class="n">i</span><span class="p">,</span><span class="n">r</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">res_list</span><span class="p">):</span>
         <span class="n">rot_id</span> <span class="o">=</span> <span class="n">sidechain</span><span class="o">.</span><span class="n">TLCToRotID</span><span class="p">(</span><span class="n">r</span><span class="o">.</span><span class="n">GetName</span><span class="p">())</span>
         <span class="k">if</span> <span class="n">rot_id</span> <span class="o">==</span> <span class="n">sidechain</span><span class="o">.</span><span class="n">XXX</span><span class="p">:</span>
-            <span class="k">continue</span> <span class="c"># no idea what it is, so we stick with ALA </span>
-                     <span class="c"># =&gt; don&#39;t model sidechain</span>
+            <span class="k">continue</span> <span class="c1"># no idea what it is, so we stick with ALA </span>
         <span class="n">rotamer_ids</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">=</span> <span class="n">rot_id</span>
     <span class="k">return</span> <span class="n">rotamer_ids</span>
 
 <span class="k">def</span> <span class="nf">_GetPhiAngle</span><span class="p">(</span><span class="n">r</span><span class="p">):</span>
     <span class="sd">&#39;&#39;&#39;Extract phi angle for residue r.&#39;&#39;&#39;</span>
-    <span class="c"># def. fallback = helix</span>
+    <span class="c1"># def. fallback = helix</span>
     <span class="n">phi</span> <span class="o">=</span> <span class="o">-</span><span class="mf">1.0472</span>
-    <span class="c"># try to get phi from torsion angles</span>
+    <span class="c1"># try to get phi from torsion angles</span>
     <span class="n">tor</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">GetPhiTorsion</span><span class="p">()</span>
     <span class="k">if</span> <span class="n">tor</span><span class="o">.</span><span class="n">IsValid</span><span class="p">():</span>
         <span class="n">phi</span> <span class="o">=</span> <span class="n">tor</span><span class="o">.</span><span class="n">GetAngle</span><span class="p">()</span>
     <span class="k">else</span><span class="p">:</span>
         <span class="n">r_prev</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">handle</span><span class="o">.</span><span class="n">prev</span>
         <span class="k">if</span> <span class="n">r_prev</span><span class="o">.</span><span class="n">IsValid</span><span class="p">()</span> <span class="ow">and</span> <span class="n">mol</span><span class="o">.</span><span class="n">InSequence</span><span class="p">(</span><span class="n">r_prev</span><span class="p">,</span> <span class="n">r</span><span class="o">.</span><span class="n">handle</span><span class="p">):</span>
-            <span class="n">c_prev</span> <span class="o">=</span> <span class="n">r_prev</span><span class="o">.</span><span class="n">FindAtom</span><span class="p">(</span><span class="s">&quot;C&quot;</span><span class="p">)</span>
-            <span class="n">n</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">FindAtom</span><span class="p">(</span><span class="s">&quot;N&quot;</span><span class="p">)</span>
-            <span class="n">ca</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">FindAtom</span><span class="p">(</span><span class="s">&quot;CA&quot;</span><span class="p">)</span>
-            <span class="n">c</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">FindAtom</span><span class="p">(</span><span class="s">&quot;C&quot;</span><span class="p">)</span>
+            <span class="n">c_prev</span> <span class="o">=</span> <span class="n">r_prev</span><span class="o">.</span><span class="n">FindAtom</span><span class="p">(</span><span class="s2">&quot;C&quot;</span><span class="p">)</span>
+            <span class="n">n</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">FindAtom</span><span class="p">(</span><span class="s2">&quot;N&quot;</span><span class="p">)</span>
+            <span class="n">ca</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">FindAtom</span><span class="p">(</span><span class="s2">&quot;CA&quot;</span><span class="p">)</span>
+            <span class="n">c</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">FindAtom</span><span class="p">(</span><span class="s2">&quot;C&quot;</span><span class="p">)</span>
             <span class="k">if</span> <span class="n">c_prev</span><span class="o">.</span><span class="n">IsValid</span><span class="p">()</span> <span class="ow">and</span> <span class="n">n</span><span class="o">.</span><span class="n">IsValid</span><span class="p">()</span> <span class="ow">and</span> <span class="n">ca</span><span class="o">.</span><span class="n">IsValid</span><span class="p">()</span> <span class="ow">and</span> <span class="n">c</span><span class="o">.</span><span class="n">IsValid</span><span class="p">():</span>
                 <span class="n">phi</span> <span class="o">=</span> <span class="n">geom</span><span class="o">.</span><span class="n">DihedralAngle</span><span class="p">(</span><span class="n">c_prev</span><span class="o">.</span><span class="n">GetPos</span><span class="p">(),</span><span class="n">n</span><span class="o">.</span><span class="n">GetPos</span><span class="p">(),</span>
                                          <span class="n">ca</span><span class="o">.</span><span class="n">GetPos</span><span class="p">(),</span><span class="n">c</span><span class="o">.</span><span class="n">GetPos</span><span class="p">())</span>
@@ -76,19 +78,19 @@
 
 <span class="k">def</span> <span class="nf">_GetPsiAngle</span><span class="p">(</span><span class="n">r</span><span class="p">):</span>
     <span class="sd">&#39;&#39;&#39;Extract psi angle for residue r.&#39;&#39;&#39;</span>
-    <span class="c"># def. fallback = helix </span>
+    <span class="c1"># def. fallback = helix </span>
     <span class="n">psi</span> <span class="o">=</span> <span class="o">-</span><span class="mf">0.7854</span>
-    <span class="c"># try to get psi from torsion angles</span>
+    <span class="c1"># try to get psi from torsion angles</span>
     <span class="n">tor</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">GetPsiTorsion</span><span class="p">()</span>
     <span class="k">if</span> <span class="n">tor</span><span class="o">.</span><span class="n">IsValid</span><span class="p">():</span>
         <span class="n">psi</span> <span class="o">=</span> <span class="n">tor</span><span class="o">.</span><span class="n">GetAngle</span><span class="p">()</span>
     <span class="k">else</span><span class="p">:</span>
         <span class="n">r_next</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">handle</span><span class="o">.</span><span class="n">next</span>
         <span class="k">if</span> <span class="n">r_next</span><span class="o">.</span><span class="n">IsValid</span><span class="p">()</span> <span class="ow">and</span> <span class="n">mol</span><span class="o">.</span><span class="n">InSequence</span><span class="p">(</span><span class="n">r</span><span class="o">.</span><span class="n">handle</span><span class="p">,</span> <span class="n">r_next</span><span class="p">):</span>
-            <span class="n">n</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">FindAtom</span><span class="p">(</span><span class="s">&quot;N&quot;</span><span class="p">)</span>
-            <span class="n">ca</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">FindAtom</span><span class="p">(</span><span class="s">&quot;CA&quot;</span><span class="p">)</span>
-            <span class="n">c</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">FindAtom</span><span class="p">(</span><span class="s">&quot;C&quot;</span><span class="p">)</span>
-            <span class="n">n_next</span> <span class="o">=</span> <span class="n">r_next</span><span class="o">.</span><span class="n">FindAtom</span><span class="p">(</span><span class="s">&quot;N&quot;</span><span class="p">)</span>
+            <span class="n">n</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">FindAtom</span><span class="p">(</span><span class="s2">&quot;N&quot;</span><span class="p">)</span>
+            <span class="n">ca</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">FindAtom</span><span class="p">(</span><span class="s2">&quot;CA&quot;</span><span class="p">)</span>
+            <span class="n">c</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">FindAtom</span><span class="p">(</span><span class="s2">&quot;C&quot;</span><span class="p">)</span>
+            <span class="n">n_next</span> <span class="o">=</span> <span class="n">r_next</span><span class="o">.</span><span class="n">FindAtom</span><span class="p">(</span><span class="s2">&quot;N&quot;</span><span class="p">)</span>
             <span class="k">if</span> <span class="n">n</span><span class="o">.</span><span class="n">IsValid</span><span class="p">()</span> <span class="ow">and</span> <span class="n">ca</span><span class="o">.</span><span class="n">IsValid</span><span class="p">()</span> <span class="ow">and</span> <span class="n">c</span><span class="o">.</span><span class="n">IsValid</span><span class="p">()</span> <span class="ow">and</span> <span class="n">n_next</span><span class="o">.</span><span class="n">IsValid</span><span class="p">():</span>
                 <span class="n">psi</span> <span class="o">=</span> <span class="n">geom</span><span class="o">.</span><span class="n">DihedralAngle</span><span class="p">(</span><span class="n">n</span><span class="o">.</span><span class="n">GetPos</span><span class="p">(),</span> <span class="n">ca</span><span class="o">.</span><span class="n">GetPos</span><span class="p">(),</span>
                                          <span class="n">c</span><span class="o">.</span><span class="n">GetPos</span><span class="p">(),</span> <span class="n">n_next</span><span class="o">.</span><span class="n">GetPos</span><span class="p">())</span>
@@ -98,7 +100,7 @@
     <span class="sd">&#39;&#39;&#39;Extract dihedral angles for all residues.</span>
 <span class="sd">    Returns phi and psi angles as 2 lists with length = len(res_list).</span>
 <span class="sd">    &#39;&#39;&#39;</span>
-    <span class="n">prof_name</span> <span class="o">=</span> <span class="s">&#39;sidechain::_GetDihedrals&#39;</span>
+    <span class="n">prof_name</span> <span class="o">=</span> <span class="s1">&#39;sidechain::_GetDihedrals&#39;</span>
     <span class="n">prof</span> <span class="o">=</span> <span class="n">core</span><span class="o">.</span><span class="n">StaticRuntimeProfiler</span><span class="o">.</span><span class="n">StartScoped</span><span class="p">(</span><span class="n">prof_name</span><span class="p">)</span>
     <span class="n">phi_angles</span> <span class="o">=</span> <span class="p">[</span><span class="mf">0.0</span><span class="p">]</span> <span class="o">*</span> <span class="nb">len</span><span class="p">(</span><span class="n">res_list</span><span class="p">)</span>
     <span class="n">psi_angles</span> <span class="o">=</span> <span class="p">[</span><span class="mf">0.0</span><span class="p">]</span> <span class="o">*</span> <span class="nb">len</span><span class="p">(</span><span class="n">res_list</span><span class="p">)</span>
@@ -114,8 +116,8 @@
         <span class="k">try</span><span class="p">:</span>
             <span class="n">frame_residue</span> <span class="o">=</span> <span class="n">rotamer_constructor</span><span class="o">.</span><span class="n">ConstructBackboneFrameResidue</span><span class="p">(</span>\
                                 <span class="n">r</span><span class="o">.</span><span class="n">handle</span><span class="p">,</span> <span class="n">rotamer_ids</span><span class="p">[</span><span class="n">i</span><span class="p">],</span> <span class="n">i</span><span class="p">,</span>
-                                <span class="n">phi_angles</span><span class="p">[</span><span class="n">i</span><span class="p">],</span> <span class="n">r</span><span class="o">.</span><span class="n">HasProp</span><span class="p">(</span><span class="s">&quot;n_ter&quot;</span><span class="p">),</span>
-                                <span class="n">r</span><span class="o">.</span><span class="n">HasProp</span><span class="p">(</span><span class="s">&quot;c_ter&quot;</span><span class="p">))</span>
+                                <span class="n">phi_angles</span><span class="p">[</span><span class="n">i</span><span class="p">],</span> <span class="n">r</span><span class="o">.</span><span class="n">HasProp</span><span class="p">(</span><span class="s2">&quot;n_ter&quot;</span><span class="p">),</span>
+                                <span class="n">r</span><span class="o">.</span><span class="n">HasProp</span><span class="p">(</span><span class="s2">&quot;c_ter&quot;</span><span class="p">))</span>
             <span class="n">frame_residues</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">frame_residue</span><span class="p">)</span>
         <span class="k">except</span><span class="p">:</span>
             <span class="k">continue</span>
@@ -124,15 +126,15 @@
     <span class="sd">&#39;&#39;&#39;Update frame_residues (list) with FrameResidues for res. in ent_lig.</span>
 <span class="sd">    Set offset &gt;= number of non-ligand residues (used for residue_index).</span>
 <span class="sd">    &#39;&#39;&#39;</span>
-    <span class="c"># parse ligand residues</span>
+    <span class="c1"># parse ligand residues</span>
     <span class="k">for</span> <span class="n">i</span><span class="p">,</span> <span class="n">res</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">ent_lig</span><span class="o">.</span><span class="n">residues</span><span class="p">):</span>
         <span class="n">res_idx</span> <span class="o">=</span> <span class="n">offset</span> <span class="o">+</span> <span class="n">i</span>
         <span class="n">is_done</span> <span class="o">=</span> <span class="bp">False</span>
-        <span class="c"># special treatment for peptides</span>
+        <span class="c1"># special treatment for peptides</span>
         <span class="k">if</span> <span class="n">res</span><span class="o">.</span><span class="n">IsPeptideLinking</span><span class="p">():</span>
             <span class="n">rot_id</span> <span class="o">=</span> <span class="n">sidechain</span><span class="o">.</span><span class="n">TLCToRotID</span><span class="p">(</span><span class="n">res</span><span class="o">.</span><span class="n">GetName</span><span class="p">())</span>
             <span class="k">if</span> <span class="n">rot_id</span> <span class="o">!=</span> <span class="n">sidechain</span><span class="o">.</span><span class="n">XXX</span><span class="p">:</span>
-                <span class="c"># get more info</span>
+                <span class="c1"># get more info</span>
                 <span class="n">phi</span> <span class="o">=</span> <span class="n">_GetPhiAngle</span><span class="p">(</span><span class="n">res</span><span class="p">)</span>
                 <span class="n">r_prev</span> <span class="o">=</span> <span class="n">res</span><span class="o">.</span><span class="n">handle</span><span class="o">.</span><span class="n">prev</span>
                 <span class="n">n_ter</span> <span class="o">=</span> <span class="ow">not</span> <span class="n">r_prev</span><span class="o">.</span><span class="n">IsValid</span><span class="p">()</span> \
@@ -140,29 +142,28 @@
                 <span class="n">r_next</span> <span class="o">=</span> <span class="n">res</span><span class="o">.</span><span class="n">handle</span><span class="o">.</span><span class="n">next</span>
                 <span class="n">c_ter</span> <span class="o">=</span> <span class="ow">not</span> <span class="n">r_next</span><span class="o">.</span><span class="n">IsValid</span><span class="p">()</span> \
                         <span class="ow">or</span> <span class="ow">not</span> <span class="n">mol</span><span class="o">.</span><span class="n">InSequence</span><span class="p">(</span><span class="n">res</span><span class="o">.</span><span class="n">handle</span><span class="p">,</span> <span class="n">r_next</span><span class="p">)</span>
-                <span class="c"># try to add frame residues (ignore exceptions)</span>
+                <span class="c1"># try to add frame residues (ignore exceptions)</span>
                 <span class="k">try</span><span class="p">:</span>
                     <span class="n">fr1</span> <span class="o">=</span> <span class="n">rotamer_constructor</span><span class="o">.</span><span class="n">ConstructBackboneFrameResidue</span><span class="p">(</span>\
                               <span class="n">res</span><span class="o">.</span><span class="n">handle</span><span class="p">,</span> <span class="n">rot_id</span><span class="p">,</span> <span class="n">res_idx</span><span class="p">,</span>
                               <span class="n">phi</span><span class="p">,</span> <span class="n">n_ter</span><span class="p">,</span> <span class="n">c_ter</span><span class="p">)</span>
-                    <span class="k">if</span> <span class="n">rot_id</span> <span class="o">!=</span> <span class="n">sidechain</span><span class="o">.</span><span class="n">ALA</span> <span class="ow">and</span> <span class="n">rot_id</span> <span class="o">!=</span> <span class="n">sidechain</span><span class="o">.</span><span class="n">GLY</span><span class="p">:</span>
-                        <span class="n">fr2</span> <span class="o">=</span> <span class="n">rotamer_constructor</span><span class="o">.</span><span class="n">ConstructSidechainFrameResidue</span><span class="p">(</span>\
-                                  <span class="n">res</span><span class="o">.</span><span class="n">handle</span><span class="p">,</span> <span class="n">rot_id</span><span class="p">,</span> <span class="n">res_idx</span><span class="p">)</span>
-                        <span class="n">frame_residues</span><span class="o">.</span><span class="n">extend</span><span class="p">([</span><span class="n">fr1</span><span class="p">,</span><span class="n">fr2</span><span class="p">])</span>
-                    <span class="k">else</span><span class="p">:</span>
-                        <span class="n">frame_residues</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">fr1</span><span class="p">)</span>
+
+                    <span class="n">fr2</span> <span class="o">=</span> <span class="n">rotamer_constructor</span><span class="o">.</span><span class="n">ConstructSidechainFrameResidue</span><span class="p">(</span>\
+                              <span class="n">res</span><span class="o">.</span><span class="n">handle</span><span class="p">,</span> <span class="n">rot_id</span><span class="p">,</span> <span class="n">res_idx</span><span class="p">)</span>
+
+                    <span class="n">frame_residues</span><span class="o">.</span><span class="n">extend</span><span class="p">([</span><span class="n">fr1</span><span class="p">,</span><span class="n">fr2</span><span class="p">])</span>
                 <span class="k">except</span><span class="p">:</span>
-                    <span class="k">pass</span>   <span class="c"># ignore peptide treatment and treat below</span>
+                    <span class="k">pass</span>   <span class="c1"># ignore peptide treatment and treat below</span>
                 <span class="k">else</span><span class="p">:</span>
                     <span class="n">is_done</span> <span class="o">=</span> <span class="bp">True</span>
-        <span class="c"># if it failed, treat it as an unknown entity</span>
+        <span class="c1"># if it failed, treat it as an unknown entity</span>
         <span class="k">if</span> <span class="ow">not</span> <span class="n">is_done</span><span class="p">:</span>
-            <span class="c"># try to add frame residues (skip exceptions)</span>
+            <span class="c1"># try to add frame residues (skip exceptions)</span>
             <span class="k">try</span><span class="p">:</span>
-                <span class="c"># NOTES:</span>
-                <span class="c"># - ConstructFrameResidueHeuristic has fall back if res unknown</span>
-                <span class="c"># - it only deals with few possible ligand cases and has not</span>
-                <span class="c">#   been tested extensively!</span>
+                <span class="c1"># NOTES:</span>
+                <span class="c1"># - ConstructFrameResidueHeuristic has fall back if res unknown</span>
+                <span class="c1"># - it only deals with few possible ligand cases and has not</span>
+                <span class="c1">#   been tested extensively!</span>
                 <span class="n">comp_lib</span> <span class="o">=</span> <span class="n">conop</span><span class="o">.</span><span class="n">GetDefaultLib</span><span class="p">()</span>
                 <span class="n">fr</span> <span class="o">=</span> <span class="n">rotamer_constructor</span><span class="o">.</span><span class="n">ConstructFrameResidueHeuristic</span><span class="p">(</span>\
                          <span class="n">res</span><span class="o">.</span><span class="n">handle</span><span class="p">,</span> <span class="n">res_idx</span><span class="p">,</span> <span class="n">comp_lib</span><span class="p">)</span>
@@ -179,18 +180,15 @@
 <span class="sd">    Each residue can only end up in one of the 3 lists.</span>
 <span class="sd">    &#39;&#39;&#39;</span>
     <span class="k">if</span> <span class="n">keep_sidechains</span><span class="p">:</span>
-        <span class="c"># try to generate frame residues for all existing side chains</span>
-        <span class="c"># skip non-existing sidechains and CYS (if cystein_indices) and update</span>
-        <span class="c"># incomplete_sidechains and cystein_indices</span>
+        <span class="c1"># try to generate frame residues for all existing side chains</span>
+        <span class="c1"># skip non-existing sidechains and CYS (if cystein_indices) and update</span>
+        <span class="c1"># incomplete_sidechains and cystein_indices</span>
         <span class="k">for</span> <span class="n">i</span><span class="p">,</span><span class="n">r</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">res_list</span><span class="p">):</span>
 
             <span class="k">if</span> <span class="n">cystein_indices</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span> <span class="ow">and</span> <span class="n">rotamer_ids</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">==</span> <span class="n">sidechain</span><span class="o">.</span><span class="n">CYS</span><span class="p">:</span>
                 <span class="n">cystein_indices</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">i</span><span class="p">)</span>
                 <span class="k">continue</span>
 
-            <span class="k">if</span> <span class="n">rotamer_ids</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">==</span> <span class="n">sidechain</span><span class="o">.</span><span class="n">ALA</span> <span class="ow">or</span> <span class="n">rotamer_ids</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">==</span> <span class="n">sidechain</span><span class="o">.</span><span class="n">GLY</span><span class="p">:</span>
-                <span class="k">continue</span> <span class="c"># no sidechain to model</span>
-
             <span class="k">try</span><span class="p">:</span>
                 <span class="n">frame_residue</span> <span class="o">=</span> <span class="n">rotamer_constructor</span><span class="o">.</span><span class="n">ConstructSidechainFrameResidue</span><span class="p">(</span>\
                                     <span class="n">r</span><span class="o">.</span><span class="n">handle</span><span class="p">,</span> <span class="n">rotamer_ids</span><span class="p">[</span><span class="n">i</span><span class="p">],</span> <span class="n">i</span><span class="p">)</span>
@@ -198,17 +196,14 @@
             <span class="k">except</span><span class="p">:</span>
                 <span class="n">incomplete_sidechains</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">i</span><span class="p">)</span>
     <span class="k">else</span><span class="p">:</span>
-        <span class="c"># no frame residues to create, just update incomplete_sidechains</span>
-        <span class="c"># and cystein_indices if needed</span>
+        <span class="c1"># no frame residues to create, just update incomplete_sidechains</span>
+        <span class="c1"># and cystein_indices if needed</span>
         <span class="k">for</span> <span class="n">i</span><span class="p">,</span><span class="n">r</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">res_list</span><span class="p">):</span>
 
             <span class="k">if</span> <span class="n">cystein_indices</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span> <span class="ow">and</span> <span class="n">rotamer_ids</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">==</span> <span class="n">sidechain</span><span class="o">.</span><span class="n">CYS</span><span class="p">:</span>
                 <span class="n">cystein_indices</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">i</span><span class="p">)</span>
                 <span class="k">continue</span>
 
-            <span class="k">if</span> <span class="n">rotamer_ids</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">==</span> <span class="n">sidechain</span><span class="o">.</span><span class="n">ALA</span> <span class="ow">or</span> <span class="n">rotamer_ids</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">==</span> <span class="n">sidechain</span><span class="o">.</span><span class="n">GLY</span><span class="p">:</span>
-                <span class="k">continue</span> <span class="c"># no sidechain to model</span>
-
             <span class="n">incomplete_sidechains</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">i</span><span class="p">)</span>
 
 <span class="k">def</span> <span class="nf">_AddCysteinFrameResidues</span><span class="p">(</span><span class="n">frame_residues</span><span class="p">,</span> <span class="n">incomplete_sidechains</span><span class="p">,</span>
@@ -220,19 +215,19 @@
 <span class="sd">    Some cysteins (in disulfid_indices) get special treatment as disulfid</span>
 <span class="sd">    bridges (disulfid_indices, disulfid_rotamers from _GetDisulfidBridges).</span>
 <span class="sd">    &#39;&#39;&#39;</span>
-    <span class="c"># handle cysteins participating in a disulfid bond</span>
+    <span class="c1"># handle cysteins participating in a disulfid bond</span>
     <span class="k">for</span> <span class="n">cys_idx</span><span class="p">,</span> <span class="n">cys_rot</span> <span class="ow">in</span> <span class="nb">zip</span><span class="p">(</span><span class="n">disulfid_indices</span><span class="p">,</span> <span class="n">disulfid_rotamers</span><span class="p">):</span>
-        <span class="c"># add FrameResidue</span>
+        <span class="c1"># add FrameResidue</span>
         <span class="n">frame_residues</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">cys_rot</span><span class="o">.</span><span class="n">ToFrameResidue</span><span class="p">(</span><span class="n">cys_idx</span><span class="p">))</span>
-        <span class="c"># set the position in the proteins residues</span>
+        <span class="c1"># set the position in the proteins residues</span>
         <span class="n">cys_rot</span><span class="o">.</span><span class="n">ApplyOnResidue</span><span class="p">(</span><span class="n">res_list</span><span class="p">[</span><span class="n">cys_idx</span><span class="p">]</span><span class="o">.</span><span class="n">handle</span><span class="p">,</span>
                                <span class="n">consider_hydrogens</span><span class="o">=</span><span class="bp">False</span><span class="p">)</span>
         <span class="n">sidechain</span><span class="o">.</span><span class="n">ConnectSidechain</span><span class="p">(</span><span class="n">res_list</span><span class="p">[</span><span class="n">cys_idx</span><span class="p">]</span><span class="o">.</span><span class="n">handle</span><span class="p">,</span> <span class="n">sidechain</span><span class="o">.</span><span class="n">CYS</span><span class="p">)</span>
 
-    <span class="c"># add remaining ones according the given flags</span>
+    <span class="c1"># add remaining ones according the given flags</span>
     <span class="k">for</span> <span class="n">idx</span> <span class="ow">in</span> <span class="n">cystein_indices</span><span class="p">:</span>
         <span class="k">if</span> <span class="n">idx</span> <span class="ow">in</span> <span class="n">disulfid_indices</span><span class="p">:</span>
-            <span class="k">continue</span> <span class="c"># already handled</span>
+            <span class="k">continue</span> <span class="c1"># already handled</span>
         <span class="k">if</span> <span class="n">keep_sidechains</span><span class="p">:</span>
             <span class="k">try</span><span class="p">:</span>
                 <span class="n">frame_residue</span> <span class="o">=</span> <span class="n">rot_constructor</span><span class="o">.</span><span class="n">ConstructSidechainFrameResidue</span><span class="p">(</span>\
@@ -271,27 +266,24 @@
                       <span class="n">phi_angles</span><span class="p">,</span> <span class="n">psi_angles</span><span class="p">,</span> <span class="n">use_frm</span><span class="p">,</span> <span class="n">bbdep</span><span class="p">,</span> <span class="n">frame_residues</span><span class="p">):</span>
     <span class="sd">&#39;&#39;&#39;Get list of rotamer groups from subset of res_list.</span>
 <span class="sd">    Residues are chosen as res_list[i] for i in indices and only if a rotamer</span>
-<span class="sd">    group can be created (e.g. no ALA, GLY).</span>
+<span class="sd">    group can be created.</span>
 <span class="sd">    Rotamer groups are filtered to keep only best ones (given frame).</span>
 <span class="sd">    Returns list of rotamer groups and list of res. indices they belong to.</span>
 <span class="sd">    &#39;&#39;&#39;</span>
-    <span class="n">prof_name</span> <span class="o">=</span> <span class="s">&#39;sidechain::_GetRotamerGroups&#39;</span>
+    <span class="n">prof_name</span> <span class="o">=</span> <span class="s1">&#39;sidechain::_GetRotamerGroups&#39;</span>
     <span class="n">prof</span> <span class="o">=</span> <span class="n">core</span><span class="o">.</span><span class="n">StaticRuntimeProfiler</span><span class="o">.</span><span class="n">StartScoped</span><span class="p">(</span><span class="n">prof_name</span><span class="p">)</span>
 
-    <span class="c"># res.index (res_list[i]) for each modelled sc</span>
+    <span class="c1"># res.index (res_list[i]) for each modelled sc</span>
     <span class="n">residues_with_rotamer_group</span> <span class="o">=</span> <span class="nb">list</span><span class="p">()</span>
-    <span class="c">#  linked to residue in residues_with_rotamer_group</span>
+    <span class="c1">#  linked to residue in residues_with_rotamer_group</span>
     <span class="n">rotamer_groups</span> <span class="o">=</span> <span class="nb">list</span><span class="p">()</span>
-    <span class="c"># get frame for score evaluation</span>
+    <span class="c1"># get frame for score evaluation</span>
     <span class="n">frame</span> <span class="o">=</span> <span class="n">sidechain</span><span class="o">.</span><span class="n">Frame</span><span class="p">(</span><span class="n">frame_residues</span><span class="p">)</span>
-    <span class="c"># build rotamers for chosen sidechains</span>
+    <span class="c1"># build rotamers for chosen sidechains</span>
     <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="n">indices</span><span class="p">:</span>
-        <span class="c"># get rotamer ID</span>
+        <span class="c1"># get rotamer ID</span>
         <span class="n">r</span> <span class="o">=</span> <span class="n">res_list</span><span class="p">[</span><span class="n">i</span><span class="p">]</span>
         <span class="n">rot_id</span> <span class="o">=</span> <span class="n">rot_ids</span><span class="p">[</span><span class="n">i</span><span class="p">]</span>
-        
-        <span class="k">if</span> <span class="n">rot_id</span> <span class="o">==</span> <span class="n">sidechain</span><span class="o">.</span><span class="n">ALA</span> <span class="ow">or</span> <span class="n">rot_id</span> <span class="o">==</span> <span class="n">sidechain</span><span class="o">.</span><span class="n">GLY</span><span class="p">:</span>
-            <span class="k">continue</span>
 
         <span class="k">if</span> <span class="n">rot_id</span> <span class="o">==</span> <span class="n">sidechain</span><span class="o">.</span><span class="n">CYS</span><span class="p">:</span>
             <span class="n">rot_id</span> <span class="o">=</span> <span class="n">sidechain</span><span class="o">.</span><span class="n">CYH</span>
@@ -302,34 +294,34 @@
             <span class="k">if</span> <span class="n">tor</span><span class="o">.</span><span class="n">IsValid</span><span class="p">():</span>
                 <span class="n">omega</span> <span class="o">=</span> <span class="n">tor</span><span class="o">.</span><span class="n">GetAngle</span><span class="p">()</span>
             <span class="k">elif</span> <span class="n">i</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">:</span>
-                <span class="c"># fallback computation of omega as in OST-code</span>
+                <span class="c1"># fallback computation of omega as in OST-code</span>
                 <span class="n">prev</span> <span class="o">=</span> <span class="n">res_list</span><span class="p">[</span><span class="n">i</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span>
                 <span class="k">if</span> <span class="n">prev</span><span class="o">.</span><span class="n">IsValid</span><span class="p">()</span> <span class="ow">and</span> <span class="n">prev</span><span class="o">.</span><span class="n">IsPeptideLinking</span><span class="p">():</span>
-                    <span class="n">ca_prev</span> <span class="o">=</span> <span class="n">prev</span><span class="o">.</span><span class="n">FindAtom</span><span class="p">(</span><span class="s">&quot;CA&quot;</span><span class="p">)</span>
-                    <span class="n">c_prev</span> <span class="o">=</span> <span class="n">prev</span><span class="o">.</span><span class="n">FindAtom</span><span class="p">(</span><span class="s">&quot;C&quot;</span><span class="p">)</span>
-                    <span class="n">n</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">FindAtom</span><span class="p">(</span><span class="s">&quot;N&quot;</span><span class="p">)</span>
-                    <span class="n">ca</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">FindAtom</span><span class="p">(</span><span class="s">&quot;CA&quot;</span><span class="p">)</span>
+                    <span class="n">ca_prev</span> <span class="o">=</span> <span class="n">prev</span><span class="o">.</span><span class="n">FindAtom</span><span class="p">(</span><span class="s2">&quot;CA&quot;</span><span class="p">)</span>
+                    <span class="n">c_prev</span> <span class="o">=</span> <span class="n">prev</span><span class="o">.</span><span class="n">FindAtom</span><span class="p">(</span><span class="s2">&quot;C&quot;</span><span class="p">)</span>
+                    <span class="n">n</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">FindAtom</span><span class="p">(</span><span class="s2">&quot;N&quot;</span><span class="p">)</span>
+                    <span class="n">ca</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">FindAtom</span><span class="p">(</span><span class="s2">&quot;CA&quot;</span><span class="p">)</span>
                     <span class="n">valid</span> <span class="o">=</span> <span class="n">ca_prev</span><span class="o">.</span><span class="n">IsValid</span><span class="p">()</span> <span class="ow">and</span> <span class="n">c_prev</span><span class="o">.</span><span class="n">IsValid</span><span class="p">()</span> \
                             <span class="ow">and</span> <span class="n">n</span><span class="o">.</span><span class="n">IsValid</span><span class="p">()</span> <span class="ow">and</span> <span class="n">ca</span><span class="o">.</span><span class="n">IsValid</span><span class="p">()</span>
                     <span class="k">if</span> <span class="n">valid</span> <span class="ow">and</span> <span class="n">mol</span><span class="o">.</span><span class="n">BondExists</span><span class="p">(</span><span class="n">c_prev</span><span class="o">.</span><span class="n">handle</span><span class="p">,</span> <span class="n">n</span><span class="o">.</span><span class="n">handle</span><span class="p">):</span>
                         <span class="n">omega</span> <span class="o">=</span> <span class="n">geom</span><span class="o">.</span><span class="n">DihedralAngle</span><span class="p">(</span><span class="n">ca_prev</span><span class="o">.</span><span class="n">GetPos</span><span class="p">(),</span>
                                                    <span class="n">c_prev</span><span class="o">.</span><span class="n">GetPos</span><span class="p">(),</span>
                                                    <span class="n">n</span><span class="o">.</span><span class="n">GetPos</span><span class="p">(),</span> <span class="n">ca</span><span class="o">.</span><span class="n">GetPos</span><span class="p">())</span>
-            <span class="c"># omega not set if prev. res. missing</span>
+            <span class="c1"># omega not set if prev. res. missing</span>
             <span class="k">if</span> <span class="n">omega</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span><span class="p">:</span>
                 <span class="k">if</span> <span class="nb">abs</span><span class="p">(</span><span class="n">omega</span><span class="p">)</span> <span class="o">&lt;</span> <span class="mf">1.57</span><span class="p">:</span>
                     <span class="n">rot_id</span> <span class="o">=</span> <span class="n">sidechain</span><span class="o">.</span><span class="n">CPR</span>
                 <span class="k">else</span><span class="p">:</span>
                     <span class="n">rot_id</span> <span class="o">=</span> <span class="n">sidechain</span><span class="o">.</span><span class="n">TPR</span>
 
-        <span class="c"># get RotamerGroup</span>
+        <span class="c1"># get RotamerGroup</span>
         <span class="k">try</span><span class="p">:</span>
             <span class="n">rot_group</span> <span class="o">=</span> <span class="n">_GetRotamerGroup</span><span class="p">(</span><span class="n">r</span><span class="o">.</span><span class="n">handle</span><span class="p">,</span> <span class="n">rot_id</span><span class="p">,</span> <span class="n">i</span><span class="p">,</span> <span class="n">rot_lib</span><span class="p">,</span>
                                          <span class="n">rot_constructor</span><span class="p">,</span> <span class="n">phi_angles</span><span class="p">[</span><span class="n">i</span><span class="p">],</span>
                                          <span class="n">psi_angles</span><span class="p">[</span><span class="n">i</span><span class="p">],</span> <span class="n">use_frm</span><span class="p">,</span> <span class="n">bbdep</span><span class="p">)</span>
         <span class="k">except</span><span class="p">:</span>
             <span class="k">continue</span>
-        <span class="c"># keep best ones</span>
+        <span class="c1"># keep best ones</span>
         <span class="n">rot_group</span><span class="o">.</span><span class="n">SetFrameEnergy</span><span class="p">(</span><span class="n">frame</span><span class="p">)</span>
         <span class="n">rot_group</span><span class="o">.</span><span class="n">ApplySelfEnergyThresh</span><span class="p">()</span>
         <span class="n">rotamer_groups</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">rot_group</span><span class="p">)</span>
@@ -345,40 +337,40 @@
 <span class="sd">    Returns: disulfid_indices: list of res. index in bridge,</span>
 <span class="sd">             disulfid_rotamers: list of rotamers (best one for bridge).</span>
 <span class="sd">    &#39;&#39;&#39;</span>
-    <span class="c"># this is required for the disulfid score evaluation</span>
+    <span class="c1"># this is required for the disulfid score evaluation</span>
     <span class="n">frame</span> <span class="o">=</span> <span class="n">sidechain</span><span class="o">.</span><span class="n">Frame</span><span class="p">(</span><span class="n">frame_residues</span><span class="p">)</span>
 
-    <span class="c"># some info we have to keep track of when evaluating disulfid bonds</span>
+    <span class="c1"># some info we have to keep track of when evaluating disulfid bonds</span>
     <span class="n">cystein_rot_groups</span> <span class="o">=</span> <span class="nb">list</span><span class="p">()</span>
     <span class="n">cys_ca_positions</span> <span class="o">=</span> <span class="nb">list</span><span class="p">()</span>
     <span class="n">cys_cb_positions</span> <span class="o">=</span> <span class="nb">list</span><span class="p">()</span>
     <span class="n">indices_with_rot_groups</span> <span class="o">=</span> <span class="nb">list</span><span class="p">()</span>
 
     <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="n">cystein_indices</span><span class="p">:</span>
-        <span class="c"># check ca, cb</span>
+        <span class="c1"># check ca, cb</span>
         <span class="n">r</span> <span class="o">=</span> <span class="n">res_list</span><span class="p">[</span><span class="n">i</span><span class="p">]</span>
-        <span class="n">ca</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">FindAtom</span><span class="p">(</span><span class="s">&quot;CA&quot;</span><span class="p">)</span>
-        <span class="n">cb</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">FindAtom</span><span class="p">(</span><span class="s">&quot;CB&quot;</span><span class="p">)</span>
+        <span class="n">ca</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">FindAtom</span><span class="p">(</span><span class="s2">&quot;CA&quot;</span><span class="p">)</span>
+        <span class="n">cb</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">FindAtom</span><span class="p">(</span><span class="s2">&quot;CB&quot;</span><span class="p">)</span>
         <span class="k">if</span> <span class="ow">not</span> <span class="p">(</span><span class="n">ca</span><span class="o">.</span><span class="n">IsValid</span><span class="p">()</span> <span class="ow">and</span> <span class="n">cb</span><span class="o">.</span><span class="n">IsValid</span><span class="p">()):</span>
             <span class="k">continue</span>
         <span class="n">cys_ca_positions</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">ca</span><span class="o">.</span><span class="n">GetPos</span><span class="p">())</span>
         <span class="n">cys_cb_positions</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">cb</span><span class="o">.</span><span class="n">GetPos</span><span class="p">())</span>
 
-        <span class="c"># get RotamerGroup in case of cysteins, we do FRM in any case...</span>
-        <span class="c"># If we&#39;re suposed to keep the existing sidechains and the processed</span>
-        <span class="c"># cystein contains all required atoms, we manually construct an FRM</span>
-        <span class="c"># rotamer to still allow the rotamer to enter the disulfid bridge </span>
-        <span class="c"># resolving algorithm.  </span>
+        <span class="c1"># get RotamerGroup in case of cysteins, we do FRM in any case...</span>
+        <span class="c1"># If we&#39;re suposed to keep the existing sidechains and the processed</span>
+        <span class="c1"># cystein contains all required atoms, we manually construct an FRM</span>
+        <span class="c1"># rotamer to still allow the rotamer to enter the disulfid bridge </span>
+        <span class="c1"># resolving algorithm.  </span>
         <span class="n">rot_group</span> <span class="o">=</span> <span class="bp">None</span>
         <span class="k">if</span> <span class="n">keep_sidechains</span><span class="p">:</span>
-            <span class="n">sg</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">FindAtom</span><span class="p">(</span><span class="s">&quot;SG&quot;</span><span class="p">)</span>
+            <span class="n">sg</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">FindAtom</span><span class="p">(</span><span class="s2">&quot;SG&quot;</span><span class="p">)</span>
             <span class="k">if</span> <span class="n">sg</span><span class="o">.</span><span class="n">IsValid</span><span class="p">():</span>
                 <span class="n">particle</span> <span class="o">=</span> <span class="n">sidechain</span><span class="o">.</span><span class="n">Particle</span><span class="p">(</span><span class="n">sidechain</span><span class="o">.</span><span class="n">SidechainParticle</span><span class="o">.</span><span class="n">SParticle</span><span class="p">,</span> 
                                               <span class="n">sg</span><span class="o">.</span><span class="n">GetPos</span><span class="p">(),</span>
-                                              <span class="o">-</span><span class="mf">0.19</span><span class="p">,</span> <span class="s">&quot;SG&quot;</span><span class="p">)</span>   
+                                              <span class="o">-</span><span class="mf">0.19</span><span class="p">,</span> <span class="s2">&quot;SG&quot;</span><span class="p">)</span>   
                 <span class="n">particle_list</span> <span class="o">=</span> <span class="p">[</span><span class="n">particle</span><span class="p">]</span>
-                <span class="c"># The temperature and self internal_e_prefactor parameter have </span>
-                <span class="c"># been copied from the SCWRLRotamerConstructor. Hacky...</span>
+                <span class="c1"># The temperature and self internal_e_prefactor parameter have </span>
+                <span class="c1"># been copied from the SCWRLRotamerConstructor. Hacky...</span>
                 <span class="n">frm_rotamer</span> <span class="o">=</span> <span class="n">sidechain</span><span class="o">.</span><span class="n">FRMRotamer</span><span class="p">(</span><span class="n">particle_list</span><span class="p">,</span> 
                                                    <span class="mf">1.69</span><span class="p">,</span> <span class="mf">1.0</span><span class="p">,</span> <span class="mf">4.07</span><span class="p">)</span>
                 <span class="n">frm_rotamer</span><span class="o">.</span><span class="n">AddSubrotamerDefinition</span><span class="p">([</span><span class="mi">0</span><span class="p">])</span>               
@@ -401,7 +393,7 @@
                                                <span class="n">cys_cb_positions</span><span class="p">,</span> <span class="mf">45.0</span><span class="p">,</span>
                                                <span class="bp">True</span><span class="p">)</span>
 
-    <span class="c"># get CYS with disulfid bonds and the chosen rotamers</span>
+    <span class="c1"># get CYS with disulfid bonds and the chosen rotamers</span>
     <span class="n">disulfid_indices</span> <span class="o">=</span> <span class="nb">list</span><span class="p">()</span>
     <span class="n">disulfid_rotamers</span> <span class="o">=</span> <span class="nb">list</span><span class="p">()</span>
   
@@ -414,10 +406,10 @@
     <span class="k">return</span> <span class="n">disulfid_indices</span><span class="p">,</span> <span class="n">disulfid_rotamers</span>
 
 
-<span class="c">###############################################################################</span>
+<span class="c1">###############################################################################</span>
 
 <div class="viewcode-block" id="ReconstructSidechains"><a class="viewcode-back" href="../../../modelling/sidechain_reconstruction.html#promod3.modelling.ReconstructSidechains">[docs]</a><span class="k">def</span> <span class="nf">ReconstructSidechains</span><span class="p">(</span><span class="n">ent</span><span class="p">,</span> <span class="n">keep_sidechains</span><span class="o">=</span><span class="bp">False</span><span class="p">,</span> <span class="n">build_disulfids</span><span class="o">=</span><span class="bp">True</span><span class="p">,</span>
-                          <span class="n">rotamer_model</span><span class="o">=</span><span class="s">&quot;frm&quot;</span><span class="p">,</span> <span class="n">consider_ligands</span><span class="o">=</span><span class="bp">True</span><span class="p">,</span> 
+                          <span class="n">rotamer_model</span><span class="o">=</span><span class="s2">&quot;frm&quot;</span><span class="p">,</span> <span class="n">consider_ligands</span><span class="o">=</span><span class="bp">True</span><span class="p">,</span> 
                           <span class="n">rotamer_library</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">optimize_subrotamers</span><span class="o">=</span><span class="bp">True</span><span class="p">,</span>
                           <span class="n">graph_max_complexity</span><span class="o">=</span><span class="mi">100000000</span><span class="p">,</span> 
                           <span class="n">graph_initial_epsilon</span><span class="o">=</span><span class="mf">0.02</span><span class="p">):</span>
@@ -465,16 +457,16 @@
 <span class="sd">                                 :meth:`RotamerGraph.TreeSolve`.</span>
 <span class="sd">    :type graph_intial_epsilon:  :class:`float`</span>
 <span class="sd">    &#39;&#39;&#39;</span>
-    <span class="n">prof_name</span> <span class="o">=</span> <span class="s">&#39;modelling::ReconstructSidechains&#39;</span>
+    <span class="n">prof_name</span> <span class="o">=</span> <span class="s1">&#39;modelling::ReconstructSidechains&#39;</span>
     <span class="n">prof</span> <span class="o">=</span> <span class="n">core</span><span class="o">.</span><span class="n">StaticRuntimeProfiler</span><span class="o">.</span><span class="n">StartScoped</span><span class="p">(</span><span class="n">prof_name</span><span class="p">)</span>
 
-    <span class="c"># setup settings</span>
-    <span class="k">if</span> <span class="n">rotamer_model</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span> <span class="o">==</span> <span class="s">&quot;frm&quot;</span><span class="p">:</span>
+    <span class="c1"># setup settings</span>
+    <span class="k">if</span> <span class="n">rotamer_model</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span> <span class="o">==</span> <span class="s2">&quot;frm&quot;</span><span class="p">:</span>
         <span class="n">use_frm</span> <span class="o">=</span> <span class="bp">True</span>
-    <span class="k">elif</span> <span class="n">rotamer_model</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span> <span class="o">==</span> <span class="s">&quot;rrm&quot;</span><span class="p">:</span>
+    <span class="k">elif</span> <span class="n">rotamer_model</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span> <span class="o">==</span> <span class="s2">&quot;rrm&quot;</span><span class="p">:</span>
         <span class="n">use_frm</span> <span class="o">=</span> <span class="bp">False</span>
     <span class="k">else</span><span class="p">:</span>
-        <span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s">&quot;Only </span><span class="se">\&quot;</span><span class="s">rrm</span><span class="se">\&quot;</span><span class="s"> and </span><span class="se">\&quot;</span><span class="s">frm</span><span class="se">\&quot;</span><span class="s"> allowed for rotamer_model!&quot;</span><span class="p">)</span>
+        <span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s2">&quot;Only </span><span class="se">\&quot;</span><span class="s2">rrm</span><span class="se">\&quot;</span><span class="s2"> and </span><span class="se">\&quot;</span><span class="s2">frm</span><span class="se">\&quot;</span><span class="s2"> allowed for rotamer_model!&quot;</span><span class="p">)</span>
 
     <span class="k">if</span> <span class="n">rotamer_library</span> <span class="o">==</span> <span class="bp">None</span><span class="p">:</span> 
         <span class="n">rotamer_library</span> <span class="o">=</span> <span class="n">sidechain</span><span class="o">.</span><span class="n">LoadDunbrackLib</span><span class="p">()</span>
@@ -482,66 +474,66 @@
     <span class="k">if</span> <span class="nb">type</span><span class="p">(</span><span class="n">rotamer_library</span><span class="p">)</span> <span class="ow">is</span> <span class="n">sidechain</span><span class="o">.</span><span class="n">BBDepRotamerLib</span><span class="p">:</span>
         <span class="n">bbdep</span> <span class="o">=</span> <span class="bp">True</span>
 
-    <span class="n">rotamer_constructor</span> <span class="o">=</span> <span class="n">sidechain</span><span class="o">.</span><span class="n">SCWRLRotamerConstructor</span><span class="p">()</span>
+    <span class="n">rotamer_constructor</span> <span class="o">=</span> <span class="n">sidechain</span><span class="o">.</span><span class="n">SCWRLRotamerConstructor</span><span class="p">(</span><span class="bp">False</span><span class="p">)</span>
     
-    <span class="c"># take out ligand chain and any non-peptides</span>
-    <span class="n">prot</span> <span class="o">=</span> <span class="n">ent</span><span class="o">.</span><span class="n">Select</span><span class="p">(</span><span class="s">&quot;peptide=true and cname!=&#39;_&#39;&quot;</span><span class="p">)</span>
+    <span class="c1"># take out ligand chain and any non-peptides</span>
+    <span class="n">prot</span> <span class="o">=</span> <span class="n">ent</span><span class="o">.</span><span class="n">Select</span><span class="p">(</span><span class="s2">&quot;peptide=true and cname!=&#39;_&#39;&quot;</span><span class="p">)</span>
     
-    <span class="c"># parse residues (all lists of length len(prot.residues))</span>
+    <span class="c1"># parse residues (all lists of length len(prot.residues))</span>
     <span class="n">rotamer_ids</span> <span class="o">=</span> <span class="n">_GetRotamerIDs</span><span class="p">(</span><span class="n">prot</span><span class="o">.</span><span class="n">residues</span><span class="p">)</span>
     <span class="n">phi_angles</span><span class="p">,</span> <span class="n">psi_angles</span> <span class="o">=</span> <span class="n">_GetDihedrals</span><span class="p">(</span><span class="n">prot</span><span class="o">.</span><span class="n">residues</span><span class="p">)</span>
 
-    <span class="c"># set nter and cter (needed in _AddBackboneFrameResidues)</span>
+    <span class="c1"># set nter and cter (needed in _AddBackboneFrameResidues)</span>
     <span class="k">for</span> <span class="n">c</span> <span class="ow">in</span> <span class="n">prot</span><span class="o">.</span><span class="n">chains</span><span class="p">:</span>
-        <span class="n">c</span><span class="o">.</span><span class="n">residues</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">SetIntProp</span><span class="p">(</span><span class="s">&quot;n_ter&quot;</span><span class="p">,</span><span class="mi">1</span><span class="p">)</span>
-        <span class="n">c</span><span class="o">.</span><span class="n">residues</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">SetIntProp</span><span class="p">(</span><span class="s">&quot;c_ter&quot;</span><span class="p">,</span><span class="mi">1</span><span class="p">)</span>
+        <span class="n">c</span><span class="o">.</span><span class="n">residues</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">SetIntProp</span><span class="p">(</span><span class="s2">&quot;n_ter&quot;</span><span class="p">,</span><span class="mi">1</span><span class="p">)</span>
+        <span class="n">c</span><span class="o">.</span><span class="n">residues</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">SetIntProp</span><span class="p">(</span><span class="s2">&quot;c_ter&quot;</span><span class="p">,</span><span class="mi">1</span><span class="p">)</span>
 
-    <span class="c"># build up frame</span>
-    <span class="n">frame_residues</span> <span class="o">=</span> <span class="nb">list</span><span class="p">()</span>         <span class="c"># list of frame residues connected to frame</span>
-    <span class="n">incomplete_sidechains</span> <span class="o">=</span> <span class="nb">list</span><span class="p">()</span>  <span class="c"># residue indices</span>
+    <span class="c1"># build up frame</span>
+    <span class="n">frame_residues</span> <span class="o">=</span> <span class="nb">list</span><span class="p">()</span>         <span class="c1"># list of frame residues connected to frame</span>
+    <span class="n">incomplete_sidechains</span> <span class="o">=</span> <span class="nb">list</span><span class="p">()</span>  <span class="c1"># residue indices</span>
     <span class="n">_AddBackboneFrameResidues</span><span class="p">(</span><span class="n">frame_residues</span><span class="p">,</span> <span class="n">prot</span><span class="o">.</span><span class="n">residues</span><span class="p">,</span> <span class="n">rotamer_ids</span><span class="p">,</span>
                               <span class="n">rotamer_constructor</span><span class="p">,</span> <span class="n">phi_angles</span><span class="p">)</span>
     
-    <span class="c"># add ligands?</span>
+    <span class="c1"># add ligands?</span>
     <span class="k">if</span> <span class="n">consider_ligands</span><span class="p">:</span>
-        <span class="n">ligs</span> <span class="o">=</span> <span class="n">ent</span><span class="o">.</span><span class="n">Select</span><span class="p">(</span><span class="s">&quot;cname=&#39;_&#39;&quot;</span><span class="p">)</span>
+        <span class="n">ligs</span> <span class="o">=</span> <span class="n">ent</span><span class="o">.</span><span class="n">Select</span><span class="p">(</span><span class="s2">&quot;cname=&#39;_&#39;&quot;</span><span class="p">)</span>
         <span class="n">offset</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="n">prot</span><span class="o">.</span><span class="n">residues</span><span class="p">)</span>
         <span class="n">_AddLigandFrameResidues</span><span class="p">(</span><span class="n">frame_residues</span><span class="p">,</span> <span class="n">ligs</span><span class="p">,</span> <span class="n">rotamer_constructor</span><span class="p">,</span> <span class="n">offset</span><span class="p">)</span>
 
-    <span class="c"># check special handling of cysteins</span>
+    <span class="c1"># check special handling of cysteins</span>
     <span class="k">if</span> <span class="n">build_disulfids</span><span class="p">:</span>
-        <span class="c"># residue indices of cysteins</span>
+        <span class="c1"># residue indices of cysteins</span>
         <span class="n">cystein_indices</span> <span class="o">=</span> <span class="nb">list</span><span class="p">()</span>
-        <span class="c"># update frame_residues, incomplete_sidechains, cystein_indices</span>
+        <span class="c1"># update frame_residues, incomplete_sidechains, cystein_indices</span>
         <span class="n">_AddSidechainFrameResidues</span><span class="p">(</span><span class="n">frame_residues</span><span class="p">,</span> <span class="n">incomplete_sidechains</span><span class="p">,</span>
                                    <span class="n">keep_sidechains</span><span class="p">,</span> <span class="n">prot</span><span class="o">.</span><span class="n">residues</span><span class="p">,</span> <span class="n">rotamer_ids</span><span class="p">,</span>
                                    <span class="n">rotamer_constructor</span><span class="p">,</span> <span class="n">cystein_indices</span><span class="p">)</span>
-        <span class="c"># update frame_residues, incomplete_sidechains with cysteins (if needed)</span>
+        <span class="c1"># update frame_residues, incomplete_sidechains with cysteins (if needed)</span>
         <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">cystein_indices</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">:</span>
-            <span class="c"># get disulfid bridges and according rotamers</span>
+            <span class="c1"># get disulfid bridges and according rotamers</span>
             <span class="n">disulfid_indices</span><span class="p">,</span> <span class="n">disulfid_rotamers</span> <span class="o">=</span> \
                 <span class="n">_GetDisulfidBridges</span><span class="p">(</span><span class="n">frame_residues</span><span class="p">,</span> <span class="n">keep_sidechains</span><span class="p">,</span> 
                                     <span class="n">cystein_indices</span><span class="p">,</span> <span class="n">prot</span><span class="o">.</span><span class="n">residues</span><span class="p">,</span>
                                     <span class="n">rotamer_library</span><span class="p">,</span> <span class="n">use_frm</span><span class="p">,</span> <span class="n">bbdep</span><span class="p">,</span>
                                     <span class="n">rotamer_constructor</span><span class="p">,</span> <span class="n">phi_angles</span><span class="p">,</span> <span class="n">psi_angles</span><span class="p">)</span>
-            <span class="c"># update frame_residues, incomplete_sidechains</span>
+            <span class="c1"># update frame_residues, incomplete_sidechains</span>
             <span class="n">_AddCysteinFrameResidues</span><span class="p">(</span><span class="n">frame_residues</span><span class="p">,</span> <span class="n">incomplete_sidechains</span><span class="p">,</span>
                                      <span class="n">keep_sidechains</span><span class="p">,</span> <span class="n">prot</span><span class="o">.</span><span class="n">residues</span><span class="p">,</span> <span class="n">rotamer_ids</span><span class="p">,</span>
                                      <span class="n">rotamer_constructor</span><span class="p">,</span> <span class="n">cystein_indices</span><span class="p">,</span>
                                      <span class="n">disulfid_indices</span><span class="p">,</span> <span class="n">disulfid_rotamers</span><span class="p">)</span>
     <span class="k">else</span><span class="p">:</span>
-        <span class="c"># update frame_residues, incomplete_sidechains</span>
+        <span class="c1"># update frame_residues, incomplete_sidechains</span>
         <span class="n">_AddSidechainFrameResidues</span><span class="p">(</span><span class="n">frame_residues</span><span class="p">,</span> <span class="n">incomplete_sidechains</span><span class="p">,</span>
                                    <span class="n">keep_sidechains</span><span class="p">,</span> <span class="n">prot</span><span class="o">.</span><span class="n">residues</span><span class="p">,</span> <span class="n">rotamer_ids</span><span class="p">,</span>
                                    <span class="n">rotamer_constructor</span><span class="p">)</span>
     
-    <span class="c"># get rotamer groups and residues they&#39;re linked to</span>
+    <span class="c1"># get rotamer groups and residues they&#39;re linked to</span>
     <span class="n">rotamer_groups</span><span class="p">,</span> <span class="n">residues_with_rotamer_group</span> <span class="o">=</span> \
         <span class="n">_GetRotamerGroups</span><span class="p">(</span><span class="n">prot</span><span class="o">.</span><span class="n">residues</span><span class="p">,</span> <span class="n">rotamer_ids</span><span class="p">,</span> <span class="n">incomplete_sidechains</span><span class="p">,</span>
                           <span class="n">rotamer_library</span><span class="p">,</span> <span class="n">rotamer_constructor</span><span class="p">,</span> <span class="n">phi_angles</span><span class="p">,</span>
                           <span class="n">psi_angles</span><span class="p">,</span> <span class="n">use_frm</span><span class="p">,</span> <span class="n">bbdep</span><span class="p">,</span> <span class="n">frame_residues</span><span class="p">)</span>
 
-    <span class="c"># set up graph and solve to get best rotamers</span>
+    <span class="c1"># set up graph and solve to get best rotamers</span>
     <span class="k">if</span> <span class="n">use_frm</span><span class="p">:</span>
         <span class="n">graph</span> <span class="o">=</span> <span class="n">sidechain</span><span class="o">.</span><span class="n">RotamerGraph</span><span class="o">.</span><span class="n">CreateFromFRMList</span><span class="p">(</span><span class="n">rotamer_groups</span><span class="p">)</span>
     <span class="k">else</span><span class="p">:</span>
@@ -557,7 +549,7 @@
             <span class="n">rotamers_to_optimize</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">rot_group</span><span class="p">[</span><span class="n">sol</span><span class="p">])</span>
         <span class="n">sidechain</span><span class="o">.</span><span class="n">SubrotamerOptimizer</span><span class="p">(</span><span class="n">rotamers_to_optimize</span><span class="p">)</span>
 
-    <span class="c"># update structure</span>
+    <span class="c1"># update structure</span>
     <span class="k">for</span> <span class="n">i</span><span class="p">,</span> <span class="n">rot_group</span><span class="p">,</span> <span class="n">sol</span> <span class="ow">in</span> <span class="nb">zip</span><span class="p">(</span><span class="n">residues_with_rotamer_group</span><span class="p">,</span> <span class="n">rotamer_groups</span><span class="p">,</span>
                                  <span class="n">solution</span><span class="p">):</span>
         <span class="k">try</span><span class="p">:</span>
@@ -565,11 +557,11 @@
             <span class="n">rot_group</span><span class="p">[</span><span class="n">sol</span><span class="p">]</span><span class="o">.</span><span class="n">ApplyOnResidue</span><span class="p">(</span><span class="n">res_handle</span><span class="p">,</span> <span class="n">consider_hydrogens</span><span class="o">=</span><span class="bp">False</span><span class="p">)</span>
             <span class="n">sidechain</span><span class="o">.</span><span class="n">ConnectSidechain</span><span class="p">(</span><span class="n">res_handle</span><span class="p">,</span> <span class="n">rotamer_ids</span><span class="p">[</span><span class="n">i</span><span class="p">])</span>
         <span class="k">except</span><span class="p">:</span>
-            <span class="k">print</span> <span class="s">&quot;there is a backbone atom missing... &quot;</span><span class="p">,</span> \
-                  <span class="n">res_handle</span><span class="o">.</span><span class="n">GetQualifiedName</span><span class="p">()</span>
+            <span class="k">print</span> <span class="s2">&quot;there is a backbone atom missing... &quot;</span><span class="p">,</span> \
+                  <span class="n">res_handle</span><span class="o">.</span><span class="n">GetQualifiedName</span><span class="p">()</span></div>
 
-<span class="c"># these methods will be exported into module</span></div>
-<span class="n">__all__</span> <span class="o">=</span> <span class="p">(</span><span class="s">&#39;ReconstructSidechains&#39;</span><span class="p">,)</span>
+<span class="c1"># these methods will be exported into module</span>
+<span class="n">__all__</span> <span class="o">=</span> <span class="p">(</span><span class="s1">&#39;ReconstructSidechains&#39;</span><span class="p">,)</span>
 </pre></div>
 
           </div>
@@ -595,9 +587,6 @@
       <input type="hidden" name="check_keywords" value="yes" />
       <input type="hidden" name="area" value="default" />
     </form>
-    <p class="searchtip" style="font-size: 90%">
-    Enter search terms or a module, class or function name.
-    </p>
 </div>
 <script type="text/javascript">$('#searchbox').show(0);</script>
         </div>
@@ -605,11 +594,11 @@
       <div class="clearer"></div>
     </div>
     <div class="footer">
-      &copy;2017, ProMod3 authors.
+      &copy;2018, ProMod3 authors.
       
       |
-      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a>
-      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.6</a>
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.4.1</a>
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
       
     </div>
 
diff --git a/doc/html/_modules/promod3/modelling/_ring_punches.html b/doc/html/_modules/promod3/modelling/_ring_punches.html
index 5d01cf28297385b05f35c93061be5b2e7b6ec8ce..a443928984846cc8360ea5a3b7339d0c45757d85 100644
--- a/doc/html/_modules/promod3/modelling/_ring_punches.html
+++ b/doc/html/_modules/promod3/modelling/_ring_punches.html
@@ -6,7 +6,7 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
-    <title>promod3.modelling._ring_punches &mdash; ProMod3 1.1.0 documentation</title>
+    <title>promod3.modelling._ring_punches &mdash; ProMod3 1.2.0 documentation</title>
     
     <link rel="stylesheet" href="../../../_static/alabaster.css" type="text/css" />
     <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
@@ -14,7 +14,7 @@
     <script type="text/javascript">
       var DOCUMENTATION_OPTIONS = {
         URL_ROOT:    '../../../',
-        VERSION:     '1.1.0',
+        VERSION:     '1.2.0',
         COLLAPSE_INDEX: false,
         FILE_SUFFIX: '.html',
         HAS_SOURCE:  true
@@ -23,14 +23,16 @@
     <script type="text/javascript" src="../../../_static/jquery.js"></script>
     <script type="text/javascript" src="../../../_static/underscore.js"></script>
     <script type="text/javascript" src="../../../_static/doctools.js"></script>
-    <link rel="top" title="ProMod3 1.1.0 documentation" href="../../../index.html" />
+    <link rel="top" title="ProMod3 1.2.0 documentation" href="../../../index.html" />
     <link rel="up" title="promod3" href="../../promod3.html" />
    
+  <link rel="stylesheet" href="../../../_static/custom.css" type="text/css" />
   
-  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
 
   </head>
-  <body role="document">  
+  <body role="document">
+  
 
     <div class="document">
       <div class="documentwrapper">
@@ -38,7 +40,7 @@
           <div class="body" role="main">
             
   <h1>Source code for promod3.modelling._ring_punches</h1><div class="highlight"><pre>
-<span class="sd">&#39;&#39;&#39;Helper functions to deal with ring punchings.&#39;&#39;&#39;</span>
+<span></span><span class="sd">&#39;&#39;&#39;Helper functions to deal with ring punchings.&#39;&#39;&#39;</span>
 <span class="kn">import</span> <span class="nn">ost</span>
 <span class="kn">from</span> <span class="nn">ost</span> <span class="kn">import</span> <span class="n">geom</span>
 <span class="kn">from</span> <span class="nn">promod3</span> <span class="kn">import</span> <span class="n">core</span>
@@ -47,8 +49,8 @@
 
 <span class="k">def</span> <span class="nf">_AddRing</span><span class="p">(</span><span class="n">rings</span><span class="p">,</span> <span class="n">res</span><span class="p">,</span> <span class="n">atom_names</span><span class="p">):</span>
     <span class="sd">&#39;&#39;&#39;Try to add ring for given atoms in residue res to rings.&#39;&#39;&#39;</span>
-    <span class="n">prof</span> <span class="o">=</span> <span class="n">core</span><span class="o">.</span><span class="n">StaticRuntimeProfiler</span><span class="o">.</span><span class="n">StartScoped</span><span class="p">(</span><span class="s">&quot;ring_punches::_AddRing&quot;</span><span class="p">)</span>
-    <span class="c"># get exisiting atom positions</span>
+    <span class="n">prof</span> <span class="o">=</span> <span class="n">core</span><span class="o">.</span><span class="n">StaticRuntimeProfiler</span><span class="o">.</span><span class="n">StartScoped</span><span class="p">(</span><span class="s2">&quot;ring_punches::_AddRing&quot;</span><span class="p">)</span>
+    <span class="c1"># get exisiting atom positions</span>
     <span class="n">N</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="n">atom_names</span><span class="p">)</span>
     <span class="k">assert</span><span class="p">(</span><span class="n">N</span> <span class="o">&gt;=</span> <span class="mi">3</span><span class="p">)</span>
     <span class="n">pos</span> <span class="o">=</span> <span class="nb">list</span><span class="p">()</span>
@@ -59,34 +61,34 @@
             <span class="n">pos</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">a</span><span class="o">.</span><span class="n">GetPos</span><span class="p">())</span>
             <span class="n">center</span> <span class="o">+=</span> <span class="n">a</span><span class="o">.</span><span class="n">GetPos</span><span class="p">()</span>
 
-    <span class="c"># all good?</span>
+    <span class="c1"># all good?</span>
     <span class="n">allgood</span> <span class="o">=</span> <span class="bp">False</span>
     <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">pos</span><span class="p">)</span> <span class="o">==</span> <span class="n">N</span><span class="p">:</span>
-        <span class="c"># all the ring there -&gt; good</span>
+        <span class="c1"># all the ring there -&gt; good</span>
         <span class="n">center</span> <span class="o">=</span> <span class="n">center</span><span class="o">/</span><span class="n">N</span>
         <span class="n">plane</span> <span class="o">=</span> <span class="n">geom</span><span class="o">.</span><span class="n">Plane</span><span class="p">(</span><span class="n">pos</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">pos</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="n">center</span><span class="p">)</span>
         <span class="n">allgood</span> <span class="o">=</span> <span class="bp">True</span>
-    <span class="k">elif</span> <span class="n">res</span><span class="o">.</span><span class="n">one_letter_code</span> <span class="o">==</span> <span class="s">&#39;P&#39;</span> <span class="ow">and</span> <span class="nb">len</span><span class="p">(</span><span class="n">pos</span><span class="p">)</span> <span class="o">==</span> <span class="mi">3</span><span class="p">:</span>
-        <span class="c"># incomplete proline: 3 BB-pos there</span>
-        <span class="c"># get ring-plane from 3 pos</span>
+    <span class="k">elif</span> <span class="n">res</span><span class="o">.</span><span class="n">one_letter_code</span> <span class="o">==</span> <span class="s1">&#39;P&#39;</span> <span class="ow">and</span> <span class="nb">len</span><span class="p">(</span><span class="n">pos</span><span class="p">)</span> <span class="o">==</span> <span class="mi">3</span><span class="p">:</span>
+        <span class="c1"># incomplete proline: 3 BB-pos there</span>
+        <span class="c1"># get ring-plane from 3 pos</span>
         <span class="n">plane</span> <span class="o">=</span> <span class="n">geom</span><span class="o">.</span><span class="n">Plane</span><span class="p">(</span><span class="n">pos</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">pos</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="n">pos</span><span class="p">[</span><span class="mi">2</span><span class="p">])</span>
-        <span class="c"># fit circle in plane through 3 points:</span>
-        <span class="c"># - build 2 planes normal to ring-plane and vector connecting 2 points</span>
-        <span class="c"># - intersect 2 planes and resulting line with ring-plane  -&gt; DONE</span>
+        <span class="c1"># fit circle in plane through 3 points:</span>
+        <span class="c1"># - build 2 planes normal to ring-plane and vector connecting 2 points</span>
+        <span class="c1"># - intersect 2 planes and resulting line with ring-plane  -&gt; DONE</span>
         <span class="n">plane1</span> <span class="o">=</span> <span class="n">geom</span><span class="o">.</span><span class="n">Plane</span><span class="p">((</span><span class="n">pos</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">+</span> <span class="n">pos</span><span class="p">[</span><span class="mi">1</span><span class="p">])</span><span class="o">/</span><span class="mi">2</span><span class="p">,</span> <span class="n">pos</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">-</span> <span class="n">pos</span><span class="p">[</span><span class="mi">1</span><span class="p">])</span>
         <span class="n">plane2</span> <span class="o">=</span> <span class="n">geom</span><span class="o">.</span><span class="n">Plane</span><span class="p">((</span><span class="n">pos</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="o">+</span> <span class="n">pos</span><span class="p">[</span><span class="mi">2</span><span class="p">])</span><span class="o">/</span><span class="mi">2</span><span class="p">,</span> <span class="n">pos</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="o">-</span> <span class="n">pos</span><span class="p">[</span><span class="mi">2</span><span class="p">])</span>
         <span class="n">i_line</span> <span class="o">=</span> <span class="n">geom</span><span class="o">.</span><span class="n">IntersectionLine</span><span class="p">(</span><span class="n">plane1</span><span class="p">,</span> <span class="n">plane2</span><span class="p">)</span>
         <span class="n">center</span> <span class="o">=</span> <span class="n">geom</span><span class="o">.</span><span class="n">IntersectionPoint</span><span class="p">(</span><span class="n">i_line</span><span class="p">,</span> <span class="n">plane</span><span class="p">)</span>
         <span class="n">allgood</span> <span class="o">=</span> <span class="bp">True</span>
     
-    <span class="c"># add ring</span>
+    <span class="c1"># add ring</span>
     <span class="k">if</span> <span class="n">allgood</span><span class="p">:</span>
-        <span class="c"># get ring radius</span>
+        <span class="c1"># get ring radius</span>
         <span class="n">radius</span> <span class="o">=</span> <span class="mi">0</span>
         <span class="k">for</span> <span class="n">p</span> <span class="ow">in</span> <span class="n">pos</span><span class="p">:</span>
             <span class="n">radius</span> <span class="o">=</span> <span class="nb">max</span><span class="p">(</span><span class="n">radius</span><span class="p">,</span> <span class="n">geom</span><span class="o">.</span><span class="n">Length</span><span class="p">(</span><span class="n">p</span> <span class="o">-</span> <span class="n">center</span><span class="p">))</span>
-        <span class="c"># append to list</span>
-        <span class="n">Ring</span> <span class="o">=</span> <span class="n">namedtuple</span><span class="p">(</span><span class="s">&#39;Ring&#39;</span><span class="p">,</span> <span class="s">&#39;center plane radius residue&#39;</span><span class="p">)</span>
+        <span class="c1"># append to list</span>
+        <span class="n">Ring</span> <span class="o">=</span> <span class="n">namedtuple</span><span class="p">(</span><span class="s1">&#39;Ring&#39;</span><span class="p">,</span> <span class="s1">&#39;center plane radius residue&#39;</span><span class="p">)</span>
         <span class="n">rings</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">Ring</span><span class="p">(</span><span class="n">center</span><span class="p">,</span> <span class="n">plane</span><span class="p">,</span> <span class="n">radius</span><span class="p">,</span> <span class="n">res</span><span class="o">.</span><span class="n">handle</span><span class="p">))</span>
 
 <span class="k">def</span> <span class="nf">_IgnoreAtom</span><span class="p">(</span><span class="n">ring</span><span class="p">,</span> <span class="n">atom</span><span class="p">):</span>
@@ -97,22 +99,22 @@
     <span class="sd">&#39;&#39;&#39;Check all bonds of atom for punches through ring.</span>
 <span class="sd">    Atom is ignored if it&#39;s in ring-residue or direct neighbors.</span>
 <span class="sd">    Return true if punch found.&#39;&#39;&#39;</span>
-    <span class="c"># check this atom (can be view or handle!)</span>
+    <span class="c1"># check this atom (can be view or handle!)</span>
     <span class="n">a1</span> <span class="o">=</span> <span class="n">atom</span><span class="o">.</span><span class="n">handle</span>
     <span class="k">if</span> <span class="n">_IgnoreAtom</span><span class="p">(</span><span class="n">ring</span><span class="p">,</span> <span class="n">a1</span><span class="p">):</span>
         <span class="k">return</span> <span class="bp">False</span>
     <span class="n">p1</span> <span class="o">=</span> <span class="n">a1</span><span class="o">.</span><span class="n">GetPos</span><span class="p">()</span>
     <span class="n">d1</span> <span class="o">=</span> <span class="n">geom</span><span class="o">.</span><span class="n">Dot</span><span class="p">(</span><span class="n">p1</span> <span class="o">-</span> <span class="n">ring</span><span class="o">.</span><span class="n">center</span><span class="p">,</span> <span class="n">ring</span><span class="o">.</span><span class="n">plane</span><span class="o">.</span><span class="n">normal</span><span class="p">)</span>
-    <span class="c"># check all bonded partners</span>
+    <span class="c1"># check all bonded partners</span>
     <span class="k">for</span> <span class="n">a_other</span> <span class="ow">in</span> <span class="n">atom</span><span class="o">.</span><span class="n">GetBondPartners</span><span class="p">():</span>
         <span class="n">a2</span> <span class="o">=</span> <span class="n">a_other</span><span class="o">.</span><span class="n">handle</span>
         <span class="k">if</span> <span class="ow">not</span> <span class="n">a_other</span><span class="o">.</span><span class="n">IsValid</span><span class="p">()</span> <span class="ow">or</span> <span class="n">_IgnoreAtom</span><span class="p">(</span><span class="n">ring</span><span class="p">,</span> <span class="n">a2</span><span class="p">):</span>
             <span class="k">continue</span>
-        <span class="c"># two bonded atoms on diff. sides of the plane?</span>
+        <span class="c1"># two bonded atoms on diff. sides of the plane?</span>
         <span class="n">p2</span> <span class="o">=</span> <span class="n">a2</span><span class="o">.</span><span class="n">GetPos</span><span class="p">()</span>
         <span class="n">d2</span> <span class="o">=</span> <span class="n">geom</span><span class="o">.</span><span class="n">Dot</span><span class="p">(</span><span class="n">p2</span> <span class="o">-</span> <span class="n">ring</span><span class="o">.</span><span class="n">center</span><span class="p">,</span> <span class="n">ring</span><span class="o">.</span><span class="n">plane</span><span class="o">.</span><span class="n">normal</span><span class="p">)</span>
         <span class="k">if</span> <span class="n">d1</span><span class="o">*</span><span class="n">d2</span> <span class="o">&lt;</span> <span class="mi">0</span><span class="p">:</span>
-            <span class="c"># get intersect</span>
+            <span class="c1"># get intersect</span>
             <span class="n">line</span> <span class="o">=</span> <span class="n">geom</span><span class="o">.</span><span class="n">Line3</span><span class="p">(</span><span class="n">p1</span><span class="p">,</span> <span class="n">p2</span><span class="p">)</span>
             <span class="n">pi</span> <span class="o">=</span> <span class="n">geom</span><span class="o">.</span><span class="n">IntersectionPoint</span><span class="p">(</span><span class="n">line</span><span class="p">,</span> <span class="n">ring</span><span class="o">.</span><span class="n">plane</span><span class="p">)</span>
             <span class="k">if</span> <span class="n">geom</span><span class="o">.</span><span class="n">Length</span><span class="p">(</span><span class="n">pi</span> <span class="o">-</span> <span class="n">ring</span><span class="o">.</span><span class="n">center</span><span class="p">)</span> <span class="o">&lt;</span> <span class="n">ring</span><span class="o">.</span><span class="n">radius</span><span class="p">:</span>
@@ -134,21 +136,21 @@
 <span class="sd">             radius (:class:`float`),</span>
 <span class="sd">             residue (:class:`~ost.mol.ResidueHandle`).</span>
 <span class="sd">    &#39;&#39;&#39;</span>
-    <span class="n">prof_name</span> <span class="o">=</span> <span class="s">&#39;ring_punches::GetRings&#39;</span>
+    <span class="n">prof_name</span> <span class="o">=</span> <span class="s1">&#39;ring_punches::GetRings&#39;</span>
     <span class="n">prof</span> <span class="o">=</span> <span class="n">core</span><span class="o">.</span><span class="n">StaticRuntimeProfiler</span><span class="o">.</span><span class="n">StartScoped</span><span class="p">(</span><span class="n">prof_name</span><span class="p">)</span>
     <span class="n">rings</span> <span class="o">=</span> <span class="nb">list</span><span class="p">()</span>
     <span class="k">for</span> <span class="n">r</span> <span class="ow">in</span> <span class="n">ent</span><span class="o">.</span><span class="n">residues</span><span class="p">:</span>
-        <span class="k">if</span> <span class="n">r</span><span class="o">.</span><span class="n">one_letter_code</span> <span class="ow">in</span> <span class="s">&#39;YF&#39;</span><span class="p">:</span>
-            <span class="n">_AddRing</span><span class="p">(</span><span class="n">rings</span><span class="p">,</span> <span class="n">r</span><span class="p">,</span> <span class="p">[</span><span class="s">&quot;CG&quot;</span><span class="p">,</span> <span class="s">&quot;CD1&quot;</span><span class="p">,</span> <span class="s">&quot;CD2&quot;</span><span class="p">,</span> <span class="s">&quot;CE1&quot;</span><span class="p">,</span> <span class="s">&quot;CE2&quot;</span><span class="p">,</span> <span class="s">&quot;CZ&quot;</span><span class="p">])</span>
-        <span class="k">elif</span> <span class="n">r</span><span class="o">.</span><span class="n">one_letter_code</span> <span class="o">==</span> <span class="s">&#39;W&#39;</span><span class="p">:</span>
-            <span class="n">_AddRing</span><span class="p">(</span><span class="n">rings</span><span class="p">,</span> <span class="n">r</span><span class="p">,</span> <span class="p">[</span><span class="s">&quot;CG&quot;</span><span class="p">,</span> <span class="s">&quot;CD1&quot;</span><span class="p">,</span> <span class="s">&quot;NE1&quot;</span><span class="p">,</span> <span class="s">&quot;CD2&quot;</span><span class="p">,</span> <span class="s">&quot;CE2&quot;</span><span class="p">])</span>
-            <span class="n">_AddRing</span><span class="p">(</span><span class="n">rings</span><span class="p">,</span> <span class="n">r</span><span class="p">,</span> <span class="p">[</span><span class="s">&quot;CD2&quot;</span><span class="p">,</span> <span class="s">&quot;CE2&quot;</span><span class="p">,</span> <span class="s">&quot;CE3&quot;</span><span class="p">,</span> <span class="s">&quot;CZ2&quot;</span><span class="p">,</span> <span class="s">&quot;CZ3&quot;</span><span class="p">,</span> <span class="s">&quot;CH2&quot;</span><span class="p">])</span>
-        <span class="k">elif</span> <span class="n">r</span><span class="o">.</span><span class="n">one_letter_code</span> <span class="o">==</span> <span class="s">&#39;H&#39;</span><span class="p">:</span>
-            <span class="n">_AddRing</span><span class="p">(</span><span class="n">rings</span><span class="p">,</span> <span class="n">r</span><span class="p">,</span> <span class="p">[</span><span class="s">&quot;CG&quot;</span><span class="p">,</span> <span class="s">&quot;CD2&quot;</span><span class="p">,</span> <span class="s">&quot;ND1&quot;</span><span class="p">,</span> <span class="s">&quot;CE1&quot;</span><span class="p">,</span> <span class="s">&quot;NE2&quot;</span><span class="p">])</span>
-        <span class="k">elif</span> <span class="n">r</span><span class="o">.</span><span class="n">one_letter_code</span> <span class="o">==</span> <span class="s">&#39;P&#39;</span><span class="p">:</span>
-            <span class="n">_AddRing</span><span class="p">(</span><span class="n">rings</span><span class="p">,</span> <span class="n">r</span><span class="p">,</span> <span class="p">[</span><span class="s">&quot;N&quot;</span><span class="p">,</span> <span class="s">&quot;CA&quot;</span><span class="p">,</span> <span class="s">&quot;CB&quot;</span><span class="p">,</span> <span class="s">&quot;CD&quot;</span><span class="p">,</span> <span class="s">&quot;CG&quot;</span><span class="p">])</span>
-    <span class="k">return</span> <span class="n">rings</span>
-</div>
+        <span class="k">if</span> <span class="n">r</span><span class="o">.</span><span class="n">one_letter_code</span> <span class="ow">in</span> <span class="s1">&#39;YF&#39;</span><span class="p">:</span>
+            <span class="n">_AddRing</span><span class="p">(</span><span class="n">rings</span><span class="p">,</span> <span class="n">r</span><span class="p">,</span> <span class="p">[</span><span class="s2">&quot;CG&quot;</span><span class="p">,</span> <span class="s2">&quot;CD1&quot;</span><span class="p">,</span> <span class="s2">&quot;CD2&quot;</span><span class="p">,</span> <span class="s2">&quot;CE1&quot;</span><span class="p">,</span> <span class="s2">&quot;CE2&quot;</span><span class="p">,</span> <span class="s2">&quot;CZ&quot;</span><span class="p">])</span>
+        <span class="k">elif</span> <span class="n">r</span><span class="o">.</span><span class="n">one_letter_code</span> <span class="o">==</span> <span class="s1">&#39;W&#39;</span><span class="p">:</span>
+            <span class="n">_AddRing</span><span class="p">(</span><span class="n">rings</span><span class="p">,</span> <span class="n">r</span><span class="p">,</span> <span class="p">[</span><span class="s2">&quot;CG&quot;</span><span class="p">,</span> <span class="s2">&quot;CD1&quot;</span><span class="p">,</span> <span class="s2">&quot;NE1&quot;</span><span class="p">,</span> <span class="s2">&quot;CD2&quot;</span><span class="p">,</span> <span class="s2">&quot;CE2&quot;</span><span class="p">])</span>
+            <span class="n">_AddRing</span><span class="p">(</span><span class="n">rings</span><span class="p">,</span> <span class="n">r</span><span class="p">,</span> <span class="p">[</span><span class="s2">&quot;CD2&quot;</span><span class="p">,</span> <span class="s2">&quot;CE2&quot;</span><span class="p">,</span> <span class="s2">&quot;CE3&quot;</span><span class="p">,</span> <span class="s2">&quot;CZ2&quot;</span><span class="p">,</span> <span class="s2">&quot;CZ3&quot;</span><span class="p">,</span> <span class="s2">&quot;CH2&quot;</span><span class="p">])</span>
+        <span class="k">elif</span> <span class="n">r</span><span class="o">.</span><span class="n">one_letter_code</span> <span class="o">==</span> <span class="s1">&#39;H&#39;</span><span class="p">:</span>
+            <span class="n">_AddRing</span><span class="p">(</span><span class="n">rings</span><span class="p">,</span> <span class="n">r</span><span class="p">,</span> <span class="p">[</span><span class="s2">&quot;CG&quot;</span><span class="p">,</span> <span class="s2">&quot;CD2&quot;</span><span class="p">,</span> <span class="s2">&quot;ND1&quot;</span><span class="p">,</span> <span class="s2">&quot;CE1&quot;</span><span class="p">,</span> <span class="s2">&quot;NE2&quot;</span><span class="p">])</span>
+        <span class="k">elif</span> <span class="n">r</span><span class="o">.</span><span class="n">one_letter_code</span> <span class="o">==</span> <span class="s1">&#39;P&#39;</span><span class="p">:</span>
+            <span class="n">_AddRing</span><span class="p">(</span><span class="n">rings</span><span class="p">,</span> <span class="n">r</span><span class="p">,</span> <span class="p">[</span><span class="s2">&quot;N&quot;</span><span class="p">,</span> <span class="s2">&quot;CA&quot;</span><span class="p">,</span> <span class="s2">&quot;CB&quot;</span><span class="p">,</span> <span class="s2">&quot;CD&quot;</span><span class="p">,</span> <span class="s2">&quot;CG&quot;</span><span class="p">])</span>
+    <span class="k">return</span> <span class="n">rings</span></div>
+
 <div class="viewcode-block" id="GetRingPunches"><a class="viewcode-back" href="../../../modelling/model_checking.html#promod3.modelling.GetRingPunches">[docs]</a><span class="k">def</span> <span class="nf">GetRingPunches</span><span class="p">(</span><span class="n">rings</span><span class="p">,</span> <span class="n">ent</span><span class="p">):</span>
     <span class="sd">&#39;&#39;&#39;Get list of residues with rings that are punched by the given structure.</span>
 
@@ -159,20 +161,20 @@
 <span class="sd">    :return: :class:`list` of residues (:class:`~ost.mol.ResidueHandle`) which</span>
 <span class="sd">              have a punched ring.</span>
 <span class="sd">    &#39;&#39;&#39;</span>
-    <span class="n">prof_name</span> <span class="o">=</span> <span class="s">&#39;ring_punches::GetRingPunches&#39;</span>
+    <span class="n">prof_name</span> <span class="o">=</span> <span class="s1">&#39;ring_punches::GetRingPunches&#39;</span>
     <span class="n">prof</span> <span class="o">=</span> <span class="n">core</span><span class="o">.</span><span class="n">StaticRuntimeProfiler</span><span class="o">.</span><span class="n">StartScoped</span><span class="p">(</span><span class="n">prof_name</span><span class="p">)</span>
     <span class="n">ring_punches</span> <span class="o">=</span> <span class="nb">list</span><span class="p">()</span>
     <span class="k">for</span> <span class="n">ring</span> <span class="ow">in</span> <span class="n">rings</span><span class="p">:</span>
-        <span class="c"># we don&#39;t need to add residues multiple times</span>
+        <span class="c1"># we don&#39;t need to add residues multiple times</span>
         <span class="k">if</span> <span class="n">ring</span><span class="o">.</span><span class="n">residue</span> <span class="ow">in</span> <span class="n">ring_punches</span><span class="p">:</span>
             <span class="k">continue</span>
-        <span class="c"># check neighborhood (3A should be enough)</span>
+        <span class="c1"># check neighborhood (3A should be enough)</span>
         <span class="k">for</span> <span class="n">atom</span> <span class="ow">in</span> <span class="n">ent</span><span class="o">.</span><span class="n">FindWithin</span><span class="p">(</span><span class="n">ring</span><span class="o">.</span><span class="n">center</span><span class="p">,</span> <span class="mi">3</span><span class="p">):</span>
             <span class="k">if</span> <span class="n">_CheckAtomVsRing</span><span class="p">(</span><span class="n">ring</span><span class="p">,</span> <span class="n">atom</span><span class="p">):</span>
                 <span class="n">ring_punches</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">ring</span><span class="o">.</span><span class="n">residue</span><span class="p">)</span>
                 <span class="k">break</span>
-    <span class="k">return</span> <span class="n">ring_punches</span>
-</div>
+    <span class="k">return</span> <span class="n">ring_punches</span></div>
+
 <div class="viewcode-block" id="HasRingPunches"><a class="viewcode-back" href="../../../modelling/model_checking.html#promod3.modelling.HasRingPunches">[docs]</a><span class="k">def</span> <span class="nf">HasRingPunches</span><span class="p">(</span><span class="n">rings</span><span class="p">,</span> <span class="n">ent</span><span class="p">):</span>
     <span class="sd">&#39;&#39;&#39;Check if any ring is punched by the given structure.</span>
 <span class="sd">    This check is faster than using :func:`GetRingPunches`.</span>
@@ -184,15 +186,15 @@
 <span class="sd">    :return: True, iff any ring is punched</span>
 <span class="sd">    :rtype:  :class:`bool`</span>
 <span class="sd">    &#39;&#39;&#39;</span>
-    <span class="n">prof_name</span> <span class="o">=</span> <span class="s">&#39;ring_punches::HasRingPunches&#39;</span>
+    <span class="n">prof_name</span> <span class="o">=</span> <span class="s1">&#39;ring_punches::HasRingPunches&#39;</span>
     <span class="n">prof</span> <span class="o">=</span> <span class="n">core</span><span class="o">.</span><span class="n">StaticRuntimeProfiler</span><span class="o">.</span><span class="n">StartScoped</span><span class="p">(</span><span class="n">prof_name</span><span class="p">)</span>
     <span class="k">for</span> <span class="n">ring</span> <span class="ow">in</span> <span class="n">rings</span><span class="p">:</span>
-        <span class="c"># check neighborhood (3A should be enough)</span>
+        <span class="c1"># check neighborhood (3A should be enough)</span>
         <span class="k">for</span> <span class="n">atom</span> <span class="ow">in</span> <span class="n">ent</span><span class="o">.</span><span class="n">FindWithin</span><span class="p">(</span><span class="n">ring</span><span class="o">.</span><span class="n">center</span><span class="p">,</span> <span class="mi">3</span><span class="p">):</span>
             <span class="k">if</span> <span class="n">_CheckAtomVsRing</span><span class="p">(</span><span class="n">ring</span><span class="p">,</span> <span class="n">atom</span><span class="p">):</span>
                 <span class="k">return</span> <span class="bp">True</span>
-    <span class="k">return</span> <span class="bp">False</span>
-</div>
+    <span class="k">return</span> <span class="bp">False</span></div>
+
 <div class="viewcode-block" id="FilterCandidates"><a class="viewcode-back" href="../../../modelling/model_checking.html#promod3.modelling.FilterCandidates">[docs]</a><span class="k">def</span> <span class="nf">FilterCandidates</span><span class="p">(</span><span class="n">candidates</span><span class="p">,</span> <span class="n">model</span><span class="p">,</span> <span class="n">gap</span><span class="p">,</span> <span class="n">orig_indices</span><span class="o">=</span><span class="p">[]):</span>
     <span class="sd">&#39;&#39;&#39;Remove loop candidates if they cause ring punches.</span>
 
@@ -207,23 +209,23 @@
 <span class="sd">                         must have as many elements as *candidates*.</span>
 <span class="sd">    :type orig_indices:  :class:`list`</span>
 <span class="sd">    &#39;&#39;&#39;</span>
-    <span class="n">prof_name</span> <span class="o">=</span> <span class="s">&#39;ring_punches::FilterCandidates&#39;</span>
+    <span class="n">prof_name</span> <span class="o">=</span> <span class="s1">&#39;ring_punches::FilterCandidates&#39;</span>
     <span class="n">prof</span> <span class="o">=</span> <span class="n">core</span><span class="o">.</span><span class="n">StaticRuntimeProfiler</span><span class="o">.</span><span class="n">StartScoped</span><span class="p">(</span><span class="n">prof_name</span><span class="p">)</span>
     <span class="n">start_resnum</span> <span class="o">=</span> <span class="n">gap</span><span class="o">.</span><span class="n">before</span><span class="o">.</span><span class="n">GetNumber</span><span class="p">()</span>
     <span class="n">chain_idx</span> <span class="o">=</span> <span class="n">gap</span><span class="o">.</span><span class="n">GetChainIndex</span><span class="p">()</span>
-    <span class="c"># precompute rings and range of rings to replace</span>
+    <span class="c1"># precompute rings and range of rings to replace</span>
     <span class="n">chain_name</span> <span class="o">=</span> <span class="n">gap</span><span class="o">.</span><span class="n">GetChainName</span><span class="p">()</span>
     <span class="n">end_resnum</span> <span class="o">=</span> <span class="n">gap</span><span class="o">.</span><span class="n">after</span><span class="o">.</span><span class="n">GetNumber</span><span class="p">()</span>
-    <span class="n">myqueryin</span> <span class="o">=</span> <span class="s">&quot;cname=&quot;</span> <span class="o">+</span> <span class="n">chain_name</span> <span class="o">+</span> <span class="s">&quot; and rnum=&quot;</span> <span class="o">+</span>\
-                <span class="nb">str</span><span class="p">(</span><span class="n">start_resnum</span><span class="p">)</span> <span class="o">+</span> <span class="s">&quot;:&quot;</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">end_resnum</span><span class="p">)</span>
-    <span class="n">myqueryout</span> <span class="o">=</span> <span class="s">&quot;cname!=&quot;</span> <span class="o">+</span> <span class="n">chain_name</span> <span class="o">+</span> <span class="s">&quot; or rnum&lt;&quot;</span> <span class="o">+</span>\
-                 <span class="nb">str</span><span class="p">(</span><span class="n">start_resnum</span><span class="p">)</span> <span class="o">+</span> <span class="s">&quot; or rnum&gt;&quot;</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">end_resnum</span><span class="p">)</span>
+    <span class="n">myqueryin</span> <span class="o">=</span> <span class="s2">&quot;cname=&quot;</span> <span class="o">+</span> <span class="n">chain_name</span> <span class="o">+</span> <span class="s2">&quot; and rnum=&quot;</span> <span class="o">+</span>\
+                <span class="nb">str</span><span class="p">(</span><span class="n">start_resnum</span><span class="p">)</span> <span class="o">+</span> <span class="s2">&quot;:&quot;</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">end_resnum</span><span class="p">)</span>
+    <span class="n">myqueryout</span> <span class="o">=</span> <span class="s2">&quot;cname!=&quot;</span> <span class="o">+</span> <span class="n">chain_name</span> <span class="o">+</span> <span class="s2">&quot; or rnum&lt;&quot;</span> <span class="o">+</span>\
+                 <span class="nb">str</span><span class="p">(</span><span class="n">start_resnum</span><span class="p">)</span> <span class="o">+</span> <span class="s2">&quot; or rnum&gt;&quot;</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">end_resnum</span><span class="p">)</span>
     <span class="n">model_out</span> <span class="o">=</span> <span class="n">model</span><span class="o">.</span><span class="n">Select</span><span class="p">(</span><span class="n">myqueryout</span><span class="p">)</span>
     <span class="n">rings_out</span> <span class="o">=</span> <span class="n">GetRings</span><span class="p">(</span><span class="n">model_out</span><span class="p">)</span>
-    <span class="c"># filter loop candidates</span>
+    <span class="c1"># filter loop candidates</span>
     <span class="n">lc_idx</span> <span class="o">=</span> <span class="mi">0</span>
     <span class="k">while</span> <span class="n">lc_idx</span> <span class="o">&lt;</span> <span class="nb">len</span><span class="p">(</span><span class="n">candidates</span><span class="p">):</span>
-        <span class="c"># get loop-entity for checks</span>
+        <span class="c1"># get loop-entity for checks</span>
         <span class="n">new_loop</span> <span class="o">=</span> <span class="n">candidates</span><span class="p">[</span><span class="n">lc_idx</span><span class="p">]</span><span class="o">.</span><span class="n">ToEntity</span><span class="p">()</span>
         <span class="n">rings_new</span> <span class="o">=</span> <span class="n">GetRings</span><span class="p">(</span><span class="n">new_loop</span><span class="p">)</span>
         <span class="n">check_punches</span> <span class="o">=</span> <span class="n">HasRingPunches</span><span class="p">(</span><span class="n">rings_out</span><span class="o">+</span><span class="n">rings_new</span><span class="p">,</span> <span class="n">new_loop</span><span class="p">)</span> <span class="ow">or</span>\
@@ -233,32 +235,32 @@
             <span class="k">if</span> <span class="n">orig_indices</span><span class="p">:</span>
                 <span class="k">del</span> <span class="n">orig_indices</span><span class="p">[</span><span class="n">lc_idx</span><span class="p">]</span>
         <span class="k">else</span><span class="p">:</span>
-            <span class="n">lc_idx</span> <span class="o">+=</span> <span class="mi">1</span>
-</div>
+            <span class="n">lc_idx</span> <span class="o">+=</span> <span class="mi">1</span></div>
+
 <div class="viewcode-block" id="FilterCandidatesWithSC"><a class="viewcode-back" href="../../../modelling/model_checking.html#promod3.modelling.FilterCandidatesWithSC">[docs]</a><span class="k">def</span> <span class="nf">FilterCandidatesWithSC</span><span class="p">(</span><span class="n">candidates</span><span class="p">,</span> <span class="n">model</span><span class="p">,</span> <span class="n">gap</span><span class="p">,</span> <span class="n">orig_indices</span><span class="o">=</span><span class="p">[]):</span>
     <span class="sd">&#39;&#39;&#39;Remove loop candidates if they (with sidechain) cause ring punches.</span>
 <span class="sd">    See :func:`FilterCandidates`.</span>
 <span class="sd">    &#39;&#39;&#39;</span>
-    <span class="n">prof_name</span> <span class="o">=</span> <span class="s">&#39;ring_punches::FilterCandidatesWithSC&#39;</span>
+    <span class="n">prof_name</span> <span class="o">=</span> <span class="s1">&#39;ring_punches::FilterCandidatesWithSC&#39;</span>
     <span class="n">prof</span> <span class="o">=</span> <span class="n">core</span><span class="o">.</span><span class="n">StaticRuntimeProfiler</span><span class="o">.</span><span class="n">StartScoped</span><span class="p">(</span><span class="n">prof_name</span><span class="p">)</span>
     <span class="n">start_resnum</span> <span class="o">=</span> <span class="n">gap</span><span class="o">.</span><span class="n">before</span><span class="o">.</span><span class="n">GetNumber</span><span class="p">()</span>
     <span class="n">chain_idx</span> <span class="o">=</span> <span class="n">gap</span><span class="o">.</span><span class="n">GetChainIndex</span><span class="p">()</span>
     <span class="n">cur_model</span> <span class="o">=</span> <span class="n">model</span><span class="o">.</span><span class="n">Copy</span><span class="p">()</span>
-    <span class="c"># precompute rings and range of rings to replace</span>
+    <span class="c1"># precompute rings and range of rings to replace</span>
     <span class="n">chain_name</span> <span class="o">=</span> <span class="n">gap</span><span class="o">.</span><span class="n">GetChainName</span><span class="p">()</span>
     <span class="n">end_resnum</span> <span class="o">=</span> <span class="n">gap</span><span class="o">.</span><span class="n">after</span><span class="o">.</span><span class="n">GetNumber</span><span class="p">()</span>
-    <span class="n">myqueryin</span> <span class="o">=</span> <span class="s">&quot;cname=&quot;</span> <span class="o">+</span> <span class="n">chain_name</span> <span class="o">+</span> <span class="s">&quot; and rnum=&quot;</span> <span class="o">+</span>\
-                <span class="nb">str</span><span class="p">(</span><span class="n">start_resnum</span><span class="p">)</span> <span class="o">+</span> <span class="s">&quot;:&quot;</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">end_resnum</span><span class="p">)</span>
-    <span class="n">myqueryout</span> <span class="o">=</span> <span class="s">&quot;cname!=&quot;</span> <span class="o">+</span> <span class="n">chain_name</span> <span class="o">+</span> <span class="s">&quot; or rnum&lt;&quot;</span> <span class="o">+</span>\
-                 <span class="nb">str</span><span class="p">(</span><span class="n">start_resnum</span><span class="p">)</span> <span class="o">+</span> <span class="s">&quot; or rnum&gt;&quot;</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">end_resnum</span><span class="p">)</span>
+    <span class="n">myqueryin</span> <span class="o">=</span> <span class="s2">&quot;cname=&quot;</span> <span class="o">+</span> <span class="n">chain_name</span> <span class="o">+</span> <span class="s2">&quot; and rnum=&quot;</span> <span class="o">+</span>\
+                <span class="nb">str</span><span class="p">(</span><span class="n">start_resnum</span><span class="p">)</span> <span class="o">+</span> <span class="s2">&quot;:&quot;</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">end_resnum</span><span class="p">)</span>
+    <span class="n">myqueryout</span> <span class="o">=</span> <span class="s2">&quot;cname!=&quot;</span> <span class="o">+</span> <span class="n">chain_name</span> <span class="o">+</span> <span class="s2">&quot; or rnum&lt;&quot;</span> <span class="o">+</span>\
+                 <span class="nb">str</span><span class="p">(</span><span class="n">start_resnum</span><span class="p">)</span> <span class="o">+</span> <span class="s2">&quot; or rnum&gt;&quot;</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">end_resnum</span><span class="p">)</span>
     <span class="n">rings_out</span> <span class="o">=</span> <span class="n">GetRings</span><span class="p">(</span><span class="n">cur_model</span><span class="o">.</span><span class="n">Select</span><span class="p">(</span><span class="n">myqueryout</span><span class="p">))</span>
-    <span class="c"># filter loop candidates</span>
+    <span class="c1"># filter loop candidates</span>
     <span class="n">lc_idx</span> <span class="o">=</span> <span class="mi">0</span>
     <span class="k">while</span> <span class="n">lc_idx</span> <span class="o">&lt;</span> <span class="nb">len</span><span class="p">(</span><span class="n">candidates</span><span class="p">):</span>
-        <span class="c"># insert loop into model-copy</span>
+        <span class="c1"># insert loop into model-copy</span>
         <span class="n">bb_list</span> <span class="o">=</span> <span class="n">candidates</span><span class="p">[</span><span class="n">lc_idx</span><span class="p">]</span>
         <span class="n">bb_list</span><span class="o">.</span><span class="n">InsertInto</span><span class="p">(</span><span class="n">cur_model</span><span class="o">.</span><span class="n">chains</span><span class="p">[</span><span class="n">chain_idx</span><span class="p">],</span> <span class="n">start_resnum</span><span class="p">)</span>
-        <span class="c"># add sidechains and check for clashes</span>
+        <span class="c1"># add sidechains and check for clashes</span>
         <span class="n">ReconstructSidechains</span><span class="p">(</span><span class="n">cur_model</span><span class="p">,</span> <span class="n">keep_sidechains</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>
         <span class="n">models_new</span> <span class="o">=</span> <span class="n">cur_model</span><span class="o">.</span><span class="n">Select</span><span class="p">(</span><span class="n">myqueryin</span><span class="p">)</span>
         <span class="n">rings_new</span> <span class="o">=</span> <span class="n">GetRings</span><span class="p">(</span><span class="n">models_new</span><span class="p">)</span>
@@ -269,11 +271,11 @@
             <span class="k">if</span> <span class="n">orig_indices</span><span class="p">:</span>
                 <span class="k">del</span> <span class="n">orig_indices</span><span class="p">[</span><span class="n">lc_idx</span><span class="p">]</span>
         <span class="k">else</span><span class="p">:</span>
-            <span class="n">lc_idx</span> <span class="o">+=</span> <span class="mi">1</span>
+            <span class="n">lc_idx</span> <span class="o">+=</span> <span class="mi">1</span></div>
 
-<span class="c"># these methods will be exported into module</span></div>
-<span class="n">__all__</span> <span class="o">=</span> <span class="p">(</span><span class="s">&#39;GetRings&#39;</span><span class="p">,</span> <span class="s">&#39;GetRingPunches&#39;</span><span class="p">,</span> <span class="s">&#39;HasRingPunches&#39;</span><span class="p">,</span> <span class="s">&#39;FilterCandidates&#39;</span><span class="p">,</span>
-           <span class="s">&#39;FilterCandidatesWithSC&#39;</span><span class="p">)</span>
+<span class="c1"># these methods will be exported into module</span>
+<span class="n">__all__</span> <span class="o">=</span> <span class="p">(</span><span class="s1">&#39;GetRings&#39;</span><span class="p">,</span> <span class="s1">&#39;GetRingPunches&#39;</span><span class="p">,</span> <span class="s1">&#39;HasRingPunches&#39;</span><span class="p">,</span> <span class="s1">&#39;FilterCandidates&#39;</span><span class="p">,</span>
+           <span class="s1">&#39;FilterCandidatesWithSC&#39;</span><span class="p">)</span>
 </pre></div>
 
           </div>
@@ -299,9 +301,6 @@
       <input type="hidden" name="check_keywords" value="yes" />
       <input type="hidden" name="area" value="default" />
     </form>
-    <p class="searchtip" style="font-size: 90%">
-    Enter search terms or a module, class or function name.
-    </p>
 </div>
 <script type="text/javascript">$('#searchbox').show(0);</script>
         </div>
@@ -309,11 +308,11 @@
       <div class="clearer"></div>
     </div>
     <div class="footer">
-      &copy;2017, ProMod3 authors.
+      &copy;2018, ProMod3 authors.
       
       |
-      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a>
-      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.6</a>
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.4.1</a>
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
       
     </div>
 
diff --git a/doc/html/_modules/test_actions.html b/doc/html/_modules/test_actions.html
index e28652fc4fab9827bcdfea9a5aab29b6a7725292..f9739b382679bc7bfe2aafe0e47bace71563dd75 100644
--- a/doc/html/_modules/test_actions.html
+++ b/doc/html/_modules/test_actions.html
@@ -6,7 +6,7 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
-    <title>test_actions &mdash; ProMod3 1.1.0 documentation</title>
+    <title>test_actions &mdash; ProMod3 1.2.0 documentation</title>
     
     <link rel="stylesheet" href="../_static/alabaster.css" type="text/css" />
     <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
@@ -14,7 +14,7 @@
     <script type="text/javascript">
       var DOCUMENTATION_OPTIONS = {
         URL_ROOT:    '../',
-        VERSION:     '1.1.0',
+        VERSION:     '1.2.0',
         COLLAPSE_INDEX: false,
         FILE_SUFFIX: '.html',
         HAS_SOURCE:  true
@@ -23,14 +23,16 @@
     <script type="text/javascript" src="../_static/jquery.js"></script>
     <script type="text/javascript" src="../_static/underscore.js"></script>
     <script type="text/javascript" src="../_static/doctools.js"></script>
-    <link rel="top" title="ProMod3 1.1.0 documentation" href="../index.html" />
+    <link rel="top" title="ProMod3 1.2.0 documentation" href="../index.html" />
     <link rel="up" title="Module code" href="index.html" />
    
+  <link rel="stylesheet" href="../_static/custom.css" type="text/css" />
   
-  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
 
   </head>
-  <body role="document">  
+  <body role="document">
+  
 
     <div class="document">
       <div class="documentwrapper">
@@ -38,7 +40,7 @@
           <div class="body" role="main">
             
   <h1>Source code for test_actions</h1><div class="highlight"><pre>
-<span class="sd">&quot;&quot;&quot;</span>
+<span></span><span class="sd">&quot;&quot;&quot;</span>
 <span class="sd">unittest.TestCase class providing common functionality for testing actions.</span>
 <span class="sd">&quot;&quot;&quot;</span>
 <span class="kn">import</span> <span class="nn">unittest</span>
@@ -46,7 +48,7 @@
 <span class="kn">import</span> <span class="nn">subprocess</span>
 <span class="kn">import</span> <span class="nn">ost</span>
 
-<span class="c"># set verbosity level here, is propagated to all others</span>
+<span class="c1"># set verbosity level here, is propagated to all others</span>
 <span class="n">ost</span><span class="o">.</span><span class="n">PushVerbosityLevel</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span>
 
 <div class="viewcode-block" id="ActionTestCase"><a class="viewcode-back" href="../actions/index_dev.html#test_actions.ActionTestCase">[docs]</a><span class="k">class</span> <span class="nc">ActionTestCase</span><span class="p">(</span><span class="n">unittest</span><span class="o">.</span><span class="n">TestCase</span><span class="p">):</span>
@@ -77,11 +79,11 @@
         <span class="sd">&quot;&quot;&quot;</span>
 <span class="sd">        Convenience stuff for action testing.</span>
 <span class="sd">        &quot;&quot;&quot;</span>
-        <span class="c"># Determining the pm binary to be called. Going hard-coded is a bad</span>
-        <span class="c"># thing. But this is a unit test and we know where we are as all unit</span>
-        <span class="c"># tests are run in &quot;tests/MODULENAME&quot; within build-folder.</span>
+        <span class="c1"># Determining the pm binary to be called. Going hard-coded is a bad</span>
+        <span class="c1"># thing. But this is a unit test and we know where we are as all unit</span>
+        <span class="c1"># tests are run in &quot;tests/MODULENAME&quot; within build-folder.</span>
         <span class="n">bld_dir</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">abspath</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">dirname</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">dirname</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">getcwd</span><span class="p">())))</span>
-        <span class="bp">self</span><span class="o">.</span><span class="n">pm_bin</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">bld_dir</span><span class="p">,</span> <span class="s">&#39;stage&#39;</span><span class="p">,</span> <span class="s">&#39;bin&#39;</span><span class="p">,</span> <span class="s">&#39;pm&#39;</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">pm_bin</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">bld_dir</span><span class="p">,</span> <span class="s1">&#39;stage&#39;</span><span class="p">,</span> <span class="s1">&#39;bin&#39;</span><span class="p">,</span> <span class="s1">&#39;pm&#39;</span><span class="p">)</span>
         <span class="bp">self</span><span class="o">.</span><span class="n">pm_action</span> <span class="o">=</span> <span class="bp">None</span>
         <span class="n">unittest</span><span class="o">.</span><span class="n">TestCase</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
 
@@ -103,30 +105,30 @@
 <span class="sd">        :returns: The exit code of the action (:class:`int`).</span>
 <span class="sd">        &quot;&quot;&quot;</span>
         <span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">pm_action</span><span class="p">:</span>
-            <span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s">&quot;A &#39;pm_action&#39; attribute has to be defined by &quot;</span><span class="o">+</span>
-                               <span class="s">&quot;each subclass of &#39;test_actions.ActionTestCase&#39;&quot;</span><span class="p">)</span>
+            <span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s2">&quot;A &#39;pm_action&#39; attribute has to be defined by &quot;</span><span class="o">+</span>
+                               <span class="s2">&quot;each subclass of &#39;test_actions.ActionTestCase&#39;&quot;</span><span class="p">)</span>
 
-        <span class="c"># run the action with arguments, wait for the job to finish and capture</span>
-        <span class="c"># output</span>
+        <span class="c1"># run the action with arguments, wait for the job to finish and capture</span>
+        <span class="c1"># output</span>
         <span class="n">cmd</span> <span class="o">=</span> <span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">pm_bin</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">pm_action</span><span class="p">]</span> <span class="o">+</span> <span class="n">arguments</span>
         <span class="n">job</span> <span class="o">=</span> <span class="n">subprocess</span><span class="o">.</span><span class="n">Popen</span><span class="p">(</span><span class="n">cmd</span><span class="p">,</span>
                                <span class="n">stdout</span><span class="o">=</span><span class="n">subprocess</span><span class="o">.</span><span class="n">PIPE</span><span class="p">,</span> <span class="n">stderr</span><span class="o">=</span><span class="n">subprocess</span><span class="o">.</span><span class="n">PIPE</span><span class="p">)</span>
         <span class="n">sout</span><span class="p">,</span> <span class="n">serr</span> <span class="o">=</span> <span class="n">job</span><span class="o">.</span><span class="n">communicate</span><span class="p">()</span>
         <span class="k">if</span> <span class="n">verbose</span><span class="p">:</span>
-            <span class="n">ost</span><span class="o">.</span><span class="n">LogScript</span><span class="p">(</span><span class="s">&quot;stdout of &#39;</span><span class="si">%s</span><span class="s">&#39;&quot;</span> <span class="o">%</span> <span class="s">&#39; &#39;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">cmd</span><span class="p">))</span>
-            <span class="n">ost</span><span class="o">.</span><span class="n">LogScript</span><span class="p">(</span><span class="s">&quot;------&quot;</span><span class="p">)</span>
+            <span class="n">ost</span><span class="o">.</span><span class="n">LogScript</span><span class="p">(</span><span class="s2">&quot;stdout of &#39;</span><span class="si">%s</span><span class="s2">&#39;&quot;</span> <span class="o">%</span> <span class="s1">&#39; &#39;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">cmd</span><span class="p">))</span>
+            <span class="n">ost</span><span class="o">.</span><span class="n">LogScript</span><span class="p">(</span><span class="s2">&quot;------&quot;</span><span class="p">)</span>
             <span class="n">lines</span> <span class="o">=</span> <span class="n">sout</span><span class="o">.</span><span class="n">splitlines</span><span class="p">()</span>
             <span class="k">for</span> <span class="n">out_l</span> <span class="ow">in</span> <span class="n">lines</span><span class="p">:</span>
                 <span class="n">ost</span><span class="o">.</span><span class="n">LogScript</span><span class="p">(</span><span class="n">out_l</span><span class="p">)</span>
-            <span class="n">ost</span><span class="o">.</span><span class="n">LogScript</span><span class="p">(</span><span class="s">&quot;------&quot;</span><span class="p">)</span>
-            <span class="n">ost</span><span class="o">.</span><span class="n">LogError</span><span class="p">(</span><span class="s">&quot;stderr of &#39;</span><span class="si">%s</span><span class="s">&#39;&quot;</span> <span class="o">%</span> <span class="s">&#39; &#39;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">cmd</span><span class="p">))</span>
-            <span class="n">ost</span><span class="o">.</span><span class="n">LogError</span><span class="p">(</span><span class="s">&quot;------&quot;</span><span class="p">)</span>
+            <span class="n">ost</span><span class="o">.</span><span class="n">LogScript</span><span class="p">(</span><span class="s2">&quot;------&quot;</span><span class="p">)</span>
+            <span class="n">ost</span><span class="o">.</span><span class="n">LogError</span><span class="p">(</span><span class="s2">&quot;stderr of &#39;</span><span class="si">%s</span><span class="s2">&#39;&quot;</span> <span class="o">%</span> <span class="s1">&#39; &#39;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">cmd</span><span class="p">))</span>
+            <span class="n">ost</span><span class="o">.</span><span class="n">LogError</span><span class="p">(</span><span class="s2">&quot;------&quot;</span><span class="p">)</span>
             <span class="n">lines</span> <span class="o">=</span> <span class="n">serr</span><span class="o">.</span><span class="n">splitlines</span><span class="p">()</span>
             <span class="k">for</span> <span class="n">err_l</span> <span class="ow">in</span> <span class="n">lines</span><span class="p">:</span>
                 <span class="n">ost</span><span class="o">.</span><span class="n">LogError</span><span class="p">(</span><span class="n">err_l</span><span class="p">)</span>
-            <span class="n">ost</span><span class="o">.</span><span class="n">LogError</span><span class="p">(</span><span class="s">&quot;------&quot;</span><span class="p">)</span>
-        <span class="k">return</span> <span class="n">job</span><span class="o">.</span><span class="n">returncode</span>
-</div>
+            <span class="n">ost</span><span class="o">.</span><span class="n">LogError</span><span class="p">(</span><span class="s2">&quot;------&quot;</span><span class="p">)</span>
+        <span class="k">return</span> <span class="n">job</span><span class="o">.</span><span class="n">returncode</span></div>
+
 <div class="viewcode-block" id="ActionTestCase.RunExitStatusTest"><a class="viewcode-back" href="../actions/index_dev.html#test_actions.ActionTestCase.RunExitStatusTest">[docs]</a>    <span class="k">def</span> <span class="nf">RunExitStatusTest</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">exit_code</span><span class="p">,</span> <span class="n">arguments</span><span class="p">,</span> <span class="n">verbose</span><span class="o">=</span><span class="bp">False</span><span class="p">):</span>
         <span class="sd">&quot;&quot;&quot;</span>
 <span class="sd">        Run the action with given arguments and check the exit code.</span>
@@ -142,12 +144,12 @@
 <span class="sd">        &quot;&quot;&quot;</span>
         <span class="n">exit_code_run</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">RunAction</span><span class="p">(</span><span class="n">arguments</span><span class="p">,</span> <span class="n">verbose</span><span class="o">=</span><span class="n">verbose</span><span class="p">)</span>
         <span class="bp">self</span><span class="o">.</span><span class="n">assertEqual</span><span class="p">(</span><span class="n">exit_code</span><span class="p">,</span> <span class="n">exit_code_run</span><span class="p">,</span>
-                         <span class="n">msg</span><span class="o">=</span><span class="s">&quot;Exit code of &#39;</span><span class="si">%s</span><span class="s">&#39; &quot;</span> <span class="o">%</span> <span class="s">&#39; &#39;</span><span class="o">.</span><span class="n">join</span><span class="p">([</span><span class="bp">self</span><span class="o">.</span><span class="n">pm_bin</span><span class="p">,</span>
+                         <span class="n">msg</span><span class="o">=</span><span class="s2">&quot;Exit code of &#39;</span><span class="si">%s</span><span class="s2">&#39; &quot;</span> <span class="o">%</span> <span class="s1">&#39; &#39;</span><span class="o">.</span><span class="n">join</span><span class="p">([</span><span class="bp">self</span><span class="o">.</span><span class="n">pm_bin</span><span class="p">,</span>
                                                               <span class="bp">self</span><span class="o">.</span><span class="n">pm_action</span><span class="p">]</span><span class="o">+</span>
                                                              <span class="n">arguments</span><span class="p">)</span><span class="o">+</span>
-                         <span class="s">&quot;is supposed to be &#39;</span><span class="si">%d</span><span class="s">&#39; &quot;</span> <span class="o">%</span> <span class="n">exit_code</span><span class="o">+</span>
-                         <span class="s">&quot;but returned as &#39;</span><span class="si">%d</span><span class="s">&#39;.&quot;</span> <span class="o">%</span> <span class="n">exit_code_run</span><span class="p">)</span>
-</div>
+                         <span class="s2">&quot;is supposed to be &#39;</span><span class="si">%d</span><span class="s2">&#39; &quot;</span> <span class="o">%</span> <span class="n">exit_code</span><span class="o">+</span>
+                         <span class="s2">&quot;but returned as &#39;</span><span class="si">%d</span><span class="s2">&#39;.&quot;</span> <span class="o">%</span> <span class="n">exit_code_run</span><span class="p">)</span></div>
+
 <div class="viewcode-block" id="ActionTestCase.testPMExists"><a class="viewcode-back" href="../actions/index_dev.html#test_actions.ActionTestCase.testPMExists">[docs]</a>    <span class="k">def</span> <span class="nf">testPMExists</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
         <span class="sd">&quot;&quot;&quot;</span>
 <span class="sd">        This is an internal test, executed when the source code of the test</span>
@@ -155,16 +157,16 @@
 <span class="sd">        file (also complains if a directory is found instead).</span>
 <span class="sd">        &quot;&quot;&quot;</span>
         <span class="bp">self</span><span class="o">.</span><span class="n">assertEqual</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">isfile</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">pm_bin</span><span class="p">),</span> <span class="bp">True</span><span class="p">,</span>
-                         <span class="n">msg</span><span class="o">=</span><span class="s">&quot;Could not find &#39;pm&#39; bin at &#39;</span><span class="si">%s</span><span class="s">&#39;, &quot;</span> <span class="o">%</span> <span class="bp">self</span><span class="o">.</span><span class="n">pm_bin</span><span class="o">+</span>
-                         <span class="s">&quot;cannot proceed unit tests.&quot;</span><span class="p">)</span>
-</div></div>
-<span class="k">if</span> <span class="n">__name__</span> <span class="o">==</span> <span class="s">&quot;__main__&quot;</span><span class="p">:</span>
+                         <span class="n">msg</span><span class="o">=</span><span class="s2">&quot;Could not find &#39;pm&#39; bin at &#39;</span><span class="si">%s</span><span class="s2">&#39;, &quot;</span> <span class="o">%</span> <span class="bp">self</span><span class="o">.</span><span class="n">pm_bin</span><span class="o">+</span>
+                         <span class="s2">&quot;cannot proceed unit tests.&quot;</span><span class="p">)</span></div></div>
+
+<span class="k">if</span> <span class="n">__name__</span> <span class="o">==</span> <span class="s2">&quot;__main__&quot;</span><span class="p">:</span>
     <span class="kn">import</span> <span class="nn">sys</span>
     <span class="kn">from</span> <span class="nn">ost</span> <span class="kn">import</span> <span class="n">testutils</span>
     <span class="n">sys</span><span class="o">.</span><span class="n">dont_write_bytecode</span> <span class="o">=</span> <span class="bp">True</span>
     <span class="n">testutils</span><span class="o">.</span><span class="n">RunTests</span><span class="p">()</span>
 
-<span class="c">#  LocalWords:  attr meth ActionTestCase init str stdout stderr param bool</span>
+<span class="c1">#  LocalWords:  attr meth ActionTestCase init str stdout stderr param bool</span>
 </pre></div>
 
           </div>
@@ -188,9 +190,6 @@
       <input type="hidden" name="check_keywords" value="yes" />
       <input type="hidden" name="area" value="default" />
     </form>
-    <p class="searchtip" style="font-size: 90%">
-    Enter search terms or a module, class or function name.
-    </p>
 </div>
 <script type="text/javascript">$('#searchbox').show(0);</script>
         </div>
@@ -198,11 +197,11 @@
       <div class="clearer"></div>
     </div>
     <div class="footer">
-      &copy;2017, ProMod3 authors.
+      &copy;2018, ProMod3 authors.
       
       |
-      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a>
-      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.6</a>
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.4.1</a>
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
       
     </div>
 
diff --git a/doc/html/_sources/buildsystem.txt b/doc/html/_sources/buildsystem.txt
index 4bb192686d60b60c60d52e9c0e8fb56b3334a91e..a601d619b695a46a2f15352e312e4bdaf91ab90f 100644
--- a/doc/html/_sources/buildsystem.txt
+++ b/doc/html/_sources/buildsystem.txt
@@ -143,11 +143,11 @@ safely delete the whole source folder.
 .. |qmean| replace:: QMEAN
 .. |eigen3| replace:: Eigen 3
 .. |openmm| replace:: OpenMM
-.. _qmean: http://swissmodel.expasy.org/qmean/cgi/index.cgi?
-.. _ost_l: http://www.OpenStructure.org
+.. _qmean: https://swissmodel.expasy.org/qmean/
+.. _ost_l: https://www.OpenStructure.org
 .. _cmake: https://cmake.org/
 .. _python: https://www.python.org/
-.. _boost: http://www.boost.org/
+.. _boost: https://www.boost.org/
 .. _eigen3: http://eigen.tuxfamily.org/index.php?title=Main_Page
 .. _openmm: http://openmm.org
 
diff --git a/doc/html/_sources/changelog.txt b/doc/html/_sources/changelog.txt
index aec8ac1362e2dbbf2f1e4d06a6ec6422e921b3d3..20e7a36a38c83e77511d058c8e9f459732964672 100644
--- a/doc/html/_sources/changelog.txt
+++ b/doc/html/_sources/changelog.txt
@@ -5,7 +5,36 @@
 Changelog
 ================================================================================
 
-Release 1.1
+Release 1.2.0
+--------------------------------------------------------------------------------
+
+* Graph optimizer has been separated from the sidechain module and can now be 
+  used for arbitrary optimization problems. Available optimization algorithms 
+  are TreePack, AStar and MonteCarlo.
+* Make it possible to distinguish between the scores of a loop towards a constant
+  environment (external scores) and the scores within the loop itself 
+  (internal scores).
+* Most scores based on pairwise interactions are now pairwise decomposable.
+* Disconnected loops at several locations can be scored at once.
+* Avoid the usage of the DSSP executable and use the OpenStructure internal
+  secondary structure assignment instead.
+* Allow to decide whether the CB atom belongs to the actual rotamer or to the
+  constant frame in sidechain optimization. This can be useful in design 
+  questions, where the identity of a rotamer is not given and you want to 
+  allow glycine or alanine.
+* The naming of the entries in the StructureDB is not strictly limited to 
+  4 letter codes anymore, arbitrary strings can be used instead.
+* Adding coordinates to the StructureDB does not require external tools anymore
+  (msms, dssp etc.), internal implementations are used instead.
+* The data that is stored in a StructureDB can be controlled at initialization,
+  everything except the sequence and the actual coordinates is optional.
+* Entries in the StructureDB can be removed again.
+* Allow to search positions of arbitrary copies in DynamicSpatialOrganizer 
+  by providing RT operators.
+* Several minor bug fixes, improvements, and speed-ups
+
+
+Release 1.1.0
 --------------------------------------------------------------------------------
 
 * Updated dependencies: need Eigen 3.3.0 and OST 1.7
diff --git a/doc/html/_sources/contributing.txt b/doc/html/_sources/contributing.txt
index 832af70cc2e46a71d3850967a075a8f423ece6d8..ae3c842c641522624e55d208c51e6a146773a033 100644
--- a/doc/html/_sources/contributing.txt
+++ b/doc/html/_sources/contributing.txt
@@ -201,7 +201,7 @@ sporting a single monolithic :file:`test_sidechain_reconstruction.py`.
 |python| code is evaluated using its own :py_docs:`unit testing framework
 <library/unittest.html>` with a little help from |ost_s|_ (|C++| uses the
 |boost| `Test Library
-<http://www.boost.org/doc/libs/1_47_0/libs/test/doc/html/index.html>`_). The
+<https://www.boost.org/doc/libs/1_53_0/libs/test/doc/html/index.html>`_). The
 basic scheme is to import your module, subclass :class:`unittest.TestCase` and
 make the whole file runnable as script using the most common |nameattr|_
 attribute. As an example we test the 
@@ -477,7 +477,7 @@ repository comes with a top-level :file:`doc` directory.
 
 While you should not spend to much time thinking about how to format
 documentation, here is a helpful list of standard formatters:
-http://sphinx-doc.org/markup/inline.html
+http://sphinx-doc.org/en/stable/markup/inline.html
 
 If you write new functionality for |project|, or fix bugs, feel free to extend
 the :file:`CHANGELOG` file. It will be automatically pulled into the
diff --git a/doc/html/_sources/core/graph_minimizer.txt b/doc/html/_sources/core/graph_minimizer.txt
new file mode 100644
index 0000000000000000000000000000000000000000..a1ddb9639f2816086ee62f64861e5e2e5b9dacb2
--- /dev/null
+++ b/doc/html/_sources/core/graph_minimizer.txt
@@ -0,0 +1,235 @@
+Graph Minimizer
+================================================================================
+
+.. currentmodule:: promod3.core
+
+The graph minimizer solves an energy minimization problem where we have n
+nodes :math:`N_i`, with each node having several possible solutions. 
+Every solution has a self energy :math:`E_{self}` and pairwise energies in between nodes
+are possible. The goal is to select exactly one solution per node to obtain 
+a set :math:`X=[x_1, x_2, ..., x_n]` that minimizes:
+
+.. math::
+  F(X)=\displaystyle\sum_iE_{self}(N_i[x_i]) +\displaystyle \sum_i \displaystyle \sum_{j>i}E_{pair}(N_i[x_i], N_j[x_j])
+
+
+
+.. class:: GraphMinimizer
+
+  .. method:: AddNode(self_energies) 
+
+    Adds a node to the graph. 
+
+    :param self_energies: Directly controls the number of possible solutions in that
+                          node and assigns the corresponding self energies
+    :type self_energies:  :class:`list` of :class:`float`
+
+    :returns:           The idx of the added node
+    :rtype:             :class:`int`
+
+
+  .. method:: AddEdge(node_idx_one, node_idx_two, pairwise_energies) 
+
+    Adds an edge between the specified nodes.
+
+    :param node_idx_one: Index of the first node
+    :param node_idx_two: Index of the second node
+    :param pairwise_energies: The pairwise energies that contribute to the 
+                              overall energy function. There must be a list for
+                              every possible solution in node one. All of those
+                              lists must have exactly the length of possible 
+                              solutions in node two.
+
+    :type node_idx_one: :class:`int`
+    :type node_idx_two: :class:`int`
+    :type pairwise_energies: :class:`list` of :class:`list` of :class:`float`
+
+    :returns:           The idx of the added edge
+    :rtype:             :class:`int`
+    :raises: :exc:`~exceptions.RuntimeError` if *node_idx_one* or *node_idx_two* 
+             specify non existent nodes or when *pairwise_energies* is 
+             inconsistent with the number of solutions in the specified nodes.
+
+
+  .. method:: ApplyDEE(node_idx, [e_cut=0.0])
+
+    Applies dead end elimination on one particular node and potentially
+    deactivates certain solutions. The goldstein criterion is described in 
+    [goldstein1994]_.
+
+    :param node_idx:    Node to apply dead end elimination
+    :param e_cut:       If set to
+                        0.0, the default goldstein criterion is applied =>
+                        a solution is removed if it's dominated by all other
+                        solutions in the same node. If you increase this value,
+                        a solution must be dominated by at least this **e_cut**.
+
+    :type node_idx:     :class:`int`
+    :type e_cut:        :class:`float`
+
+    :returns:           :class:`bool` whether any solution has been deactivated.
+
+
+  .. method:: ApplyEdgeDecomposition(edge_idx, epsilon)
+
+    Applies edge decomposition on one particular edge and potentially
+    deactivates it. The exact decomposition  procedure is described in 
+    [krivov2009]_.
+
+    :param edge_idx:    Edge to decompose. 
+    :param epsilon:     The energy threshold to perform edge decomposition.
+
+    :type edge_idx:     :class:`int`
+    :type epsilon:      :class:`float`
+
+
+    :returns:           :class:`bool` whether the edge has been decomposed and 
+                        deactivated 
+
+
+
+  .. method:: Prune(epsilon, [e_cut=0.0, consider_all_nodes=False])
+
+    Performs edge decomposition followed by dead end elimination in an
+    iterative manner until no changes can be observed anymore given 
+    **epsilon**.
+
+    :param epsilon:     The energy threshold to perform edge decomposition.
+    :param e_cut:       Parameter to control dead end elimination.
+    :param consider_all_nodes: Flag, wether the dead end elimination should be
+                               applied to all nodes, or only those who are
+                               connected with an edge removed by edge 
+                               decomposition. This is useful if already a Prune
+                               operation has been performed => only those nodes
+                               connected to a removed edge have the chance for
+                               successful dead end elimination.
+
+    :type epsilon:      :class:`float`
+    :type e_cut:        :class:`float`
+    :type consider_all_nodes: :class:`bool`
+                        
+
+  .. method:: Reset()
+
+    Resets the graph by undoing any pruning operation (DEE and edge decomposition)
+
+
+  .. method:: TreeSolve([max_complexity=inf, initial_epsilon=0.02])
+
+    The method solves a graph using a minimal width tree decomposition
+    approach in an iterative manner. In every iteration, the algorithm performs
+    a pruning step (DEE / Edge Decomposition) and subsequently tries to solve 
+    each connected component in the graph separately. 
+    If the number of possible enumerations in the tree constructetd from a 
+    particular connected component is is larger **max_complexity**, 
+    this component is solved in a later iteration. The algorithm iterates until 
+    all connected components are solved and steadily increases the epsilon value 
+    resulting in a more and more agressive edge decomposition.
+    Algorithm further descsribed in [krivov2009]_.
+
+    :param max_complexity: Max number of possible permutations, that have to 
+                           be enumerated in the resulting tree after tree
+                           decomposition.
+
+    :param initial_epsilon: The initial energy threshold to perform edge
+                            decomposition.
+
+    :type max_complexity: :class:`int`
+    :type initial_epsilon: :class:`float`
+
+    :returns:           A tuple with the first element being a list of indices 
+                        representing the single solutions minimizing
+                        the overall energy function.
+                        The second element is the according energy value.
+
+
+  .. method:: AStarSolve(e_thresh, [max_n=100, max_visited_nodes=100000000])
+
+    The method solves a graph using the A\* algorithm. Besides creating the
+    minimal energy solution, the function produces a maximum of **max_n**
+    solutions sorted by energy. It aborts as soon as it sees the first solution
+    with an energy difference of **e_thresh** to the optimal solution or hits
+    **max_n**. If you're only interested in the optimal solution you should use
+    the TreeSolve function since it's much faster and uses less memory.
+    There is no automatic pruning of the graph using DEE or edge decomposition, 
+    so you have to do it by yourself, otherwise you'll have a looooooong 
+    runtime or even hit the **max_visited_nodes** parameter that caps the memory
+    usage. 
+    To have a valid solution you have to take care that you set the **e_cut** 
+    parameter in the pruning function to **e_tresh**.
+    Algorithm is described in [leach1998]_.
+
+    :param e_thresh:    Maximal energy difference of a solution to the
+                        optimal solution to be considered.
+
+    :param max_n:       The maximum number of solutions that will be generated.
+
+    :param  max_visited_nodes: Caps the memory usage of the algorithm. Besides
+                               The memory used for pairwise energies and self
+                               energies, the algorithm uses about 
+                               **max_visited_nodes** * 20 bytes.
+
+
+    :type e_thresh:      :class:`float`
+    :type max_n:        :class:`int`
+    :type max_visited_nodes: :class:`int`
+
+    :returns:           A tuple with the first element being a list of 
+                        solutions. The second element is a list
+                        of energies for the according solutions.
+
+
+  .. method:: MCSolve([n=100, mc_steps=100000, start_temperature=1000.0, \\
+                       change_frequency=1000, cooling_factor=0.9, seed=0]) 
+
+    Does a total of **n** Monte Carlo runs to find low energy solutions
+    of the graph. Each run starts with a random 
+    configuration. At each of the **mc_steps** steps, a random node and
+    a random solution at that location is selected and an energy difference 
+    of that random selection relative to the current configuration is 
+    estimated. If the difference in energy is negative, the step is 
+    accepted. If not, the step is accepted with a probability given by
+    the temperature dependent Metropolis criterion
+    :math:`exp^{\left(\frac{-e_{diff}}{T}\right)}`.
+    The temperature for every run starts with **start_temperature** 
+    and is multiplied every **change_frequency** steps with **cooling_factor**
+    to achieve a simulated annealing effect.
+    There is no automatic pruning of the graph using DEE or edge decomposition,
+    you have to do that by yourself.
+    
+    :param n:           Number of Monte Carlo runs 
+    :param mc_steps:    Number of Monte Carlo steps per run
+    :param start_temperature: Start temperature for the temperature dependent
+                              Metropolis criterion
+    :param change_frequency: Number of steps the temperature stays the same
+    :param cooling_factor: Factor to multiply temperature each 
+                          **change_frequency** steps
+    :param seed:        Seed for random number generator 
+
+    :type n:            :class:`int`
+    :type mc_steps:     :class:`int`
+    :type start_temperature: :class:`float`
+    :type change_frequency: :class:`int`
+    :type cooling_factor: :class:`float`
+    :type seed:         :class:`float`
+
+    :returns:           A tuple with the first element being a list of 
+                        solutions. The second element is a list
+                        of energies for the according solutions.
+
+  .. method:: NaiveSolve()
+
+    Don't even think of using this... This function only exists for debug 
+    purposes and does the full enumeration of the solution space. 
+    It might become faster with the appropriate  
+    `techniques <https://www.youtube.com/watch?v=fQGbXmkSArs>`_.
+
+    :returns:           A tuple with the first element being a list of indices 
+                        representing the single solutions minimizing
+                        the overall energy function.
+                        The second element is the according energy value.          
+
+
+.. [goldstein1994] Goldstein RF (1994). Efficient rotamer elimination applied to protein side-chains and related spin glasses. Biophys J.
+
+.. [leach1998] Leach AR, Lemon AP (1998). Explring the conformational space of prootein side chains using dead-end elimination and the A* algorithm. Proteins.
diff --git a/doc/html/_sources/core/index.txt b/doc/html/_sources/core/index.txt
index 17f9534aea783a5b313ec58c5ba52b4b9d199fcc..2af5fca9cace92deef375d4857a1c9b55f9ec0d5 100644
--- a/doc/html/_sources/core/index.txt
+++ b/doc/html/_sources/core/index.txt
@@ -16,3 +16,4 @@ Contents:
   helper
   geometry
   runtime_profiling
+  graph_minimizer
diff --git a/doc/html/_sources/loop/structure_db.txt b/doc/html/_sources/loop/structure_db.txt
index 631811ed79575c01da39b5dba4b94ad6a54729b2..a967d08a3823e6ae0eba26410ba7bdfa313ba358 100644
--- a/doc/html/_sources/loop/structure_db.txt
+++ b/doc/html/_sources/loop/structure_db.txt
@@ -3,30 +3,37 @@ Structural Data
 
 .. currentmodule:: promod3.loop
 
-The structural database serves as a container for structural backbone
-and profile data. It can be filled with chains of pdb structures with their
-corresponding profiles as they are produced by the HHSuite tools [soding2005]_. 
-Structural and profile data get complemented by with additional information.
-Following features get stored on a per residue basis:
-
-* The amino acid one letter code
-* The coordinates of the backbone atoms (N,CA,C,O)
-* The phi/psi dihedral angles
-* The secondary structure state as defined by dssp
-* The solvent accessibility in square Angstrom 
-* The residue depth defined as the average distance from all atoms of a
-  residue to the closest surface vertex as calculated by msms [sanner1996]_.
-  This is a simplified version of the residue depth as discussed in
-  [chakravarty1999]_ and gets directly calculated when structural information
-  gets added to the StructureDB.
-* The amino acid frequencies as given by an input sequence profile
-* The amino acid frequency derived from structural alignments as described
-  in [zhou2005]_ - Since the calculation of such a profile already requires a 
-  StructureDB, we end up in a hen and egg problem here... When adding
-  structural information to the StructureDB, the according memory gets
-  just allocated and set to zero. The usage of this information
-  is therefore only meaningful if you calculate these profiles
-  and manually set them (or load the provided default database).
+The structural database serves as a container for structural backbone and 
+sequence data. Custom accessor objects can be implemented that relate
+arbitrary features to structural data. Examples provided by ProMod3 include
+accession using matching stem geometry (see: :class:`FragDB`) or sequence
+features (see: :class:`Fragger`). 
+Besides backbone and sequence data, derived features can  
+optionally be stored. E.g. sequence profiles or secondary structure information.
+Optional data includes:
+
+  * The phi/psi dihedral angles
+  * The secondary structure state as defined by dssp
+  * The solvent accessibility in square Angstrom 
+  * The amino acid frequencies as given by an input sequence profile
+  * The residue depth - The residue depth is defined as the minimum distance of 
+    a residue towards any of the exposed residues. 
+    Distances are calculated using CB positions (artificially constructed in case 
+    of glycine) and exposed is defined as:
+    relative solvent accessibility > 25% and at least one atom being exposed
+    to the OUTER surface. To determine whether an atom is part of that outer 
+    surface, the full structure is placed into a 3D grid and a flood fill 
+    algorithm is used to determine the atoms of interest. 
+    Internal cavities are excluded by using this approach. This is a simplified 
+    version of the residue depth as discussed in [chakravarty1999]_ and gets 
+    directly calculated when structural information is added to the StructureDB.
+  * The amino acid frequency derived from structural alignments as described
+    in [zhou2005]_ - Since the calculation of such a profile already requires a 
+    StructureDB, we end up in a hen and egg problem here... When adding
+    structural information to the StructureDB, the according memory gets
+    just allocated and set to zero. The usage of this information
+    is therefore only meaningful if you calculate these profiles
+    and manually set them (or load the provided default database).
 
 Defining Chains and Fragments
 --------------------------------------------------------------------------------
@@ -34,27 +41,45 @@ Defining Chains and Fragments
 .. class:: CoordInfo()
 
   The CoordInfo gets automatically generated when new chains are added to
-  the structural database. It contains internal information of how
-  the according chain is stored in the database.
+  the structural database. It contains internal information of how a 
+  connected stretch of residues is stored in the database.
 
-  .. attribute:: pdb_id
+  .. attribute:: id
 
-    A character residue string containing the 4 character pdb_id and the
-    1 character chain_id. (:class:`str`) 
+    An id string specified when adding the corresponding stretch to the 
+    structure db
+
+  .. attribute:: chain_name
+
+    A chain name string specified when adding the corresponding stretch to the
+    structure db
 
   .. attribute:: offset
 
-    All residues of the added structures are stored in a linear memory layout.
-    The offset parameter tells us where it exactly starts. (:class:`int`)
+    All residues of the added stretch are stored in a linear memory layout.
+    The offset parameter tells us where it exactly starts in the global data 
+    structure. (:class:`int`)
 
   .. attribute:: size
 
-    The length of the stretch of residues. (:class:`int`)
+    The number of residues in that stretch (:class:`int`)
+
+  .. attribute:: start_resnum
+
+    Residue number of first residue in the added stretch. The residue number
+    is relative to the SEQRES provided in the input profile when adding the 
+    stuff to the structure db.
+
+  .. attribute:: shift
+
+    Translation from original coordinates that has been applied before storing
+    structural information in db.
 
 
 .. class:: FragmentInfo(chain_index, offset, length)
 
-  The FragmentInfo defines a fragment in the structural database.
+  The FragmentInfo defines any fragment in the structural database. If you 
+  implement your own accessor object, thats the information you want to store.
 
   :param chain_index:   Fills :attr:`chain_index`
 
@@ -64,17 +89,19 @@ Defining Chains and Fragments
 
   .. attribute:: chain_index
     
-    The index of the chain (defined by :class:`CoordInfo`) in the structure db this particle belongs to. (:class:`int`)
+    The index of the chain (defined by :class:`CoordInfo`) in the structure db 
+    this particle belongs to. (:class:`int`)
 
   .. attribute:: offset
 
-    Index of residue in **chain** the fragment starts. (:class:`int`)
+    Index of residue in **chain** the fragment starts. (0-based, :class:`int`)
 
   .. attribute:: length
 
     Length of the fragment (:class:`int`)
 
 
+
 The Structure Database
 --------------------------------------------------------------------------------
 
@@ -83,18 +110,46 @@ and fill it with content.
 
 .. literalinclude:: ../../../tests/doc/scripts/loop_structure_db.py
 
-Calculating the structural profiles is highly expensive and heavily depends on
+Calculating the structural profiles is expensive and heavily depends on
 the size of the database used as source. If you want to do this for a larger
 database, you might want to consider two things:
 
-1. Use a database of limited size as structural source (something
+1. Use a database of limited size to generate the actual profiles (something
    in between 5000 and 10000 nonredundant chains is enough)
 2. Use the :class:`ost.seq.ProfileDB` to gather profiles produced from jobs
    running in parallel
 
-.. class:: StructureDB()
 
-  .. staticmethod:: Load(filename, load_frequencies=True)
+.. class:: StructureDBDataType
+
+  The StructureDBDataType enum has to be passed at initialization of a 
+  StructureDB in order to define what data you want to store additionally
+  to backbone coordinates and sequence.
+  If you want to store all data possible, use All. If you only want a subset,
+  you can combine some of the datatypes with a bitwise or operation 
+  (see example script for StructureDB). One important note:
+  If you enable AAFrequenciesStruct, the actual information is not automatically
+  assigned. Only the according memory is allocated and set to zero, the actual 
+  information must be assigned manually (see example script again...).
+
+  All, Dihedrals, SolventAccessibilities, ResidueDepths, DSSP, AAFrequencies,
+  AAFrequenciesStruct
+  
+
+.. class:: StructureDB(data_to_store)
+
+  Generates an empty StructureDB that can be filled with content through
+  :func:`AddCoordinates`. The information extracted there is defined by
+  *data_to_store*. Have a look at the :class:`StructureDBDataType` 
+  documentation and at the example script...
+
+  :param data_to_store: Specifies what data to store in the database, several
+                        flags can be combined with a bitwise or operator.
+  :type data_to_store:  :class:`StructureDBDataType` 
+
+
+
+  .. staticmethod:: Load(filename)
                     LoadPortable(filename)
 
     Loads raw binary file generated with :meth:`Save` (optimized for fast
@@ -103,13 +158,6 @@ database, you might want to consider two things:
     
     :param filename: Path to the file from which to load the database.
     :type filename:  :class:`str`
-    :param load_frequencies: If True, the full database including profile
-                             information for every position gets loaded.
-                             A database without profiles loads faster and 
-                             requires less memory. But it's not possible
-                             to add new coordinates or call one of the
-                             profile dependent functions.
-    :type load_frequencies:  :class:`bool`
 
     :returns: The loaded data base
     :rtype:   :class:`StructureDB`
@@ -117,6 +165,7 @@ database, you might want to consider two things:
     :raises:  :exc:`~exceptions.RuntimeError` if file cannot be opened or if
               file cannot be parsed (see :ref:`here <portableIO>` for details).
 
+
   .. method:: Save(filename)
               SavePortable(filename)
 
@@ -127,73 +176,127 @@ database, you might want to consider two things:
     :param filename: Path to the file where the database will be saved
     :type filename:  :class:`str`
 
-    :raises:  :exc:`~exceptions.RuntimeError` if file cannot be opened or if
-              db has been loaded with load_frequencies=False (enforces only
-              complete databases to be saved down)
-
-  .. method:: AddCoordinates(pdb_id, chain_name, chain, surf, prof, \
-                             solvent_accessibility_string="solvent_accessibility")
-
-    This method takes a structural chain and searches the longest stretch of
-    connected residues containing all necessary backbone atoms. This stretch
-    gets then added to the database. Due to technical reasons, The maximal
-    extent along one of the base axis cannot exceed 650 A.
-    Following features are expected to be set on a per residue level in *chain*:
-    The secondary structure (e.g. call :meth:`ost.mol.alg.AssignSecStruct` on the
-    full :class:`ost.mol.EntityView` the *chain* belongs to) and
-    the solvent accessibility assigned using a float property with name 
-    *solvent_accessibility_string* as name on a per residue level (e.g. call 
-    :meth:`ost.mol.alg.Accessibility` on the full :class:`ost.mol.EntityView`
-    the chain belongs to and take care to pass the appropriate
-    *solvent_accessibility_string*).
-
-    :param pdb_id:      4-letter code of the structure the chain belongs to
-    :param chain_name:  Name of the chain consisting of one letter
-    :param chain:       The actual chain 
-    :param surf:        A surface describing the solvent accessible surface
-                        (we advise you to provide a surface estimated with the
-                        full :class:`ost.mol.EntityView` the *chain* belongs to)
-    :param prof:        Profile information for this *chain*.
-    :param solvent_accessibility_string: Name of float property where the 
-                                         solvent accessibilities are stored
-                                         on a per residue basis in *chain*
-
-    :type pdb_id:       :class:`str`
+    :raises:  :exc:`~exceptions.RuntimeError` if file cannot be opened 
+
+
+  .. method:: HasData(data_type)
+
+    Checks, whether requested data type is available in the current database.
+
+    :param data_type:   Data type to check
+    :type data_type:    :class:`StructureDBDataType`
+
+    :returns:           Whether the requested datatype is available
+    :rtype:             :class:`bool`
+
+
+  .. method:: AddCoordinates(id, chain_name, ent, seqres, prof=None, \
+                             only_longest_stretch=True)
+
+    This method takes an entity and adds coordinates and the sequence 
+    of one of its chains to the structural database. Additionally, all 
+    data as specified at the initialization of the database is extracted
+    fully automatically by considering the full *ent* (e.g. when 
+    calculating solvent accessibilities etc.).
+    The only exception is AAFrequencies, where a valid sequence profile 
+    is expected in *prof* that has matching sequence with *seqres*
+    All residues in chain with name *chain_name* must have residue numbers 
+    that directly relate them to the *seqres* with an indexing scheme 
+    starting from one.
+    If this is not the case, an error gets thrown. You might want to
+    consider to use :meth:`ost.seq.Renumber` for proper numbering.
+    Based on consecutive numbering and additionally checking for valid
+    peptide bonds, connected stretches are identified
+    and every added connected stretch gets its own entry with 
+    :class:`CoordInfo` as a descriptor. 
+    To avoid cluttering the database with many small fragments, the flag:
+    *only_longest_stretch* can be used. Set it to False if all
+    connected stretches of chain with name *chain_name* should be added.
+    There is one final catch you have to consider: Due to the internal
+    lossy data compression for the positions, the extent in x, y and
+    z - direction for every connected stretch is limited to 655A. This should
+    be sufficient for most structures, but stretches exceeding this maximum
+    are discarded. For storing the structural data given these restraints,
+    a translation is applied that gets stored as the *shift* attribute
+    in the according :class:`CoordInfo` object.
+
+    :param id:          identifier of the added structure (e.g. pdb id)
+    :param chain_name:  Name of the chain in *ent* you want to add
+    :param ent:         The full entity that must contain a chain named
+                        as specified by *chain_name*.
+    :param seqres:      The reference sequence of chain with name *chain_name*
+    :param prof:        Profile information for the chain with name 
+                        *chain_name*. The profile sequence must match *seqres*.
+    :param only_longest_stretch: Flag whether you want to add only the longest
+                                 connected stretch of residues are all connected
+                                 stretches of residues
+
+    :type id:           :class:`str`
     :type chain_name:   :class:`str`
-    :type chain:        :class:`ost.mol.ChainView`
-    :type surf:         :class:`ost.mol.SurfaceHandle`
+    :type ent:          :class:`ost.mol.EntityView`
+    :type seqres:       :class:`ost.seq.SequenceHandle`
     :type prof:         :class:`ost.seq.ProfileHandle`
-    :type solvent_accessibility_string: :class:`str`
+    :type only_longest_strech: :class:`bool`
 
-    :returns: DB index of added chain.
-    :rtype:   :class:`int`
+    :returns: indices of added stretches in db
+    :rtype:   :class:`list` of `int`
 
-    :raises:  :exc:`~exceptions.RuntimeError` if size of chain is too large,
-              when db has been loaded with load_frequencies=False or when the
-              ATOMSEQ form the *chain* can't be aligned with the SEQRES from
-              the *prof*.
+    :raises:  :exc:`~exceptions.RuntimeError` if the residues in chain with
+              name *chain_name* do not match *seqres* given the 
+              residue numbers, when AAFrequencies have to to be extracted and
+              the sequence in *prof* does not match the *seqres* or *prof* is 
+              invalid. 
 
-  .. method:: GetCoordIndex(pdb_id, chain_name)
 
-    :returns: The StructureDB index (in [0, :meth:`GetNumCoords`-1]) of the
-              chain of interest, -1 if it cannot be found.
-    :rtype:   :class:`int`
+  .. method:: RemoveCoordinates(coord_idx) 
+
+    Removes coordinates at specified location and all its associated data. This
+    has an impact on the offset values of all :class:`CoordInfo` objects 
+    that are internally stored afterwards and on the actual coord indices 
+    (all shifted by one). So make sure that you adapt your data access 
+    accordingly! 
+
+    :param coord_idx:   Specifies coordinates to be removed
+    :type coord_idx:    :class:`int`
 
-    :param pdb_id:      4-letter code of the structure the chain belongs to
-    :param chain_name:  Name of the chain consisting of one letter
+    :raises:  :exc:`~exceptions.RuntimeError` if *coord_idx* is invalid
+
+  .. method:: GetCoordIdx(id, chain_name)
+
+    :returns: The StructureDB indices (in [0, :meth:`GetNumCoords`-1]) of 
+              of all coords (connected stretches) with matching 
+              *id* / *chain_name*.
+    :rtype:   :class:`list` of :class:`int`
+
+    :param id:          Identifier given when calling :meth:`AddCoordinates`
+    :param chain_name:  Name of chain given when calling :meth:`AddCoordinates`
 
     :type pdb_id:       :class:`str`
     :type chain_name:   :class:`str`
 
+
   .. method:: GetCoordInfo(idx)
 
-    :returns: Object describing the chain with index *idx*.
+    :returns: Object describing the stretch of connected residues with 
+              index *idx*.
     :rtype:   :class:`CoordInfo`
 
     :param idx: The StructureDB index (in [0, :meth:`GetNumCoords`-1])
     :type idx:  :class:`int`
 
 
+  .. method:: GetNumCoords()
+
+    :returns: Number of connected stretches of residues that have been added to 
+              the database.
+    :rtype:   :class:`int`
+
+
+  .. method:: PrintStatistics()
+
+    Prints out some information about the db.
+
+
   .. method:: GetBackboneList(fragment, sequence)
               GetBackboneList(n_stem, c_stem, fragment, sequence)
 
@@ -212,20 +315,9 @@ database, you might want to consider two things:
     :type c_stem:  :class:`ost.mol.ResidueHandle`
 
     :raises:  :exc:`~exceptions.RuntimeError` if fragment is invalid (happens
-              if the fragment does not fully fit into one of the chains in the
-              database) or if *sequence* contains a one letter code which is not
-              one of the 20 default amino acids.
-
-
-  .. method:: GetNumCoords()
-
-    :returns: Number of chains that have been added to the database.
-    :rtype:   :class:`int`
-
-
-  .. method:: PrintStatistics()
-
-    Prints out some information about the db.
+              if the fragment does not fully fit into one of the connected 
+              stretches in the database) or if *sequence* contains a one letter 
+              code which is not one of the 20 default amino acids.
 
 
   .. method:: GetSequence(fragment)
@@ -238,7 +330,7 @@ database, you might want to consider two things:
 
     :raises:  :exc:`~exceptions.RuntimeError` if fragment is invalid. This is
               the case when the fragment does not fully fit into one of the
-              chains in the database.
+              connected stretches of residues in the database.
 
 
   .. method:: GetDSSPStates(fragment)
@@ -249,9 +341,10 @@ database, you might want to consider two things:
     :param fragment: Fragment definition from which to extract the states.
     :type fragment:  :class:`FragmentInfo`
 
-    :raises:  :exc:`~exceptions.RuntimeError` if fragment is invalid. This is
+    :raises:  :exc:`~exceptions.RuntimeError` if database does not contain dssp 
+              data or if fragment is invalid. This is
               the case when the fragment does not fully fit into one of the
-              chains in the database.
+              connected stretches of residues in the database.
 
 
   .. method:: GetDihedralAngles(fragment)
@@ -262,9 +355,11 @@ database, you might want to consider two things:
     :param fragment: Fragment definition from which to extract the dihedrals.
     :type fragment:  :class:`FragmentInfo`
 
-    :raises:  :exc:`~exceptions.RuntimeError` if fragment is invalid. This is
+    :raises:  :exc:`~exceptions.RuntimeError` if database does not contain 
+              dihedral angle data or if fragment is invalid. This is
               the case when the fragment does not fully fit into one of the
-              chains in the database.
+              connected stretches of residues in the database.
+
 
   .. method:: GetResidueDepths(fragment)
 
@@ -275,9 +370,11 @@ database, you might want to consider two things:
                      depths
     :type fragment:  :class:`FragmentInfo`
 
-    :raises:  :exc:`~exceptions.RuntimeError` if fragment is invalid. This is
+    :raises:  :exc:`~exceptions.RuntimeError` if database does not contain 
+              residue depth data or if fragment is invalid. This is
               the case when the fragment does not fully fit into one of the
-              chains in the database.
+              connected stretches of residues in the database.
+
 
   .. method:: GetSolventAccessibilitites(fragment)
 
@@ -289,9 +386,11 @@ database, you might want to consider two things:
                      accessibilities
     :type fragment:  :class:`FragmentInfo`
 
-    :raises:  :exc:`~exceptions.RuntimeError` if fragment is invalid. This is
+    :raises:  :exc:`~exceptions.RuntimeError` if database does not contain 
+              solvent accessibility data or if fragment is invalid. This is
               the case when the fragment does not fully fit into one of the
-              chains in the database.
+              connected stretches of residues in the database.
+
 
   .. method:: GetSequenceProfile(fragment)
 
@@ -304,10 +403,12 @@ database, you might want to consider two things:
 
     :type fragment:     :class:`FragmentInfo`
 
-    :raises:  :exc:`~exceptions.RuntimeError` if fragment is invalid. This is
+    :raises:  :exc:`~exceptions.RuntimeError` if database does not cotain
+              aa frequency data or if fragment is invalid. This is
               the case when the fragment does not fully fit into one of the
-              chains in the database.
-                        
+              connected stretches of residues in the database.
+                    
+
   .. method:: GetStructureProfile(fragment)
 
     :returns: The structure profile for the residues defined by *fragment* with
@@ -319,44 +420,50 @@ database, you might want to consider two things:
 
     :type fragment:     :class:`FragmentInfo`
 
-    :raises:  :exc:`~exceptions.RuntimeError` if fragment is invalid. This is
+    :raises:  :exc:`~exceptions.RuntimeError` if database does not contain
+              aa frequencies struct data or if fragment is invalid. This is
               the case when the fragment does not fully fit into one of the
-              chains in the database.
+              connected stretches of residues in the database.
 
-  .. method:: GenerateStructureProfile(other_db, fragment)
 
-    Takes the CA positions and residue depths for *fragment* defined from
-    *other_db* to calculate a structure profile using the full internal
-    structural data of this database with their corresponding residue depths.
+  .. method:: GenerateStructureProfile(bb_list, residue_depths)
 
-    :param fragment: Fragment definition from *other_db*.
-    :type fragment:  :class:`FragmentInfo`
-    :param other_db: Structural database from which we extract CA positions and
-                     residue depths for *fragment*.
-    :type other_db:  :class:`StructureDB`
+    Calculates a structure profile for *bb_list* with given *residue_depths*
+    using the full internal data of this StructureDB.
+
+    :param bb_list:  Positions for which to calculate the structural profile
+    :type bb_list:   :class:`BackboneList`
+    :param residue_depths: The residue depth for each residue in *bb_list* 
+                           as you would extract it from any StructureDB 
+                           containing that data. 
+    :type residue_depths:  :class:`list` of :class:`float`
 
     :returns: The structure profile for the input with the BLOSUM62
               probabilities as NULL model.
     :rtype:   :class:`ost.seq.ProfileHandle`
 
     :raises:  :exc:`~exceptions.RuntimeError` if *bb_list* and 
-              *residue_depths* differ in size or when their size is 0
+              *residue_depths* differ in size, when their size is 0
+              or when database does not contain aa frequencies struct data.
 
-  .. method:: SetStructureProfile(chain_idx, prof)
+
+  .. method:: SetStructureProfile(coord_idx, prof)
 
     Takes the *prof* and sets the corresponding StructureProfile
-    frequencies in entry with *chain_idx*
+    frequencies in entry with *coord_idx*
 
     :param prof:      Source of profile frequencies
-    :param chain_idx: StructureDB index of entry for which to set frequencies
+    :param coord_idx: StructureDB index of entry for which to set frequencies
                       (in [0, :meth:`GetNumCoords`-1])
 
     :type prof:       :class:`ost.seq.ProfileHandle`
-    :type chain_idx:  :class:`int`
+    :type coord_idx:  :class:`int`
+
+    :raises: :exc:`~exceptions.RuntimeError` if *coord_idx* does not match
+             any entry in the db, when the size of the *prof* does not
+             exactly match the size of entry at *coord_idx* or when database
+             does not contain aa frequency struct data.
 
-    :raises: :exc:`~exceptions.RuntimeError` if *chain_idx* does not match
-             any entry in the db or when the size of the *prof* does not
-             exactly match the size of entry at *chain_idx*
 
   .. method:: GetSubDB(indices)
 
@@ -437,6 +544,7 @@ This example illustrates how to create a custom FragDB based on a StructureDB:
     :return:    The bin size
     :rtype:     :class:`float`
 
+
   .. method:: AddFragments(fragment_length, rmsd_cutoff, structure_db)
 
     Iterates over all fragments of length **fragment_length** in the given structural database and adds them to the fragment database. Fragments will be skipped if there is already a fragment in the database that has an RMSD to the one being added smaller than **rmsd_cutoff**.
@@ -870,7 +978,6 @@ The PsipredPrediction class
 
 
 .. [soding2005] Söding J (2005). Protein homology detection by HMM-HMM comparison. Bioinformatics 21 (7): 951–960.
-.. [sanner1996] Sanner M, Olson AJ, Spehner JC (1996). Reduced Surface: an Efficient Way to Compute Molecular Surfaces. Biopolymers 38 (3): 305-320.
 .. [chakravarty1999] Chakravarty S, Varadarajan R (1999). Residue depth: a novel parameter for the analysis of protein structure and stability. Structure 7 (7): 723–732.
 .. [zhou2005] Zhou H, Zhou Y (2005). Fold Recognition by Combining Sequence Profiles Derived From Evolution and From Depth-Dependent Structural Alignment of Fragments. Proteins 58 (2): 321–328.
 .. [Jones1999] Jones DT (1999) Protein secondary structure prediction based on position-specific scoring matrices. J. Mol. Biol. 292: 195-202. 
diff --git a/doc/html/_sources/modelling/algorithms.txt b/doc/html/_sources/modelling/algorithms.txt
index 439fd2d9009650a24933a6ccaebb0a6d567c8528..7ff5ae3a33e08ccccdf6d98f87abe2748e1d0d19 100644
--- a/doc/html/_sources/modelling/algorithms.txt
+++ b/doc/html/_sources/modelling/algorithms.txt
@@ -24,11 +24,9 @@ iterative superposition multiple times by using a sliding window to select the
 initial subset and gathers all unique results. These results can be very 
 similar and only differ by single positions. The algorithm therefore reduces
 the amount of solutions by merging them based on a threshold of similarity.
-If the sum of matching positions within the distance threshold divided by
-the maximum length of the two solutions is above a cluster thresh, the two
-solutions get merged by producing a common solution containing the shared
-positions. As a final result, the algorithm therefore detects common rigid
-subsets of positions.
+The similarity is defined by the fraction of positions in solution A that are
+also present in solution B. As a final result, the algorithm therefore detects 
+common rigid subsets of positions.
 
 .. method:: RigidBlocks(bb_list_one, bb_list_two, [window_length = 12, max_iterations=20, distance_thresh=3.0, cluster_thresh=0.9])
 
diff --git a/doc/html/_sources/modelling/loop_candidates.txt b/doc/html/_sources/modelling/loop_candidates.txt
index dc3b5c96a28b7320d2fbb4dbdf47fe2492b49ff1..d0711c5a7c89292a61e3f1547ed28af62841382b 100644
--- a/doc/html/_sources/modelling/loop_candidates.txt
+++ b/doc/html/_sources/modelling/loop_candidates.txt
@@ -67,6 +67,12 @@ The LoopCandidates class
     
     Uses Monte Carlo simulated annealing to sample the loop to be modelled.
     If *initial_bb* is given, every Monte Carlo run starts from that configuration.
+
+    .. warning:: The :class:`~promod3.scoring.BackboneScoreEnv`
+                 attached to *scorer* will be altered in the specified stretch.
+                 You might consider the Stash / Pop mechanism of the 
+                 :class:`~promod3.scoring.BackboneScoreEnv` to restore to the 
+                 original state once the sampling is done.    
  
     :param initial_bb: Initial configuration used for the sampling
     :param seq:        The sequence of residues to be sampled
@@ -181,10 +187,14 @@ The LoopCandidates class
              useful to keep track of scores and other data extracted before.
     :rtype:  :class:`list` of :class:`int`
 
-  .. method:: CalculateBackboneScores(score_container, scorer, \
+  .. method:: CalculateBackboneScores(score_container, scorer, scorer_env,\
                                       start_resnum, chain_idx=0)
-              CalculateBackboneScores(score_container, scorer, keys, \
+              CalculateBackboneScores(score_container, scorer, scorer_env,\
+                                      keys, start_resnum, chain_idx=0)
+              CalculateBackboneScores(score_container, mhandle,\
                                       start_resnum, chain_idx=0)
+              CalculateBackboneScores(score_container, mhandle,\
+                                      keys, start_resnum, chain_idx=0)
               CalculateAllAtomScores(score_container, mhandle, \
                                      start_resnum, chain_idx=0)
               CalculateAllAtomScores(score_container, mhandle, keys, \
@@ -201,7 +211,10 @@ The LoopCandidates class
     :param scorer: Backbone scoring object with set environment for the
                    particular loop modelling problem.
     :type scorer:  :class:`~promod3.scoring.BackboneOverallScorer`
-    :param mhandle: Modelling handle set up for all atom scoring (see
+    :param scorer_env: The scoring environment attached to *scorer*
+    :type scorer_env: :class:`~promod3.scoring.BackboneScoreEnv`
+    :param mhandle: Modelling handle set up scoring (see
+                    :func:`SetupDefaultBackboneScoring`
                     :func:`SetupDefaultAllAtomScoring`).
     :type mhandle:  :class:`ModellingHandle`
     :param keys: Keys of the desired scorers. If not given, we use the set of
@@ -484,15 +497,25 @@ on loop candidates.
   a consistent naming of keys used for backbone and all atom scorers as set up
   by :func:`SetupDefaultBackboneScoring` and :func:`SetupDefaultAllAtomScoring`.
 
+  Different sets of weights are available. You can get general weights 
+  that have been optimized for a non redundant set of loops with lengths [3,14]
+  (including stem residues). The alternative is to get weights that have only
+  been optimized on a length specific subset of loops. By default you get
+  different weights for following lengths: [0,1,2,3,4], [5,6], [7,8], [9,10],
+  [11,12], [13,14]. 
+
   If you choose to modify the weights, please ensure to set consistently named
   keys in here and to use consistently named scorers and scoring computations!
 
-  .. staticmethod:: GetWeights(with_db=False, with_aa=False)
+  .. staticmethod:: GetWeights(with_db=False, with_aa=False,\
+                               length_dependent=False, loop_length=-1)
 
     :return: Named weights to be used when scoring loop candidates. The default
              weights were optimized to give the best performance when choosing
              the loop candidate with the lowest combined score. Each set of
-             weights includes (different) backbone scoring weights.
+             weights includes (different) backbone scoring weights, that are
+             optionally only trained on a subset of loops with corresponding 
+             loop length.
     :rtype:  :class:`dict` (keys: :class:`str`, values: :class:`float`)
 
     :param with_db: True to choose a set of weights including DB specific scores
@@ -500,12 +523,21 @@ on loop candidates.
     :type with_db:  :class:`bool`
     :param with_aa: True to choose a set of weights including all atom scores
     :type with_aa:  :class:`bool`
+    :param length_dependent: Whether to use general weights or their length 
+                             length dependent counterparts.
+    :type length_dependent: :class:`bool`
+    :param loop_length: Length of full loop. If no weights are available for
+                        this length or when *loop_length* is -1, the general
+                        weights are returned.
+    :type loop_length: :class:`int`
 
-  .. staticmethod:: SetWeights(with_db, with_aa, weights)
+  .. staticmethod:: SetWeights(with_db, with_aa, weights,\
+                               length_dependent=False, loop_length=-1)
 
     Overwrite a set of weights as returned by :meth:`GetWeights`.
 
-  .. staticmethod:: GetBackboneWeights(with_db=False, with_aa=False)
+  .. staticmethod:: GetBackboneWeights(with_db=False, with_aa=False,\
+                                       length_dependent=False, loop_length=-1)
 
     :return: Subset of :meth:`GetWeights` for backbone scoring as in
              :meth:`scoring.BackboneOverallScorer.CalculateLinearCombination`.
@@ -515,8 +547,13 @@ on loop candidates.
     :type with_db:  :class:`bool`
     :param with_aa: As in :meth:`GetWeights`
     :type with_aa:  :class:`bool`
+    :param length_dependent: As in :meth:`GetWeights`
+    :type length_dependent:  :class:`bool`
+    :param loop_length: As in :meth:`GetWeights`
+    :type loop_length:  :class:`int`
 
-  .. staticmethod:: GetAllAtomWeights(with_db=False)
+  .. staticmethod:: GetAllAtomWeights(with_db=False, length_dependent=False,\
+                                      loop_length=-1)
 
     :return: Subset of :meth:`GetWeights` for all atom scoring as in
              :meth:`scoring.AllAtomOverallScorer.CalculateLinearCombination`.
@@ -524,6 +561,10 @@ on loop candidates.
 
     :param with_db: As in :meth:`GetWeights`
     :type with_db:  :class:`bool`
+    :param length_dependent: As in :meth:`GetWeights`
+    :type length_dependent:  :class:`bool`
+    :param loop_length: As in :meth:`GetWeights`
+    :type loop_length:  :class:`int`
 
 
   .. staticmethod:: GetStemRMSDsKey()
diff --git a/doc/html/_sources/modelling/loop_closing.txt b/doc/html/_sources/modelling/loop_closing.txt
index 386458ba39abdf80e0b2289a35c5eb25b7cb6463..7ec7230b20a4e32fd9cc1f15a9e84ea7b549c113 100644
--- a/doc/html/_sources/modelling/loop_closing.txt
+++ b/doc/html/_sources/modelling/loop_closing.txt
@@ -197,7 +197,11 @@ the relaxer.
 
   .. method:: Run(bb_list, steps=100, stop_criterion=0.01)
 
-    Performs steepest descent on given BackboneList.
+    Performs steepest descent on given BackboneList. The function possibly fails
+    if there are particles (almost) on top of each other, resulting in NaN 
+    positions in the OpenMM system. The positions of **bb_list** are not touched
+    in this case and the function returns an infinit potential energy. 
+    In Python you can check for that with float("inf").
 
     :param bb_list:     To be relaxed
     :param steps:       number of steepest descent steps
@@ -209,7 +213,7 @@ the relaxer.
     :type steps:        :class:`int`
     :type stop_criterion: :class:`float`
 
-    :return: Forcefield energy upon relaxation
+    :return: Forcefield energy upon relaxation, infinity in case of OpenMM Error
     :rtype:  :class:`float`
 
     :raises:  :exc:`~exceptions.RuntimeError` if *bb_list* has not the same
@@ -332,7 +336,11 @@ Example usage:
   .. method:: Run(sc_data, steps=100, stop_criterion=0.01)
 
     Performs steepest descent for this system and writes updated positions into
-    *sc_data.env_pos.all_pos*.
+    *sc_data.env_pos.all_pos*. The function possibly fails
+    if there are particles (almost) on top of each other, resulting in NaN 
+    positions in the OpenMM system. The positions of *sc_data.env_pos.all_pos* 
+    are not touched in this case and the function returns an infinit potential 
+    energy. In Python you can check for that with float("inf").
 
     :param sc_data: Sidechain reconstruction result to be updated
     :type sc_data:  :class:`~promod3.modelling.SidechainReconstructionData`
@@ -342,7 +350,7 @@ Example usage:
                            that threshold, the relaxation aborts.
     :type stop_criterion:  :class:`float`
 
-    :return: Potential energy after relaxation
+    :return: Potential energy after relaxation, infinity in case of OpenMM Error
     :rtype:  :class:`float`
 
     :raises: :exc:`~exceptions.RuntimeError` if *sc_data* is incompatible with
diff --git a/doc/html/_sources/modelling/monte_carlo.txt b/doc/html/_sources/modelling/monte_carlo.txt
index 328b73d366cf8ce5a6affe7cce3d27a1d6325036..56e572a8788749bde35c415893a964126c5e67b9 100644
--- a/doc/html/_sources/modelling/monte_carlo.txt
+++ b/doc/html/_sources/modelling/monte_carlo.txt
@@ -402,18 +402,29 @@ The scorer asses a proposed conformation and are intended to return a pseudo
 energy, the lower the better.
 
 
-.. class:: LinearScorer(scorer, start_resnum, chain_idx, linear_weights)
+.. class:: LinearScorer(scorer, scorer_env, start_resnum, num_residues,
+                        chain_idx, linear_weights)
 
   The LinearScorer allows to combine the scores available from
   :class:`~promod3.scoring.BackboneOverallScorer` in a linear manner. See
   :meth:`~promod3.scoring.BackboneOverallScorer.CalculateLinearCombination` for a
   detailed description of the arguments.
 
+  .. warning:: The provided *scorer_env* will be altered in every 
+               :func:`GetScore` call.
+               You might consider the Stash / Pop mechanism of the 
+               :class:`~promod3.scoring.BackboneScoreEnv` to restore to the 
+               original state once the sampling is done.
+
   :param scorer: Scorer Object with set environment for the particular loop
                  modelling problem.
   :type scorer:  :class:`~promod3.scoring.BackboneOverallScorer`
+  :param scorer_env: The environment that is linked to the *scorer*
+  :type scorer_env: :class:`~promod3.scoring.BackboneScoreEnv`
   :param start_resnum: Res. number defining the position in the SEQRES.
   :type start_resnum:  :class:`int`
+  :param num_residues: Number of residues to score
+  :type num_residues: :class:`int`
   :param chain_idx: Index of chain the loop(s) belong to.
   :type chain_idx:  :class:`int`
   :param linear_weights: Weights for each desired scorer.
diff --git a/doc/html/_sources/modelling/pipeline.txt b/doc/html/_sources/modelling/pipeline.txt
index db7dc9d5bf060bf81fcca1e3b918b9824d6d145d..175b65c5d6554d15f76076e3bd3c530595a7cf64 100644
--- a/doc/html/_sources/modelling/pipeline.txt
+++ b/doc/html/_sources/modelling/pipeline.txt
@@ -236,10 +236,8 @@ Modelling Steps
     - "reduced": :class:`~promod3.scoring.ReducedScorer`
     - "clash": :class:`~promod3.scoring.ClashScorer`
     - "hbond": :class:`~promod3.scoring.HBondScorer`
-    - "ss_agreement": :class:`~promod3.scoring.SSAgreementScorer`
     - "torsion": :class:`~promod3.scoring.TorsionScorer`
     - "pairwise": :class:`~promod3.scoring.PairwiseScorer`
-    - "density": :class:`~promod3.scoring.DensityScorer`
 
     :param mhandle: The modelling handle. This will set the properties
                     :attr:`~ModellingHandle.backbone_scorer` and
diff --git a/doc/html/_sources/scoring/all_atom_scorers.txt b/doc/html/_sources/scoring/all_atom_scorers.txt
index 5637039287244c727e7e700670d182e2b64bacec..0a1b39b1613522dd671df0b73b32e98dcaac55eb 100644
--- a/doc/html/_sources/scoring/all_atom_scorers.txt
+++ b/doc/html/_sources/scoring/all_atom_scorers.txt
@@ -37,10 +37,10 @@ AllAtomOverallScorer class
     :type env:  :class:`~promod3.loop.AllAtomEnv`
 
   .. method:: CalculateLinearCombination(linear_weights, start_resnum, \
-                                         num_residues, chain_idx=0)
+                                         num_residues, chain_idx)
 
-    Calculate linear combination of scores for the desired loop (extracted from
-    environment) against the set environment (see
+    Calculate linear combination of scores for the desired loop(s) (extracted 
+    from environment) against the set environment (see
     :meth:`AllAtomScorer.CalculateScore`).
 
     :param linear_weights: Weights for each desired scorer. You can add a
@@ -48,14 +48,14 @@ AllAtomOverallScorer class
                            with key "intercept".
     :type linear_weights:  :class:`dict` (keys: :class:`str`,
                            values: :class:`float`)
-    :param start_resnum: Res. number defining the position in the SEQRES
+    :param start_resnum: Res. number(s) defining the position(s) in the SEQRES
                          (see :class:`~promod3.loop.AllAtomEnv` for indexing)
-    :type start_resnum:  :class:`int` / :class:`ost.mol.ResNum`
-    :param num_residues: Length of loop.
-    :type num_residues:  :class:`int`
-    :param chain_idx: Index of chain the loop belongs to
+    :type start_resnum:  :class:`int` / :class:`list` of :class:`int`
+    :param num_residues: Length of loop(s).
+    :type num_residues:  :class:`int` / :class:`list` of :class:`int`
+    :param chain_idx: Index of chain the loop(s) belongs to
                       (see :class:`~promod3.loop.AllAtomEnv` for indexing)
-    :type chain_idx:  :class:`int`
+    :type chain_idx:  :class:`int` / :class:`list` of :class:`int`
 
     :return: Score for the given set of atoms.
     :rtype:  :class:`float`
@@ -91,25 +91,20 @@ AllAtomScorer base class
     :param env: Link scorer to this score environment.
     :type env:  :class:`~promod3.loop.AllAtomEnv`
 
-  .. method:: CalculateScore(start_resnum, num_residues, chain_idx=0)
+  .. method:: CalculateScore(start_resnum, num_residues, chain_idx)
 
-    Calculates score for the desired loop (extracted from environment) against
+    Calculates score for the desired loop(s) (extracted from environment) against
     the set environment. Unless otherwise noted in the scorer, a lower "score"
     is better!
 
-    Note that the structural data of the loop is expected to be in the linked
-    environment before calling this! This behavior is different from the
-    corresponding function in :class:`BackboneScorer` as, for performance
-    reasons, we require all the comparisons to be done against the environment.
-
-    :param start_resnum: Res. number defining the position in the SEQRES
+    :param start_resnum: Res. number(s) defining the position(s) in the SEQRES
                          (see :class:`~promod3.loop.AllAtomEnv` for indexing)
-    :type start_resnum:  :class:`int` / :class:`ost.mol.ResNum`
-    :param num_residues: Length of loop.
-    :type num_residues:  :class:`int`
-    :param chain_idx: Index of chain the loop belongs to
+    :type start_resnum:  :class:`int` / :class:`list` of :class:`int`
+    :param num_residues: Length of loop(s).
+    :type num_residues:  :class:`int` / :class:`list` of :class:`int`
+    :param chain_idx: Index of chain the loop(s) belongs to
                       (see :class:`~promod3.loop.AllAtomEnv` for indexing)
-    :type chain_idx:  :class:`int`
+    :type chain_idx:  :class:`int` / :class:`list` of :class:`int`
 
     :return: Score for the given set of atoms.
     :rtype:  :class:`float`
@@ -121,25 +116,21 @@ AllAtomScorer base class
 
   .. method:: CalculateScoreProfile(start_resnum, num_residues, chain_idx=0)
 
-    Calculates per residue scores for the desired loop (extracted from
+    Calculates per residue scores for the desired loop(s) (extracted from
     environment) against the set environment.
 
-    Note that the structural data of the loop is expected to be in the linked
-    environment before calling this! This behavior is different from the
-    corresponding function in :class:`BackboneScorer` as, for performance
-    reasons, we require all the comparisons to be done against the environment.
-
-    :param start_resnum: Res. number defining the position in the SEQRES
+    :param start_resnum: Res. number(s) defining the position(s) in the SEQRES
                          (see :class:`~promod3.loop.AllAtomEnv` for indexing)
-    :type start_resnum:  :class:`int` / :class:`ost.mol.ResNum`
-    :param num_residues: Length of loop.
+    :type start_resnum:  :class:`int` / :class:`list` of :class:`int`
+    :param num_residues: Length of loop(s).
     :type num_residues:  :class:`int`
-    :param chain_idx: Index of chain the loop belongs to
+    :param chain_idx: Index of chain the loop(s) belongs to
                       (see :class:`~promod3.loop.AllAtomEnv` for indexing)
-    :type chain_idx:  :class:`int`
+    :type chain_idx:  :class:`int` / :class:`list` of :class:`int`
 
-    :return: Scores for the given loop, one for each residue.
-    :rtype:  :class:`list` of :class:`float`
+    :return: Scores for the given loop(s), one for each residue.
+    :rtype:  :class:`list` of :class:`float` / :class:`list` of :class:`list` 
+             of :class:`float`
 
     :raises: same :exc:`~exceptions.RuntimeError` as :meth:`CalculateScore`.
 
@@ -154,8 +145,11 @@ AllAtomInteractionScorer class
   *cutoff* and which are at least *seq_sep* residues apart. An energy is
   assigned to each distance using equally sized bins and distinguishing all
   possible pairs of atoms (usually the energy only differs for chemically
-  distinguishable heavy atoms). The calculated score is normalized by the number
-  of interacting atom pairs.
+  distinguishable heavy atoms). 
+  By default, the scorer calculates the scores by
+  including everything, the stuff set in the environment and the coordinates
+  in the input loops. You can change this behaviour with the according 
+  functions. 
 
   The scorer needs to be initialized either by loading a predefined scorer (e.g.
   :func:`LoadAllAtomInteractionScorer`) or by setting all energies (see :meth:`SetEnergy`).
@@ -204,6 +198,10 @@ AllAtomInteractionScorer class
 
     Setup one energy value. Unless a predefined scorer is loaded, this must be
     called for every pair of heavy atom types and for every *bin* < *bins*.
+    Internal symmetry is enforced => Calling SetEnergy(aaa1, aaa2, bin, energy) is
+    equivalent to calling SetEnergy(aaa1, aaa2, bin, energy) AND
+    SetEnergy(aaa2, aaa1, bin, energy).
+
 
     :param aaa1: Heavy atom type for first interaction partner.
     :type aaa1:  :class:`~promod3.loop.AminoAcidAtom`
@@ -216,6 +214,24 @@ AllAtomInteractionScorer class
 
     :raises: :exc:`~exceptions.RuntimeError` if inputs are invalid
 
+  .. method:: DoInternalScores(do_it) 
+
+    :param do_it:       Whether to include pairwise interactions within the 
+                        loop. True by default.
+    :type do_it:        :class:`bool`
+
+  .. method:: DoExternalScores(do_it) 
+
+    :param do_it:       Whether to include pairwise interactions towards the 
+                        environment. True by default.
+    :type do_it:        :class:`bool`
+
+  .. method:: DoNormalize(do_it) 
+
+    :param do_it:       Whether to normalize the calculated scores by the number
+                        of residues in the input loop. True by default.
+    :type do_it:        :class:`bool`
+
 
 .. function:: LoadAllAtomInteractionScorer()
 
@@ -230,8 +246,7 @@ AllAtomPackingScorer class
 
   Inherits all functionality of :class:`AllAtomScorer`. Evaluates pseudo
   energies by counting surrounding atoms within a certain *cutoff* radius around
-  all heavy atoms not belonging to the assessed residue itself. The calculated
-  score is normalized by the number of atoms being assessed.
+  all heavy atoms not belonging to the assessed residue itself. 
 
   The scorer needs to be initialized either by loading a predefined scorer (e.g.
   :func:`LoadAllAtomPackingScorer`) or by setting all energies (see
@@ -287,6 +302,12 @@ AllAtomPackingScorer class
 
     :raises: :exc:`~exceptions.RuntimeError` if inputs are invalid
 
+  .. method:: DoNormalize(do_it) 
+
+    :param do_it:       Whether to normalize the calculated scores by the number
+                        of residues in the input loop. True by default.
+    :type do_it:        :class:`bool`
+
 
 .. function:: LoadAllAtomPackingScorer()
 
@@ -302,5 +323,25 @@ AllAtomClashScorer class
   Inherits all functionality of :class:`AllAtomScorer`. Calculates a simple
   clash score of all atoms against the environment. There is no need to define
   any parameters here as all interaction energies are fixed (see Eq. (11) in
-  [canutescu2003b]_). The calculated score is normalized by the number of atoms
-  being assessed.
+  [canutescu2003b]_). By default, the scorer calculates the scores by
+  including everything, the stuff set in the environment and the coordinates
+  in the input loops. You can change this behaviour with the according 
+  functions. 
+
+  .. method:: DoInternalScores(do_it) 
+
+    :param do_it:       Whether to include pairwise interactions within the 
+                        loop. True by default.
+    :type do_it:        :class:`bool`
+
+  .. method:: DoExternalScores(do_it) 
+
+    :param do_it:       Whether to include pairwise interactions towards the 
+                        environment. True by default.
+    :type do_it:        :class:`bool`
+
+  .. method:: DoNormalize(do_it) 
+
+    :param do_it:       Whether to normalize the calculated scores by the number
+                        of residues in the input loop. True by default.
+    :type do_it:        :class:`bool`
diff --git a/doc/html/_sources/scoring/backbone_score_env.txt b/doc/html/_sources/scoring/backbone_score_env.txt
index f9c1e18ce2d2537df02f053e2932ab28d24b7712..25980a4d34ba90890e7686c87838fa8dcd0f1679 100644
--- a/doc/html/_sources/scoring/backbone_score_env.txt
+++ b/doc/html/_sources/scoring/backbone_score_env.txt
@@ -12,10 +12,18 @@ BackboneScoreEnv class
   used by the scorers. It is linked to a (list of) seqres (one per chain) at
   construction. The idea is to initialize it at the beginning of the modelling
   process with all known data (positions extracted from template, psipred
-  prediction, density map, etc) and then update the environment whenever a new
-  loop is being added. Note that, depending on the used scorers, some
-  information must be provided for the score to make sense and any env. data can
-  be set at any time before actually calculating a score.
+  prediction, etc). All scorers attached to that environment will see that data 
+  and can calculate scores accordingly.
+  Scoring with this setup is a two step process:
+
+  * Set the positions you want to score in the environment to make it available
+    to all attached scorers
+  * Call the scorers to get the desired scores
+
+  One problem that might occur is that you mess around with the environment and
+  at some point you want to restore the original state. The 
+  :class:`BackboneScoreEnv` provides a Stash / Pop mechanism to perform this 
+  task.
 
   :param seqres: Internal SEQRES to be set (single chain or list with one per
                  chain). Whenever setting structural data, consistency with this SEQRES is enforced.
@@ -94,17 +102,6 @@ BackboneScoreEnv class
              inconsistent with the number of internal chains or when one of the
              predictions' sizes is inconsistent with the internal SEQRES size.
 
-  .. method:: SetMap(map, resolution, all_atom=False)
-
-    Sets an internal density map, which is necessary to calculate some scores.
-
-    :param map:         The density map
-    :type map:          :class:`ost.img.ImageHandle`
-    :param resolution:  Expected resolution of the density map.
-    :type resolution:   :class:`float`
-    :param all_atom:    Whether the map is accurate enough to resolve all atoms.
-    :type all_atom:     :class:`bool`
-
   .. method:: AddPairwiseFunction(function, function_type)
 
     Adds a pairwise function that can be used in :meth:`ApplyPairwiseFunction`.
@@ -139,6 +136,26 @@ BackboneScoreEnv class
               res. numbers is invalid, the interaction partners are the same
               residue or when *f_idx* is an invalid index.
 
+  .. method:: Stash(start_rnum, num_residues, chain_idx) 
+
+    FILO style stashing. You can perform up to 100 stash operations to save
+    the current state of certain stretches in the environment. This state can
+    be restored by calling :func:`Pop`. In one stash operation you can either 
+    stash one stretch by providing integers as input or several stretches by 
+    providing lists of integers.
+
+    :param start_rnum:  start rnum of stretch to stash
+    :param num_residues: length of stretch to stash
+    :param chain_idx:   chain idx of stretch to stash
+
+    :type start_rnum:   :class:`int` / :class:`list` of :class:`int`
+    :type num_residues: :class:`int` / :class:`list` of :class:`int`
+    :type chain_idx:    :class:`int` / :class:`list` of :class:`int`
+
+  .. method:: Pop()
+
+    Remove and apply the the last stash operation.
+
   .. method:: GetSeqres()
 
     :return: SEQRES that was set in constructor (one sequence per chain).
diff --git a/doc/html/_sources/scoring/backbone_scorers.txt b/doc/html/_sources/scoring/backbone_scorers.txt
index ebb0bc300bd52033bb4a020ac0a5a63c390d3617..55a07ec77cc2e0ebc0b619c90c4ebaf824e9531a 100644
--- a/doc/html/_sources/scoring/backbone_scorers.txt
+++ b/doc/html/_sources/scoring/backbone_scorers.txt
@@ -36,55 +36,51 @@ BackboneOverallScorer class
     :param env: Link all scorers to this score environment.
     :type env:  :class:`BackboneScoreEnv`
 
-  .. method:: Calculate(key, bb_list, start_resnum, chain_idx=0)
+  .. method:: Calculate(key, start_resnum, num_residues, chain_idx=0)
 
-    Calculate score(s) for one or many loop(s) with
-    :meth:`BackboneScorer.CalculateScore`.
+    Calculate score for one or several stretches of amino acids given the 
+    current scoring environment.
 
     :param key: Key for desired scorer.
     :type key:  :class:`str`
-    :param bb_list: Loop(s) for which to calculate the given score
-    :type bb_list:  :class:`~promod3.loop.BackboneList` / :class:`list` of
-                    :class:`~promod3.loop.BackboneList`
     :param start_resnum: Res. number defining the position in the SEQRES
                          (see :class:`BackboneScoreEnv` for indexing)
-    :type start_resnum:  :class:`int`
-    :param chain_idx: Index of chain the loop(s) belong to
+    :type start_resnum:  :class:`int` / :class:`list` of :class:`int`
+    :param num_residues: Number of residues in the stretch(es) to score
+    :type num_residues: :class:`int` / :class:`list` of :class:`int`
+    :param chain_idx: Index of chain the stretch(es) belongs to
                       (see :class:`BackboneScoreEnv` for indexing)
-    :type chain_idx:  :class:`int`
+    :type chain_idx:  :class:`int` / :class:`list` of :class:`int`
 
-    :return: Score(s) calculated with the desired scorer for the given loop(s).
-             In the case of multiple loops, the returned list has the same
-             order as the input.
-    :rtype:  :class:`float` / :class:`list` of :class:`float`
+    :return: Score calculated with the desired scorer for the given stretch(es).
+    :rtype:  :class:`float` 
 
     :raises: :exc:`~exceptions.RuntimeError` if there is no scorer with that
              *key* or anything raised in :meth:`BackboneScorer.CalculateScore`.
 
-  .. method:: CalculateLinearCombination(linear_weights, bb_list, start_resnum,\
-                                         chain_idx=0)
+  .. method:: CalculateLinearCombination(linear_weights, start_resnum,\
+                                         num_residues, chain_idx=0)
 
-    Calculate linear combination(s) of scores for one or many loop(s).
+    Calculate linear combination of scores for one or several stretches of 
+    amino acids given the current scoring environment.
 
     :param linear_weights: Weights for each desired scorer. You can add a
                            constant value to each score by defining a weight
                            with key "intercept".
     :type linear_weights:  :class:`dict` (keys: :class:`str`,
                            values: :class:`float`)
-    :param bb_list: Loop(s) for which to calculate the given score
-    :type bb_list:  :class:`~promod3.loop.BackboneList` / :class:`list` of
-                    :class:`~promod3.loop.BackboneList`
     :param start_resnum: Res. number defining the position in the SEQRES
                          (see :class:`BackboneScoreEnv` for indexing)
-    :type start_resnum:  :class:`int`
-    :param chain_idx: Index of chain the loop(s) belong to
+    :type start_resnum:  :class:`int` / :class:`list` of :class:`int`
+    :param num_residues: Number of residues in the stretch(es) to score
+    :type num_residues: :class:`int` / :class:`list` of :class:`int`
+    :param chain_idx: Index of chain the stretch(es) belongs to
                       (see :class:`BackboneScoreEnv` for indexing)
-    :type chain_idx:  :class:`int`
+    :type chain_idx:  :class:`int` / :class:`list` of :class:`int`
 
-    :return: Linear combination(s) of the scores calculated with the desired
-             scorers for the given loop(s). In the case of multiple loops, the
-             returned list has the same order as the input.
-    :rtype:  :class:`float` / :class:`list` of :class:`float`
+    :return: Linear combination of the scores calculated with the desired
+             scorers for the given stretch(es)
+    :rtype:  :class:`float` 
 
     :raises: :exc:`~exceptions.RuntimeError` if *linear_weights* has a *key* for
              which no scorer exists or anything raised in
@@ -103,7 +99,7 @@ BackboneOverallScorer class
   :returns: Loads or creates the default scorers accessible through 
             following keys:
             "cb_packing", "cbeta", "reduced", "clash", "hbond", "ss_agreement",\
-            "torsion", "pairwise", "density"
+            "torsion", "pairwise"
   :rtype:   :class:`BackboneOverallScorer`
 
 
@@ -119,47 +115,46 @@ BackboneScorer base class
     :param env: Link scorer to this score environment.
     :type env:  :class:`BackboneScoreEnv`
 
-  .. method:: CalculateScore(bb_list, start_resnum, chain_idx=0)
+  .. method:: CalculateScore(start_resnum, num_residues, chain_idx=0)
 
-    Calculates score for the given loop internally and against the set
-    environment. Data in the environment, which overlaps with the given
-    *bb_list* is ignored. Unless otherwise noted in the scorer, a lower "score"
-    is better!
+    Calculates score for one or several stretches given the structural 
+    information in the attached environment. Unless otherwise noted in the 
+    scorer, a lower "score" is better!
 
-    :param bb_list: Loop for which to calculate the given score
-    :type bb_list:  :class:`~promod3.loop.BackboneList`
     :param start_resnum: Res. number defining the position in the SEQRES
                          (see :class:`BackboneScoreEnv` for indexing)
-    :type start_resnum:  :class:`int`
-    :param chain_idx: Index of chain the loop belongs to
+    :type start_resnum:  :class:`int` / :class:`list` of :class:`int`
+    :param num_residues: Number of residues in the stretch(es) to score
+    :type num_residues: :class:`int` / :class:`list` of :class:`int`
+    :param chain_idx: Index of chain the stretch(es) belongs to
                       (see :class:`BackboneScoreEnv` for indexing)
-    :type chain_idx:  :class:`int`
+    :type chain_idx:  :class:`int` / :class:`list` of :class:`int`
 
-    :return: Score for the given loop.
+    :return: Score for the given stretch(es).
     :rtype:  :class:`float`
 
     :raises: (for most scorers) :exc:`~exceptions.RuntimeError` if scorer was
              never attached to a score environment, if scorer has never been
-             properly initialized or if *chain_index* / *start_resnum* lead to
-             invalid positions.
+             properly initialized or if *start_resnum* / *num_residues* / 
+             *chain_idx* lead to invalid positions.
 
-  .. method:: CalculateScoreProfile(bb_list, start_resnum, chain_idx=0)
+  .. method:: CalculateScoreProfile(start_resnum, num_residues, chain_idx=0)
 
-    Calculates per residue scores for the given loop internally and against the
-    set environment. Data in the environment, which overlaps with the given
-    *bb_list* is ignored.
+    Calculates per residue scores for one or several stretches given the 
+    structural information in the attached environment.
 
-    :param bb_list: Loop for which to calculate the given scores
-    :type bb_list:  :class:`~promod3.loop.BackboneList`
     :param start_resnum: Res. number defining the position in the SEQRES
                          (see :class:`BackboneScoreEnv` for indexing)
-    :type start_resnum:  :class:`int`
-    :param chain_idx: Index of chain the loop belongs to
+    :type start_resnum:  :class:`int` / :class:`list` of :class:`int`
+    :param num_residues: Number of residues in the stretch(es) to score
+    :type num_residues: :class:`int` / :class:`list` of :class:`int`
+    :param chain_idx: Index of chain the stretch(es) belongs to
                       (see :class:`BackboneScoreEnv` for indexing)
-    :type chain_idx:  :class:`int`
+    :type chain_idx:  :class:`int` / :class:`list` of :class:`int`
 
-    :return: Scores for the given loop, one for each residue.
-    :rtype:  :class:`list` of :class:`float`
+    :return: Scores for the given stretch(es), one for each residue.
+    :rtype:  :class:`list` of :class:`float` or :class:`list` of :class:`list`
+             of :class:`float`
 
     :raises: same :exc:`~exceptions.RuntimeError` as :meth:`CalculateScore`.
 
@@ -171,25 +166,7 @@ CBPackingScorer class
 
   Inherits all functionality of :class:`BackboneScorer`. Evaluates pseudo
   energies by counting the number of other CB positions within a certain
-  *cutoff* radius of the CB position of the residue to be evaluated. The
-  calculated score is normalized by the number of residues in the loop.
-  In the default mode, the scorer scores a :class:`promod3.loop.BackboneList` 
-  given the defined environment. By placing this 
-  :class:`promod3.loop.BackboneList`, the score of the residues in the 
-  environment also change. It is possible to honour this effect by using the 
-  "IncludeEnv" mode. In this alternative mode, every environment residue close 
-  to the input :class:`promod3.loop.BackboneList` also contributes 
-  to the final score by adding the difference in score when the environment 
-  residue sees the original environment and the score when the environment would 
-  be modified by the :class:`promod3.loop.BackboneList`. You choose the mode 
-  by specifically calling the according CalculateEnergy functions. 
-  If you call the CalculateScore function from the parent class
-  (e.g. when the scorer is part of the :class:`BackboneOverallScorer`), it
-  gets checked what mode is currently active. You can toggle the mode by calling
-  the appropriate functions in this class. By default (when you load a scorer or
-  when you create a new scorer) the classic version gets called. If you want to
-  get per residue scores, the "IncludeEnv" mode makes not much sense and the 
-  scorer throws an error if a profile is requeset in this mode.
+  *cutoff* radius of the CB position of the residue to be evaluated. 
 
   The scorer needs to be initialized either by loading a predefined scorer (e.g.
   :func:`LoadCBPackingScorer`) or by setting all energies (see
@@ -245,16 +222,12 @@ CBPackingScorer class
 
     :raises: :exc:`~exceptions.RuntimeError` if inputs are invalid
 
-  .. method:: UseClassicMode()
+  .. method:: DoNormalize(do_it) 
 
-    If you call this function, the default mode is set to classic if the 
-    CalculateScore function from the parent class gets called. 
+    :param do_it:       Whether to normalize the calculated scores by the number
+                        of residues to be scored. True by default.
+    :type do_it:        :class:`bool`
 
-  .. method:: UseIncludeEnvMode()
-
-    If you call this function, the default mode is set to the 
-    described alternative mode if the CalculateScore function from the parent 
-    class gets called. 
 
 .. function:: LoadCBPackingScorer()
 
@@ -270,9 +243,8 @@ CBetaScorer class
   Inherits all functionality of :class:`BackboneScorer`. Evaluates a pairwise
   pseudo interaction energy between CB atoms which are located within a *cutoff*
   and which are at least *seq_sep* residues apart. An energy is assigned to each
-  distance using *bins* equally sized bins and distinguishing all possible pairs
-  of amino acids. The calculated score is normalized by the number of
-  interacting CB pairs.
+  distance using equally sized bins and distinguishing all possible pairs
+  of amino acids.  
 
   The scorer needs to be initialized either by loading a predefined scorer (e.g.
   :func:`LoadCBetaScorer`) or by setting all energies (see :meth:`SetEnergy`).
@@ -321,6 +293,9 @@ CBetaScorer class
 
     Setup one energy value. Unless a predefined scorer is loaded, this must be
     called for every pair of amino acids and for every *bin* < *bins*.
+    Internal symmetry is enforced => Calling SetEnergy(aa1, aa2, bin, energy) is
+    equivalent to calling SetEnergy(aa1, aa2, bin, energy) AND
+    SetEnergy(aa2, aa1, bin, energy).
 
     :param aa1: Amino acid for first interaction partner.
     :type aa1:  :class:`ost.conop.AminoAcid`
@@ -333,6 +308,25 @@ CBetaScorer class
 
     :raises: :exc:`~exceptions.RuntimeError` if inputs are invalid
 
+  .. method:: DoInternalScores(do_it) 
+
+    :param do_it:       Whether to include pairwise interactions between
+                        the scored residues. True by default.
+    :type do_it:        :class:`bool`
+
+  .. method:: DoExternalScores(do_it) 
+
+    :param do_it:       Whether to include pairwise interactions of the scored
+                        residues towards the surrounding environment. 
+                        True by default.
+    :type do_it:        :class:`bool`
+
+  .. method:: DoNormalize(do_it) 
+
+    :param do_it:       Whether to normalize the calculated scores by the number
+                        of residues to be scored. True by default.
+    :type do_it:        :class:`bool`
+
 
 .. function:: LoadCBetaScorer()
 
@@ -348,7 +342,7 @@ ReducedScorer class
   Inherits all functionality of :class:`BackboneScorer`. Evaluates a pairwise
   pseudo interaction energy between the reduced representation of residues.
   Every residue gets represented by its CA position p and a directional
-  component ``v = norm(ca_pos-n_pos) + norm (ca_pos-c_pos)``. Residues with CA
+  component ``v = norm(p-n_pos) + norm(p-c_pos)``. Residues with CA
   distance < *cutoff* and which are at least *seq_sep* residues apart are
   considered to be interacting. For interacting residues r1 and r2, we can
   define a line l between p1 and p2. The potential then considers:
@@ -358,10 +352,6 @@ ReducedScorer class
   * beta => angle between v2 and l
   * gamma => dihedral between (p1+v1,p1,p2,p2+v2)
 
-  Every pairwise interaction within the loop and to the environment gets
-  evaluated according to the given parametrization, summed up and finally
-  normalized by the number of total interactions.
-
   The scorer needs to be initialized either by loading a predefined scorer (e.g.
   :func:`LoadReducedScorer`) or by setting all energies (see :meth:`SetEnergy`).
 
@@ -418,6 +408,11 @@ ReducedScorer class
     called for every pair of amino acids, every *dist_bin* < *dist_bins*, every
     *alpha_bin* < *angle_bins*, every *beta_bin* < *angle_bins* and every
     *gamma_bin* < *dihedral_bins*.
+    Internal symmetry is enforced => Calling 
+    SetEnergy(aa1, aa2, dist_bin, alpha_bin, beta_bin, energy) is
+    equivalent to calling 
+    SetEnergy(aa1, aa2, dist_bin, alpha_bin, beta_bin, energy) AND
+    SetEnergy(aa2, aa1, dist_bin, beta_bin, alpha_bin, energy).
 
     :param aa1: Amino acid for first interaction partner.
     :type aa1:  :class:`ost.conop.AminoAcid`
@@ -436,6 +431,24 @@ ReducedScorer class
 
     :raises: :exc:`~exceptions.RuntimeError` if inputs are invalid
 
+  .. method:: DoInternalScores(do_it) 
+
+    :param do_it:       Whether to include pairwise interactions between
+                        the scored residues. True by default.
+    :type do_it:        :class:`bool`
+
+  .. method:: DoExternalScores(do_it) 
+
+    :param do_it:       Whether to include pairwise interactions of the scored
+                        residues towards the surrounding environment. 
+                        True by default.
+    :type do_it:        :class:`bool`
+
+  .. method:: DoNormalize(do_it) 
+
+    :param do_it:       Whether to normalize the calculated scores by the number
+                        of residues to be scored. True by default.
+    :type do_it:        :class:`bool`
 
 .. function:: LoadReducedScorer()
 
@@ -450,29 +463,27 @@ ClashScorer class
 
   Inherits all functionality of :class:`BackboneScorer`. Calculates a simple
   clash score of a loop itself and with the set environment. There is no need to
-  define any parameters here as all interaction energies are fixed. The
-  calculated score is normalized by the number of residues in the loop.
+  define any parameters here as all interaction energies are fixed (see Eq. (11) 
+  in [canutescu2003b]_). 
 
+  .. method:: DoInternalScores(do_it) 
 
-DensityScorer class
---------------------------------------------------------------------------------
+    :param do_it:       Whether to include pairwise interactions between
+                        the scored residues. True by default.
+    :type do_it:        :class:`bool`
 
-.. class:: DensityScorer
+  .. method:: DoExternalScores(do_it) 
 
-  Inherits all functionality of :class:`BackboneScorer`. Calculates the
-  normalized cross correlation between a density generated from the input
-  :class:`~promod3.loop.BackboneList` and a set map.
+    :param do_it:       Whether to include pairwise interactions of the scored
+                        residues towards the surrounding environment. 
+                        True by default.
+    :type do_it:        :class:`bool`
 
-  This scorer requires that the attached environment has a density map defined
-  (see :meth:`BackboneScoreEnv.SetMap`) as soon as a score is to be calculated.
-  The *resolution* and *all_atom* flags that were specified in SetMap determine
-  how the backbone list is translated into an artificial density map. If
-  *all_atom* is set to False (which is recommended for low resolution maps), the
-  artificial map gets constructed by only using CA positions instead of all
-  atoms.
+  .. method:: DoNormalize(do_it) 
 
-  Note that for this scorer a higher "score" is better! So take care when
-  combining this to other scores, where it is commonly the other way around.
+    :param do_it:       Whether to normalize the calculated scores by the number
+                        of residues to be scored. True by default.
+    :type do_it:        :class:`bool`
 
 
 HBondScorer class
@@ -499,10 +510,6 @@ HBondScorer class
   thats the one from which the energy is extracted. In all other cases, the
   energy is extracted from the 0 state.
 
-  Every pairwise interaction within the loop and to the environment gets
-  evaluated according to the given parametrization, summed up and finally
-  normalized by the number of residues in the loop.
-
   The scorer needs to be initialized either by loading a predefined scorer (e.g.
   :func:`LoadHBondScorer`) or by setting all energies (see :meth:`SetEnergy`).
 
@@ -589,6 +596,25 @@ HBondScorer class
 
     :raises: :exc:`~exceptions.RuntimeError` if inputs are invalid
 
+  .. method:: DoInternalScores(do_it) 
+
+    :param do_it:       Whether to include pairwise interactions between
+                        the scored residues. True by default.
+    :type do_it:        :class:`bool`
+
+  .. method:: DoExternalScores(do_it) 
+
+    :param do_it:       Whether to include pairwise interactions of the scored
+                        residues towards the surrounding environment. 
+                        True by default.
+    :type do_it:        :class:`bool`
+
+  .. method:: DoNormalize(do_it) 
+
+    :param do_it:       Whether to normalize the calculated scores by the number
+                        of residues to be scored. True by default.
+    :type do_it:        :class:`bool`
+
 
 .. function:: LoadHBondScorer()
 
@@ -607,8 +633,7 @@ SSAgreementScorer class
   structure in the model. In every score evaluation, the secondary structure of
   the loop is estimated by searching for hydrogen bonds leading to a secondary
   structure as defined by dssp. The hbonds are searched internally in the loop
-  as well as in the environment. The final score gets summed up over all
-  residues in the loop and normalized by the number of residues.
+  as well as in the environment. 
 
   The scorer needs to be initialized either by loading a predefined scorer (e.g.
   :func:`LoadSSAgreementScorer`) or by setting scores for all possible states
@@ -665,6 +690,11 @@ SSAgreementScorer class
 
     :raises: :exc:`~exceptions.RuntimeError` if inputs are invalid
 
+  .. method:: DoNormalize(do_it) 
+
+    :param do_it:       Whether to normalize the calculated scores by the number
+                        of residues to be scored. True by default.
+    :type do_it:        :class:`bool`
 
 .. function:: LoadSSAgreementScorer()
 
@@ -679,9 +709,7 @@ TorsionScorer class
 
   Inherits all functionality of :class:`BackboneScorer`. Evaluates pseudo
   energies based on the identity of three consecutive residues and the phi/psi
-  dihedral angles of the central residue. Every residue gets evaluated according
-  to the set parametrization and the final score gets normalized by the total
-  number of summed pseudo energies. The first phi and last psi angle get
+  dihedral angles of the central residue. The first phi and last psi angle get
   determined with the help of the environment if set.
 
   The scorer needs to be initialized either by loading a predefined scorer (e.g.
@@ -746,6 +774,11 @@ TorsionScorer class
 
     :raises: :exc:`~exceptions.RuntimeError` if inputs are invalid
 
+  .. method:: DoNormalize(do_it) 
+
+    :param do_it:       Whether to normalize the calculated scores by the number
+                        of residues to be scored. True by default.
+    :type do_it:        :class:`bool`
 
 .. function:: LoadTorsionScorer()
 
@@ -759,14 +792,28 @@ PairwiseScorer class
 .. class:: PairwiseScorer
 
   Inherits all functionality of :class:`BackboneScorer`. Evaluates a list of
-  generic pairwise functions (see :class:`PairwiseFunction`). When evaluating a
-  loop, the scores of all pairwise functions which involve a residue in the loop
-  are summed up (the other residue can be either in the loop or in the env.) and
-  normalized by the number of residues in the loop.
-
-  This scorer assumes that the attached environment has pairwise functions
-  defined (see :meth:`BackboneScoreEnv.ApplyPairwiseFunction`) as soon as a
-  score is to be calculated.
+  generic pairwise functions (see :class:`PairwiseFunction`). 
+  That are set in the attached scoring environment 
+  (see :meth:`BackboneScoreEnv.ApplyPairwiseFunction`).
 
   Note that for this scorer a higher "score" is better! So take care when
   combining this to other scores, where it is commonly the other way around.
+
+  .. method:: DoInternalScores(do_it) 
+
+    :param do_it:       Whether to include pairwise interactions between
+                        the scored residues. True by default.
+    :type do_it:        :class:`bool`
+
+  .. method:: DoExternalScores(do_it) 
+
+    :param do_it:       Whether to include pairwise interactions of the scored
+                        residues towards the surrounding environment. 
+                        True by default.
+    :type do_it:        :class:`bool`, true by default.
+
+  .. method:: DoNormalize(do_it) 
+
+    :param do_it:       Whether to normalize the calculated scores by the number
+                        of residues to be scored. True by default.
+    :type do_it:        :class:`bool`
diff --git a/doc/html/_sources/scoring/index.txt b/doc/html/_sources/scoring/index.txt
index 9b9a97882cf52c828b6d48133c6b721a34cb66b8..983d6b5587c5f70fc9088e6bdac386567fef16c3 100644
--- a/doc/html/_sources/scoring/index.txt
+++ b/doc/html/_sources/scoring/index.txt
@@ -9,8 +9,8 @@
 Tools and algorithms to score loops. The scoring system is split between an
 environment which contains model-specific data and scorers which evaluate loops.
 
-In this example, we load a structure, setup a score environment and a few
-scorers and finally score some loops:
+In this example, we load a structure, setup a score environment, link a few
+scorers to it and finally score some loops:
 
 .. literalinclude:: ../../../tests/doc/scripts/scoring_main.py
 
@@ -22,3 +22,4 @@ Contents:
    backbone_score_env
    backbone_scorers
    all_atom_scorers
+   other_scoring_functions
diff --git a/doc/html/_sources/scoring/other_scoring_functions.txt b/doc/html/_sources/scoring/other_scoring_functions.txt
new file mode 100644
index 0000000000000000000000000000000000000000..f505232e026655cdebf83d068269e805eb99fedd
--- /dev/null
+++ b/doc/html/_sources/scoring/other_scoring_functions.txt
@@ -0,0 +1,56 @@
+Other Scoring Functions
+================================================================================
+
+.. currentmodule:: promod3.scoring
+
+
+Scoring Functions from SCWRL3
+--------------------------------------------------------------------------------
+
+.. method:: SCWRL3PairwiseScore(d, Rij)
+
+  Pairwise score from the SCWRL3 sidechain construction algorithm 
+  [canutescu2003b]_.
+
+  :param d:             Distance between the two interacting particles
+  :param Rij:           Summed hard-sphere radii of the interacting particles.
+                        Suggestions from the paper:
+
+                        - carbon: 1.6
+                        - oxygen: 1.3
+                        - nitrogen: 1.3
+                        - sulfur: 1.7
+
+  :type d:              :class:`float`
+  :type Rij:            :class:`float`
+
+  :returns:             The score
+  :rtype:               :class:`float`
+
+
+.. method:: SCWRL3DisulfidScore(ca_pos_one, cb_pos_one, sg_pos_one\
+                                ca_pos_two, cb_pos_two, sg_pos_two)
+
+  Implements the empirically derived disulfid score from the SCWRL3 sidechain 
+  construction algorithm [canutescu2003b]_.
+
+  :param ca_pos_one:    CA carbon position of first amino acid
+  :param cb_pos_one:    CB carbon position of first amino acid
+  :param sg_pos_one:    SG sulfur position of first amino acid
+  :param ca_pos_two:    CA carbon position of second amino acid
+  :param cb_pos_two:    CB carbon position of second amino acid
+  :param sg_pos_two:    SG sulfur position of second amino acid
+
+  :type ca_pos_one:     :class:`ost.geoom.Vec3`
+  :type cb_pos_one:     :class:`ost.geoom.Vec3`
+  :type sg_pos_one:     :class:`ost.geoom.Vec3`
+  :type ca_pos_two:     :class:`ost.geoom.Vec3`
+  :type cb_pos_two:     :class:`ost.geoom.Vec3`
+  :type sg_pos_two:     :class:`ost.geoom.Vec3`
+
+  :returns:             The score
+  :rtype:               :class:`float`
+
+
+
+.. [canutescu2003b] Canutescu AA, Shelenkov AA, Dunbrack RL Jr. (2003). A graph-theory algorithm for rapid protein side-chain prediction. Protein Sci (2003).
diff --git a/doc/html/_sources/sidechain/disulfid.txt b/doc/html/_sources/sidechain/disulfid.txt
index 5b330287975708bdf84fa008b20d2e63315f4895..1cee3075640728b8c205c8bf9d9ff0128d6eeb9d 100644
--- a/doc/html/_sources/sidechain/disulfid.txt
+++ b/doc/html/_sources/sidechain/disulfid.txt
@@ -7,8 +7,9 @@ When calculating the pairwise interaction energy between two rotamers building
 a disulfid bond, one would get an unfavourable energy due to "clashes" between
 the sulfur atoms. It is possible to improve performance in sidechain
 reconstruction regarding cysteins when finding and separately handle
-disulfid bonds. PROMOD3 implements a simple geometrical description 
-[canutescu2003b]_ . The paper proposes two rotamers to be in a disulfid
+disulfid bonds. The scoring module implements an empirically derived disulfid
+score (:func:`promod3.scoring.SCWRL3DisulfidScore`) as defined in 
+[canutescu2003b]_. The paper proposes two rotamers to be in a disulfid
 bonded state, if the resulting disulfid score plus the self energies of the 
 involved rotamers is below 45. If there are several cysteines close together,
 this problem gets another layer of complexity. One has to assure, that
@@ -16,38 +17,18 @@ every cysteine only participates in one disulfid bond but the network
 of disulfid bonds is geometrically optimal. SCWRL4 proposes an approach,
 that has also been implemented here.
 
-.. method:: DisulfidRawScore(ca_pos_one, cb_pos_one, sg_pos_one, \
-                             ca_pos_two, cb_pos_two, sg_pos_two)
-
-  Evaluates the geometric expression based on the input positions
-
-  :param ca_pos_one:    The CA position of first rotamer
-  :param cb_pos_one:    The CB position of first rotamer
-  :param sg_pos_one:    The gamma sulfur position of first rotamer
-  :param ca_pos_two:    The CA position of second rotamer
-  :param cb_pos_two:    The CB position of second rotamer
-  :param sg_pos_two:    The gamma sulfur position of second rotamer
-
-  :type ca_pos_one:     :class:`ost.geom.Vec3`
-  :type cb_pos_one:     :class:`ost.geom.Vec3`
-  :type sg_pos_one:     :class:`ost.geom.Vec3`
-  :type ca_pos_two:     :class:`ost.geom.Vec3`
-  :type cb_pos_two:     :class:`ost.geom.Vec3`
-  :type sg_pos_two:     :class:`ost.geom.Vec3`
-
-  :returns:             The result of the raw score
-
-  
 
 .. method:: DisulfidScore(rotamer_one, rotamer_two, ca_pos_one, cb_pos_one, \
                           ca_pos_two, cb_pos_two)
 
   Directly extracts the positions of the gamma sulfurs from the rotamers by
-  searching for particles with the name "SG". In case of :class:`RRMRotamer`
-  It expects exactly one gamma sulfur per rotamer. In case of
-  :class:`FRMRotamer` there can be an arbitrary number of gamma sulfurs per
-  rotamer (at least one), it then evaluates the score for all possible
-  combinations of gamma sulfurs and takes the minimum score.
+  searching for particles with the name "SG".
+  The found positions are then passed to 
+  :func:`promod3.scoring.SCWRL3DisulfidScore`. 
+  In case of :class:`RRMRotamer` it expects exactly one gamma sulfur per 
+  rotamer. In case of :class:`FRMRotamer` there can be an arbitrary number 
+  of gamma sulfurs per rotamer (at least one), it then evaluates the score 
+  for all possible combinations of gamma sulfurs and takes the minimum score.
   To get a final DisulfidScore, it finally adds the self energies of the
   rotamers to the result of the geometric expression.
 
@@ -108,6 +89,3 @@ that has also been implemented here.
             The tuples in the first list describe the indices of cysteins 
             participating in disulfid bonds. The tuples in the second list 
             describe the optimal rotamers in the according rotamer groups.
-
-
-.. [canutescu2003b] Canutescu AA, Shelenkov AA, Dunbrack RL Jr. (2003). A graph-theory algorithm for rapid protein side-chain prediction. Protein Sci (2003).
diff --git a/doc/html/_sources/sidechain/graph.txt b/doc/html/_sources/sidechain/graph.txt
index 33f3da97bd5f34cd341d31a25f09b733b3b015df..118c72eabb98ed98acdc13eafcb6f3af4bbbb867 100644
--- a/doc/html/_sources/sidechain/graph.txt
+++ b/doc/html/_sources/sidechain/graph.txt
@@ -6,15 +6,15 @@ Rotamer Graph
 Once having a frame representing the rigid parts, the internal energies in
 rotamer groups can be calculated. To come to a final solution of the sidechain
 modelling problem, the pairwise energies also have to be evaluated and an
-overall solution has to be found. PROMOD3 implements an interaction graph that
-takes a list of rotamer groups, calculates the pairwise energies, does edge
-decomposition and dead end elimination. Solutions can finally be found 
-using Tree decomposition, AStar or Monte Carlo approaches. 
+overall solution has to be found. PROMOD3 implements a
+:class:`promod3.core.GraphMinimizer` that allows to find solutions using
+tree decomposition, A* and Monte Carlo algorithms.
 
 .. class:: RotamerGraph
 
-  The Graph object has no constructor exported to python. It is meant to be
-  constructed using the static create functions.
+  The :class:`RotamerGraph` objects inherits from 
+  :class:`promod3.core.GraphMinimizer` and extends the minimizer by static
+  initialization functions.
 
   .. staticmethod:: CreateFromRRMList(rotamer_groups)
 
@@ -27,276 +27,3 @@ using Tree decomposition, AStar or Monte Carlo approaches.
     :type rotamer_groups:  :class:`list`
 
 
-  .. method:: Prune(epsilon, [e_cut=0.0, consider_all_nodes=False])
-
-    Performs edge decomposition followed by dead end elimination in an
-    iterative manner until no changes can be observed anymore given 
-    **epsilon**.
-
-    :param epsilon:     The energy threshold to perform edge decomposition.
-
-    :param e_cut:       Parameter to control dead end elimination. If set to
-                        0.0, the default goldstein criterion is applied =>
-                        the rotamer gets removed if it's dominated by all other
-                        rotamers in the same node. If you increase this value,
-                        a rotamer must be dominated by at least this **e_cut**.
-
-
-    :param consider_all_nodes: Flag, wether the dead end elimination should be
-                               applied to all nodes, or only those who are
-                               connected with an edge removed by edge 
-                               decomposition. This is useful if already a Prune
-                               operation has been performed => only those nodes
-                               connected to a removed edge have the chance for
-                               successful dead end elimination.
-
-    :type epsilon:      :class:`float`
-    :type e_cut:        :class:`float`
-    :type consider_all_nodes: :class:`bool`
-
-
-  .. method:: ApplyDEE(node_idx, [e_cut=0.0])
-
-    Applies dead end elimination on one particular node and potentially
-    deactivates certain rotamers.
-
-    :param node_idx:    Node to apply dead end elimination
-    :param e_cut:       If set to
-                        0.0, the default goldstein criterion is applied =>
-                        the rotamer gets removed if it's dominated by all other
-                        rotamers in the same node. If you increase this value,
-                        a rotamer must be dominated by at least this **e_cut**.
-
-    :type node_idx:     :class:`int`
-    :type e_cut:        :class:`float`
-
-    :returns:           :class:`bool` whether any rotamer has been deactivated.
-
-
-
-  .. method:: ApplyEdgeDecomposition(edge_idx, epsilon)
-
-    Applies edge decomposition on one particular edge and potentially
-    deactivates it.
-
-
-    :param edge_idx:    Edge to decompose. 
-                        the idx relates to the list you get back
-                        when calling the :meth:`GetEdges` function.
-
-    :param epsilon:     The energy threshold to perform edge decomposition.
-
-    :type edge_idx:     :class:`int`
-    :type epsilon:      :class:`float`
-
-
-    :returns:           :class:`bool` whether the edge has been decomposed and 
-                        deactivated 
-                        
-
-  .. method:: Reset()
-
-    Resets the graph by undoing any pruning operation (DEE and edge decomposition)
-
-
-  .. method:: TreeSolve([max_complexity=inf, initial_epsilon=0.02])
-
-    The method solves a rotamer graph using a minimal width tree decomposition
-    approach in an iterative manner. In every iteration, the algorithm performs
-    a pruning step (DEE / Edge Decomposition) and subsequently tries to solve 
-    each connected component in the graph separately. 
-    If the number of possible enumerations in the tree constructetd from a 
-    particular connected component is is larger **max_complexity**, 
-    this component is solved in a later iteration. The algorithm iterates until 
-    all connected components are solved and steadily increases the epsilon value 
-    resulting in a more and more agressive edge decomposition. This function
-    assumes all self energies of the rotamers to be calculated and properly set!
-
-    :param max_complexity: Max number of possible permutations, that have to 
-                           be enumerated in the resulting tree after tree
-                           decomposition.
-
-    :param initial_epsilon: The initial energy threshold to perform edge
-                            decomposition.
-
-    :type max_complexity: :class:`int`
-    :type initial_epsilon: :class:`float`
-
-    :returns:           A tuple with the first element being a list of indices 
-                        representing the single rotamers minimizing
-                        the overall energy functions from every rotamer group.
-                        The second element is the according energy value.
-
-
-  .. method:: AStarSolve(e_thresh, [max_n=100, max_visited_nodes=100000000])
-
-    The method solves a rotamer graph using the A\* algorithm. Besides creating
-    minimal energy solution, the function produces a maximum of **max_n**
-    solutions sorted by energy. It aborts as soon as it sees the first solution
-    with an energy difference of **e_thresh** to the optimal solution or hits
-    **max_n**. If you're only interested in the optimal solution you should use
-    the TreeSolve function since it's much faster and uses less memory.
-    There is no automatic pruning of the graph using DEE or edge decomposition, 
-    so you have to do it by yourself, otherwise you'll have a looooooong 
-    runtime or even hit the **max_visited_nodes** parameter that caps the memory
-    usage. 
-    To have a valid solution you have to take care that you set the **e_cut** 
-    parameter in the pruning function to **e_tresh**.
-    This function assumes all self energies of the rotamers to be calculated 
-    and properly set!
-
-    :param e_thresh:    Maximal energy difference of a solution to the
-                        optimal solution to be considered.
-
-    :param max_n:       The maximum number of solutions that will be generated.
-
-    :param  max_visited_nodes: Caps the memory usage of the algorithm. Besides
-                               The memory used for pairwise energies and self
-                               energies, the algorithm uses about 
-                               **max_visited_nodes** * 20 bytes.
-
-
-    :type e_thresh:      :class:`float`
-    :type max_n:        :class:`int`
-    :type max_visited_nodes: :class:`int`
-
-    :returns:           A tuple with the first element being a list of 
-                        solutions with indices representing the single rotamers 
-                        selected for that solution. The second element is a list
-                        of energies for the according solutions.
-
-
-  .. method:: MCSolve([n=100, mc_steps=100000, start_temperature=1000.0, \\
-                       change_frequency=1000, cooling_factor=0.9, seed=0]) 
-
-    Does a total of **n** Monte Carlo runs to find low energy solutions
-    of the RotamerGraph. Each run starts with a random rotamer
-    configuration. At each of the **mc_steps** steps, a random location and
-    a random rotamer at that location is selected and an energy difference 
-    of that random selection relative to the current configuration is 
-    estimated. If the difference in energy is negative, the step is 
-    accepted. If not, the step is accepted with a probability given by
-    the temperature dependent Metropolis criterion (exp(-ediff/T)).
-    The temperature for every run starts with **start_temperature** 
-    and is multiplied every **change_frequency** steps with **cooling_factor**
-    to achieve a simulated annealing effect.
-    There is no automatic pruning of the graph using DEE or edge decomposition,
-    you have to do that by yourself.
-    This function assumes all self energies of the rotamers to be calculated 
-    and properly set!
-    
-    :param n:           Number of Monte Carlo runs 
-    :param mc_steps:    Number of Monte Carlo steps per run
-    :param start_temperature: Start temperature for the temperature dependent
-                              Metropolis criterion
-    :param change_frequency: Number of steps the temperature stays the same
-    :param cooling_factor: Factor to multiply temperature each 
-                          **change_frequency** steps
-    :param seed:        Seed for random number generator 
-
-    :type n:            :class:`int`
-    :type mc_steps:     :class:`int`
-    :type start_temperature: :class:`float`
-    :type change_frequency: :class:`int`
-    :type cooling_factor: :class:`float`
-    :type seed:         :class:`float`
-
-    :returns:           A tuple with the first element being a list of 
-                        solutions with indices representing the single rotamers 
-                        selected for that solution. The second element is a list
-                        of energies for the according solutions.
-
-
-
-  .. method:: GetNumNodes()
-
-    :returns:           The number of nodes in the graph
-                        => every RotamerGroup is a node
-
-
-  .. method:: GetNumEdges()
-
-    :returns:           The number of edges in the graph, representing
-                        connections between nodes with at least one
-                        nonzero interaction
-
-
-  .. method:: GetNumActiveNodes()
-
-    :returns:           The number of nodes having more than one active rotamer, 
-                        even after performing pruning operations
-
-
-  .. method:: GetNumActiveEdges()
-
-    :returns:           The number of edges representing nonzero interactions,
-                        even after performing pruning operations
-
-
-  .. method:: GetNumRotamers()
-
-    :returns:           The total number of rotamers in the graph
-
-
-  .. method:: GetNumActiveRotamers()
-
-    :returns:           The total number of active rotamers (Total number of 
-                        rotamers minus those that have been deactivated by DEE)
-
-
-  .. method:: GetEdges()
-
-    :returns:           A list of tuples describing the edges 
-                        connecting nodes with nonzero pairwise interactions   
-
-
-  .. method:: GetActiveEdges()
-    
-    :returns:           A :class:`list` of :class:`tuples` describing the edges 
-                        connecting nodes with nonzero pairwise interactions 
-                        (All edges minus those that have been deactived by edge 
-                        decomposition)
-
-
-  .. method:: GetActiveRotamers(node_idx)
-
-    :param node_idx:    Specifies node from which the active rotamers should be 
-                        extracted
-
-    :type node_idx:     :class:`int`
-
-    :returns:           list of the rotamers that are active
-                        in specified node (all rotamers minus those that have 
-                        been deactivated using DEE) 
-
-
-  .. method:: GetSelfEnergies(node_idx)
-
-    :param node_idx:    Specifies node from which the self energies should be 
-                        extracted
-
-    :type node_idx:     :class:`int`
-
-    :returns:           list of self energies for all rotamers in 
-                        specified node as they are fed into the solving 
-                        algorithms. Note, that they might slightly differ 
-                        from the original self energies in the input rotamers
-                        because of approximations introduced in edge 
-                        decomposition.
-
-
-  .. method:: GetPairwiseEnergies(edge_idx)
-
-    :param edge_idx:    Specifies edge from which the pairwise energies should
-                        be extracted, the idx relates to the list you get back
-                        when calling the :meth:`GetEdges` function.
-
-    :type edge_idx:     :class:`int`
-
-    :returns:           list of list where you can extract 
-                        the energy of rotamer i in the first node in the
-                        edge with rotamer j in the second node in the edge 
-                        with: e = pairwise_energies[i][j]
-                         
-
-                       
diff --git a/doc/html/_sources/sidechain/rotamer.txt b/doc/html/_sources/sidechain/rotamer.txt
index a62ca72acb66bab21f99740b7d46912eba07b18a..40f882320bb51f59b604a6ea7de7106d8582ca2a 100644
--- a/doc/html/_sources/sidechain/rotamer.txt
+++ b/doc/html/_sources/sidechain/rotamer.txt
@@ -156,7 +156,8 @@ Rotamers
 
     Iterates over every particle and searches for the according atom in
     **res**. If it's present, the position gets reset to the particle position.
-    If not, a new atom gets added to **res**. 
+    If not, a new atom gets added to **res**. No atoms are removed from **res**
+    in this process. 
 
     :param res:         Residue to be reconstructed
     :param consider_hydrogens: Flag, whether polar hydrogens should be added to 
@@ -313,6 +314,7 @@ Rotamers
     Iterates over every particle of the active subrotamer and searches for the 
     according atom in **res**. If it's present, the position gets reset to the 
     particle position. If not, a new atom gets added to **res**. 
+    No atoms are removed from **res** in this process. 
 
     :param res:         Residue to be reconstructed
     :param consider_hydrogens: Flag, whether polar hydrogens should be added to 
diff --git a/doc/html/_sources/sidechain/rotamer_constructor.txt b/doc/html/_sources/sidechain/rotamer_constructor.txt
index 316c0aba0559e2c0061d8a5ed23641967093a00f..36c76a2c0857dc5bdbd5b3257e24e8b2bde5eaac 100644
--- a/doc/html/_sources/sidechain/rotamer_constructor.txt
+++ b/doc/html/_sources/sidechain/rotamer_constructor.txt
@@ -11,22 +11,33 @@ Constructing Rotamers and Frame Residues
 --------------------------------------------------------------------------------
 
 
-.. class:: SCWRLRotamerConstructor()
+.. class:: SCWRLRotamerConstructor(cb_in_sidechain)
 
   Constructing rotamers and frame residues that are parametrized according to
   the SCWRL4 method. They contain all heavy atoms, but also the
-  polar hydrogens. The rotamers start after the CB atom (typically CG). 
+  polar hydrogens. 
   In case of the :class:`FrameResidue` construction, the
   constructor distinguishes between backbone and sidechain frame residues.
 
+  :param cb_in_sidechain: If set to true, all constructed rotamers will contain 
+                          the cb atom. This flag also affects the construction 
+                          of frame residues and controls whether the cb atom 
+                          shows up in the backbone frame residues or sidechain 
+                          frame residues.
+                          This is useful when you want to represent ALA or 
+                          GLY with actual rotamers, but be aware of increased 
+                          runtime. This flag can be set to False for most
+                          modeling applications and you just don't generate
+                          any rotamers for ALA and GLY.
+
+  :type cb_in_sidechain: :class:`bool`
+
+
   .. method:: ConstructRRMRotamerGroup(res, id, residue_index, rot_lib,\
                                        [probability_cutoff = 0.98])
   .. method:: ConstructRRMRotamerGroup(all_atom_pos, aa_res_idx, id,\
                                        residue_index, rot_lib,\
                                        [probability_cutoff = 0.98])
-  .. method:: ConstructRRMRotamerGroup(n_pos, ca_pos, cb_pos, id,\
-                                       residue_index, rot_lib,\          
-                                       [probability_cutoff = 0.98])
   .. method:: ConstructRRMRotamerGroup(res, id, residue_index, rot_lib,\
                                        [phi = -1.0472, psi = -0.7854,\
                                         probability_cutoff = 0.98])
@@ -34,29 +45,19 @@ Constructing Rotamers and Frame Residues
                                        residue_index, rot_lib,\
                                        [phi = -1.0472, psi = -0.7854,\
                                         probability_cutoff = 0.98])
-  .. method:: ConstructRRMRotamerGroup(n_pos, ca_pos, cb_pos, id,\
-                                       residue_index, rot_lib,\
-                                       [phi = -1.0472, psi = -0.7854,\
-                                        probability_cutoff = 0.98])
   .. method:: ConstructRRMRotamerGroup(res, id, residue_index, rot_lib_entries,\
                                        [probability_cutoff = 0.98])
   .. method:: ConstructRRMRotamerGroup(all_atom_pos, aa_res_idx, id,\
                                        residue_index, rot_lib_entries,\
                                        [probability_cutoff = 0.98])
-  .. method:: ConstructRRMRotamerGroup(n_pos, ca_pos, cb_pos, id,\
-                                       residue_index, rot_lib_entries,\          
-                                       [probability_cutoff = 0.98])
 
     All functions are also avaible for their flexible rotamer model counterpart.
     =>ConstructFRMRotamerGroup(...) with exactly the same parameters. 
 
-    :param res:         To extract the N, CA, CB backbone anchor
-    :param all_atom_pos: To extract the N, CA, CB backbone anchor
+    :param res:         To extract the required backbone atoms
+    :param all_atom_pos: To extract the required backbone atoms
     :param aa_res_idx:  Index of residue in **all_atom_pos** from which to
-                        extract the backbone anchor
-    :param n_pos:       To directly feed in the backbone anchor positions
-    :param ca_pos:      To directly feed in the backbone anchor positions
-    :param cb_pos:      To directly feed in the backbone anchor positions
+                        extract the required backbone atoms
     :param id:          Identifies the sidechain.
     :param residue_index: Important for the energy calculations towards the 
                           :class:`Frame` you don't want to calculate a pairwise
@@ -82,9 +83,6 @@ Constructing Rotamers and Frame Residues
     :type res:          :class:`ost.mol.ResidueHandle`
     :type all_atom_pos: :class:`promod3.loop.AllAtomPositions`
     :type aa_res_idx:   :class:`int`
-    :type n_pos:        :class:`ost.geom.Vec3`
-    :type ca_pos:       :class:`ost.geom.Vec3`
-    :type cb_pos:       :class:`ost.geom.Vec3`
     :type id:           :class:`RotamerID`
     :type residue_index: :class:`int`
     :type rot_lib:      :class:`RotamerLib` / :class:`BBDepRotamerLib`
@@ -93,9 +91,8 @@ Constructing Rotamers and Frame Residues
     :rtype:             :class:`RRMRotamerGroup`
 
     :raises:  :exc:`~exceptions.RuntimeError` when not all required backbone
-              atoms are present in **residue**, not all required atom
-              positions are set in **all_atom_pos** or when the rotamer library
-              does not contain any entries for **id**
+              atoms are present in **residue** or not all required atom
+              positions are set in **all_atom_pos**
 
 
   .. method:: ConstructBackboneFrameResidue(res, id, residue_index, Real phi,\
@@ -105,13 +102,8 @@ Constructing Rotamers and Frame Residues
                                             residue_index, Real phi,\
                                             [n_ter = False, c_ter = False])
 
-  .. method:: ConstructBackboneFrameResidue(n_pos, ca_pos, c_pos, o_pos, cb_pos,\ 
-                                            id, residue_index, Real phi,\
-                                            [n_ter = False, c_ter = False])
-
-    Constructs backbone frame residues for amino acid residues. It extracts
-    the n, ca, c, o and cb positions and constructs a frame residue based on
-    the parametrizations of SCWRL4. In case of **n_ter**, there are additional
+    Constructs backbone frame residues for amino acid residues based on the 
+    parametrizations of SCWRL4. In case of **n_ter**, there are additional
     hydrogens added at the nitrogen to represent a proper n-terminus. The same
     is true for **c_ter**, an additional oxygen is built instead. In any case,
     a single hydrogen is added to the nitrogen (except proline), this is
@@ -121,11 +113,6 @@ Constructing Rotamers and Frame Residues
     :param all_atom_pos: To extract the backbone positions
     :param aa_res_idx:  Index of residue in **all_atom_pos** from which to 
                         extract the backbone positions
-    :param n_pos:       To directly feed in the backbone positions
-    :param ca_pos:      To directly feed in the backbone positions
-    :param c_pos:       To directly feed in the backbone positions
-    :param o_pos:       To directly feed in the backbone positions
-    :param cb_pos:      To directly feed in the backbone positions
     :param id:          Identifies the sidechain
     :param residue_index: Important for the energy calculations towards the 
                           :class:`Frame` you don't want to calculate a pairwise
@@ -141,11 +128,6 @@ Constructing Rotamers and Frame Residues
     :type res:          :class:`ost.mol.ResidueHandle`
     :type all_atom_pos: :class:`promod3.loop.AllAtomPositions`
     :type aa_res_idx:   :class:`int`
-    :type n_pos:        :class:`ost.geom.Vec3`
-    :type ca_pos:       :class:`ost.geom.Vec3`
-    :type c_pos:        :class:`ost.geom.Vec3`
-    :type o_pos:        :class:`ost.geom.Vec3`
-    :type cb_pos:       :class:`ost.geom.Vec3`
     :type id:           :class:`RotamerID`
     :type residue_index: :class:`int`
     :type phi:          :class:`float`
@@ -156,7 +138,7 @@ Constructing Rotamers and Frame Residues
 
 
     :raises:  :exc:`~exceptions.RuntimeError` when not all required backbone
-              atoms are present in **residue**, not all required atom
+              atoms are present in **residue** or not all required atom
               positions are set in **all_atom_pos**.
 
 
diff --git a/doc/html/_static/alabaster.css b/doc/html/_static/alabaster.css
index 07a9e2a42ae0c0d42495b844723754f80d111911..517cb43e58b2e57a766cbed1ca59eddbe7f4515c 100644
--- a/doc/html/_static/alabaster.css
+++ b/doc/html/_static/alabaster.css
@@ -28,6 +28,7 @@ body {
     padding: 0;
 }
 
+
 div.document {
     width: 940px;
     margin: 30px auto 0 auto;
@@ -44,6 +45,8 @@ div.bodywrapper {
 
 div.sphinxsidebar {
     width: 220px;
+    font-size: 14px;
+    line-height: 1.5;
 }
 
 hr {
@@ -56,6 +59,10 @@ div.body {
     padding: 0 30px 0 30px;
 }
 
+div.body > .section {
+    text-align: left;
+}
+
 div.footer {
     width: 940px;
     margin: 20px auto 30px auto;
@@ -68,6 +75,11 @@ div.footer a {
     color: #888;
 }
 
+p.caption {
+    font-family: ;
+    font-size: inherit;
+}
+
 
 div.relations {
     display: none;
@@ -84,11 +96,6 @@ div.sphinxsidebar a:hover {
     border-bottom: 1px solid #999;
 }
 
-div.sphinxsidebar {
-    font-size: 14px;
-    line-height: 1.5;
-}
-
 div.sphinxsidebarwrapper {
     padding: 18px 10px;
 }
@@ -168,8 +175,8 @@ div.sphinxsidebar input {
 div.sphinxsidebar hr {
     border: none;
     height: 1px;
-    color: #999;
-    background: #999;
+    color: #AAA;
+    background: #AAA;
 
     text-align: left;
     margin-left: 0;
@@ -350,8 +357,12 @@ table.field-list td {
     padding: 0;
 }
 
+table.field-list p {
+    margin-bottom: 0.8em;
+}
+
 table.footnote td.label {
-    width: 0px;
+    width: .1px;
     padding: 0.3em 0 0.3em 0.5em;
 }
 
@@ -374,6 +385,7 @@ blockquote {
 }
 
 ul, ol {
+    /* Matches the 30px from the narrow-screen "li > ul" selector below */
     margin: 10px 0 10px 30px;
     padding: 0;
 }
@@ -411,6 +423,11 @@ a.reference {
     border-bottom: 1px dotted #004B6B;
 }
 
+/* Don't put an underline on images */
+a.image-reference, a.image-reference:hover {
+    border-bottom: none;
+}
+
 a.reference:hover {
     border-bottom: 1px solid #6D4100;
 }
@@ -460,6 +477,11 @@ a:hover tt, a:hover code {
     	margin-left: 0;
     }
 
+	li > ul {
+        /* Matches the 30px from the "ul, ol" selector above */
+		margin-left: 30px;
+	}
+
     .document {
     	width: auto;
     }
diff --git a/doc/html/_static/basic.css b/doc/html/_static/basic.css
index 9fa77d886d4f09c635c781bc3fadf10c8036c59e..65dfd7dfda92b36a93ea2b50d82d3917aec69c66 100644
--- a/doc/html/_static/basic.css
+++ b/doc/html/_static/basic.css
@@ -4,7 +4,7 @@
  *
  * Sphinx stylesheet -- basic theme.
  *
- * :copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
+ * :copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS.
  * :license: BSD, see LICENSE for details.
  *
  */
@@ -52,6 +52,8 @@ div.sphinxsidebar {
     width: 230px;
     margin-left: -100%;
     font-size: 90%;
+    word-wrap: break-word;
+    overflow-wrap : break-word;
 }
 
 div.sphinxsidebar ul {
@@ -187,6 +189,13 @@ div.genindex-jumpbox {
 
 /* -- general body styles --------------------------------------------------- */
 
+div.body p, div.body dd, div.body li, div.body blockquote {
+    -moz-hyphens: auto;
+    -ms-hyphens: auto;
+    -webkit-hyphens: auto;
+    hyphens: auto;
+}
+
 a.headerlink {
     visibility: hidden;
 }
diff --git a/doc/html/_static/custom.css b/doc/html/_static/custom.css
new file mode 100644
index 0000000000000000000000000000000000000000..2a924f1d6a8bc930c5296bdb2d5c2d3e39b04a1c
--- /dev/null
+++ b/doc/html/_static/custom.css
@@ -0,0 +1 @@
+/* This file intentionally left blank. */
diff --git a/doc/html/_static/doctools.js b/doc/html/_static/doctools.js
index c7bfe760aa8b32cfa5676be000a43f465531ac0c..816349563588e87ca99c7cf2d6e54268e52e761d 100644
--- a/doc/html/_static/doctools.js
+++ b/doc/html/_static/doctools.js
@@ -4,7 +4,7 @@
  *
  * Sphinx JavaScript utilities for all documentation.
  *
- * :copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
+ * :copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS.
  * :license: BSD, see LICENSE for details.
  *
  */
@@ -124,6 +124,7 @@ var Documentation = {
     this.fixFirefoxAnchorBug();
     this.highlightSearchWords();
     this.initIndexTable();
+    
   },
 
   /**
@@ -252,6 +253,29 @@ var Documentation = {
     });
     var url = parts.join('/');
     return path.substring(url.lastIndexOf('/') + 1, path.length - 1);
+  },
+
+  initOnKeyListeners: function() {
+    $(document).keyup(function(event) {
+      var activeElementType = document.activeElement.tagName;
+      // don't navigate when in search box or textarea
+      if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT') {
+        switch (event.keyCode) {
+          case 37: // left
+            var prevHref = $('link[rel="prev"]').prop('href');
+            if (prevHref) {
+              window.location.href = prevHref;
+              return false;
+            }
+          case 39: // right
+            var nextHref = $('link[rel="next"]').prop('href');
+            if (nextHref) {
+              window.location.href = nextHref;
+              return false;
+            }
+        }
+      }
+    });
   }
 };
 
@@ -260,4 +284,4 @@ _ = Documentation.gettext;
 
 $(document).ready(function() {
   Documentation.init();
-});
+});
\ No newline at end of file
diff --git a/doc/html/_static/pygments.css b/doc/html/_static/pygments.css
index 57eadc030ea86ea65a3747c27dfa3ef334f8f79a..8213e90bed399b1ddc4914808df328f5803e953f 100644
--- a/doc/html/_static/pygments.css
+++ b/doc/html/_static/pygments.css
@@ -4,8 +4,10 @@
 .highlight .err { border: 1px solid #FF0000 } /* Error */
 .highlight .k { color: #007020; font-weight: bold } /* Keyword */
 .highlight .o { color: #666666 } /* Operator */
+.highlight .ch { color: #408090; font-style: italic } /* Comment.Hashbang */
 .highlight .cm { color: #408090; font-style: italic } /* Comment.Multiline */
 .highlight .cp { color: #007020 } /* Comment.Preproc */
+.highlight .cpf { color: #408090; font-style: italic } /* Comment.PreprocFile */
 .highlight .c1 { color: #408090; font-style: italic } /* Comment.Single */
 .highlight .cs { color: #408090; background-color: #fff0f0 } /* Comment.Special */
 .highlight .gd { color: #A00000 } /* Generic.Deleted */
diff --git a/doc/html/_static/searchtools.js b/doc/html/_static/searchtools.js
index 0e794fd3e906970a10812199e11f9f159ab906b5..066857ce21b1b4b055f9a9308eb351237260fcca 100644
--- a/doc/html/_static/searchtools.js
+++ b/doc/html/_static/searchtools.js
@@ -2,14 +2,15 @@
  * searchtools.js_t
  * ~~~~~~~~~~~~~~~~
  *
- * Sphinx JavaScript utilties for the full-text search.
+ * Sphinx JavaScript utilities for the full-text search.
  *
- * :copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
+ * :copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS.
  * :license: BSD, see LICENSE for details.
  *
  */
 
 
+/* Non-minified version JS is _stemmer.js if file is provided */ 
 /**
  * Porter Stemmer
  */
@@ -373,8 +374,7 @@ var Search = {
     }
 
     // lookup as search terms in fulltext
-    results = results.concat(this.performTermsSearch(searchterms, excluded, terms, Scorer.term))
-                     .concat(this.performTermsSearch(searchterms, excluded, titleterms, Scorer.title));
+    results = results.concat(this.performTermsSearch(searchterms, excluded, terms, titleterms));
 
     // let the scorer override scores with a custom scoring function
     if (Scorer.score) {
@@ -538,23 +538,47 @@ var Search = {
   /**
    * search for full-text terms in the index
    */
-  performTermsSearch : function(searchterms, excluded, terms, score) {
+  performTermsSearch : function(searchterms, excluded, terms, titleterms) {
     var filenames = this._index.filenames;
     var titles = this._index.titles;
 
-    var i, j, file, files;
+    var i, j, file;
     var fileMap = {};
+    var scoreMap = {};
     var results = [];
 
     // perform the search on the required terms
     for (i = 0; i < searchterms.length; i++) {
       var word = searchterms[i];
+      var files = [];
+      var _o = [
+        {files: terms[word], score: Scorer.term},
+        {files: titleterms[word], score: Scorer.title}
+      ];
+
       // no match but word was a required one
-      if ((files = terms[word]) === undefined)
+      if ($u.every(_o, function(o){return o.files === undefined;})) {
         break;
-      if (files.length === undefined) {
-        files = [files];
       }
+      // found search word in contents
+      $u.each(_o, function(o) {
+        var _files = o.files;
+        if (_files === undefined)
+          return
+
+        if (_files.length === undefined)
+          _files = [_files];
+        files = files.concat(_files);
+
+        // set score for the word in each file to Scorer.term
+        for (j = 0; j < _files.length; j++) {
+          file = _files[j];
+          if (!(file in scoreMap))
+            scoreMap[file] = {}
+          scoreMap[file][word] = o.score;
+        }
+      });
+
       // create the mapping
       for (j = 0; j < files.length; j++) {
         file = files[j];
@@ -576,7 +600,9 @@ var Search = {
       // ensure that none of the excluded terms is in the search result
       for (i = 0; i < excluded.length; i++) {
         if (terms[excluded[i]] == file ||
-          $u.contains(terms[excluded[i]] || [], file)) {
+            titleterms[excluded[i]] == file ||
+            $u.contains(terms[excluded[i]] || [], file) ||
+            $u.contains(titleterms[excluded[i]] || [], file)) {
           valid = false;
           break;
         }
@@ -584,6 +610,9 @@ var Search = {
 
       // if we have still a valid result we can add it to the result list
       if (valid) {
+        // select one (max) score for the file.
+        // for better ranking, we should calculate ranking by using words statistics like basic tf-idf...
+        var score = $u.max($u.map(fileMap[file], function(w){return scoreMap[file][w]}));
         results.push([filenames[file], titles[file], '', null, score]);
       }
     }
@@ -594,7 +623,7 @@ var Search = {
    * helper function to return a node containing the
    * search summary for a given text. keywords is a list
    * of stemmed words, hlwords is the list of normal, unstemmed
-   * words. the first one is used to find the occurance, the
+   * words. the first one is used to find the occurrence, the
    * latter for highlighting it.
    */
   makeSearchSummary : function(text, keywords, hlwords) {
diff --git a/doc/html/_static/websupport.js b/doc/html/_static/websupport.js
index 28d65db4aaf30db00ac3e591b88035ba434d4901..98e7f40b6327e673e382068cdfb3bf3674a06cca 100644
--- a/doc/html/_static/websupport.js
+++ b/doc/html/_static/websupport.js
@@ -2,9 +2,9 @@
  * websupport.js
  * ~~~~~~~~~~~~~
  *
- * sphinx.websupport utilties for all documentation.
+ * sphinx.websupport utilities for all documentation.
  *
- * :copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
+ * :copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS.
  * :license: BSD, see LICENSE for details.
  *
  */
diff --git a/doc/html/actions/index.html b/doc/html/actions/index.html
index 0a4e2803686157f938ff3a21635aadb3eadd0577..f83632f45740b0b6ed02b2d4176abe058c068625 100644
--- a/doc/html/actions/index.html
+++ b/doc/html/actions/index.html
@@ -6,7 +6,7 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
-    <title>ProMod3 Actions &mdash; ProMod3 1.1.0 documentation</title>
+    <title>ProMod3 Actions &mdash; ProMod3 1.2.0 documentation</title>
     
     <link rel="stylesheet" href="../_static/alabaster.css" type="text/css" />
     <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
@@ -14,7 +14,7 @@
     <script type="text/javascript">
       var DOCUMENTATION_OPTIONS = {
         URL_ROOT:    '../',
-        VERSION:     '1.1.0',
+        VERSION:     '1.2.0',
         COLLAPSE_INDEX: false,
         FILE_SUFFIX: '.html',
         HAS_SOURCE:  true
@@ -23,16 +23,18 @@
     <script type="text/javascript" src="../_static/jquery.js"></script>
     <script type="text/javascript" src="../_static/underscore.js"></script>
     <script type="text/javascript" src="../_static/doctools.js"></script>
-    <link rel="top" title="ProMod3 1.1.0 documentation" href="../index.html" />
+    <link rel="top" title="ProMod3 1.2.0 documentation" href="../index.html" />
     <link rel="up" title="Documentation For Users" href="../users.html" />
     <link rel="next" title="Building ProMod3" href="../buildsystem.html" />
     <link rel="prev" title="Getting Started" href="../gettingstarted.html" />
    
+  <link rel="stylesheet" href="../_static/custom.css" type="text/css" />
   
-  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
 
   </head>
-  <body role="document">  
+  <body role="document">
+  
 
     <div class="document">
       <div class="documentwrapper">
@@ -49,12 +51,12 @@ you can type <code class="docutils literal"><span class="pre">pm</span> <span cl
 <span id="promod-build-model"></span><h2>Building models<a class="headerlink" href="#building-models" title="Permalink to this headline">¶</a></h2>
 <p>You can run a full protein homology modelling pipeline from the command line
 with</p>
-<div class="highlight-console"><div class="highlight"><pre><span class="gp">$</span> pm build-model <span class="o">[</span>-h<span class="o">]</span> <span class="o">(</span>-f &lt;FILE&gt; <span class="p">|</span> -c &lt;FILE&gt; <span class="p">|</span> -j &lt;OBJECT&gt;<span class="p">|</span>&lt;FILE&gt;<span class="o">)</span>
+<div class="highlight-console"><div class="highlight"><pre><span></span><span class="gp">$</span> pm build-model <span class="o">[</span>-h<span class="o">]</span> <span class="o">(</span>-f &lt;FILE&gt; <span class="p">|</span> -c &lt;FILE&gt; <span class="p">|</span> -j &lt;OBJECT&gt;<span class="p">|</span>&lt;FILE&gt;<span class="o">)</span>
 <span class="go">                 (-p &lt;FILE&gt; | -e &lt;FILE&gt;) [-o &lt;FILENAME&gt;]</span>
 </pre></div>
 </div>
 <p>Example usage:</p>
-<div class="highlight-console"><div class="highlight"><pre><span class="gp">$</span> pm build-model -f aln.fasta -p tpl.pdb
+<div class="highlight-console"><div class="highlight"><pre><span></span><span class="gp">$</span> pm build-model -f aln.fasta -p tpl.pdb
 </pre></div>
 </div>
 <p>This reads a target-template alignment from <code class="file docutils literal"><span class="pre">aln.fasta</span></code> and a matching
@@ -71,7 +73,7 @@ Notes on the input formats:</p>
 <li><p class="first">Leading/trailing whitespaces of sequence names will always be deleted</p>
 </li>
 <li><p class="first">FASTA input example:</p>
-<div class="highlight-none"><div class="highlight"><pre>&gt;target
+<div class="highlight-none"><div class="highlight"><pre><span></span>&gt;target
 HGFHVHEFGDNTNGCMSSGPHFNPYGKEHGAPVDENRHLG
 &gt;2jlp-1.A|55
 RAIHVHQFGDLSQGCESTGPHYNPLAVPH------PQHPG
@@ -92,7 +94,7 @@ Those in turn are objects with keys
 &#8216;seqres&#8217; (string for aligned sequence) and optionally for templates
 &#8216;offset&#8217; (number of residues to skip in structure file attached to it).
 Example:</p>
-<div class="highlight-json"><div class="highlight"><pre><span class="p">{</span><span class="nt">&quot;alignmentlist&quot;</span><span class="p">:</span> <span class="p">[</span> <span class="p">{</span>
+<div class="highlight-json"><div class="highlight"><pre><span></span><span class="p">{</span><span class="nt">&quot;alignmentlist&quot;</span><span class="p">:</span> <span class="p">[</span> <span class="p">{</span>
   <span class="nt">&quot;target&quot;</span><span class="p">:</span> <span class="p">{</span>
       <span class="nt">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;mytrg&quot;</span><span class="p">,</span>
       <span class="nt">&quot;seqres&quot;</span><span class="p">:</span> <span class="s2">&quot;HGFHVHEFGDNTNGCMSSGPHFNPYGKEHGAPVDENRHLG&quot;</span>
@@ -108,7 +110,7 @@ Example:</p>
 </li>
 </ul>
 <p>Structures can be provided in PDB (<code class="docutils literal"><span class="pre">-p</span></code>) or in any format readable by the
-<a class="reference external" href="http://www.openstructure.org/docs/dev/io/io/#ost.io.LoadEntity" title="(in OpenStructure v1.6.0)"><code class="xref py py-func docutils literal"><span class="pre">ost.io.LoadEntity()</span></code></a> method (<code class="docutils literal"><span class="pre">-e</span></code>). In the latter case, the format is
+<a class="reference external" href="https://www.openstructure.org/docs/dev/io/io/#ost.io.LoadEntity" title="(in OpenStructure v1.7.1)"><code class="xref py py-func docutils literal"><span class="pre">ost.io.LoadEntity()</span></code></a> method (<code class="docutils literal"><span class="pre">-e</span></code>). In the latter case, the format is
 chosen by file ending. Recognized File Extensions: <code class="docutils literal"><span class="pre">.ent</span></code>, <code class="docutils literal"><span class="pre">.pdb</span></code>,
 <code class="docutils literal"><span class="pre">.ent.gz</span></code>, <code class="docutils literal"><span class="pre">.pdb.gz</span></code>, <code class="docutils literal"><span class="pre">.cif</span></code>, <code class="docutils literal"><span class="pre">.cif.gz</span></code>. At least one structure must be
 given and you cannot mix file formats. Multiple structures can be given and each
@@ -182,9 +184,6 @@ residue in the aligned sequence. Leading/trailing whitespaces of &lt;CHAINID&gt;
       <input type="hidden" name="check_keywords" value="yes" />
       <input type="hidden" name="area" value="default" />
     </form>
-    <p class="searchtip" style="font-size: 90%">
-    Enter search terms or a module, class or function name.
-    </p>
 </div>
 <script type="text/javascript">$('#searchbox').show(0);</script>
         </div>
@@ -192,11 +191,11 @@ residue in the aligned sequence. Leading/trailing whitespaces of &lt;CHAINID&gt;
       <div class="clearer"></div>
     </div>
     <div class="footer">
-      &copy;2017, ProMod3 authors.
+      &copy;2018, ProMod3 authors.
       
       |
-      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a>
-      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.6</a>
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.4.1</a>
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
       
       |
       <a href="../_sources/actions/index.txt"
diff --git a/doc/html/actions/index_dev.html b/doc/html/actions/index_dev.html
index 5b85e1b17a59c30e08cf733e350e284590fc685f..7a72c1a6616b45888b696930be029d8e2cb467f2 100644
--- a/doc/html/actions/index_dev.html
+++ b/doc/html/actions/index_dev.html
@@ -6,7 +6,7 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
-    <title>test_actions - Testing Actions &mdash; ProMod3 1.1.0 documentation</title>
+    <title>test_actions - Testing Actions &mdash; ProMod3 1.2.0 documentation</title>
     
     <link rel="stylesheet" href="../_static/alabaster.css" type="text/css" />
     <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
@@ -14,7 +14,7 @@
     <script type="text/javascript">
       var DOCUMENTATION_OPTIONS = {
         URL_ROOT:    '../',
-        VERSION:     '1.1.0',
+        VERSION:     '1.2.0',
         COLLAPSE_INDEX: false,
         FILE_SUFFIX: '.html',
         HAS_SOURCE:  true
@@ -23,16 +23,18 @@
     <script type="text/javascript" src="../_static/jquery.js"></script>
     <script type="text/javascript" src="../_static/underscore.js"></script>
     <script type="text/javascript" src="../_static/doctools.js"></script>
-    <link rel="top" title="ProMod3 1.1.0 documentation" href="../index.html" />
+    <link rel="top" title="ProMod3 1.2.0 documentation" href="../index.html" />
     <link rel="up" title="Documentation For Developers" href="../developers.html" />
     <link rel="next" title="ProMod3‘s Share Of CMake" href="../cmake/index.html" />
     <link rel="prev" title="Contributing" href="../contributing.html" />
    
+  <link rel="stylesheet" href="../_static/custom.css" type="text/css" />
   
-  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
 
   </head>
-  <body role="document">  
+  <body role="document">
+  
 
     <div class="document">
       <div class="documentwrapper">
@@ -62,15 +64,15 @@ Python imports a module, its usually compiled into bytecode. This new file
 would clutter up the source repository, it would always show up as untracked
 file on <code class="docutils literal"><span class="pre">git</span> <span class="pre">status</span></code>. To prevent this, tell Python to stop producing
 bytecode right at the beginning of your test-script:</p>
-<div class="highlight-python"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1
+<div class="highlight-default"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1
 2
 3
 4
-5</pre></div></td><td class="code"><div class="highlight"><pre><span class="kn">import</span> <span class="nn">sys</span>
+5</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">sys</span>
 
-<span class="c"># this is needed so there will be no test_actions.pyc created in the source</span>
-<span class="c"># directory</span>
-<span class="hll"><span class="n">sys</span><span class="o">.</span><span class="n">dont_write_bytecode</span> <span class="o">=</span> <span class="bp">True</span>
+<span class="c1"># this is needed so there will be no test_actions.pyc created in the source</span>
+<span class="c1"># directory</span>
+<span class="hll"><span class="n">sys</span><span class="o">.</span><span class="n">dont_write_bytecode</span> <span class="o">=</span> <span class="kc">True</span>
 </span></pre></div>
 </td></tr></table></div>
 <p>Line 5 does the trick. This needs to be set by you in every action unit test
@@ -101,20 +103,20 @@ called <code class="docutils literal"><span class="pre">do-awesome</span></code>
 action. So here we create a file <code class="file docutils literal"><span class="pre">test_action_do_awesome.py</span></code> (recognise
 the underscore between <code class="docutils literal"><span class="pre">do</span></code> and <code class="docutils literal"><span class="pre">awesome</span></code> instead of a hyphen, that&#8217;s
 <a class="reference external" href="https://www.python.org/dev/peps/pep-0008/">PEP 8</a>).</p>
-<div class="highlight-console"><div class="highlight"><pre><span class="gp">$</span> touch &lt;SOURCE&gt;/actions/tests/test_action_do_awesome.py
+<div class="highlight-console"><div class="highlight"><pre><span></span><span class="gp">$</span> touch &lt;SOURCE&gt;/actions/tests/test_action_do_awesome.py
 <span class="gp">$</span>
 </pre></div>
 </div>
 <p>As a starter, we disable bytecode compilation in the script:</p>
-<div class="highlight-python"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1
+<div class="highlight-default"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1
 2
 3
 4
-5</pre></div></td><td class="code"><div class="highlight"><pre><span class="kn">import</span> <span class="nn">sys</span>
+5</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">sys</span>
 
-<span class="c"># this is needed so there will be no test_actions.pyc created in the source</span>
-<span class="c"># directory</span>
-<span class="n">sys</span><span class="o">.</span><span class="n">dont_write_bytecode</span> <span class="o">=</span> <span class="bp">True</span>
+<span class="c1"># this is needed so there will be no test_actions.pyc created in the source</span>
+<span class="c1"># directory</span>
+<span class="n">sys</span><span class="o">.</span><span class="n">dont_write_bytecode</span> <span class="o">=</span> <span class="kc">True</span>
 </pre></div>
 </td></tr></table></div>
 </div>
@@ -130,7 +132,7 @@ add your new script:</p>
 4
 5
 6
-7</pre></div></td><td class="code"><div class="highlight"><pre><span class="nb">set</span><span class="p">(</span><span class="s">ACTION_UNIT_TESTS</span>
+7</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="nb">set</span><span class="p">(</span><span class="s">ACTION_UNIT_TESTS</span>
   <span class="s">test_action_help.py</span>
 <span class="hll">  <span class="s">test_action_do_awesome.py</span>
 </span>  <span class="s">test_actions.py</span> <span class="c"># leave this as last item so it will be executed first!</span>
@@ -152,20 +154,20 @@ other action test script is run.</p>
 tests. By spawning off from this you inherit a bunch of useful methods for your
 testing. To make it work, the childclass needs to be set up properly. But
 first, <code class="file docutils literal"><span class="pre">test_actions.py</span></code> has to be loaded as a module:</p>
-<div class="highlight-python"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>6</pre></div></td><td class="code"><div class="highlight"><pre><span class="kn">import</span> <span class="nn">test_actions</span>
+<div class="highlight-default"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>6</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">test_actions</span>
 </pre></div>
 </td></tr></table></div>
 <p>To showcase, the test cases, we explain how one would (and does) test the
 <code class="docutils literal"><span class="pre">help</span></code> action of <code class="docutils literal"><span class="pre">pm</span></code>.
 First, we create the childclass for the action.
 Go for <code class="xref py py-class docutils literal"><span class="pre">&lt;NAME&gt;ActionTests</span></code> as a naming scheme:</p>
-<div class="highlight-python"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre> 7
+<div class="highlight-default"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre> 7
  8
  9
-10</pre></div></td><td class="code"><div class="highlight"><pre><span class="k">class</span> <span class="nc">HelpActionTests</span><span class="p">(</span><span class="n">test_actions</span><span class="o">.</span><span class="n">ActionTestCase</span><span class="p">):</span>
+10</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="k">class</span> <span class="nc">HelpActionTests</span><span class="p">(</span><span class="n">test_actions</span><span class="o">.</span><span class="n">ActionTestCase</span><span class="p">):</span>
     <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
         <span class="n">test_actions</span><span class="o">.</span><span class="n">ActionTestCase</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
-        <span class="bp">self</span><span class="o">.</span><span class="n">pm_action</span> <span class="o">=</span> <span class="s">&#39;help&#39;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">pm_action</span> <span class="o">=</span> <span class="s1">&#39;help&#39;</span>
 </pre></div>
 </td></tr></table></div>
 <p>Pay attention that in your own class, you must set <code class="xref py py-attr docutils literal"><span class="pre">pm_action</span></code> to make
@@ -178,8 +180,8 @@ is derived from the <a class="reference external" href="https://docs.python.org/
 states will be placed in the userlevel documentation. This topic is already
 covered in <a class="reference internal" href="#test_actions.ActionTestCase" title="test_actions.ActionTestCase"><code class="xref py py-class docutils literal"><span class="pre">test_actions.ActionTestCase</span></code></a> by <a class="reference internal" href="#test_actions.ActionTestCase.RunExitStatusTest" title="test_actions.ActionTestCase.RunExitStatusTest"><code class="xref py py-meth docutils literal"><span class="pre">RunExitStatusTest()</span></code></a>.
 As an example, testing for <code class="docutils literal"><span class="pre">$?=0</span></code> could work like this:</p>
-<div class="highlight-python"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>11
-12</pre></div></td><td class="code"><div class="highlight"><pre>    <span class="k">def</span> <span class="nf">testExit0</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+<div class="highlight-default"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>11
+12</pre></div></td><td class="code"><div class="highlight"><pre><span></span>    <span class="k">def</span> <span class="nf">testExit0</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
         <span class="bp">self</span><span class="o">.</span><span class="n">RunExitStatusTest</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="nb">list</span><span class="p">())</span>
 </pre></div>
 </td></tr></table></div>
@@ -191,13 +193,13 @@ happens if a user throws dirty input data in.</p>
 </div>
 <div class="section" id="making-the-script-executable">
 <h3>Making the Script Executable<a class="headerlink" href="#making-the-script-executable" title="Permalink to this headline">¶</a></h3>
-<p>In ProMod3, unit tests are run via <a class="reference external" href="http://www.OpenStructure.org">OST</a>&#8216;s <a class="reference external" href="http://www.openstructure.org/docs/dev/base/testutils/#module-ost.testutils" title="(in OpenStructure v1.6.0)"><code class="xref py py-mod docutils literal"><span class="pre">ost.testutils</span></code></a> and Python&#8216;s
+<p>In ProMod3, unit tests are run via <a class="reference external" href="https://www.OpenStructure.org">OST</a>&#8216;s <a class="reference external" href="https://www.openstructure.org/docs/dev/base/testutils/#module-ost.testutils" title="(in OpenStructure v1.7.1)"><code class="xref py py-mod docutils literal"><span class="pre">ost.testutils</span></code></a> and Python&#8216;s
 <a class="reference external" href="https://docs.python.org/2.7/library/unittest.html#unittest.TestCase" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">unittest.TestCase</span></code></a>. Those are called when the test module is executed
 as a script:</p>
-<div class="highlight-python"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>13
+<div class="highlight-default"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>13
 14
-15</pre></div></td><td class="code"><div class="highlight"><pre><span class="k">if</span> <span class="n">__name__</span> <span class="o">==</span> <span class="s">&quot;__main__&quot;</span><span class="p">:</span>
-    <span class="kn">from</span> <span class="nn">ost</span> <span class="kn">import</span> <span class="n">testutils</span>
+15</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="k">if</span> <span class="n">__name__</span> <span class="o">==</span> <span class="s2">&quot;__main__&quot;</span><span class="p">:</span>
+    <span class="kn">from</span> <span class="nn">ost</span> <span class="k">import</span> <span class="n">testutils</span>
     <span class="n">testutils</span><span class="o">.</span><span class="n">RunTests</span><span class="p">()</span>
 </pre></div>
 </td></tr></table></div>
@@ -208,7 +210,7 @@ as a script:</p>
 <p>Unit tests are executed via <code class="docutils literal"><span class="pre">make</span> <span class="pre">check</span></code> and so are ProMod3 action tests.
 But for every test script, we also provide a private <code class="docutils literal"><span class="pre">make</span></code> target, ending
 with <code class="file docutils literal"><span class="pre">_run</span></code>. To solely run the tests for the awesome action, hit</p>
-<div class="highlight-console"><div class="highlight"><pre><span class="gp">$</span> make test_action_do_awesome.py_run
+<div class="highlight-console"><div class="highlight"><pre><span></span><span class="gp">$</span> make test_action_do_awesome.py_run
 </pre></div>
 </div>
 </div>
@@ -225,20 +227,20 @@ parameter <code class="xref py py-attr docutils literal"><span class="pre">verbo
 output onto the command line. The idea is to turn it on for development, but
 once done, disable it to keep output of unit tests low.</p>
 <p>To get the test for exit code <code class="docutils literal"><span class="pre">0</span></code> talking to you, just do</p>
-<div class="highlight-python"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>11
-12</pre></div></td><td class="code"><div class="highlight"><pre>    <span class="k">def</span> <span class="nf">testExit0</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
-        <span class="bp">self</span><span class="o">.</span><span class="n">RunExitStatusTest</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="nb">list</span><span class="p">(),</span> <span class="n">verbose</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>
+<div class="highlight-default"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>11
+12</pre></div></td><td class="code"><div class="highlight"><pre><span></span>    <span class="k">def</span> <span class="nf">testExit0</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">RunExitStatusTest</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="nb">list</span><span class="p">(),</span> <span class="n">verbose</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
 </pre></div>
 </td></tr></table></div>
 <p>and</p>
-<div class="highlight-python"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>11
-12</pre></div></td><td class="code"><div class="highlight"><pre>    <span class="k">def</span> <span class="nf">testExit0</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+<div class="highlight-default"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>11
+12</pre></div></td><td class="code"><div class="highlight"><pre><span></span>    <span class="k">def</span> <span class="nf">testExit0</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
         <span class="bp">self</span><span class="o">.</span><span class="n">RunExitStatusTest</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="nb">list</span><span class="p">())</span>
 </pre></div>
 </td></tr></table></div>
 <p>keeps it silent (<code class="xref py py-attr docutils literal"><span class="pre">verbose</span></code> is set to <code class="docutils literal"><span class="pre">False</span></code> by default). If enabled,
 output will be separated into <code class="file docutils literal"><span class="pre">stdout</span></code> and <code class="file docutils literal"><span class="pre">stderr</span></code>:</p>
-<div class="highlight-console"><div class="highlight"><pre><span class="gp">$</span> make test_action_do_awesome.py_run
+<div class="highlight-console"><div class="highlight"><pre><span></span><span class="gp">$</span> make test_action_do_awesome.py_run
 <span class="go">&lt;Lots of output from the build process&gt;</span>
 <span class="go">running checks test_action_do_awesome.py</span>
 <span class="go">stdout of &#39;&lt;BUILD&gt;/stage/bin/pm do-awesome&#39;</span>
@@ -401,9 +403,6 @@ file (also complains if a directory is found instead).</p>
       <input type="hidden" name="check_keywords" value="yes" />
       <input type="hidden" name="area" value="default" />
     </form>
-    <p class="searchtip" style="font-size: 90%">
-    Enter search terms or a module, class or function name.
-    </p>
 </div>
 <script type="text/javascript">$('#searchbox').show(0);</script>
         </div>
@@ -411,11 +410,11 @@ file (also complains if a directory is found instead).</p>
       <div class="clearer"></div>
     </div>
     <div class="footer">
-      &copy;2017, ProMod3 authors.
+      &copy;2018, ProMod3 authors.
       
       |
-      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a>
-      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.6</a>
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.4.1</a>
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
       
       |
       <a href="../_sources/actions/index_dev.txt"
diff --git a/doc/html/buildsystem.html b/doc/html/buildsystem.html
index a716f5434283bb2cfa80fb2322bbd42795c26a38..05f730f28a2e8349dffce5b4b7a0fcbfb68a61a0 100644
--- a/doc/html/buildsystem.html
+++ b/doc/html/buildsystem.html
@@ -6,7 +6,7 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
-    <title>Building ProMod3 &mdash; ProMod3 1.1.0 documentation</title>
+    <title>Building ProMod3 &mdash; ProMod3 1.2.0 documentation</title>
     
     <link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
     <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
@@ -14,7 +14,7 @@
     <script type="text/javascript">
       var DOCUMENTATION_OPTIONS = {
         URL_ROOT:    './',
-        VERSION:     '1.1.0',
+        VERSION:     '1.2.0',
         COLLAPSE_INDEX: false,
         FILE_SUFFIX: '.html',
         HAS_SOURCE:  true
@@ -23,16 +23,18 @@
     <script type="text/javascript" src="_static/jquery.js"></script>
     <script type="text/javascript" src="_static/underscore.js"></script>
     <script type="text/javascript" src="_static/doctools.js"></script>
-    <link rel="top" title="ProMod3 1.1.0 documentation" href="index.html" />
+    <link rel="top" title="ProMod3 1.2.0 documentation" href="index.html" />
     <link rel="up" title="Documentation For Users" href="users.html" />
     <link rel="next" title="modelling - Protein Modelling" href="modelling/index.html" />
     <link rel="prev" title="ProMod3 Actions" href="actions/index.html" />
    
+  <link rel="stylesheet" href="_static/custom.css" type="text/css" />
   
-  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
 
   </head>
-  <body role="document">  
+  <body role="document">
+  
 
     <div class="document">
       <div class="documentwrapper">
@@ -43,20 +45,20 @@
 <span id="building-promod"></span><h1>Building ProMod3<a class="headerlink" href="#building-project" title="Permalink to this headline">¶</a></h1>
 <div class="section" id="dependencies">
 <h2>Dependencies<a class="headerlink" href="#dependencies" title="Permalink to this headline">¶</a></h2>
-<p>ProMod3 is build on top of <a class="reference external" href="http://www.OpenStructure.org">OpenStructure</a> (OST), requiring at least version
+<p>ProMod3 is build on top of <a class="reference external" href="https://www.OpenStructure.org">OpenStructure</a> (OST), requiring at least version
 1.7. OST must be configured and compiled with <code class="docutils literal"><span class="pre">ENABLE_MM=1</span></code> to use <a class="reference external" href="http://openmm.org">OpenMM</a>.
 To create the build system, <a class="reference external" href="https://cmake.org/">CMake</a> is required in version
 2.8.7 or higher. <a class="reference external" href="https://www.python.org/">Python</a> works well from version 2.7. For OST and the
-C++ bit of ProMod3, <a class="reference external" href="http://www.boost.org/">Boost</a> is required in version 1.53.0 (the same as
+C++ bit of ProMod3, <a class="reference external" href="https://www.boost.org/">Boost</a> is required in version 1.53.0 (the same as
 used for OST). Also <a class="reference external" href="http://eigen.tuxfamily.org/index.php?title=Main_Page">Eigen 3</a> is needed. To build
 documentation, <a class="reference external" href="http://sphinx-doc.org/">Sphinx</a> 1.2b1 is required.</p>
 <p>The currently preferred versions are:</p>
 <ul class="simple">
-<li><a class="reference external" href="http://www.OpenStructure.org">OST</a> 1.7</li>
+<li><a class="reference external" href="https://www.OpenStructure.org">OST</a> 1.7</li>
 <li><a class="reference external" href="http://openmm.org">OpenMM</a> 7.1.1</li>
 <li><a class="reference external" href="https://cmake.org/">CMake</a> 2.8.12</li>
 <li><a class="reference external" href="https://www.python.org/">Python</a> 2.7.5</li>
-<li><a class="reference external" href="http://www.boost.org/">Boost</a> 1.53.0</li>
+<li><a class="reference external" href="https://www.boost.org/">Boost</a> 1.53.0</li>
 <li><a class="reference external" href="http://eigen.tuxfamily.org/index.php?title=Main_Page">Eigen 3</a> 3.3.0</li>
 <li><a class="reference external" href="http://sphinx-doc.org/">Sphinx</a> 1.3.1</li>
 </ul>
@@ -68,9 +70,9 @@ and certain directories needed for building ProMod3. Basically it is called
 right from a shell with the directory containing the top-level
 <code class="file docutils literal"><span class="pre">CMakeLists.txt</span></code> as an argument. The preferred approach is to generate a
 build folder and configure and compile in there:</p>
-<div class="highlight-console"><div class="highlight"><pre><span class="gp">#</span> execute this in the ProMod3 root folder
+<div class="highlight-console"><div class="highlight"><pre><span></span><span class="gp">#</span> execute this in the ProMod3 root folder
 <span class="gp">$</span> mkdir build
-<span class="gp">$</span> <span class="nb">cd </span>build
+<span class="gp">$</span> <span class="nb">cd</span> build
 <span class="gp">$</span> cmake .. -DOST_ROOT<span class="o">=</span>&lt;PATH TO OST&gt;
 </pre></div>
 </div>
@@ -115,7 +117,7 @@ really got rebuild and similar things required.</p>
 <div class="section" id="running-make">
 <h2>Running Make<a class="headerlink" href="#running-make" title="Permalink to this headline">¶</a></h2>
 <p>After configuring, you want to build ProMod3 by</p>
-<div class="highlight-console"><div class="highlight"><pre><span class="gp">$</span> make
+<div class="highlight-console"><div class="highlight"><pre><span></span><span class="gp">$</span> make
 </pre></div>
 </div>
 <p>to populate the <code class="file docutils literal"><span class="pre">stage</span></code> directory with a ready-to-go version of the
@@ -139,7 +141,7 @@ builder</li>
 <h2>Installing ProMod3<a class="headerlink" href="#installing-project" title="Permalink to this headline">¶</a></h2>
 <p>If you wish to install ProMod3 (note that you can also safely keep it all in
 the <code class="file docutils literal"><span class="pre">stage</span></code> directory), you can use</p>
-<div class="highlight-console"><div class="highlight"><pre><span class="gp">$</span> make install
+<div class="highlight-console"><div class="highlight"><pre><span></span><span class="gp">$</span> make install
 </pre></div>
 </div>
 <p>By default, this will copy the <code class="file docutils literal"><span class="pre">stage</span></code> directory to <code class="file docutils literal"><span class="pre">/usr/local</span></code>. To
@@ -195,9 +197,6 @@ safely delete the whole source folder.</p>
       <input type="hidden" name="check_keywords" value="yes" />
       <input type="hidden" name="area" value="default" />
     </form>
-    <p class="searchtip" style="font-size: 90%">
-    Enter search terms or a module, class or function name.
-    </p>
 </div>
 <script type="text/javascript">$('#searchbox').show(0);</script>
         </div>
@@ -205,11 +204,11 @@ safely delete the whole source folder.</p>
       <div class="clearer"></div>
     </div>
     <div class="footer">
-      &copy;2017, ProMod3 authors.
+      &copy;2018, ProMod3 authors.
       
       |
-      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a>
-      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.6</a>
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.4.1</a>
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
       
       |
       <a href="_sources/buildsystem.txt"
diff --git a/doc/html/changelog.html b/doc/html/changelog.html
index 0893031cb90a205da543e19cea1f2bea928af80f..776b517f5d8af27418df83b927924c2b327d2a65 100644
--- a/doc/html/changelog.html
+++ b/doc/html/changelog.html
@@ -6,7 +6,7 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
-    <title>Changelog &mdash; ProMod3 1.1.0 documentation</title>
+    <title>Changelog &mdash; ProMod3 1.2.0 documentation</title>
     
     <link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
     <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
@@ -14,7 +14,7 @@
     <script type="text/javascript">
       var DOCUMENTATION_OPTIONS = {
         URL_ROOT:    './',
-        VERSION:     '1.1.0',
+        VERSION:     '1.2.0',
         COLLAPSE_INDEX: false,
         FILE_SUFFIX: '.html',
         HAS_SOURCE:  true
@@ -23,14 +23,16 @@
     <script type="text/javascript" src="_static/jquery.js"></script>
     <script type="text/javascript" src="_static/underscore.js"></script>
     <script type="text/javascript" src="_static/doctools.js"></script>
-    <link rel="top" title="ProMod3 1.1.0 documentation" href="index.html" />
+    <link rel="top" title="ProMod3 1.2.0 documentation" href="index.html" />
     <link rel="prev" title="Using Binary Files In ProMod3" href="portableIO.html" />
    
+  <link rel="stylesheet" href="_static/custom.css" type="text/css" />
   
-  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
 
   </head>
-  <body role="document">  
+  <body role="document">
+  
 
     <div class="document">
       <div class="documentwrapper">
@@ -39,8 +41,37 @@
             
   <div class="section" id="changelog">
 <h1>Changelog<a class="headerlink" href="#changelog" title="Permalink to this headline">¶</a></h1>
-<div class="section" id="release-1-1">
-<h2>Release 1.1<a class="headerlink" href="#release-1-1" title="Permalink to this headline">¶</a></h2>
+<div class="section" id="release-1-2-0">
+<h2>Release 1.2.0<a class="headerlink" href="#release-1-2-0" title="Permalink to this headline">¶</a></h2>
+<ul class="simple">
+<li>Graph optimizer has been separated from the sidechain module and can now be
+used for arbitrary optimization problems. Available optimization algorithms
+are TreePack, AStar and MonteCarlo.</li>
+<li>Make it possible to distinguish between the scores of a loop towards a constant
+environment (external scores) and the scores within the loop itself
+(internal scores).</li>
+<li>Most scores based on pairwise interactions are now pairwise decomposable.</li>
+<li>Disconnected loops at several locations can be scored at once.</li>
+<li>Avoid the usage of the DSSP executable and use the OpenStructure internal
+secondary structure assignment instead.</li>
+<li>Allow to decide whether the CB atom belongs to the actual rotamer or to the
+constant frame in sidechain optimization. This can be useful in design
+questions, where the identity of a rotamer is not given and you want to
+allow glycine or alanine.</li>
+<li>The naming of the entries in the StructureDB is not strictly limited to
+4 letter codes anymore, arbitrary strings can be used instead.</li>
+<li>Adding coordinates to the StructureDB does not require external tools anymore
+(msms, dssp etc.), internal implementations are used instead.</li>
+<li>The data that is stored in a StructureDB can be controlled at initialization,
+everything except the sequence and the actual coordinates is optional.</li>
+<li>Entries in the StructureDB can be removed again.</li>
+<li>Allow to search positions of arbitrary copies in DynamicSpatialOrganizer
+by providing RT operators.</li>
+<li>Several minor bug fixes, improvements, and speed-ups</li>
+</ul>
+</div>
+<div class="section" id="release-1-1-0">
+<h2>Release 1.1.0<a class="headerlink" href="#release-1-1-0" title="Permalink to this headline">¶</a></h2>
 <ul class="simple">
 <li>Updated dependencies: need Eigen 3.3.0 and OST 1.7</li>
 <li>Changes in modelling pipeline: remove clashing loop candidates early, new
@@ -80,7 +111,8 @@ selected loops, reconstruct hydrogens and minimize energy with MM</li>
   <h3><a href="index.html">Table Of Contents</a></h3>
   <ul>
 <li><a class="reference internal" href="#">Changelog</a><ul>
-<li><a class="reference internal" href="#release-1-1">Release 1.1</a></li>
+<li><a class="reference internal" href="#release-1-2-0">Release 1.2.0</a></li>
+<li><a class="reference internal" href="#release-1-1-0">Release 1.1.0</a></li>
 <li><a class="reference internal" href="#release-1-0">Release 1.0</a></li>
 </ul>
 </li>
@@ -108,9 +140,6 @@ selected loops, reconstruct hydrogens and minimize energy with MM</li>
       <input type="hidden" name="check_keywords" value="yes" />
       <input type="hidden" name="area" value="default" />
     </form>
-    <p class="searchtip" style="font-size: 90%">
-    Enter search terms or a module, class or function name.
-    </p>
 </div>
 <script type="text/javascript">$('#searchbox').show(0);</script>
         </div>
@@ -118,11 +147,11 @@ selected loops, reconstruct hydrogens and minimize energy with MM</li>
       <div class="clearer"></div>
     </div>
     <div class="footer">
-      &copy;2017, ProMod3 authors.
+      &copy;2018, ProMod3 authors.
       
       |
-      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a>
-      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.6</a>
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.4.1</a>
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
       
       |
       <a href="_sources/changelog.txt"
diff --git a/doc/html/cmake/index.html b/doc/html/cmake/index.html
index 4f3556eef9038ea882168fed65877fa5ab20eacc..f80cc16828502e7b936f090bbb38cd803d3b88ee 100644
--- a/doc/html/cmake/index.html
+++ b/doc/html/cmake/index.html
@@ -6,7 +6,7 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
-    <title>ProMod3‘s Share Of CMake &mdash; ProMod3 1.1.0 documentation</title>
+    <title>ProMod3‘s Share Of CMake &mdash; ProMod3 1.2.0 documentation</title>
     
     <link rel="stylesheet" href="../_static/alabaster.css" type="text/css" />
     <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
@@ -14,7 +14,7 @@
     <script type="text/javascript">
       var DOCUMENTATION_OPTIONS = {
         URL_ROOT:    '../',
-        VERSION:     '1.1.0',
+        VERSION:     '1.2.0',
         COLLAPSE_INDEX: false,
         FILE_SUFFIX: '.html',
         HAS_SOURCE:  true
@@ -23,16 +23,18 @@
     <script type="text/javascript" src="../_static/jquery.js"></script>
     <script type="text/javascript" src="../_static/underscore.js"></script>
     <script type="text/javascript" src="../_static/doctools.js"></script>
-    <link rel="top" title="ProMod3 1.1.0 documentation" href="../index.html" />
+    <link rel="top" title="ProMod3 1.2.0 documentation" href="../index.html" />
     <link rel="up" title="Documentation For Developers" href="../developers.html" />
     <link rel="next" title="Using Binary Files In ProMod3" href="../portableIO.html" />
     <link rel="prev" title="test_actions - Testing Actions" href="../actions/index_dev.html" />
    
+  <link rel="stylesheet" href="../_static/custom.css" type="text/css" />
   
-  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
 
   </head>
-  <body role="document">  
+  <body role="document">
+  
 
     <div class="document">
       <div class="documentwrapper">
@@ -73,7 +75,7 @@ various <code class="file docutils literal"><span class="pre">CMakeLists.txt</sp
 <dl class="command">
 <dt id="command:module">
 <code class="descname">module</code><a class="headerlink" href="#command:module" title="Permalink to this definition">¶</a></dt>
-<dd><div class="highlight-cmake"><div class="highlight"><pre><span class="nb">module</span><span class="p">(</span><span class="s">NAME</span> <span class="s">name</span>
+<dd><div class="highlight-cmake"><div class="highlight"><pre><span></span><span class="nb">module</span><span class="p">(</span><span class="s">NAME</span> <span class="s">name</span>
        <span class="s">SOURCES</span> <span class="s">source1</span> <span class="s">source2</span>
        <span class="s">HEADERS</span> <span class="s">header1</span> <span class="s">header2</span> <span class="s">[IN_DIR</span> <span class="s">dir]</span>
                <span class="s">[header3</span> <span class="s">header4</span> <span class="s">[IN_DIR</span> <span class="s">dir]]</span>
@@ -114,7 +116,7 @@ libraries here, such as <code class="docutils literal"><span class="pre">${OST_L
 <dl class="command">
 <dt id="command:pymod">
 <code class="descname">pymod</code><a class="headerlink" href="#command:pymod" title="Permalink to this definition">¶</a></dt>
-<dd><div class="highlight-cmake"><div class="highlight"><pre><span class="nb">pymod</span><span class="p">(</span><span class="s">NAME</span> <span class="s">name</span>
+<dd><div class="highlight-cmake"><div class="highlight"><pre><span></span><span class="nb">pymod</span><span class="p">(</span><span class="s">NAME</span> <span class="s">name</span>
       <span class="s">CPP</span> <span class="s">source1</span> <span class="s">source2</span>
       <span class="s">PY</span> <span class="s">source</span> <span class="s">source2</span> <span class="s">[IN_DIR</span> <span class="s">dir]</span>
          <span class="s">[source3</span> <span class="s">source4</span> <span class="s">[IN_DIR</span> <span class="s">dir]]</span>
@@ -162,7 +164,7 @@ headers in the <code class="file docutils literal"><span class="pre">config</spa
 <dl class="command">
 <dt id="command:convert_module_data">
 <code class="descname">convert_module_data</code><a class="headerlink" href="#command:convert_module_data" title="Permalink to this definition">¶</a></dt>
-<dd><div class="highlight-cmake"><div class="highlight"><pre><span class="nb">convert_module_data</span><span class="p">(</span><span class="s">MODULE</span> <span class="s">name</span>
+<dd><div class="highlight-cmake"><div class="highlight"><pre><span></span><span class="nb">convert_module_data</span><span class="p">(</span><span class="s">MODULE</span> <span class="s">name</span>
                     <span class="s">FILE</span> <span class="s">file</span>
                     <span class="s">SCRIPT</span> <span class="s">script</span>
                     <span class="s">[ARGS</span> <span class="s">args]</span><span class="p">)</span>
@@ -184,7 +186,7 @@ If given, <code class="docutils literal"><span class="pre">args</span></code> ca
 <dl class="command">
 <dt id="command:promod3_unittest">
 <code class="descname">promod3_unittest</code><a class="headerlink" href="#command:promod3_unittest" title="Permalink to this definition">¶</a></dt>
-<dd><div class="highlight-cmake"><div class="highlight"><pre><span class="nb">promod3_unittest</span><span class="p">(</span><span class="s">MODULE</span> <span class="s">name</span>
+<dd><div class="highlight-cmake"><div class="highlight"><pre><span></span><span class="nb">promod3_unittest</span><span class="p">(</span><span class="s">MODULE</span> <span class="s">name</span>
                  <span class="s">SOURCES</span> <span class="s">source1</span> <span class="s">[source2</span> <span class="s">...]</span>
                  <span class="s">[LINK</span> <span class="s">library1/</span> <span class="s">linker</span> <span class="s">flag1</span> <span class="s">[library2/</span> <span class="s">linker</span> <span class="s">flag2</span> <span class="s">...]]</span>
                  <span class="s">[DATA</span> <span class="s">data1</span> <span class="s">[data2</span> <span class="s">...]]</span>
@@ -240,7 +242,7 @@ By default all unit tests are registered to be executed with the
 <dl class="command">
 <dt id="command:add_doc_source">
 <code class="descname">add_doc_source</code><a class="headerlink" href="#command:add_doc_source" title="Permalink to this definition">¶</a></dt>
-<dd><div class="highlight-cmake"><div class="highlight"><pre><span class="nb">add_doc_source</span><span class="p">(</span><span class="s">NAME</span> <span class="s">name</span>
+<dd><div class="highlight-cmake"><div class="highlight"><pre><span></span><span class="nb">add_doc_source</span><span class="p">(</span><span class="s">NAME</span> <span class="s">name</span>
                <span class="s">RST</span> <span class="s">rst1</span> <span class="s">[rst2...]</span><span class="p">)</span>
 </pre></div>
 </div>
@@ -265,7 +267,7 @@ name or a CMake list.</dd>
 <dl class="command">
 <dt id="command:add_doc_dependency">
 <code class="descname">add_doc_dependency</code><a class="headerlink" href="#command:add_doc_dependency" title="Permalink to this definition">¶</a></dt>
-<dd><div class="highlight-cmake"><div class="highlight"><pre><span class="nb">add_doc_dependency</span><span class="p">(</span><span class="s">NAME</span> <span class="s">name</span>
+<dd><div class="highlight-cmake"><div class="highlight"><pre><span></span><span class="nb">add_doc_dependency</span><span class="p">(</span><span class="s">NAME</span> <span class="s">name</span>
                    <span class="s">DEP</span> <span class="s">dependency1</span> <span class="s">[dependency2...]</span><span class="p">)</span>
 </pre></div>
 </div>
@@ -292,7 +294,7 @@ absolute path.</dd>
 <dl class="command">
 <dt id="command:pm_action">
 <code class="descname">pm_action</code><a class="headerlink" href="#command:pm_action" title="Permalink to this definition">¶</a></dt>
-<dd><div class="highlight-cmake"><div class="highlight"><pre><span class="nb">pm_action</span><span class="p">(</span><span class="s">ACTION</span> <span class="s">action-script</span>
+<dd><div class="highlight-cmake"><div class="highlight"><pre><span></span><span class="nb">pm_action</span><span class="p">(</span><span class="s">ACTION</span> <span class="s">action-script</span>
           <span class="s">TARGET</span> <span class="s">target</span><span class="p">)</span>
 </pre></div>
 </div>
@@ -363,9 +365,6 @@ target has to be created <strong>before</strong> any action may be attached to i
       <input type="hidden" name="check_keywords" value="yes" />
       <input type="hidden" name="area" value="default" />
     </form>
-    <p class="searchtip" style="font-size: 90%">
-    Enter search terms or a module, class or function name.
-    </p>
 </div>
 <script type="text/javascript">$('#searchbox').show(0);</script>
         </div>
@@ -373,11 +372,11 @@ target has to be created <strong>before</strong> any action may be attached to i
       <div class="clearer"></div>
     </div>
     <div class="footer">
-      &copy;2017, ProMod3 authors.
+      &copy;2018, ProMod3 authors.
       
       |
-      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a>
-      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.6</a>
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.4.1</a>
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
       
       |
       <a href="../_sources/cmake/index.txt"
diff --git a/doc/html/contributing.html b/doc/html/contributing.html
index a603efdf074a16bb0b6c713c9757612dc40d17f5..069ec304aa26f141410c4fe3bfd06b0b7624cbce 100644
--- a/doc/html/contributing.html
+++ b/doc/html/contributing.html
@@ -6,7 +6,7 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
-    <title>Contributing &mdash; ProMod3 1.1.0 documentation</title>
+    <title>Contributing &mdash; ProMod3 1.2.0 documentation</title>
     
     <link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
     <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
@@ -14,7 +14,7 @@
     <script type="text/javascript">
       var DOCUMENTATION_OPTIONS = {
         URL_ROOT:    './',
-        VERSION:     '1.1.0',
+        VERSION:     '1.2.0',
         COLLAPSE_INDEX: false,
         FILE_SUFFIX: '.html',
         HAS_SOURCE:  true
@@ -23,16 +23,18 @@
     <script type="text/javascript" src="_static/jquery.js"></script>
     <script type="text/javascript" src="_static/underscore.js"></script>
     <script type="text/javascript" src="_static/doctools.js"></script>
-    <link rel="top" title="ProMod3 1.1.0 documentation" href="index.html" />
+    <link rel="top" title="ProMod3 1.2.0 documentation" href="index.html" />
     <link rel="up" title="Documentation For Developers" href="developers.html" />
     <link rel="next" title="test_actions - Testing Actions" href="actions/index_dev.html" />
     <link rel="prev" title="ProMod3 Setup" href="dev_setup.html" />
    
+  <link rel="stylesheet" href="_static/custom.css" type="text/css" />
   
-  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
 
   </head>
-  <body role="document">  
+  <body role="document">
+  
 
     <div class="document">
       <div class="documentwrapper">
@@ -53,27 +55,27 @@ the repository into a directory and just changed into it.</p>
 work fine with all the other new fellows waiting for release right from the
 beginning. Therefore you need to switch branches as a first step. Git will
 tell you for which branch you went, a story of failure otherwise.</p>
-<div class="highlight-console"><div class="highlight"><pre><span class="gp">$</span> git checkout develop
+<div class="highlight-console"><div class="highlight"><pre><span></span><span class="gp">$</span> git checkout develop
 <span class="go">Switched to branch &#39;develop&#39;</span>
 </pre></div>
 </div>
 <p>Sitting on top of the right code basis, you should just spawn your own branch
 from it. As an example, your feature will go by the name of &#8216;sidechain&#8217;.</p>
-<div class="highlight-console"><div class="highlight"><pre><span class="gp">$</span> git checkout -b sidechain
+<div class="highlight-console"><div class="highlight"><pre><span></span><span class="gp">$</span> git checkout -b sidechain
 <span class="go">Switched to a new branch &#39;sidechain&#39;</span>
 </pre></div>
 </div>
 <p>This time, Git should tell you about going for <strong>a new</strong> branch.</p>
 <p>Before starting to create anything for real, now is the perfect moment to
 install our very own Git hook to check some coding rules on commit.</p>
-<div class="highlight-console"><div class="highlight"><pre><span class="gp">$</span> cp extras/pre_commit/pre-commit .git/hooks/
+<div class="highlight-console"><div class="highlight"><pre><span></span><span class="gp">$</span> cp extras/pre_commit/pre-commit .git/hooks/
 </pre></div>
 </div>
 <p>With that in place, changes which break our coding standards will abort any
 commit.</p>
 <p>Now create the directory structure where your project will live. Here is the
 list of directories which are likely to be used in every project.</p>
-<div class="highlight-console"><div class="highlight"><pre><span class="gp">$</span> mkdir -p sidechain/doc
+<div class="highlight-console"><div class="highlight"><pre><span></span><span class="gp">$</span> mkdir -p sidechain/doc
 <span class="gp">$</span> mkdir -p sidechain/pymod
 <span class="gp">$</span> mkdir -p sidechain/tests
 </pre></div>
@@ -81,7 +83,7 @@ list of directories which are likely to be used in every project.</p>
 <p>If you run <code class="docutils literal"><span class="pre">git</span> <span class="pre">status</span></code> at this point, you will see basically nothing. That
 is, Git does not admire empty directories. Before you bring your module under
 version control, create a couple of files which are always needed.</p>
-<div class="highlight-console"><div class="highlight"><pre><span class="gp">$</span> touch sidechain/pymod/__init__.py
+<div class="highlight-console"><div class="highlight"><pre><span></span><span class="gp">$</span> touch sidechain/pymod/__init__.py
 <span class="gp">$</span> <span class="nb">echo</span> <span class="s2">&quot;:mod:\`~promod3.sidechain\` - ProMod3 side chain optimiser&quot;</span> &gt;&gt; sidechain/doc/index.rst
 <span class="gp">$</span> <span class="nb">echo</span> <span class="s2">&quot;================================================================================&quot;</span> &gt;&gt; sidechain/doc/index.rst
 </pre></div>
@@ -93,7 +95,7 @@ your documentation.</p>
 <p>For integration with <strong class="command">make</strong>, the build system needs to now about the
 new module and its members. This goes for setting up new CMake files and
 extending some around the directory root.</p>
-<div class="highlight-console"><div class="highlight"><pre><span class="gp">$</span> touch sidechain/CMakeLists.txt
+<div class="highlight-console"><div class="highlight"><pre><span></span><span class="gp">$</span> touch sidechain/CMakeLists.txt
 <span class="gp">$</span> touch sidechain/pymod/CMakeLists.txt
 <span class="gp">$</span> touch sidechain/doc/CMakeLists.txt
 </pre></div>
@@ -101,7 +103,7 @@ extending some around the directory root.</p>
 <p>Each of those files still needs a bit of content. The simplest one comes from
 the module&#8217;s root, <code class="file docutils literal"><span class="pre">sidechain/CMakeLists.txt</span></code>:</p>
 <div class="highlight-cmake"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1
-2</pre></div></td><td class="code"><div class="highlight"><pre><span class="nb">add_subdirectory</span><span class="p">(</span><span class="s">pymod</span><span class="p">)</span>
+2</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="nb">add_subdirectory</span><span class="p">(</span><span class="s">pymod</span><span class="p">)</span>
 <span class="nb">add_subdirectory</span><span class="p">(</span><span class="s">doc</span><span class="p">)</span>
 </pre></div>
 </td></tr></table></div>
@@ -113,7 +115,7 @@ configurations. The next level in <code class="file docutils literal"><span clas
 2
 3
 4
-5</pre></div></td><td class="code"><div class="highlight"><pre><span class="nb">set</span><span class="p">(</span><span class="s">SIDECHAIN_RST</span>
+5</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="nb">set</span><span class="p">(</span><span class="s">SIDECHAIN_RST</span>
 <span class="s">index.rst</span>
 <span class="p">)</span>
 
@@ -138,7 +140,7 @@ a couple of examples around in this repository. Here is the most basic
 2
 3
 4
-5</pre></div></td><td class="code"><div class="highlight"><pre><span class="nb">set</span><span class="p">(</span><span class="s">SIDECHAIN_PYMOD</span>
+5</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="nb">set</span><span class="p">(</span><span class="s">SIDECHAIN_PYMOD</span>
 <span class="s">__init__.py</span>
 <span class="p">)</span>
 
@@ -166,7 +168,7 @@ top level <code class="file docutils literal"><span class="pre">CMakeLists.txt</
 12
 13
 14
-15</pre></div></td><td class="code"><div class="highlight"><pre><span class="c">## &lt;lots of cmake commands...&gt;</span>
+15</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="c">## &lt;lots of cmake commands...&gt;</span>
 
 <span class="c">## sub dirs to be recognised by CMake</span>
 <span class="c">## e.g. add_subdirectory(src), subdirs have their own CMakeLists.txt</span>
@@ -198,8 +200,8 @@ still can stay in your repository while being out of the source tree by using
 sub-directories. ProMod3 comes with a dedicated prefix &#8216;build*&#8217; in
 <code class="file docutils literal"><span class="pre">.gitignore</span></code>. Have a directory <code class="file docutils literal"><span class="pre">build</span></code> and <code class="file docutils literal"><span class="pre">build-dbg</span></code> and it
 will not show up in <code class="docutils literal"><span class="pre">git</span> <span class="pre">status</span></code>.</p>
-<div class="highlight-console"><div class="highlight"><pre><span class="gp">$</span> mkdir build
-<span class="gp">$</span> <span class="nb">cd </span>build
+<div class="highlight-console"><div class="highlight"><pre><span></span><span class="gp">$</span> mkdir build
+<span class="gp">$</span> <span class="nb">cd</span> build
 </pre></div>
 </div>
 <p>To actually create all the makefiles and generated files, you may use one of
@@ -208,7 +210,7 @@ those scripts only need to be pointed to an OST staging tree. Even if you
 are on a system not covered by available scripts, their code may help you at
 the CMake command. Once you managed to conquer a new system, feel free to add
 a new configuration script. The following example assumes Fedora 19.</p>
-<div class="highlight-console"><div class="highlight"><pre><span class="gp">$</span> ../conf-scripts/fedora-19-conf ../../ost.git/stage
+<div class="highlight-console"><div class="highlight"><pre><span></span><span class="gp">$</span> ../conf-scripts/fedora-19-conf ../../ost.git/stage
 </pre></div>
 </div>
 <p>From this point, <strong class="command">make</strong> should work and you could start adding your
@@ -219,13 +221,13 @@ beginning. At some point, new code needs testing anyway to see if it does what
 it should, so just do this by writing unit tests. Test sources are stored in
 files with a prefix <code class="file docutils literal"><span class="pre">test_</span></code> and usually come per submodule instead of
 sporting a single monolithic <code class="file docutils literal"><span class="pre">test_sidechain_reconstruction.py</span></code>.</p>
-<p>Python code is evaluated using its own <a class="reference external" href="https://docs.python.org/2.7/library/unittest.html">unit testing framework</a> with a little help from <a class="reference external" href="http://www.OpenStructure.org">OST</a> (C++ uses the
-Boost <a class="reference external" href="http://www.boost.org/doc/libs/1_47_0/libs/test/doc/html/index.html">Test Library</a>). The
+<p>Python code is evaluated using its own <a class="reference external" href="https://docs.python.org/2.7/library/unittest.html">unit testing framework</a> with a little help from <a class="reference external" href="https://www.OpenStructure.org">OST</a> (C++ uses the
+Boost <a class="reference external" href="https://www.boost.org/doc/libs/1_53_0/libs/test/doc/html/index.html">Test Library</a>). The
 basic scheme is to import your module, subclass <a class="reference external" href="https://docs.python.org/2.7/library/unittest.html#unittest.TestCase" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">unittest.TestCase</span></code></a> and
 make the whole file runnable as script using the most common <a class="reference external" href="https://docs.python.org/2.7/library/__main__.html"><code class="xref py py-attr docutils literal"><span class="pre">__name__</span></code></a>
 attribute. As an example we test the
 <a class="reference internal" href="modelling/sidechain_reconstruction.html#promod3.modelling.ReconstructSidechains" title="promod3.modelling.ReconstructSidechains"><code class="xref py py-func docutils literal"><span class="pre">promod3.modelling.ReconstructSidechains()</span></code></a> function:</p>
-<div class="highlight-python"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre> 1
+<div class="highlight-default"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre> 1
  2
  3
  4
@@ -243,24 +245,24 @@ attribute. As an example we test the
 16
 17
 18
-19</pre></div></td><td class="code"><div class="highlight"><pre><span class="kn">import</span> <span class="nn">unittest</span>
-<span class="kn">from</span> <span class="nn">promod3</span> <span class="kn">import</span> <span class="n">modelling</span>
-<span class="kn">from</span> <span class="nn">ost</span> <span class="kn">import</span> <span class="n">io</span><span class="p">,</span><span class="n">mol</span>
+19</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">unittest</span>
+<span class="kn">from</span> <span class="nn">promod3</span> <span class="k">import</span> <span class="n">modelling</span>
+<span class="kn">from</span> <span class="nn">ost</span> <span class="k">import</span> <span class="n">io</span><span class="p">,</span><span class="n">mol</span>
 <span class="kn">import</span> <span class="nn">os</span>
 
 <span class="k">class</span> <span class="nc">ReconstructTests</span><span class="p">(</span><span class="n">unittest</span><span class="o">.</span><span class="n">TestCase</span><span class="p">):</span>
     <span class="k">def</span> <span class="nf">testReconstruct</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
-    	<span class="n">in_file</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="s">&#39;data&#39;</span><span class="p">,</span> <span class="s">&#39;1eye.pdb&#39;</span><span class="p">)</span>
-    	<span class="n">ref_file</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="s">&#39;data&#39;</span><span class="p">,</span> <span class="s">&#39;1eye_rec.pdb&#39;</span><span class="p">)</span>
-    	<span class="c"># get and reconstruct 1eye</span>
+    	<span class="n">in_file</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="s1">&#39;data&#39;</span><span class="p">,</span> <span class="s1">&#39;1eye.pdb&#39;</span><span class="p">)</span>
+    	<span class="n">ref_file</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="s1">&#39;data&#39;</span><span class="p">,</span> <span class="s1">&#39;1eye_rec.pdb&#39;</span><span class="p">)</span>
+    	<span class="c1"># get and reconstruct 1eye</span>
     	<span class="n">prot</span> <span class="o">=</span> <span class="n">io</span><span class="o">.</span><span class="n">LoadPDB</span><span class="p">(</span><span class="n">in_file</span><span class="p">)</span>
-    	<span class="n">modelling</span><span class="o">.</span><span class="n">ReconstructSidechains</span><span class="p">(</span><span class="n">prot</span><span class="p">,</span> <span class="n">keep_sidechains</span><span class="o">=</span><span class="bp">False</span><span class="p">)</span>
-    	<span class="c"># compare with reference solution</span>
+    	<span class="n">modelling</span><span class="o">.</span><span class="n">ReconstructSidechains</span><span class="p">(</span><span class="n">prot</span><span class="p">,</span> <span class="n">keep_sidechains</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
+    	<span class="c1"># compare with reference solution</span>
     	<span class="n">prot_rec</span> <span class="o">=</span> <span class="n">io</span><span class="o">.</span><span class="n">LoadPDB</span><span class="p">(</span><span class="n">ref_file</span><span class="p">)</span>
         <span class="bp">self</span><span class="o">.</span><span class="n">assertEqual</span><span class="p">(</span><span class="n">prot</span><span class="o">.</span><span class="n">GetAtomCount</span><span class="p">(),</span> <span class="n">prot_rec</span><span class="o">.</span><span class="n">GetAtomCount</span><span class="p">())</span>
 
-<span class="k">if</span> <span class="n">__name__</span> <span class="o">==</span> <span class="s">&quot;__main__&quot;</span><span class="p">:</span>
-    <span class="kn">from</span> <span class="nn">ost</span> <span class="kn">import</span> <span class="n">testutils</span>
+<span class="k">if</span> <span class="n">__name__</span> <span class="o">==</span> <span class="s2">&quot;__main__&quot;</span><span class="p">:</span>
+    <span class="kn">from</span> <span class="nn">ost</span> <span class="k">import</span> <span class="n">testutils</span>
     <span class="n">testutils</span><span class="o">.</span><span class="n">RunTests</span><span class="p">()</span>
 </pre></div>
 </td></tr></table></div>
@@ -270,7 +272,7 @@ First, tell CMake to search <code class="file docutils literal"><span class="pre
 by extending the list of sub-directories in <code class="file docutils literal"><span class="pre">sidechain/CMakeLists.txt</span></code>:</p>
 <div class="highlight-cmake"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1
 2
-3</pre></div></td><td class="code"><div class="highlight"><pre> <span class="nb">add_subdirectory</span><span class="p">(</span><span class="s">pymod</span><span class="p">)</span>
+3</pre></div></td><td class="code"><div class="highlight"><pre><span></span> <span class="nb">add_subdirectory</span><span class="p">(</span><span class="s">pymod</span><span class="p">)</span>
  <span class="nb">add_subdirectory</span><span class="p">(</span><span class="s">doc</span><span class="p">)</span>
  <span class="nb">add_subdirectory</span><span class="p">(</span><span class="s">tests</span><span class="p">)</span>
 </pre></div>
@@ -289,7 +291,7 @@ you.</p>
  9
 10
 11
-12</pre></div></td><td class="code"><div class="highlight"><pre><span class="nb">set</span><span class="p">(</span><span class="s">SIDECHAIN_UNIT_TESTS</span>
+12</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="nb">set</span><span class="p">(</span><span class="s">SIDECHAIN_UNIT_TESTS</span>
   <span class="s">test_reconstruct_sidechains.py</span>
 <span class="p">)</span>
 
@@ -314,10 +316,10 @@ you.</p>
 launcher found in your staging directory at <code class="file docutils literal"><span class="pre">stage/bin/pm</span></code>. This little
 guy helps keeping the shell environment in the right mood to carry out your
 job. So usually you will start an action by</p>
-<div class="highlight-console"><div class="highlight"><pre><span class="gp">$</span> stage/bin/pm <span class="nb">help</span>
+<div class="highlight-console"><div class="highlight"><pre><span></span><span class="gp">$</span> stage/bin/pm <span class="nb">help</span>
 </pre></div>
 </div>
-<p>To start your own action, follow <a class="reference internal" href="#how-to-start-your-own-module"><span>How To Start Your Own Module</span></a> until
+<p>To start your own action, follow <a class="reference internal" href="#how-to-start-your-own-module"><span class="std std-ref">How To Start Your Own Module</span></a> until
 creating a directory structure for a new module. Also <strong>do</strong> go for a dedicated
 branch for action-development. There you can produce intermediate commits while
 other branches stay clean in case you have to do some work there which needs to
@@ -325,7 +327,7 @@ get public.</p>
 <p>After preparing your repository its time to create a file for the action. That
 is a bit different than for modules. Assuming we are sitting in the
 repository&#8217;s root:</p>
-<div class="highlight-console"><div class="highlight"><pre><span class="gp">$</span> touch action/pm-awesome-action
+<div class="highlight-console"><div class="highlight"><pre><span></span><span class="gp">$</span> touch action/pm-awesome-action
 <span class="gp">$</span> chmod +x action/pm-awesome-action
 </pre></div>
 </div>
@@ -342,7 +344,7 @@ executable, which does not propagate if you do it <strong>after</strong> the fir
 4
 5
 6
-7</pre></div></td><td class="code"><div class="highlight"><pre> <span class="nb">add_custom_target</span><span class="p">(</span><span class="s">actions</span> <span class="s">ALL</span><span class="p">)</span>
+7</pre></div></td><td class="code"><div class="highlight"><pre><span></span> <span class="nb">add_custom_target</span><span class="p">(</span><span class="s">actions</span> <span class="s">ALL</span><span class="p">)</span>
  <span class="nb">add_subdirectory</span><span class="p">(</span><span class="s">tests</span><span class="p">)</span>
 
  <span class="nb">pm_action_init</span><span class="p">()</span>
@@ -376,11 +378,11 @@ that&#8217;s enough to get everything just right.</p>
 Your action will have own function definitions, variables and all the bells
 and whistles. Hiding behind <a class="reference external" href="https://docs.python.org/2.7/library/__main__.html"><code class="xref py py-attr docutils literal"><span class="pre">__main__</span></code></a> keeps everything separated and makes
 things easier when it gets to debugging. So just after</p>
-<div class="highlight-python"><div class="highlight"><pre><span class="kn">import</span> <span class="nn">alot</span>
+<div class="highlight-python"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">alot</span>
 
 <span class="k">def</span> <span class="nf">functions_specific_to_your_action</span><span class="p">(</span><span class="o">...</span><span class="p">):</span>
 
-<span class="k">if</span> <span class="n">__name__</span> <span class="o">==</span> <span class="s">&quot;__main__&quot;</span><span class="p">:</span>
+<span class="k">if</span> <span class="n">__name__</span> <span class="o">==</span> <span class="s2">&quot;__main__&quot;</span><span class="p">:</span>
     <span class="o">&lt;</span><span class="n">put</span> <span class="n">together</span> <span class="n">what</span> <span class="n">your</span> <span class="n">action</span> <span class="n">should</span> <span class="n">do</span> <span class="n">here</span><span class="o">&gt;</span>
 </pre></div>
 </div>
@@ -463,7 +465,7 @@ and <code class="docutils literal"><span class="pre">ost</span></code> as in the
 folder and adapt it for your purposes. First, you will have to fix the paths
 to ProMod3 and OST in the <code class="file docutils literal"><span class="pre">Makefile</span></code> by changing the following
 lines:</p>
-<div class="highlight-make"><div class="highlight"><pre><span class="c"># path to OST and ProMod3 stage</span>
+<div class="highlight-make"><div class="highlight"><pre><span></span><span class="c"># path to OST and ProMod3 stage</span>
 <span class="nv">OST_ROOT</span> <span class="o">=</span> &lt;DEFINEME&gt;/ost/build/stage
 <span class="nv">PROMOD3_ROOT</span> <span class="o">=</span> &lt;DEFINEME&gt;/ProMod3/build/stage
 </pre></div>
@@ -518,7 +520,7 @@ crucial. For documentation which does not relate to a particular module, the
 repository comes with a top-level <code class="file docutils literal"><span class="pre">doc</span></code> directory.</p>
 <p>While you should not spend to much time thinking about how to format
 documentation, here is a helpful list of standard formatters:
-<a class="reference external" href="http://sphinx-doc.org/markup/inline.html">http://sphinx-doc.org/markup/inline.html</a></p>
+<a class="reference external" href="http://sphinx-doc.org/en/stable/markup/inline.html">http://sphinx-doc.org/en/stable/markup/inline.html</a></p>
 <p>If you write new functionality for ProMod3, or fix bugs, feel free to extend
 the <code class="file docutils literal"><span class="pre">CHANGELOG</span></code> file. It will be automatically pulled into the
 documentation.</p>
@@ -532,13 +534,13 @@ they can be included in the documentation using the
 <a class="reference external" href="http://www.sphinx-doc.org/en/stable/markup/code.html#includes">literalinclude</a>
 directive. For instance, if you add a new example code <code class="file docutils literal"><span class="pre">loop_main.py</span></code>,
 you would add it in your module documentation as follows:</p>
-<div class="highlight-rest"><div class="highlight"><pre><span class="p">..</span> <span class="ow">literalinclude</span><span class="p">::</span> ../../../tests/doc/scripts/loop_main.py
+<div class="highlight-rest"><div class="highlight"><pre><span></span><span class="p">..</span> <span class="ow">literalinclude</span><span class="p">::</span> ../../../tests/doc/scripts/loop_main.py
 </pre></div>
 </div>
 <p>If your example does not relate to a specific module and the documentation is
 in the top-level <code class="file docutils literal"><span class="pre">doc</span></code> directory, you need to drop one of the <code class="docutils literal"><span class="pre">..</span></code> as
 follows:</p>
-<div class="highlight-rest"><div class="highlight"><pre><span class="p">..</span> <span class="ow">literalinclude</span><span class="p">::</span> ../../tests/doc/scripts/hello_world.py
+<div class="highlight-rest"><div class="highlight"><pre><span></span><span class="p">..</span> <span class="ow">literalinclude</span><span class="p">::</span> ../../tests/doc/scripts/hello_world.py
 </pre></div>
 </div>
 <p>To ensure that the code examples keep on working, a unit test has to be defined
@@ -556,7 +558,7 @@ test.</li>
 there is no need to compile ProMod3 to read it. Our policy is to keep that
 folder in-sync with the latest documentation at least on the <code class="docutils literal"><span class="pre">master</span></code> branch
 (i.e. for every release). You can use the following commands to do the update:</p>
-<div class="highlight-console"><div class="highlight"><pre><span class="gp">$</span> <span class="nb">cd</span> &lt;PROMOD3_PATH&gt;/build
+<div class="highlight-console"><div class="highlight"><pre><span></span><span class="gp">$</span> <span class="nb">cd</span> &lt;PROMOD3_PATH&gt;/build
 <span class="gp">$</span> make html
 <span class="gp">$</span> rsync -iv -az --exclude<span class="o">=</span><span class="s2">&quot;.*&quot;</span> --delete <span class="se">\</span>
 <span class="go">        &quot;stage/share/promod3/html/&quot; &quot;../doc/html&quot;</span>
@@ -639,9 +641,6 @@ contributions to web pages using ProMod3.</p>
       <input type="hidden" name="check_keywords" value="yes" />
       <input type="hidden" name="area" value="default" />
     </form>
-    <p class="searchtip" style="font-size: 90%">
-    Enter search terms or a module, class or function name.
-    </p>
 </div>
 <script type="text/javascript">$('#searchbox').show(0);</script>
         </div>
@@ -649,11 +648,11 @@ contributions to web pages using ProMod3.</p>
       <div class="clearer"></div>
     </div>
     <div class="footer">
-      &copy;2017, ProMod3 authors.
+      &copy;2018, ProMod3 authors.
       
       |
-      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a>
-      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.6</a>
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.4.1</a>
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
       
       |
       <a href="_sources/contributing.txt"
diff --git a/doc/html/core/geometry.html b/doc/html/core/geometry.html
index d5c2a5d69c5b5b2f98ed0b572ee1ea3d57f40a2a..3cdcb509f583cc24facb60b9bcd5c19e7db01f34 100644
--- a/doc/html/core/geometry.html
+++ b/doc/html/core/geometry.html
@@ -6,7 +6,7 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
-    <title>Geometry functions &mdash; ProMod3 1.1.0 documentation</title>
+    <title>Geometry functions &mdash; ProMod3 1.2.0 documentation</title>
     
     <link rel="stylesheet" href="../_static/alabaster.css" type="text/css" />
     <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
@@ -14,7 +14,7 @@
     <script type="text/javascript">
       var DOCUMENTATION_OPTIONS = {
         URL_ROOT:    '../',
-        VERSION:     '1.1.0',
+        VERSION:     '1.2.0',
         COLLAPSE_INDEX: false,
         FILE_SUFFIX: '.html',
         HAS_SOURCE:  true
@@ -23,16 +23,18 @@
     <script type="text/javascript" src="../_static/jquery.js"></script>
     <script type="text/javascript" src="../_static/underscore.js"></script>
     <script type="text/javascript" src="../_static/doctools.js"></script>
-    <link rel="top" title="ProMod3 1.1.0 documentation" href="../index.html" />
+    <link rel="top" title="ProMod3 1.2.0 documentation" href="../index.html" />
     <link rel="up" title="core - ProMod3 Core Functionality" href="index.html" />
     <link rel="next" title="Runtime profiling" href="runtime_profiling.html" />
     <link rel="prev" title="helper - Shared Functionality For the Everything" href="helper.html" />
    
+  <link rel="stylesheet" href="../_static/custom.css" type="text/css" />
   
-  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
 
   </head>
-  <body role="document">  
+  <body role="document">
+  
 
     <div class="document">
       <div class="documentwrapper">
@@ -53,14 +55,14 @@
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
 <li><strong>rule</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Gromacs rule</li>
 <li><strong>number</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Desired number of positions (max. 3)</li>
-<li><strong>anchors</strong> (<code class="xref py py-class docutils literal"><span class="pre">list</span></code> of <a class="reference external" href="http://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">Vec3</span></code></a>) &#8211; Anchor positions (max. 4)</li>
+<li><strong>anchors</strong> (<code class="xref py py-class docutils literal"><span class="pre">list</span></code> of <a class="reference external" href="https://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">Vec3</span></code></a>) &#8211; Anchor positions (max. 4)</li>
 </ul>
 </td>
 </tr>
 <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Constructed <em>number</em> positions.</p>
 </td>
 </tr>
-<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><code class="xref py py-class docutils literal"><span class="pre">list</span></code> of <a class="reference external" href="http://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">Vec3</span></code></a></p>
+<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><code class="xref py py-class docutils literal"><span class="pre">list</span></code> of <a class="reference external" href="https://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">Vec3</span></code></a></p>
 </td>
 </tr>
 </tbody>
@@ -76,16 +78,16 @@
 <col class="field-body" />
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
-<li><strong>c_pos</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">Vec3</span></code></a>) &#8211; Position of C atom</li>
-<li><strong>n_pos</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">Vec3</span></code></a>) &#8211; Position of nitrogen atom</li>
-<li><strong>ca_pos</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">Vec3</span></code></a>) &#8211; Position of C-alpha atom</li>
+<li><strong>c_pos</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">Vec3</span></code></a>) &#8211; Position of C atom</li>
+<li><strong>n_pos</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">Vec3</span></code></a>) &#8211; Position of nitrogen atom</li>
+<li><strong>ca_pos</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">Vec3</span></code></a>) &#8211; Position of C-alpha atom</li>
 </ul>
 </td>
 </tr>
 <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Positions of O and OXT atoms.</p>
 </td>
 </tr>
-<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><code class="xref py py-class docutils literal"><span class="pre">tuple</span></code> of <a class="reference external" href="http://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">Vec3</span></code></a></p>
+<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><code class="xref py py-class docutils literal"><span class="pre">tuple</span></code> of <a class="reference external" href="https://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">Vec3</span></code></a></p>
 </td>
 </tr>
 </tbody>
@@ -102,9 +104,9 @@ dihedral (A-B-C-D).</p>
 <col class="field-body" />
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
-<li><strong>A</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">Vec3</span></code></a>) &#8211; Position of atom A</li>
-<li><strong>B</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">Vec3</span></code></a>) &#8211; Position of atom B</li>
-<li><strong>C</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">Vec3</span></code></a>) &#8211; Position of atom C</li>
+<li><strong>A</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">Vec3</span></code></a>) &#8211; Position of atom A</li>
+<li><strong>B</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">Vec3</span></code></a>) &#8211; Position of atom B</li>
+<li><strong>C</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">Vec3</span></code></a>) &#8211; Position of atom C</li>
 <li><strong>bond_length</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>) &#8211; Bond length (C-D)</li>
 <li><strong>angle</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>) &#8211; Angle (B-C-D)</li>
 <li><strong>dihedral</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>) &#8211; Dihedral (A-B-C-D)</li>
@@ -114,7 +116,7 @@ dihedral (A-B-C-D).</p>
 <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Position of atom D</p>
 </td>
 </tr>
-<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference external" href="http://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">Vec3</span></code></a></p>
+<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference external" href="https://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">Vec3</span></code></a></p>
 </td>
 </tr>
 </tbody>
@@ -131,16 +133,16 @@ C-alpha and c atoms.</p>
 <col class="field-body" />
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
-<li><strong>n_pos</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">Vec3</span></code></a>) &#8211; Position of nitrogen atom</li>
-<li><strong>ca_pos</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">Vec3</span></code></a>) &#8211; Position of C-alpha atom</li>
-<li><strong>c_pos</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">Vec3</span></code></a>) &#8211; Position of C atom</li>
+<li><strong>n_pos</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">Vec3</span></code></a>) &#8211; Position of nitrogen atom</li>
+<li><strong>ca_pos</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">Vec3</span></code></a>) &#8211; Position of C-alpha atom</li>
+<li><strong>c_pos</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">Vec3</span></code></a>) &#8211; Position of C atom</li>
 </ul>
 </td>
 </tr>
 <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Position of C-beta atom</p>
 </td>
 </tr>
-<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference external" href="http://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">Vec3</span></code></a></p>
+<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference external" href="https://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">Vec3</span></code></a></p>
 </td>
 </tr>
 </tbody>
@@ -157,8 +159,8 @@ around a line defined by <cite>axis</cite> and <cite>anchor</cite>.</p>
 <col class="field-body" />
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
-<li><strong>axis</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">Vec3</span></code></a>) &#8211; Axis of rotation</li>
-<li><strong>anchor</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">Vec3</span></code></a>) &#8211; Anchor for rotation</li>
+<li><strong>axis</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">Vec3</span></code></a>) &#8211; Axis of rotation</li>
+<li><strong>anchor</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">Vec3</span></code></a>) &#8211; Anchor for rotation</li>
 <li><strong>angle</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>) &#8211; Angle (in radians in range [-pi,pi]) of rotation</li>
 </ul>
 </td>
@@ -166,7 +168,7 @@ around a line defined by <cite>axis</cite> and <cite>anchor</cite>.</p>
 <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Transformation matrix</p>
 </td>
 </tr>
-<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference external" href="http://www.openstructure.org/docs/dev/geom/mat/#ost.geom.Mat4" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">Mat4</span></code></a></p>
+<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference external" href="https://www.openstructure.org/docs/dev/geom/mat/#ost.geom.Mat4" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">Mat4</span></code></a></p>
 </td>
 </tr>
 </tbody>
@@ -183,7 +185,7 @@ going through the origin.</p>
 <col class="field-body" />
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
-<li><strong>axis</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">Vec3</span></code></a>) &#8211; Axis of rotation</li>
+<li><strong>axis</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">Vec3</span></code></a>) &#8211; Axis of rotation</li>
 <li><strong>angle</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>) &#8211; Angle (in radians in range [-pi,pi]) of rotation</li>
 </ul>
 </td>
@@ -191,7 +193,7 @@ going through the origin.</p>
 <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Rotation matrix</p>
 </td>
 </tr>
-<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference external" href="http://www.openstructure.org/docs/dev/geom/mat/#ost.geom.Mat3" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">Mat3</span></code></a></p>
+<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference external" href="https://www.openstructure.org/docs/dev/geom/mat/#ost.geom.Mat3" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">Mat3</span></code></a></p>
 </td>
 </tr>
 </tbody>
@@ -208,7 +210,7 @@ going through the origin.</p>
 <col class="field-name" />
 <col class="field-body" />
 <tbody valign="top">
-<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>res</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; Residue handle from which to extract N, CA and C coordinates.</td>
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>res</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; Residue handle from which to extract N, CA and C coordinates.</td>
 </tr>
 <tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/2.7/library/exceptions.html#exceptions.RuntimeError" title="(in Python v2.7)"><code class="xref py py-exc docutils literal"><span class="pre">RuntimeError</span></code></a> if <em>res</em> does not contain N, CA and C
 atoms.</td>
@@ -227,7 +229,7 @@ atoms.</td>
 <col class="field-name" />
 <col class="field-body" />
 <tbody valign="top">
-<tr class="field-odd field"><th class="field-name">Type:</th><td class="field-body"><a class="reference external" href="http://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">Vec3</span></code></a></td>
+<tr class="field-odd field"><th class="field-name">Type:</th><td class="field-body"><a class="reference external" href="https://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">Vec3</span></code></a></td>
 </tr>
 </tbody>
 </table>
@@ -337,9 +339,6 @@ angles and one distance and is used in the fragment database for fast lookups.</
       <input type="hidden" name="check_keywords" value="yes" />
       <input type="hidden" name="area" value="default" />
     </form>
-    <p class="searchtip" style="font-size: 90%">
-    Enter search terms or a module, class or function name.
-    </p>
 </div>
 <script type="text/javascript">$('#searchbox').show(0);</script>
         </div>
@@ -347,11 +346,11 @@ angles and one distance and is used in the fragment database for fast lookups.</
       <div class="clearer"></div>
     </div>
     <div class="footer">
-      &copy;2017, ProMod3 authors.
+      &copy;2018, ProMod3 authors.
       
       |
-      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a>
-      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.6</a>
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.4.1</a>
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
       
       |
       <a href="../_sources/core/geometry.txt"
diff --git a/doc/html/core/graph_minimizer.html b/doc/html/core/graph_minimizer.html
new file mode 100644
index 0000000000000000000000000000000000000000..b99d92a070ce4ed9faef1242be310ea4eb2a9fe7
--- /dev/null
+++ b/doc/html/core/graph_minimizer.html
@@ -0,0 +1,402 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>Graph Minimizer &mdash; ProMod3 1.2.0 documentation</title>
+    
+    <link rel="stylesheet" href="../_static/alabaster.css" type="text/css" />
+    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '../',
+        VERSION:     '1.2.0',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="../_static/jquery.js"></script>
+    <script type="text/javascript" src="../_static/underscore.js"></script>
+    <script type="text/javascript" src="../_static/doctools.js"></script>
+    <link rel="top" title="ProMod3 1.2.0 documentation" href="../index.html" />
+    <link rel="up" title="core - ProMod3 Core Functionality" href="index.html" />
+    <link rel="next" title="SetCompoundsChemlib()" href="setcompoundschemlib.html" />
+    <link rel="prev" title="Runtime profiling" href="runtime_profiling.html" />
+   
+  <link rel="stylesheet" href="../_static/custom.css" type="text/css" />
+  
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
+
+  </head>
+  <body role="document">
+  
+
+    <div class="document">
+      <div class="documentwrapper">
+        <div class="bodywrapper">
+          <div class="body" role="main">
+            
+  <div class="section" id="graph-minimizer">
+<h1>Graph Minimizer<a class="headerlink" href="#graph-minimizer" title="Permalink to this headline">¶</a></h1>
+<p>The graph minimizer solves an energy minimization problem where we have n
+nodes <span class="math">N_i</span>, with each node having several possible solutions.
+Every solution has a self energy <span class="math">E_{self}</span> and pairwise energies in between nodes
+are possible. The goal is to select exactly one solution per node to obtain
+a set <span class="math">X=[x_1, x_2, ..., x_n]</span> that minimizes:</p>
+<div class="math">
+<p><span class="math">F(X)=\displaystyle\sum_iE_{self}(N_i[x_i]) +\displaystyle \sum_i \displaystyle \sum_{j&gt;i}E_{pair}(N_i[x_i], N_j[x_j])</span></p>
+</div><dl class="class">
+<dt id="promod3.core.GraphMinimizer">
+<em class="property">class </em><code class="descclassname">promod3.core.</code><code class="descname">GraphMinimizer</code><a class="headerlink" href="#promod3.core.GraphMinimizer" title="Permalink to this definition">¶</a></dt>
+<dd><dl class="method">
+<dt id="promod3.core.GraphMinimizer.AddNode">
+<code class="descname">AddNode</code><span class="sig-paren">(</span><em>self_energies</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.core.GraphMinimizer.AddNode" title="Permalink to this definition">¶</a></dt>
+<dd><p>Adds a node to the graph.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>self_energies</strong> (<code class="xref py py-class docutils literal"><span class="pre">list</span></code> of <a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>) &#8211; Directly controls the number of possible solutions in that
+node and assigns the corresponding self energies</td>
+</tr>
+<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The idx of the added node</td>
+</tr>
+<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a></td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="method">
+<dt id="promod3.core.GraphMinimizer.AddEdge">
+<code class="descname">AddEdge</code><span class="sig-paren">(</span><em>node_idx_one</em>, <em>node_idx_two</em>, <em>pairwise_energies</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.core.GraphMinimizer.AddEdge" title="Permalink to this definition">¶</a></dt>
+<dd><p>Adds an edge between the specified nodes.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
+<li><strong>node_idx_one</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Index of the first node</li>
+<li><strong>node_idx_two</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Index of the second node</li>
+<li><strong>pairwise_energies</strong> (<code class="xref py py-class docutils literal"><span class="pre">list</span></code> of <code class="xref py py-class docutils literal"><span class="pre">list</span></code> of <a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>) &#8211; The pairwise energies that contribute to the
+overall energy function. There must be a list for
+every possible solution in node one. All of those
+lists must have exactly the length of possible
+solutions in node two.</li>
+</ul>
+</td>
+</tr>
+<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The idx of the added edge</p>
+</td>
+</tr>
+<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first"><a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a></p>
+</td>
+</tr>
+<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last"><a class="reference external" href="https://docs.python.org/2.7/library/exceptions.html#exceptions.RuntimeError" title="(in Python v2.7)"><code class="xref py py-exc docutils literal"><span class="pre">RuntimeError</span></code></a> if <em>node_idx_one</em> or <em>node_idx_two</em>
+specify non existent nodes or when <em>pairwise_energies</em> is
+inconsistent with the number of solutions in the specified nodes.</p>
+</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="method">
+<dt id="promod3.core.GraphMinimizer.ApplyDEE">
+<code class="descname">ApplyDEE</code><span class="sig-paren">(</span><em>node_idx</em><span class="optional">[</span>, <em>e_cut=0.0</em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#promod3.core.GraphMinimizer.ApplyDEE" title="Permalink to this definition">¶</a></dt>
+<dd><p>Applies dead end elimination on one particular node and potentially
+deactivates certain solutions. The goldstein criterion is described in
+<a class="reference internal" href="#goldstein1994" id="id1">[goldstein1994]</a>.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
+<li><strong>node_idx</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Node to apply dead end elimination</li>
+<li><strong>e_cut</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>) &#8211; If set to
+0.0, the default goldstein criterion is applied =&gt;
+a solution is removed if it&#8217;s dominated by all other
+solutions in the same node. If you increase this value,
+a solution must be dominated by at least this <strong>e_cut</strong>.</li>
+</ul>
+</td>
+</tr>
+<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><a class="reference external" href="https://docs.python.org/2.7/library/functions.html#bool" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">bool</span></code></a> whether any solution has been deactivated.</p>
+</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="method">
+<dt id="promod3.core.GraphMinimizer.ApplyEdgeDecomposition">
+<code class="descname">ApplyEdgeDecomposition</code><span class="sig-paren">(</span><em>edge_idx</em>, <em>epsilon</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.core.GraphMinimizer.ApplyEdgeDecomposition" title="Permalink to this definition">¶</a></dt>
+<dd><p>Applies edge decomposition on one particular edge and potentially
+deactivates it. The exact decomposition  procedure is described in
+<a class="reference internal" href="../sidechain/index.html#krivov2009" id="id2">[krivov2009]</a>.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
+<li><strong>edge_idx</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Edge to decompose.</li>
+<li><strong>epsilon</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>) &#8211; The energy threshold to perform edge decomposition.</li>
+</ul>
+</td>
+</tr>
+<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><a class="reference external" href="https://docs.python.org/2.7/library/functions.html#bool" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">bool</span></code></a> whether the edge has been decomposed and
+deactivated</p>
+</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="method">
+<dt id="promod3.core.GraphMinimizer.Prune">
+<code class="descname">Prune</code><span class="sig-paren">(</span><em>epsilon</em><span class="optional">[</span>, <em>e_cut=0.0</em>, <em>consider_all_nodes=False</em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#promod3.core.GraphMinimizer.Prune" title="Permalink to this definition">¶</a></dt>
+<dd><p>Performs edge decomposition followed by dead end elimination in an
+iterative manner until no changes can be observed anymore given
+<strong>epsilon</strong>.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
+<li><strong>epsilon</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>) &#8211; The energy threshold to perform edge decomposition.</li>
+<li><strong>e_cut</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>) &#8211; Parameter to control dead end elimination.</li>
+<li><strong>consider_all_nodes</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#bool" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">bool</span></code></a>) &#8211; Flag, wether the dead end elimination should be
+applied to all nodes, or only those who are
+connected with an edge removed by edge
+decomposition. This is useful if already a Prune
+operation has been performed =&gt; only those nodes
+connected to a removed edge have the chance for
+successful dead end elimination.</li>
+</ul>
+</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="method">
+<dt id="promod3.core.GraphMinimizer.Reset">
+<code class="descname">Reset</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#promod3.core.GraphMinimizer.Reset" title="Permalink to this definition">¶</a></dt>
+<dd><p>Resets the graph by undoing any pruning operation (DEE and edge decomposition)</p>
+</dd></dl>
+
+<dl class="method">
+<dt id="promod3.core.GraphMinimizer.TreeSolve">
+<code class="descname">TreeSolve</code><span class="sig-paren">(</span><span class="optional">[</span><em>max_complexity=inf</em>, <em>initial_epsilon=0.02</em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#promod3.core.GraphMinimizer.TreeSolve" title="Permalink to this definition">¶</a></dt>
+<dd><p>The method solves a graph using a minimal width tree decomposition
+approach in an iterative manner. In every iteration, the algorithm performs
+a pruning step (DEE / Edge Decomposition) and subsequently tries to solve
+each connected component in the graph separately.
+If the number of possible enumerations in the tree constructetd from a
+particular connected component is is larger <strong>max_complexity</strong>,
+this component is solved in a later iteration. The algorithm iterates until
+all connected components are solved and steadily increases the epsilon value
+resulting in a more and more agressive edge decomposition.
+Algorithm further descsribed in <a class="reference internal" href="../sidechain/index.html#krivov2009" id="id3">[krivov2009]</a>.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
+<li><strong>max_complexity</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Max number of possible permutations, that have to
+be enumerated in the resulting tree after tree
+decomposition.</li>
+<li><strong>initial_epsilon</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>) &#8211; The initial energy threshold to perform edge
+decomposition.</li>
+</ul>
+</td>
+</tr>
+<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A tuple with the first element being a list of indices
+representing the single solutions minimizing
+the overall energy function.
+The second element is the according energy value.</p>
+</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="method">
+<dt id="promod3.core.GraphMinimizer.AStarSolve">
+<code class="descname">AStarSolve</code><span class="sig-paren">(</span><em>e_thresh</em><span class="optional">[</span>, <em>max_n=100</em>, <em>max_visited_nodes=100000000</em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#promod3.core.GraphMinimizer.AStarSolve" title="Permalink to this definition">¶</a></dt>
+<dd><p>The method solves a graph using the A* algorithm. Besides creating the
+minimal energy solution, the function produces a maximum of <strong>max_n</strong>
+solutions sorted by energy. It aborts as soon as it sees the first solution
+with an energy difference of <strong>e_thresh</strong> to the optimal solution or hits
+<strong>max_n</strong>. If you&#8217;re only interested in the optimal solution you should use
+the TreeSolve function since it&#8217;s much faster and uses less memory.
+There is no automatic pruning of the graph using DEE or edge decomposition,
+so you have to do it by yourself, otherwise you&#8217;ll have a looooooong
+runtime or even hit the <strong>max_visited_nodes</strong> parameter that caps the memory
+usage.
+To have a valid solution you have to take care that you set the <strong>e_cut</strong>
+parameter in the pruning function to <strong>e_tresh</strong>.
+Algorithm is described in <a class="reference internal" href="#leach1998" id="id4">[leach1998]</a>.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
+<li><strong>e_thresh</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>) &#8211; Maximal energy difference of a solution to the
+optimal solution to be considered.</li>
+<li><strong>max_n</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; The maximum number of solutions that will be generated.</li>
+<li><strong>max_visited_nodes</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Caps the memory usage of the algorithm. Besides
+The memory used for pairwise energies and self
+energies, the algorithm uses about
+<strong>max_visited_nodes</strong> * 20 bytes.</li>
+</ul>
+</td>
+</tr>
+<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A tuple with the first element being a list of
+solutions. The second element is a list
+of energies for the according solutions.</p>
+</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="method">
+<dt id="promod3.core.GraphMinimizer.MCSolve">
+<code class="descname">MCSolve</code><span class="sig-paren">(</span><span class="optional">[</span><em>n=100</em>, <em>mc_steps=100000</em>, <em>start_temperature=1000.0</em>, <em>change_frequency=1000</em>, <em>cooling_factor=0.9</em>, <em>seed=0</em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#promod3.core.GraphMinimizer.MCSolve" title="Permalink to this definition">¶</a></dt>
+<dd><p>Does a total of <strong>n</strong> Monte Carlo runs to find low energy solutions
+of the graph. Each run starts with a random
+configuration. At each of the <strong>mc_steps</strong> steps, a random node and
+a random solution at that location is selected and an energy difference
+of that random selection relative to the current configuration is
+estimated. If the difference in energy is negative, the step is
+accepted. If not, the step is accepted with a probability given by
+the temperature dependent Metropolis criterion
+<span class="math">exp^{\left(\frac{-e_{diff}}{T}\right)}</span>.
+The temperature for every run starts with <strong>start_temperature</strong>
+and is multiplied every <strong>change_frequency</strong> steps with <strong>cooling_factor</strong>
+to achieve a simulated annealing effect.
+There is no automatic pruning of the graph using DEE or edge decomposition,
+you have to do that by yourself.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
+<li><strong>n</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Number of Monte Carlo runs</li>
+<li><strong>mc_steps</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Number of Monte Carlo steps per run</li>
+<li><strong>start_temperature</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>) &#8211; Start temperature for the temperature dependent
+Metropolis criterion</li>
+<li><strong>change_frequency</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Number of steps the temperature stays the same</li>
+<li><strong>cooling_factor</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>) &#8211; Factor to multiply temperature each
+<strong>change_frequency</strong> steps</li>
+<li><strong>seed</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>) &#8211; Seed for random number generator</li>
+</ul>
+</td>
+</tr>
+<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A tuple with the first element being a list of
+solutions. The second element is a list
+of energies for the according solutions.</p>
+</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="method">
+<dt id="promod3.core.GraphMinimizer.NaiveSolve">
+<code class="descname">NaiveSolve</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#promod3.core.GraphMinimizer.NaiveSolve" title="Permalink to this definition">¶</a></dt>
+<dd><p>Don&#8217;t even think of using this... This function only exists for debug
+purposes and does the full enumeration of the solution space.
+It might become faster with the appropriate
+<a class="reference external" href="https://www.youtube.com/watch?v=fQGbXmkSArs">techniques</a>.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">A tuple with the first element being a list of indices
+representing the single solutions minimizing
+the overall energy function.
+The second element is the according energy value.</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+</dd></dl>
+
+<table class="docutils citation" frame="void" id="goldstein1994" rules="none">
+<colgroup><col class="label" /><col /></colgroup>
+<tbody valign="top">
+<tr><td class="label"><a class="fn-backref" href="#id1">[goldstein1994]</a></td><td>Goldstein RF (1994). Efficient rotamer elimination applied to protein side-chains and related spin glasses. Biophys J.</td></tr>
+</tbody>
+</table>
+<table class="docutils citation" frame="void" id="leach1998" rules="none">
+<colgroup><col class="label" /><col /></colgroup>
+<tbody valign="top">
+<tr><td class="label"><a class="fn-backref" href="#id4">[leach1998]</a></td><td>Leach AR, Lemon AP (1998). Explring the conformational space of prootein side chains using dead-end elimination and the A* algorithm. Proteins.</td></tr>
+</tbody>
+</table>
+</div>
+
+
+          </div>
+        </div>
+      </div>
+      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
+        <div class="sphinxsidebarwrapper"><div class="relations">
+<h3>Related Topics</h3>
+<ul>
+  <li><a href="../index.html">Documentation overview</a><ul>
+  <li><a href="../users.html">Documentation For Users</a><ul>
+  <li><a href="index.html"><code class="docutils literal"><span class="pre">core</span></code> - ProMod3 Core Functionality</a><ul>
+      <li>Previous: <a href="runtime_profiling.html" title="previous chapter">Runtime profiling</a></li>
+      <li>Next: <a href="setcompoundschemlib.html" title="next chapter"><code class="docutils literal"><span class="pre">SetCompoundsChemlib()</span></code></a></li>
+  </ul></li>
+  </ul></li>
+  </ul></li>
+</ul>
+</div>
+  <div role="note" aria-label="source link">
+    <h3>This Page</h3>
+    <ul class="this-page-menu">
+      <li><a href="../_sources/core/graph_minimizer.txt"
+            rel="nofollow">Show Source</a></li>
+    </ul>
+   </div>
+<div id="searchbox" style="display: none" role="search">
+  <h3>Quick search</h3>
+    <form class="search" action="../search.html" method="get">
+      <input type="text" name="q" />
+      <input type="submit" value="Go" />
+      <input type="hidden" name="check_keywords" value="yes" />
+      <input type="hidden" name="area" value="default" />
+    </form>
+</div>
+<script type="text/javascript">$('#searchbox').show(0);</script>
+        </div>
+      </div>
+      <div class="clearer"></div>
+    </div>
+    <div class="footer">
+      &copy;2018, ProMod3 authors.
+      
+      |
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.4.1</a>
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
+      
+      |
+      <a href="../_sources/core/graph_minimizer.txt"
+          rel="nofollow">Page source</a>
+    </div>
+
+    
+
+    
+  </body>
+</html>
\ No newline at end of file
diff --git a/doc/html/core/helper.html b/doc/html/core/helper.html
index fbc111e15392a003d2646f3e8cfbb502a57fdf29..2ef049d9bc9fdc579ad7b7dffa6e9227371c6429 100644
--- a/doc/html/core/helper.html
+++ b/doc/html/core/helper.html
@@ -6,7 +6,7 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
-    <title>helper - Shared Functionality For the Everything &mdash; ProMod3 1.1.0 documentation</title>
+    <title>helper - Shared Functionality For the Everything &mdash; ProMod3 1.2.0 documentation</title>
     
     <link rel="stylesheet" href="../_static/alabaster.css" type="text/css" />
     <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
@@ -14,7 +14,7 @@
     <script type="text/javascript">
       var DOCUMENTATION_OPTIONS = {
         URL_ROOT:    '../',
-        VERSION:     '1.1.0',
+        VERSION:     '1.2.0',
         COLLAPSE_INDEX: false,
         FILE_SUFFIX: '.html',
         HAS_SOURCE:  true
@@ -23,16 +23,18 @@
     <script type="text/javascript" src="../_static/jquery.js"></script>
     <script type="text/javascript" src="../_static/underscore.js"></script>
     <script type="text/javascript" src="../_static/doctools.js"></script>
-    <link rel="top" title="ProMod3 1.1.0 documentation" href="../index.html" />
+    <link rel="top" title="ProMod3 1.2.0 documentation" href="../index.html" />
     <link rel="up" title="core - ProMod3 Core Functionality" href="index.html" />
     <link rel="next" title="Geometry functions" href="geometry.html" />
     <link rel="prev" title="pm3argparse - Parsing Command Lines" href="pm3argparse.html" />
    
+  <link rel="stylesheet" href="../_static/custom.css" type="text/css" />
   
-  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
 
   </head>
-  <body role="document">  
+  <body role="document">
+  
 
     <div class="document">
       <div class="documentwrapper">
@@ -48,15 +50,15 @@ rather empty modules left alone.</p>
 </div>
 <div class="section" id="messages">
 <h2>Messages<a class="headerlink" href="#messages" title="Permalink to this headline">¶</a></h2>
-<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">promod3.core</span> <span class="kn">import</span> <span class="n">helper</span>
+<div class="highlight-default"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">promod3.core</span> <span class="k">import</span> <span class="n">helper</span>
 
-<span class="n">helper</span><span class="o">.</span><span class="n">MsgErrorAndExit</span><span class="p">(</span><span class="s">&quot;Something failed!&quot;</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
+<span class="n">helper</span><span class="o">.</span><span class="n">MsgErrorAndExit</span><span class="p">(</span><span class="s2">&quot;Something failed!&quot;</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
 </pre></div>
 </div>
 <dl class="function">
 <dt id="promod3.core.helper.MsgErrorAndExit">
 <code class="descclassname">promod3.core.helper.</code><code class="descname">MsgErrorAndExit</code><span class="sig-paren">(</span><em>msg</em>, <em>exit_status</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/promod3/core/helper.html#MsgErrorAndExit"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#promod3.core.helper.MsgErrorAndExit" title="Permalink to this definition">¶</a></dt>
-<dd><p>Send a messages to the OST <a class="reference external" href="http://www.openstructure.org/docs/dev/base/logging/">error log</a> and
+<dd><p>Send a messages to the OST <a class="reference external" href="https://www.openstructure.org/docs/dev/base/logging/">error log</a> and
 exit the Python interpreter.</p>
 <table class="docutils field-list" frame="void" rules="none">
 <col class="field-name" />
@@ -81,20 +83,20 @@ traditionally reserved to successful commands.</li>
 <h2>File Tests<a class="headerlink" href="#file-tests" title="Permalink to this headline">¶</a></h2>
 <p>The following example parses an argument (call as <code class="docutils literal"><span class="pre">pm</span> <span class="pre">SCRIPTNAME</span> <span class="pre">FILENAME</span></code>) as
 a file name and checks whether it is a <code class="docutils literal"><span class="pre">pdb</span></code> or <code class="docutils literal"><span class="pre">mmcif</span></code> file.</p>
-<div class="highlight-python"><div class="highlight"><pre><span class="sd">&quot;&quot;&quot;Test for file reading.&quot;&quot;&quot;</span>
-<span class="kn">from</span> <span class="nn">promod3.core</span> <span class="kn">import</span> <span class="n">helper</span>
-<span class="kn">from</span> <span class="nn">promod3.core</span> <span class="kn">import</span> <span class="n">pm3argparse</span>
+<div class="highlight-default"><div class="highlight"><pre><span></span><span class="sd">&quot;&quot;&quot;Test for file reading.&quot;&quot;&quot;</span>
+<span class="kn">from</span> <span class="nn">promod3.core</span> <span class="k">import</span> <span class="n">helper</span>
+<span class="kn">from</span> <span class="nn">promod3.core</span> <span class="k">import</span> <span class="n">pm3argparse</span>
 
 <span class="n">p</span> <span class="o">=</span> <span class="n">pm3argparse</span><span class="o">.</span><span class="n">PM3ArgumentParser</span><span class="p">(</span><span class="n">__doc__</span><span class="p">)</span>
-<span class="n">p</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">&#39;file&#39;</span><span class="p">,</span> <span class="nb">type</span><span class="o">=</span><span class="nb">str</span><span class="p">)</span>
+<span class="n">p</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s1">&#39;file&#39;</span><span class="p">,</span> <span class="nb">type</span><span class="o">=</span><span class="nb">str</span><span class="p">)</span>
 <span class="n">opts</span> <span class="o">=</span> <span class="n">p</span><span class="o">.</span><span class="n">Parse</span><span class="p">()</span>
 
-<span class="n">helper</span><span class="o">.</span><span class="n">FileExists</span><span class="p">(</span><span class="s">&#39;Test file&#39;</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="n">opts</span><span class="o">.</span><span class="n">file</span><span class="p">)</span>
+<span class="n">helper</span><span class="o">.</span><span class="n">FileExists</span><span class="p">(</span><span class="s1">&#39;Test file&#39;</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="n">opts</span><span class="o">.</span><span class="n">file</span><span class="p">)</span>
 
-<span class="n">opts</span><span class="o">.</span><span class="n">name</span><span class="p">,</span> <span class="n">opts</span><span class="o">.</span><span class="n">ext</span><span class="p">,</span> <span class="n">opts</span><span class="o">.</span><span class="n">gz</span> <span class="o">=</span> <span class="n">helper</span><span class="o">.</span><span class="n">FileExtension</span><span class="p">(</span><span class="s">&#39;Test file&#39;</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span>
+<span class="n">opts</span><span class="o">.</span><span class="n">name</span><span class="p">,</span> <span class="n">opts</span><span class="o">.</span><span class="n">ext</span><span class="p">,</span> <span class="n">opts</span><span class="o">.</span><span class="n">gz</span> <span class="o">=</span> <span class="n">helper</span><span class="o">.</span><span class="n">FileExtension</span><span class="p">(</span><span class="s1">&#39;Test file&#39;</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span>
                                                     <span class="n">opts</span><span class="o">.</span><span class="n">file</span><span class="p">,</span>
-                                                    <span class="p">(</span><span class="s">&#39;pdb&#39;</span><span class="p">,</span> <span class="s">&#39;mmcif&#39;</span><span class="p">),</span>
-                                                    <span class="n">gzip</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>
+                                                    <span class="p">(</span><span class="s1">&#39;pdb&#39;</span><span class="p">,</span> <span class="s1">&#39;mmcif&#39;</span><span class="p">),</span>
+                                                    <span class="n">gzip</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
 </pre></div>
 </div>
 <dl class="function">
@@ -237,9 +239,6 @@ script will terminate if a gzip file is found.</li>
       <input type="hidden" name="check_keywords" value="yes" />
       <input type="hidden" name="area" value="default" />
     </form>
-    <p class="searchtip" style="font-size: 90%">
-    Enter search terms or a module, class or function name.
-    </p>
 </div>
 <script type="text/javascript">$('#searchbox').show(0);</script>
         </div>
@@ -247,11 +246,11 @@ script will terminate if a gzip file is found.</li>
       <div class="clearer"></div>
     </div>
     <div class="footer">
-      &copy;2017, ProMod3 authors.
+      &copy;2018, ProMod3 authors.
       
       |
-      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a>
-      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.6</a>
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.4.1</a>
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
       
       |
       <a href="../_sources/core/helper.txt"
diff --git a/doc/html/core/index.html b/doc/html/core/index.html
index af6c850eff696102202c58faeb9a58eb77c6a922..774d53ed424cd8915182a7f8216297a4fe85bde9 100644
--- a/doc/html/core/index.html
+++ b/doc/html/core/index.html
@@ -6,7 +6,7 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
-    <title>core - ProMod3 Core Functionality &mdash; ProMod3 1.1.0 documentation</title>
+    <title>core - ProMod3 Core Functionality &mdash; ProMod3 1.2.0 documentation</title>
     
     <link rel="stylesheet" href="../_static/alabaster.css" type="text/css" />
     <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
@@ -14,7 +14,7 @@
     <script type="text/javascript">
       var DOCUMENTATION_OPTIONS = {
         URL_ROOT:    '../',
-        VERSION:     '1.1.0',
+        VERSION:     '1.2.0',
         COLLAPSE_INDEX: false,
         FILE_SUFFIX: '.html',
         HAS_SOURCE:  true
@@ -23,16 +23,18 @@
     <script type="text/javascript" src="../_static/jquery.js"></script>
     <script type="text/javascript" src="../_static/underscore.js"></script>
     <script type="text/javascript" src="../_static/doctools.js"></script>
-    <link rel="top" title="ProMod3 1.1.0 documentation" href="../index.html" />
+    <link rel="top" title="ProMod3 1.2.0 documentation" href="../index.html" />
     <link rel="up" title="Documentation For Users" href="../users.html" />
     <link rel="next" title="pm3argparse - Parsing Command Lines" href="pm3argparse.html" />
     <link rel="prev" title="Loading Precomputed Objects" href="../loop/load_loop_objects.html" />
    
+  <link rel="stylesheet" href="../_static/custom.css" type="text/css" />
   
-  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
 
   </head>
-  <body role="document">  
+  <body role="document">
+  
 
     <div class="document">
       <div class="documentwrapper">
@@ -59,6 +61,7 @@ modeling per se but cover standard programming issues.</p>
 </li>
 <li class="toctree-l1"><a class="reference internal" href="geometry.html">Geometry functions</a></li>
 <li class="toctree-l1"><a class="reference internal" href="runtime_profiling.html">Runtime profiling</a></li>
+<li class="toctree-l1"><a class="reference internal" href="graph_minimizer.html">Graph Minimizer</a></li>
 </ul>
 </div>
 </div>
@@ -94,9 +97,6 @@ modeling per se but cover standard programming issues.</p>
       <input type="hidden" name="check_keywords" value="yes" />
       <input type="hidden" name="area" value="default" />
     </form>
-    <p class="searchtip" style="font-size: 90%">
-    Enter search terms or a module, class or function name.
-    </p>
 </div>
 <script type="text/javascript">$('#searchbox').show(0);</script>
         </div>
@@ -104,11 +104,11 @@ modeling per se but cover standard programming issues.</p>
       <div class="clearer"></div>
     </div>
     <div class="footer">
-      &copy;2017, ProMod3 authors.
+      &copy;2018, ProMod3 authors.
       
       |
-      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a>
-      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.6</a>
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.4.1</a>
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
       
       |
       <a href="../_sources/core/index.txt"
diff --git a/doc/html/core/pm3argparse.html b/doc/html/core/pm3argparse.html
index 6f049e99f43e4b5e6051f44e039b68398b84ddcb..c92c89603a57ec80a32e2435a5661d076d14f31a 100644
--- a/doc/html/core/pm3argparse.html
+++ b/doc/html/core/pm3argparse.html
@@ -6,7 +6,7 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
-    <title>pm3argparse - Parsing Command Lines &mdash; ProMod3 1.1.0 documentation</title>
+    <title>pm3argparse - Parsing Command Lines &mdash; ProMod3 1.2.0 documentation</title>
     
     <link rel="stylesheet" href="../_static/alabaster.css" type="text/css" />
     <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
@@ -14,7 +14,7 @@
     <script type="text/javascript">
       var DOCUMENTATION_OPTIONS = {
         URL_ROOT:    '../',
-        VERSION:     '1.1.0',
+        VERSION:     '1.2.0',
         COLLAPSE_INDEX: false,
         FILE_SUFFIX: '.html',
         HAS_SOURCE:  true
@@ -23,16 +23,18 @@
     <script type="text/javascript" src="../_static/jquery.js"></script>
     <script type="text/javascript" src="../_static/underscore.js"></script>
     <script type="text/javascript" src="../_static/doctools.js"></script>
-    <link rel="top" title="ProMod3 1.1.0 documentation" href="../index.html" />
+    <link rel="top" title="ProMod3 1.2.0 documentation" href="../index.html" />
     <link rel="up" title="core - ProMod3 Core Functionality" href="index.html" />
     <link rel="next" title="helper - Shared Functionality For the Everything" href="helper.html" />
     <link rel="prev" title="core - ProMod3 Core Functionality" href="index.html" />
    
+  <link rel="stylesheet" href="../_static/custom.css" type="text/css" />
   
-  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
 
   </head>
-  <body role="document">  
+  <body role="document">
+  
 
     <div class="document">
       <div class="documentwrapper">
@@ -52,14 +54,14 @@ There <a class="reference internal" href="#promod3.core.pm3argparse.PM3ArgumentP
 simplification. It provides a set of standard arguments you just need to
 activate for your action plus it comes with some verification functionality for
 input.</p>
-<div class="highlight-python"><div class="highlight"><pre><span class="sd">&quot;&quot;&quot;</span>
+<div class="highlight-default"><div class="highlight"><pre><span></span><span class="sd">&quot;&quot;&quot;</span>
 <span class="sd">Place the description of your script right in the file and import</span>
 <span class="sd">it via &#39;__doc__&#39; as description to the parser (&#39;-h&#39;, &#39;--help&#39;).</span>
 <span class="sd">&quot;&quot;&quot;</span>
 
-<span class="kn">from</span> <span class="nn">promod3.core</span> <span class="kn">import</span> <span class="n">pm3argparse</span>
+<span class="kn">from</span> <span class="nn">promod3.core</span> <span class="k">import</span> <span class="n">pm3argparse</span>
 
-<span class="c"># make sure we see output when passing &#39;-h&#39;</span>
+<span class="c1"># make sure we see output when passing &#39;-h&#39;</span>
 <span class="kn">import</span> <span class="nn">ost</span>
 <span class="n">ost</span><span class="o">.</span><span class="n">PushVerbosityLevel</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span> 
 
@@ -154,7 +156,7 @@ sequence is used. File can be plain or gzipped.</li>
 <li><code class="docutils literal"><span class="pre">-j/--json</span> <span class="pre">&lt;OBJECT&gt;|&lt;FILE&gt;</span></code> - Alignments provided as JSON
 file/object. File can be plain or gzipped.</li>
 </ul>
-<p>See <a class="reference internal" href="../actions/index.html#promod-build-model"><span>here</span></a> for details on the file formats.</p>
+<p>See <a class="reference internal" href="../actions/index.html#promod-build-model"><span class="std std-ref">here</span></a> for details on the file formats.</p>
 <p>Attributes added to the namespace returned by <a class="reference internal" href="#promod3.core.pm3argparse.PM3ArgumentParser.Parse" title="promod3.core.pm3argparse.PM3ArgumentParser.Parse"><code class="xref py py-meth docutils literal"><span class="pre">Parse()</span></code></a>:</p>
 <ul class="simple">
 <li><code class="xref py py-attr docutils literal"><span class="pre">fasta</span></code> - filled with the input of the <code class="docutils literal"><span class="pre">--fasta</span></code> option, a
@@ -211,7 +213,7 @@ input is post processed and checked in <a class="reference internal" href="#prom
 to <a class="reference internal" href="#promod3.core.pm3argparse.PM3ArgumentParser.AddAlignment" title="promod3.core.pm3argparse.PM3ArgumentParser.AddAlignment"><code class="xref py py-meth docutils literal"><span class="pre">AddAlignment()</span></code></a>. Chains for each sequence
 are identified based on the sequence name of the
 templates in the alignments (see 
-<a class="reference internal" href="../actions/index.html#promod-build-model"><span>here</span></a> for details).</td>
+<a class="reference internal" href="../actions/index.html#promod-build-model"><span class="std std-ref">here</span></a> for details).</td>
 </tr>
 </tbody>
 </table>
@@ -334,9 +336,6 @@ and with the right constraints.</p>
       <input type="hidden" name="check_keywords" value="yes" />
       <input type="hidden" name="area" value="default" />
     </form>
-    <p class="searchtip" style="font-size: 90%">
-    Enter search terms or a module, class or function name.
-    </p>
 </div>
 <script type="text/javascript">$('#searchbox').show(0);</script>
         </div>
@@ -344,11 +343,11 @@ and with the right constraints.</p>
       <div class="clearer"></div>
     </div>
     <div class="footer">
-      &copy;2017, ProMod3 authors.
+      &copy;2018, ProMod3 authors.
       
       |
-      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a>
-      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.6</a>
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.4.1</a>
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
       
       |
       <a href="../_sources/core/pm3argparse.txt"
diff --git a/doc/html/core/runtime_profiling.html b/doc/html/core/runtime_profiling.html
index c0b3d5d6181ec1cbe5963d9be53733855a330d43..2466ad9d3f6e6d8de264e1874c43332677a3a97a 100644
--- a/doc/html/core/runtime_profiling.html
+++ b/doc/html/core/runtime_profiling.html
@@ -6,7 +6,7 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
-    <title>Runtime profiling &mdash; ProMod3 1.1.0 documentation</title>
+    <title>Runtime profiling &mdash; ProMod3 1.2.0 documentation</title>
     
     <link rel="stylesheet" href="../_static/alabaster.css" type="text/css" />
     <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
@@ -14,7 +14,7 @@
     <script type="text/javascript">
       var DOCUMENTATION_OPTIONS = {
         URL_ROOT:    '../',
-        VERSION:     '1.1.0',
+        VERSION:     '1.2.0',
         COLLAPSE_INDEX: false,
         FILE_SUFFIX: '.html',
         HAS_SOURCE:  true
@@ -23,16 +23,18 @@
     <script type="text/javascript" src="../_static/jquery.js"></script>
     <script type="text/javascript" src="../_static/underscore.js"></script>
     <script type="text/javascript" src="../_static/doctools.js"></script>
-    <link rel="top" title="ProMod3 1.1.0 documentation" href="../index.html" />
+    <link rel="top" title="ProMod3 1.2.0 documentation" href="../index.html" />
     <link rel="up" title="core - ProMod3 Core Functionality" href="index.html" />
-    <link rel="next" title="SetCompoundsChemlib()" href="setcompoundschemlib.html" />
+    <link rel="next" title="Graph Minimizer" href="graph_minimizer.html" />
     <link rel="prev" title="Geometry functions" href="geometry.html" />
    
+  <link rel="stylesheet" href="../_static/custom.css" type="text/css" />
   
-  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
 
   </head>
-  <body role="document">  
+  <body role="document">
+  
 
     <div class="document">
       <div class="documentwrapper">
@@ -170,7 +172,7 @@ will fail miserably if timers are currently running.</p>
   <li><a href="../users.html">Documentation For Users</a><ul>
   <li><a href="index.html"><code class="docutils literal"><span class="pre">core</span></code> - ProMod3 Core Functionality</a><ul>
       <li>Previous: <a href="geometry.html" title="previous chapter">Geometry functions</a></li>
-      <li>Next: <a href="setcompoundschemlib.html" title="next chapter"><code class="docutils literal"><span class="pre">SetCompoundsChemlib()</span></code></a></li>
+      <li>Next: <a href="graph_minimizer.html" title="next chapter">Graph Minimizer</a></li>
   </ul></li>
   </ul></li>
   </ul></li>
@@ -191,9 +193,6 @@ will fail miserably if timers are currently running.</p>
       <input type="hidden" name="check_keywords" value="yes" />
       <input type="hidden" name="area" value="default" />
     </form>
-    <p class="searchtip" style="font-size: 90%">
-    Enter search terms or a module, class or function name.
-    </p>
 </div>
 <script type="text/javascript">$('#searchbox').show(0);</script>
         </div>
@@ -201,11 +200,11 @@ will fail miserably if timers are currently running.</p>
       <div class="clearer"></div>
     </div>
     <div class="footer">
-      &copy;2017, ProMod3 authors.
+      &copy;2018, ProMod3 authors.
       
       |
-      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a>
-      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.6</a>
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.4.1</a>
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
       
       |
       <a href="../_sources/core/runtime_profiling.txt"
diff --git a/doc/html/core/setcompoundschemlib.html b/doc/html/core/setcompoundschemlib.html
index 1d400cd0581fb53191bd47ace59e84b0d5bb8f75..e0e9cb4d4256b35a60b91b487c28cbea9efd04cf 100644
--- a/doc/html/core/setcompoundschemlib.html
+++ b/doc/html/core/setcompoundschemlib.html
@@ -6,7 +6,7 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
-    <title>SetCompoundsChemlib() &mdash; ProMod3 1.1.0 documentation</title>
+    <title>SetCompoundsChemlib() &mdash; ProMod3 1.2.0 documentation</title>
     
     <link rel="stylesheet" href="../_static/alabaster.css" type="text/css" />
     <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
@@ -14,7 +14,7 @@
     <script type="text/javascript">
       var DOCUMENTATION_OPTIONS = {
         URL_ROOT:    '../',
-        VERSION:     '1.1.0',
+        VERSION:     '1.2.0',
         COLLAPSE_INDEX: false,
         FILE_SUFFIX: '.html',
         HAS_SOURCE:  true
@@ -23,16 +23,18 @@
     <script type="text/javascript" src="../_static/jquery.js"></script>
     <script type="text/javascript" src="../_static/underscore.js"></script>
     <script type="text/javascript" src="../_static/doctools.js"></script>
-    <link rel="top" title="ProMod3 1.1.0 documentation" href="../index.html" />
+    <link rel="top" title="ProMod3 1.2.0 documentation" href="../index.html" />
     <link rel="up" title="Documentation For Users" href="../users.html" />
     <link rel="next" title="Documentation For Developers" href="../developers.html" />
-    <link rel="prev" title="Runtime profiling" href="runtime_profiling.html" />
+    <link rel="prev" title="Graph Minimizer" href="graph_minimizer.html" />
    
+  <link rel="stylesheet" href="../_static/custom.css" type="text/css" />
   
-  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
 
   </head>
-  <body role="document">  
+  <body role="document">
+  
 
     <div class="document">
       <div class="documentwrapper">
@@ -75,7 +77,7 @@ enabled globally.</p>
 <ul>
   <li><a href="../index.html">Documentation overview</a><ul>
   <li><a href="../users.html">Documentation For Users</a><ul>
-      <li>Previous: <a href="runtime_profiling.html" title="previous chapter">Runtime profiling</a></li>
+      <li>Previous: <a href="graph_minimizer.html" title="previous chapter">Graph Minimizer</a></li>
       <li>Next: <a href="../developers.html" title="next chapter">Documentation For Developers</a></li>
   </ul></li>
   </ul></li>
@@ -96,9 +98,6 @@ enabled globally.</p>
       <input type="hidden" name="check_keywords" value="yes" />
       <input type="hidden" name="area" value="default" />
     </form>
-    <p class="searchtip" style="font-size: 90%">
-    Enter search terms or a module, class or function name.
-    </p>
 </div>
 <script type="text/javascript">$('#searchbox').show(0);</script>
         </div>
@@ -106,11 +105,11 @@ enabled globally.</p>
       <div class="clearer"></div>
     </div>
     <div class="footer">
-      &copy;2017, ProMod3 authors.
+      &copy;2018, ProMod3 authors.
       
       |
-      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a>
-      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.6</a>
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.4.1</a>
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
       
       |
       <a href="../_sources/core/setcompoundschemlib.txt"
diff --git a/doc/html/dev_setup.html b/doc/html/dev_setup.html
index 3ff8fe004347ca275dbef3cb11121d983eb8b853..f58b1ee6ad20de2cf87c9fc6bf8c81d1ba15d6b5 100644
--- a/doc/html/dev_setup.html
+++ b/doc/html/dev_setup.html
@@ -6,7 +6,7 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
-    <title>ProMod3 Setup &mdash; ProMod3 1.1.0 documentation</title>
+    <title>ProMod3 Setup &mdash; ProMod3 1.2.0 documentation</title>
     
     <link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
     <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
@@ -14,7 +14,7 @@
     <script type="text/javascript">
       var DOCUMENTATION_OPTIONS = {
         URL_ROOT:    './',
-        VERSION:     '1.1.0',
+        VERSION:     '1.2.0',
         COLLAPSE_INDEX: false,
         FILE_SUFFIX: '.html',
         HAS_SOURCE:  true
@@ -23,16 +23,18 @@
     <script type="text/javascript" src="_static/jquery.js"></script>
     <script type="text/javascript" src="_static/underscore.js"></script>
     <script type="text/javascript" src="_static/doctools.js"></script>
-    <link rel="top" title="ProMod3 1.1.0 documentation" href="index.html" />
+    <link rel="top" title="ProMod3 1.2.0 documentation" href="index.html" />
     <link rel="up" title="Documentation For Developers" href="developers.html" />
     <link rel="next" title="Contributing" href="contributing.html" />
     <link rel="prev" title="Documentation For Developers" href="developers.html" />
    
+  <link rel="stylesheet" href="_static/custom.css" type="text/css" />
   
-  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
 
   </head>
-  <body role="document">  
+  <body role="document">
+  
 
     <div class="document">
       <div class="documentwrapper">
@@ -85,9 +87,9 @@ created something that could go into a release, tidy things up according to the
 rules from above and merge it into <code class="docutils literal"><span class="pre">develop</span></code>. From there it will
 automatically find its way into the next release.</p>
 <p>To set up your own branch, start from a current <code class="docutils literal"><span class="pre">develop</span></code> branch:</p>
-<div class="highlight-console"><div class="highlight"><pre><span class="gp">$</span> git checkout develop         <span class="c"># switch to branch develop</span>
-<span class="gp">$</span> git pull --rebase            <span class="c"># update branch develop</span>
-<span class="gp">$</span> git checkout -b &lt;BRANCHNAME&gt; <span class="c"># create branch &lt;BRANCHNAME&gt; and switch to it</span>
+<div class="highlight-console"><div class="highlight"><pre><span></span><span class="gp">$</span> git checkout develop         <span class="c1"># switch to branch develop</span>
+<span class="gp">$</span> git pull --rebase            <span class="c1"># update branch develop</span>
+<span class="gp">$</span> git checkout -b &lt;BRANCHNAME&gt; <span class="c1"># create branch &lt;BRANCHNAME&gt; and switch to it</span>
 </pre></div>
 </div>
 <p>Over time, <code class="docutils literal"><span class="pre">develop</span></code> may recognise some changes, e.g. new features, which you
@@ -95,7 +97,7 @@ want to make use of in your project. Keeping your branch up to date is a three
 step process. Git does not allow updates on top of changed code, so either
 changes have to be committed, or if in the middle of implementing something,
 stored away temporarily. Making commits is straight forward:</p>
-<div class="highlight-console"><div class="highlight"><pre><span class="gp">$</span> git commit -m <span class="s1">&#39;&lt;DESCRIPTION&gt;&#39;</span> <span class="c"># commit changes including a comment</span>
+<div class="highlight-console"><div class="highlight"><pre><span></span><span class="gp">$</span> git commit -m <span class="s1">&#39;&lt;DESCRIPTION&gt;&#39;</span> <span class="c1"># commit changes including a comment</span>
 </pre></div>
 </div>
 <p>Hiding your changes away from Git just for updating files is a bit more
@@ -106,15 +108,15 @@ you have changed, too, and stashed away, this may end up in a non-resolvable
 merge conflict and your changes are lost. Usually the log tells you, which
 files were recently modified. Moving all current changes to the stack is
 achieved by:</p>
-<div class="highlight-console"><div class="highlight"><pre><span class="gp">$</span> git stash save
+<div class="highlight-console"><div class="highlight"><pre><span></span><span class="gp">$</span> git stash save
 </pre></div>
 </div>
 <p>To revive them, use:</p>
-<div class="highlight-console"><div class="highlight"><pre><span class="gp">$</span> git stash pop
+<div class="highlight-console"><div class="highlight"><pre><span></span><span class="gp">$</span> git stash pop
 </pre></div>
 </div>
 <p>After cleaning up your branch, switch to <code class="docutils literal"><span class="pre">develop</span></code>, update it and switch back:</p>
-<div class="highlight-console"><div class="highlight"><pre><span class="gp">$</span> git checkout develop
+<div class="highlight-console"><div class="highlight"><pre><span></span><span class="gp">$</span> git checkout develop
 <span class="gp">$</span> git pull --rebase
 <span class="gp">$</span> git checkout &lt;BRANCHNAME&gt;
 </pre></div>
@@ -123,11 +125,11 @@ achieved by:</p>
 and rebasing. A rebase may only be done, if you <strong>never</strong> pushed your branch to
 the origin of the repository (otherwise you will mess up history, in the worst
 case <code class="docutils literal"><span class="pre">develop</span></code> may be unusable once you merge):</p>
-<div class="highlight-console"><div class="highlight"><pre><span class="gp">$</span> git rebase develop
+<div class="highlight-console"><div class="highlight"><pre><span></span><span class="gp">$</span> git rebase develop
 </pre></div>
 </div>
 <p>For branches which are available to others, do a proper merge:</p>
-<div class="highlight-console"><div class="highlight"><pre><span class="gp">$</span> git merge develop
+<div class="highlight-console"><div class="highlight"><pre><span></span><span class="gp">$</span> git merge develop
 </pre></div>
 </div>
 <p>This may require some manual conflict solving and will end up in a merge commit.</p>
@@ -136,17 +138,17 @@ case <code class="docutils literal"><span class="pre">develop</span></code> may
 <h2>Git Hooks<a class="headerlink" href="#git-hooks" title="Permalink to this headline">¶</a></h2>
 <p>Git hooks are scripts invoked by Git in connection to certain commands.
 ProMod3 currently provides one for <strong class="command">commit</strong>. It is installed by</p>
-<div class="highlight-console"><div class="highlight"><pre><span class="gp">$</span> cp extras/pre_commit/pre-commit .git/hooks/
+<div class="highlight-console"><div class="highlight"><pre><span></span><span class="gp">$</span> cp extras/pre_commit/pre-commit .git/hooks/
 </pre></div>
 </div>
 <p>Its task is applying coding standards and doing a bunch of other checks on the
 files involved in a commit. Everything around the script is hosted in
 <code class="file docutils literal"><span class="pre">extras/pre_commit/</span></code>. The checks can be manually executed with</p>
-<div class="highlight-console"><div class="highlight"><pre><span class="gp">$</span> python .git/hooks/pre-commit
+<div class="highlight-console"><div class="highlight"><pre><span></span><span class="gp">$</span> python .git/hooks/pre-commit
 </pre></div>
 </div>
 <p>If you ever have to skip the hook,</p>
-<div class="highlight-console"><div class="highlight"><pre><span class="gp">$</span> git commit --no-verify
+<div class="highlight-console"><div class="highlight"><pre><span></span><span class="gp">$</span> git commit --no-verify
 </pre></div>
 </div>
 <p>does the trick. <strong>But</strong> checks are always run on the complete file containing
@@ -172,7 +174,7 @@ is invoked on unit test code, where we may go a little bit less restrictive.</p>
 everything together that belongs together&#8217;. That is, code, documentation and
 extra data should be gathered on a per-module basis immediately in the
 repository root. The directory structure of your module should look like this:</p>
-<div class="highlight-text"><div class="highlight"><pre>promod3.git/                            Project folder
+<div class="highlight-text"><div class="highlight"><pre><span></span>promod3.git/                            Project folder
       your_module/                      Module directory
             CMakeLists.txt              CMake configuration
             data/                       Extra data (if needed)
@@ -204,13 +206,13 @@ repository root. The directory structure of your module should look like this:</
 <p>Additionally to the module directories there are a few extra folders:</p>
 <ul class="simple">
 <li><code class="file docutils literal"><span class="pre">actions</span></code>: Scripts callable as <code class="docutils literal"><span class="pre">pm</span> <span class="pre">&lt;ACTION_NAME&gt;</span></code>.
-See <a class="reference internal" href="contributing.html#how-to-start-your-own-action"><span>here</span></a> for details.</li>
+See <a class="reference internal" href="contributing.html#how-to-start-your-own-action"><span class="std std-ref">here</span></a> for details.</li>
 <li><code class="file docutils literal"><span class="pre">cmake_support</span></code>: Helper functions for CMake.
-See <a class="reference internal" href="cmake/index.html#pm3-cmake-doc"><span>here</span></a> for details.</li>
+See <a class="reference internal" href="cmake/index.html#pm3-cmake-doc"><span class="std std-ref">here</span></a> for details.</li>
 <li><code class="file docutils literal"><span class="pre">doc</span></code>: High-level documentation, test scripts (<code class="file docutils literal"><span class="pre">doc/tests</span></code>) and a
 copy of the generated html documentation (<code class="file docutils literal"><span class="pre">doc/html</span></code>). The latter must
 be kept up-to-date at least on the <code class="docutils literal"><span class="pre">master</span></code> branch.
-See <a class="reference internal" href="contributing.html#writing-documentation"><span>here</span></a> for details.</li>
+See <a class="reference internal" href="contributing.html#writing-documentation"><span class="std std-ref">here</span></a> for details.</li>
 <li><code class="file docutils literal"><span class="pre">extras</span></code>: Extra data and information that doesn&#8217;t fit anywhere
 else (e.g. Git hooks or scripts to recreate the binary files).</li>
 <li><code class="file docutils literal"><span class="pre">scripts</span></code>: Input for scripts that end up in <code class="file docutils literal"><span class="pre">stage/bin</span></code></li>
@@ -225,7 +227,7 @@ Python modules are declared there as well as which files belong to the
 documentation. CMake is a rather complex topic (unfortunately all usable
 build systems seem to be) so we skip a detailed view, here, and just advice you
 to go by example. There is a tiny bit of documentation on our additions to
-CMake <a class="reference internal" href="cmake/index.html#pm3-cmake-doc"><span>here</span></a>. If you really need to make changes to the
+CMake <a class="reference internal" href="cmake/index.html#pm3-cmake-doc"><span class="std std-ref">here</span></a>. If you really need to make changes to the
 build system, other than adding new files and modules, you have to dive into
 CMake documentation all by yourself and on your own responsibility. You have
 been warned.</p>
@@ -283,9 +285,6 @@ modules from there, use the binaries from <code class="file docutils literal"><s
       <input type="hidden" name="check_keywords" value="yes" />
       <input type="hidden" name="area" value="default" />
     </form>
-    <p class="searchtip" style="font-size: 90%">
-    Enter search terms or a module, class or function name.
-    </p>
 </div>
 <script type="text/javascript">$('#searchbox').show(0);</script>
         </div>
@@ -293,11 +292,11 @@ modules from there, use the binaries from <code class="file docutils literal"><s
       <div class="clearer"></div>
     </div>
     <div class="footer">
-      &copy;2017, ProMod3 authors.
+      &copy;2018, ProMod3 authors.
       
       |
-      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a>
-      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.6</a>
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.4.1</a>
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
       
       |
       <a href="_sources/dev_setup.txt"
diff --git a/doc/html/developers.html b/doc/html/developers.html
index b0e89ed94976d7191cf20e01038ccd570dec8c19..89882a9474b79f60d2d36dbbc47bec5394e3ccc3 100644
--- a/doc/html/developers.html
+++ b/doc/html/developers.html
@@ -6,7 +6,7 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
-    <title>Documentation For Developers &mdash; ProMod3 1.1.0 documentation</title>
+    <title>Documentation For Developers &mdash; ProMod3 1.2.0 documentation</title>
     
     <link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
     <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
@@ -14,7 +14,7 @@
     <script type="text/javascript">
       var DOCUMENTATION_OPTIONS = {
         URL_ROOT:    './',
-        VERSION:     '1.1.0',
+        VERSION:     '1.2.0',
         COLLAPSE_INDEX: false,
         FILE_SUFFIX: '.html',
         HAS_SOURCE:  true
@@ -23,15 +23,17 @@
     <script type="text/javascript" src="_static/jquery.js"></script>
     <script type="text/javascript" src="_static/underscore.js"></script>
     <script type="text/javascript" src="_static/doctools.js"></script>
-    <link rel="top" title="ProMod3 1.1.0 documentation" href="index.html" />
+    <link rel="top" title="ProMod3 1.2.0 documentation" href="index.html" />
     <link rel="next" title="ProMod3 Setup" href="dev_setup.html" />
     <link rel="prev" title="SetCompoundsChemlib()" href="core/setcompoundschemlib.html" />
    
+  <link rel="stylesheet" href="_static/custom.css" type="text/css" />
   
-  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
 
   </head>
-  <body role="document">  
+  <body role="document">
+  
 
     <div class="document">
       <div class="documentwrapper">
@@ -114,9 +116,6 @@ new features.</p>
       <input type="hidden" name="check_keywords" value="yes" />
       <input type="hidden" name="area" value="default" />
     </form>
-    <p class="searchtip" style="font-size: 90%">
-    Enter search terms or a module, class or function name.
-    </p>
 </div>
 <script type="text/javascript">$('#searchbox').show(0);</script>
         </div>
@@ -124,11 +123,11 @@ new features.</p>
       <div class="clearer"></div>
     </div>
     <div class="footer">
-      &copy;2017, ProMod3 authors.
+      &copy;2018, ProMod3 authors.
       
       |
-      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a>
-      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.6</a>
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.4.1</a>
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
       
       |
       <a href="_sources/developers.txt"
diff --git a/doc/html/genindex.html b/doc/html/genindex.html
index a4b8a6fb84b1412936a635669decd771273df8ab..4e5da3b46b5ba10cbb6458cf8b9eee2e6aeedac4 100644
--- a/doc/html/genindex.html
+++ b/doc/html/genindex.html
@@ -7,7 +7,7 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
-    <title>Index &mdash; ProMod3 1.1.0 documentation</title>
+    <title>Index &mdash; ProMod3 1.2.0 documentation</title>
     
     <link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
     <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
@@ -15,7 +15,7 @@
     <script type="text/javascript">
       var DOCUMENTATION_OPTIONS = {
         URL_ROOT:    './',
-        VERSION:     '1.1.0',
+        VERSION:     '1.2.0',
         COLLAPSE_INDEX: false,
         FILE_SUFFIX: '.html',
         HAS_SOURCE:  true
@@ -24,13 +24,15 @@
     <script type="text/javascript" src="_static/jquery.js"></script>
     <script type="text/javascript" src="_static/underscore.js"></script>
     <script type="text/javascript" src="_static/doctools.js"></script>
-    <link rel="top" title="ProMod3 1.1.0 documentation" href="index.html" />
+    <link rel="top" title="ProMod3 1.2.0 documentation" href="index.html" />
    
+  <link rel="stylesheet" href="_static/custom.css" type="text/css" />
   
-  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
 
   </head>
-  <body role="document">  
+  <body role="document">
+  
 
     <div class="document">
       <div class="documentwrapper">
@@ -230,6 +232,10 @@
   </dt>
 
       
+  <dt><a href="core/graph_minimizer.html#promod3.core.GraphMinimizer.AddEdge">AddEdge() (promod3.core.GraphMinimizer method)</a>
+  </dt>
+
+      
   <dt><a href="modelling/loop_candidates.html#promod3.modelling.LoopCandidates.AddFragmentInfo">AddFragmentInfo() (promod3.modelling.LoopCandidates method)</a>
   </dt>
 
@@ -260,6 +266,10 @@
   </dt>
 
       
+  <dt><a href="core/graph_minimizer.html#promod3.core.GraphMinimizer.AddNode">AddNode() (promod3.core.GraphMinimizer method)</a>
+  </dt>
+
+      
   <dt><a href="modelling/loop_closing.html#promod3.modelling.BackboneRelaxer.AddNRestraint">AddNRestraint() (promod3.modelling.BackboneRelaxer method)</a>
   </dt>
 
@@ -329,12 +339,12 @@
   <dt><a href="modelling/pipeline.html#promod3.modelling.ModellingHandle.all_atom_sidechain_env">all_atom_sidechain_env (promod3.modelling.ModellingHandle attribute)</a>
   </dt>
 
+  </dl></td>
+  <td style="width: 33%" valign="top"><dl>
       
   <dt><a href="loop/all_atom.html#promod3.loop.AllAtomEnvPositions.all_pos">all_pos (promod3.loop.AllAtomEnvPositions attribute)</a>
   </dt>
 
-  </dl></td>
-  <td style="width: 33%" valign="top"><dl>
       
   <dt><a href="scoring/all_atom_scorers.html#promod3.scoring.AllAtomClashScorer">AllAtomClashScorer (class in promod3.scoring)</a>
   </dt>
@@ -430,11 +440,11 @@
   </dt>
 
       
-  <dt><a href="sidechain/graph.html#promod3.sidechain.RotamerGraph.ApplyDEE">ApplyDEE() (promod3.sidechain.RotamerGraph method)</a>
+  <dt><a href="core/graph_minimizer.html#promod3.core.GraphMinimizer.ApplyDEE">ApplyDEE() (promod3.core.GraphMinimizer method)</a>
   </dt>
 
       
-  <dt><a href="sidechain/graph.html#promod3.sidechain.RotamerGraph.ApplyEdgeDecomposition">ApplyEdgeDecomposition() (promod3.sidechain.RotamerGraph method)</a>
+  <dt><a href="core/graph_minimizer.html#promod3.core.GraphMinimizer.ApplyEdgeDecomposition">ApplyEdgeDecomposition() (promod3.core.GraphMinimizer method)</a>
   </dt>
 
       
@@ -486,7 +496,7 @@
   </dt>
 
       
-  <dt><a href="sidechain/graph.html#promod3.sidechain.RotamerGraph.AStarSolve">AStarSolve() (promod3.sidechain.RotamerGraph method)</a>
+  <dt><a href="core/graph_minimizer.html#promod3.core.GraphMinimizer.AStarSolve">AStarSolve() (promod3.core.GraphMinimizer method)</a>
   </dt>
 
       
@@ -682,6 +692,10 @@
   </dt>
 
       
+  <dt><a href="loop/structure_db.html#promod3.loop.CoordInfo.chain_name">chain_name (promod3.loop.CoordInfo attribute)</a>
+  </dt>
+
+      
   <dt><a href="modelling/pipeline.html#promod3.modelling.CheckFinalModel">CheckFinalModel() (in module promod3.modelling)</a>
   </dt>
 
@@ -815,7 +829,7 @@
   </dt>
 
       
-  <dt><a href="sidechain/rotamer_constructor.html#promod3.sidechain.SCWRLRotamerConstructor.ConstructBackboneFrameResidue">ConstructBackboneFrameResidue() (promod3.sidechain.SCWRLRotamerConstructor method)</a>, <a href="sidechain/rotamer_constructor.html#promod3.sidechain.SCWRLRotamerConstructor.ConstructBackboneFrameResidue">[1]</a>, <a href="sidechain/rotamer_constructor.html#promod3.sidechain.SCWRLRotamerConstructor.ConstructBackboneFrameResidue">[2]</a>
+  <dt><a href="sidechain/rotamer_constructor.html#promod3.sidechain.SCWRLRotamerConstructor.ConstructBackboneFrameResidue">ConstructBackboneFrameResidue() (promod3.sidechain.SCWRLRotamerConstructor method)</a>, <a href="sidechain/rotamer_constructor.html#promod3.sidechain.SCWRLRotamerConstructor.ConstructBackboneFrameResidue">[1]</a>
   </dt>
 
       
@@ -835,7 +849,7 @@
   </dt>
 
       
-  <dt><a href="sidechain/rotamer_constructor.html#promod3.sidechain.SCWRLRotamerConstructor.ConstructRRMRotamerGroup">ConstructRRMRotamerGroup() (promod3.sidechain.SCWRLRotamerConstructor method)</a>, <a href="sidechain/rotamer_constructor.html#promod3.sidechain.SCWRLRotamerConstructor.ConstructRRMRotamerGroup">[1]</a>, <a href="sidechain/rotamer_constructor.html#promod3.sidechain.SCWRLRotamerConstructor.ConstructRRMRotamerGroup">[2]</a>, <a href="sidechain/rotamer_constructor.html#promod3.sidechain.SCWRLRotamerConstructor.ConstructRRMRotamerGroup">[3]</a>, <a href="sidechain/rotamer_constructor.html#promod3.sidechain.SCWRLRotamerConstructor.ConstructRRMRotamerGroup">[4]</a>, <a href="sidechain/rotamer_constructor.html#promod3.sidechain.SCWRLRotamerConstructor.ConstructRRMRotamerGroup">[5]</a>, <a href="sidechain/rotamer_constructor.html#promod3.sidechain.SCWRLRotamerConstructor.ConstructRRMRotamerGroup">[6]</a>, <a href="sidechain/rotamer_constructor.html#promod3.sidechain.SCWRLRotamerConstructor.ConstructRRMRotamerGroup">[7]</a>, <a href="sidechain/rotamer_constructor.html#promod3.sidechain.SCWRLRotamerConstructor.ConstructRRMRotamerGroup">[8]</a>
+  <dt><a href="sidechain/rotamer_constructor.html#promod3.sidechain.SCWRLRotamerConstructor.ConstructRRMRotamerGroup">ConstructRRMRotamerGroup() (promod3.sidechain.SCWRLRotamerConstructor method)</a>, <a href="sidechain/rotamer_constructor.html#promod3.sidechain.SCWRLRotamerConstructor.ConstructRRMRotamerGroup">[1]</a>, <a href="sidechain/rotamer_constructor.html#promod3.sidechain.SCWRLRotamerConstructor.ConstructRRMRotamerGroup">[2]</a>, <a href="sidechain/rotamer_constructor.html#promod3.sidechain.SCWRLRotamerConstructor.ConstructRRMRotamerGroup">[3]</a>, <a href="sidechain/rotamer_constructor.html#promod3.sidechain.SCWRLRotamerConstructor.ConstructRRMRotamerGroup">[4]</a>, <a href="sidechain/rotamer_constructor.html#promod3.sidechain.SCWRLRotamerConstructor.ConstructRRMRotamerGroup">[5]</a>
   </dt>
 
       
@@ -932,10 +946,6 @@
 <table style="width: 100%" class="indextable genindextable"><tr>
   <td style="width: 33%" valign="top"><dl>
       
-  <dt><a href="scoring/backbone_scorers.html#promod3.scoring.DensityScorer">DensityScorer (class in promod3.scoring)</a>
-  </dt>
-
-      
   <dt><a href="modelling/monte_carlo.html#promod3.modelling.DirtyCCDCloser">DirtyCCDCloser (class in promod3.modelling)</a>
   </dt>
 
@@ -955,20 +965,122 @@
   <dt><a href="core/geometry.html#promod3.core.StemPairOrientation.distance">distance (promod3.core.StemPairOrientation attribute)</a>
   </dt>
 
+      
+  <dt><a href="modelling/sidechain_reconstruction.html#promod3.modelling.SidechainReconstructionData.disulfid_bridges">disulfid_bridges (promod3.modelling.SidechainReconstructionData attribute)</a>
+  </dt>
+
+      
+  <dt><a href="sidechain/disulfid.html#promod3.sidechain.DisulfidScore">DisulfidScore() (in module promod3.sidechain)</a>
+  </dt>
+
   </dl></td>
   <td style="width: 33%" valign="top"><dl>
       
-  <dt><a href="modelling/sidechain_reconstruction.html#promod3.modelling.SidechainReconstructionData.disulfid_bridges">disulfid_bridges (promod3.modelling.SidechainReconstructionData attribute)</a>
+  <dt><a href="scoring/all_atom_scorers.html#promod3.scoring.AllAtomClashScorer.DoExternalScores">DoExternalScores() (promod3.scoring.AllAtomClashScorer method)</a>
   </dt>
 
+      <dd><dl>
+        
+  <dt><a href="scoring/all_atom_scorers.html#promod3.scoring.AllAtomInteractionScorer.DoExternalScores">(promod3.scoring.AllAtomInteractionScorer method)</a>
+  </dt>
+
+        
+  <dt><a href="scoring/backbone_scorers.html#promod3.scoring.CBetaScorer.DoExternalScores">(promod3.scoring.CBetaScorer method)</a>
+  </dt>
+
+        
+  <dt><a href="scoring/backbone_scorers.html#promod3.scoring.ClashScorer.DoExternalScores">(promod3.scoring.ClashScorer method)</a>
+  </dt>
+
+        
+  <dt><a href="scoring/backbone_scorers.html#promod3.scoring.HBondScorer.DoExternalScores">(promod3.scoring.HBondScorer method)</a>
+  </dt>
+
+        
+  <dt><a href="scoring/backbone_scorers.html#promod3.scoring.PairwiseScorer.DoExternalScores">(promod3.scoring.PairwiseScorer method)</a>
+  </dt>
+
+        
+  <dt><a href="scoring/backbone_scorers.html#promod3.scoring.ReducedScorer.DoExternalScores">(promod3.scoring.ReducedScorer method)</a>
+  </dt>
+
+      </dl></dd>
       
-  <dt><a href="sidechain/disulfid.html#promod3.sidechain.DisulfidRawScore">DisulfidRawScore() (in module promod3.sidechain)</a>
+  <dt><a href="scoring/all_atom_scorers.html#promod3.scoring.AllAtomClashScorer.DoInternalScores">DoInternalScores() (promod3.scoring.AllAtomClashScorer method)</a>
+  </dt>
+
+      <dd><dl>
+        
+  <dt><a href="scoring/all_atom_scorers.html#promod3.scoring.AllAtomInteractionScorer.DoInternalScores">(promod3.scoring.AllAtomInteractionScorer method)</a>
+  </dt>
+
+        
+  <dt><a href="scoring/backbone_scorers.html#promod3.scoring.CBetaScorer.DoInternalScores">(promod3.scoring.CBetaScorer method)</a>
+  </dt>
+
+        
+  <dt><a href="scoring/backbone_scorers.html#promod3.scoring.ClashScorer.DoInternalScores">(promod3.scoring.ClashScorer method)</a>
+  </dt>
+
+        
+  <dt><a href="scoring/backbone_scorers.html#promod3.scoring.HBondScorer.DoInternalScores">(promod3.scoring.HBondScorer method)</a>
+  </dt>
+
+        
+  <dt><a href="scoring/backbone_scorers.html#promod3.scoring.PairwiseScorer.DoInternalScores">(promod3.scoring.PairwiseScorer method)</a>
+  </dt>
+
+        
+  <dt><a href="scoring/backbone_scorers.html#promod3.scoring.ReducedScorer.DoInternalScores">(promod3.scoring.ReducedScorer method)</a>
   </dt>
 
+      </dl></dd>
       
-  <dt><a href="sidechain/disulfid.html#promod3.sidechain.DisulfidScore">DisulfidScore() (in module promod3.sidechain)</a>
+  <dt><a href="scoring/all_atom_scorers.html#promod3.scoring.AllAtomClashScorer.DoNormalize">DoNormalize() (promod3.scoring.AllAtomClashScorer method)</a>
+  </dt>
+
+      <dd><dl>
+        
+  <dt><a href="scoring/all_atom_scorers.html#promod3.scoring.AllAtomInteractionScorer.DoNormalize">(promod3.scoring.AllAtomInteractionScorer method)</a>
+  </dt>
+
+        
+  <dt><a href="scoring/all_atom_scorers.html#promod3.scoring.AllAtomPackingScorer.DoNormalize">(promod3.scoring.AllAtomPackingScorer method)</a>
+  </dt>
+
+        
+  <dt><a href="scoring/backbone_scorers.html#promod3.scoring.CBPackingScorer.DoNormalize">(promod3.scoring.CBPackingScorer method)</a>
+  </dt>
+
+        
+  <dt><a href="scoring/backbone_scorers.html#promod3.scoring.CBetaScorer.DoNormalize">(promod3.scoring.CBetaScorer method)</a>
+  </dt>
+
+        
+  <dt><a href="scoring/backbone_scorers.html#promod3.scoring.ClashScorer.DoNormalize">(promod3.scoring.ClashScorer method)</a>
+  </dt>
+
+        
+  <dt><a href="scoring/backbone_scorers.html#promod3.scoring.HBondScorer.DoNormalize">(promod3.scoring.HBondScorer method)</a>
+  </dt>
+
+        
+  <dt><a href="scoring/backbone_scorers.html#promod3.scoring.PairwiseScorer.DoNormalize">(promod3.scoring.PairwiseScorer method)</a>
+  </dt>
+
+        
+  <dt><a href="scoring/backbone_scorers.html#promod3.scoring.ReducedScorer.DoNormalize">(promod3.scoring.ReducedScorer method)</a>
+  </dt>
+
+        
+  <dt><a href="scoring/backbone_scorers.html#promod3.scoring.SSAgreementScorer.DoNormalize">(promod3.scoring.SSAgreementScorer method)</a>
+  </dt>
+
+        
+  <dt><a href="scoring/backbone_scorers.html#promod3.scoring.TorsionScorer.DoNormalize">(promod3.scoring.TorsionScorer method)</a>
   </dt>
 
+      </dl></dd>
       
   <dt><a href="loop/torsion_sampler.html#promod3.loop.TorsionSampler.Draw">Draw() (promod3.loop.TorsionSampler method)</a>, <a href="loop/torsion_sampler.html#promod3.loop.TorsionSampler.Draw">[1]</a>
   </dt>
@@ -1302,14 +1414,6 @@
   </dt>
 
       
-  <dt><a href="sidechain/graph.html#promod3.sidechain.RotamerGraph.GetActiveEdges">GetActiveEdges() (promod3.sidechain.RotamerGraph method)</a>
-  </dt>
-
-      
-  <dt><a href="sidechain/graph.html#promod3.sidechain.RotamerGraph.GetActiveRotamers">GetActiveRotamers() (promod3.sidechain.RotamerGraph method)</a>
-  </dt>
-
-      
   <dt><a href="sidechain/rotamer.html#promod3.sidechain.FRMRotamer.GetActiveSubrotamer">GetActiveSubrotamer() (promod3.sidechain.FRMRotamer method)</a>
   </dt>
 
@@ -1418,7 +1522,7 @@
   </dt>
 
       
-  <dt><a href="loop/structure_db.html#promod3.loop.StructureDB.GetCoordIndex">GetCoordIndex() (promod3.loop.StructureDB method)</a>
+  <dt><a href="loop/structure_db.html#promod3.loop.StructureDB.GetCoordIdx">GetCoordIdx() (promod3.loop.StructureDB method)</a>
   </dt>
 
       
@@ -1454,10 +1558,6 @@
   </dt>
 
       
-  <dt><a href="sidechain/graph.html#promod3.sidechain.RotamerGraph.GetEdges">GetEdges() (promod3.sidechain.RotamerGraph method)</a>
-  </dt>
-
-      
   <dt><a href="loop/all_atom.html#promod3.loop.AminoAcidLookup.GetElement">GetElement() (promod3.loop.AminoAcidLookup static method)</a>
   </dt>
 
@@ -1553,6 +1653,8 @@
   </dt>
 
       </dl></dd>
+  </dl></td>
+  <td style="width: 33%" valign="top"><dl>
       
   <dt><a href="loop/mm_system_creation.html#promod3.loop.MmSystemCreator.GetIndexing">GetIndexing() (promod3.loop.MmSystemCreator method)</a>
   </dt>
@@ -1561,8 +1663,6 @@
   <dt><a href="loop/mm_system_creation.html#promod3.loop.ForcefieldLookup.GetInternalConnectivity">GetInternalConnectivity() (promod3.loop.ForcefieldLookup method)</a>
   </dt>
 
-  </dl></td>
-  <td style="width: 33%" valign="top"><dl>
       
   <dt><a href="sidechain/rotamer.html#promod3.sidechain.FRMRotamer.GetInternalEnergy">GetInternalEnergy() (promod3.sidechain.FRMRotamer method)</a>
   </dt>
@@ -1632,18 +1732,6 @@
   </dt>
 
       
-  <dt><a href="sidechain/graph.html#promod3.sidechain.RotamerGraph.GetNumActiveEdges">GetNumActiveEdges() (promod3.sidechain.RotamerGraph method)</a>
-  </dt>
-
-      
-  <dt><a href="sidechain/graph.html#promod3.sidechain.RotamerGraph.GetNumActiveNodes">GetNumActiveNodes() (promod3.sidechain.RotamerGraph method)</a>
-  </dt>
-
-      
-  <dt><a href="sidechain/graph.html#promod3.sidechain.RotamerGraph.GetNumActiveRotamers">GetNumActiveRotamers() (promod3.sidechain.RotamerGraph method)</a>
-  </dt>
-
-      
   <dt><a href="loop/all_atom.html#promod3.loop.AllAtomPositions.GetNumAtoms">GetNumAtoms() (promod3.loop.AllAtomPositions method)</a>
   </dt>
 
@@ -1666,10 +1754,6 @@
   </dt>
 
       
-  <dt><a href="sidechain/graph.html#promod3.sidechain.RotamerGraph.GetNumEdges">GetNumEdges() (promod3.sidechain.RotamerGraph method)</a>
-  </dt>
-
-      
   <dt><a href="loop/structure_db.html#promod3.loop.FragDB.GetNumFragments">GetNumFragments() (promod3.loop.FragDB method)</a>
   </dt>
 
@@ -1682,10 +1766,6 @@
   </dt>
 
       
-  <dt><a href="sidechain/graph.html#promod3.sidechain.RotamerGraph.GetNumNodes">GetNumNodes() (promod3.sidechain.RotamerGraph method)</a>
-  </dt>
-
-      
   <dt><a href="loop/all_atom.html#promod3.loop.AllAtomPositions.GetNumResidues">GetNumResidues() (promod3.loop.AllAtomPositions method)</a>
   </dt>
 
@@ -1696,10 +1776,6 @@
 
       </dl></dd>
       
-  <dt><a href="sidechain/graph.html#promod3.sidechain.RotamerGraph.GetNumRotamers">GetNumRotamers() (promod3.sidechain.RotamerGraph method)</a>
-  </dt>
-
-      
   <dt><a href="loop/structure_db.html#promod3.loop.FragDB.GetNumStemPairs">GetNumStemPairs() (promod3.loop.FragDB method)</a>
   </dt>
 
@@ -1736,10 +1812,6 @@
   </dt>
 
       
-  <dt><a href="sidechain/graph.html#promod3.sidechain.RotamerGraph.GetPairwiseEnergies">GetPairwiseEnergies() (promod3.sidechain.RotamerGraph method)</a>
-  </dt>
-
-      
   <dt><a href="sidechain/rotamer.html#promod3.sidechain.Particle.GetParticleType">GetParticleType() (promod3.sidechain.Particle method)</a>
   </dt>
 
@@ -1820,20 +1892,16 @@
   </dt>
 
       
-  <dt><a href="loop/structure_db.html#promod3.loop.Fragger.GetScore">GetScore() (promod3.loop.Fragger method)</a>, <a href="loop/structure_db.html#promod3.loop.Fragger.GetScore">[1]</a>
+  <dt><a href="modelling/monte_carlo.html#promod3.modelling.GetScore">GetScore() (in module promod3.modelling)</a>
   </dt>
 
       <dd><dl>
         
-  <dt><a href="modelling/monte_carlo.html#promod3.modelling.LinearScorer.GetScore">(promod3.modelling.LinearScorer method)</a>
+  <dt><a href="loop/structure_db.html#promod3.loop.Fragger.GetScore">(promod3.loop.Fragger method)</a>, <a href="loop/structure_db.html#promod3.loop.Fragger.GetScore">[1]</a>
   </dt>
 
       </dl></dd>
       
-  <dt><a href="sidechain/graph.html#promod3.sidechain.RotamerGraph.GetSelfEnergies">GetSelfEnergies() (promod3.sidechain.RotamerGraph method)</a>
-  </dt>
-
-      
   <dt><a href="sidechain/rotamer.html#promod3.sidechain.FRMRotamer.GetSelfEnergy">GetSelfEnergy() (promod3.sidechain.FRMRotamer method)</a>
   </dt>
 
@@ -1933,6 +2001,10 @@
   <dt><a href="modelling/loop_candidates.html#promod3.modelling.ScoringWeights.GetWeights">GetWeights() (promod3.modelling.ScoringWeights static method)</a>
   </dt>
 
+      
+  <dt><a href="core/graph_minimizer.html#promod3.core.GraphMinimizer">GraphMinimizer (class in promod3.core)</a>
+  </dt>
+
   </dl></td>
 </tr></table>
 
@@ -1952,12 +2024,16 @@
   </dt>
 
       
-  <dt><a href="loop/structure_db.html#promod3.loop.FragDB.HasFragLength">HasFragLength() (promod3.loop.FragDB method)</a>
+  <dt><a href="loop/structure_db.html#promod3.loop.StructureDB.HasData">HasData() (promod3.loop.StructureDB method)</a>
   </dt>
 
   </dl></td>
   <td style="width: 33%" valign="top"><dl>
       
+  <dt><a href="loop/structure_db.html#promod3.loop.FragDB.HasFragLength">HasFragLength() (promod3.loop.FragDB method)</a>
+  </dt>
+
+      
   <dt><a href="modelling/loop_candidates.html#promod3.modelling.LoopCandidates.HasFragmentInfos">HasFragmentInfos() (promod3.modelling.LoopCandidates method)</a>
   </dt>
 
@@ -1976,6 +2052,10 @@
 <table style="width: 100%" class="indextable genindextable"><tr>
   <td style="width: 33%" valign="top"><dl>
       
+  <dt><a href="loop/structure_db.html#promod3.loop.CoordInfo.id">id (promod3.loop.CoordInfo attribute)</a>
+  </dt>
+
+      
   <dt><a href="loop/mm_system_creation.html#promod3.loop.ForcefieldHarmonicImproperInfo.index_four">index_four (promod3.loop.ForcefieldHarmonicImproperInfo attribute)</a>
   </dt>
 
@@ -2099,12 +2179,12 @@
   <dt><a href="modelling/pipeline.html#promod3.modelling.IsAllAtomScoringSetUp">IsAllAtomScoringSetUp() (in module promod3.modelling)</a>
   </dt>
 
+  </dl></td>
+  <td style="width: 33%" valign="top"><dl>
       
   <dt><a href="loop/all_atom.html#promod3.loop.AllAtomPositions.IsAllSet">IsAllSet() (promod3.loop.AllAtomPositions method)</a>
   </dt>
 
-  </dl></td>
-  <td style="width: 33%" valign="top"><dl>
       
   <dt><a href="loop/all_atom.html#promod3.loop.AllAtomPositions.IsAnySet">IsAnySet() (promod3.loop.AllAtomPositions method)</a>
   </dt>
@@ -2190,10 +2270,6 @@
   </dt>
 
       
-  <dt><a href="modelling/monte_carlo.html#promod3.modelling.LinearScorer">LinearScorer (class in promod3.modelling)</a>
-  </dt>
-
-      
   <dt><a href="loop/mm_system_creation.html#promod3.loop.ForcefieldConnectivity.lj_pairs">lj_pairs (promod3.loop.ForcefieldConnectivity attribute)</a>
   </dt>
 
@@ -2299,12 +2375,12 @@
   <dt><a href="sidechain/loading.html#promod3.sidechain.LoadDunbrackLib">LoadDunbrackLib() (in module promod3.sidechain)</a>
   </dt>
 
-  </dl></td>
-  <td style="width: 33%" valign="top"><dl>
       
   <dt><a href="loop/load_loop_objects.html#promod3.loop.LoadFragDB">LoadFragDB() (in module promod3.loop)</a>
   </dt>
 
+  </dl></td>
+  <td style="width: 33%" valign="top"><dl>
       
   <dt><a href="scoring/backbone_scorers.html#promod3.scoring.LoadHBondScorer">LoadHBondScorer() (in module promod3.scoring)</a>
   </dt>
@@ -2460,7 +2536,7 @@
   </dt>
 
       
-  <dt><a href="sidechain/graph.html#promod3.sidechain.RotamerGraph.MCSolve">MCSolve() (promod3.sidechain.RotamerGraph method)</a>
+  <dt><a href="core/graph_minimizer.html#promod3.core.GraphMinimizer.MCSolve">MCSolve() (promod3.core.GraphMinimizer method)</a>
   </dt>
 
       
@@ -2540,6 +2616,10 @@
   <dt><a href="core/geometry.html#promod3.core.StemCoords.n_coord">n_coord (promod3.core.StemCoords attribute)</a>
   </dt>
 
+      
+  <dt><a href="core/graph_minimizer.html#promod3.core.GraphMinimizer.NaiveSolve">NaiveSolve() (promod3.core.GraphMinimizer method)</a>
+  </dt>
+
   </dl></td>
   <td style="width: 33%" valign="top"><dl>
       
@@ -2593,10 +2673,6 @@
   </dt>
 
       
-  <dt><a href="loop/structure_db.html#promod3.loop.CoordInfo.pdb_id">pdb_id (promod3.loop.CoordInfo attribute)</a>
-  </dt>
-
-      
   <dt><a href="loop/mm_system_creation.html#promod3.loop.ForcefieldConnectivity.periodic_dihedrals">periodic_dihedrals (promod3.loop.ForcefieldConnectivity attribute)</a>
   </dt>
 
@@ -2636,6 +2712,10 @@
   </dt>
 
       
+  <dt><a href="scoring/backbone_score_env.html#promod3.scoring.BackboneScoreEnv.Pop">Pop() (promod3.scoring.BackboneScoreEnv method)</a>
+  </dt>
+
+      
   <dt><a href="loop/structure_db.html#promod3.loop.FragDB.PrintStatistics">PrintStatistics() (promod3.loop.FragDB method)</a>
   </dt>
 
@@ -2713,7 +2793,7 @@
 
       </dl></dd>
       
-  <dt><a href="sidechain/graph.html#promod3.sidechain.RotamerGraph.Prune">Prune() (promod3.sidechain.RotamerGraph method)</a>
+  <dt><a href="core/graph_minimizer.html#promod3.core.GraphMinimizer.Prune">Prune() (promod3.core.GraphMinimizer method)</a>
   </dt>
 
       
@@ -2794,6 +2874,10 @@
   </dt>
 
       
+  <dt><a href="loop/structure_db.html#promod3.loop.StructureDB.RemoveCoordinates">RemoveCoordinates() (promod3.loop.StructureDB method)</a>
+  </dt>
+
+      
   <dt><a href="modelling/pipeline.html#promod3.modelling.RemoveTerminalGaps">RemoveTerminalGaps() (in module promod3.modelling)</a>
   </dt>
 
@@ -2814,12 +2898,12 @@
   </dt>
 
       
-  <dt><a href="modelling/monte_carlo.html#promod3.modelling.ExponentialCooler.Reset">Reset() (promod3.modelling.ExponentialCooler method)</a>
+  <dt><a href="core/graph_minimizer.html#promod3.core.GraphMinimizer.Reset">Reset() (promod3.core.GraphMinimizer method)</a>
   </dt>
 
       <dd><dl>
         
-  <dt><a href="sidechain/graph.html#promod3.sidechain.RotamerGraph.Reset">(promod3.sidechain.RotamerGraph method)</a>
+  <dt><a href="modelling/monte_carlo.html#promod3.modelling.ExponentialCooler.Reset">(promod3.modelling.ExponentialCooler method)</a>
   </dt>
 
       </dl></dd>
@@ -2835,12 +2919,12 @@
   <dt><a href="modelling/algorithms.html#promod3.modelling.RigidBlocks">RigidBlocks() (in module promod3.modelling)</a>, <a href="modelling/algorithms.html#promod3.modelling.RigidBlocks">[1]</a>, <a href="modelling/algorithms.html#promod3.modelling.RigidBlocks">[2]</a>
   </dt>
 
+  </dl></td>
+  <td style="width: 33%" valign="top"><dl>
       
   <dt><a href="loop/backbone.html#promod3.loop.BackboneList.RMSD">RMSD() (promod3.loop.BackboneList method)</a>
   </dt>
 
-  </dl></td>
-  <td style="width: 33%" valign="top"><dl>
       
   <dt><a href="modelling/sidechain_reconstruction.html#promod3.modelling.SidechainReconstructionData.rotamer_res_indices">rotamer_res_indices (promod3.modelling.SidechainReconstructionData attribute)</a>
   </dt>
@@ -3070,6 +3154,14 @@
   </dt>
 
       
+  <dt><a href="scoring/other_scoring_functions.html#promod3.scoring.SCWRL3DisulfidScore">SCWRL3DisulfidScore() (in module promod3.scoring)</a>
+  </dt>
+
+      
+  <dt><a href="scoring/other_scoring_functions.html#promod3.scoring.SCWRL3PairwiseScore">SCWRL3PairwiseScore() (in module promod3.scoring)</a>
+  </dt>
+
+      
   <dt><a href="sidechain/rotamer_constructor.html#promod3.sidechain.SCWRLRotamerConstructor">SCWRLRotamerConstructor (class in promod3.sidechain)</a>
   </dt>
 
@@ -3272,10 +3364,6 @@
   </dt>
 
       
-  <dt><a href="scoring/backbone_score_env.html#promod3.scoring.BackboneScoreEnv.SetMap">SetMap() (promod3.scoring.BackboneScoreEnv method)</a>
-  </dt>
-
-      
   <dt><a href="loop/mm_system_creation.html#promod3.loop.ForcefieldLookup.SetMasses">SetMasses() (promod3.loop.ForcefieldLookup method)</a>
   </dt>
 
@@ -3291,8 +3379,6 @@
   <dt><a href="loop/backbone.html#promod3.loop.BackboneList.SetO">SetO() (promod3.loop.BackboneList method)</a>
   </dt>
 
-  </dl></td>
-  <td style="width: 33%" valign="top"><dl>
       
   <dt><a href="loop/backbone.html#promod3.loop.BackboneList.SetOLC">SetOLC() (promod3.loop.BackboneList method)</a>
   </dt>
@@ -3301,6 +3387,8 @@
   <dt><a href="loop/mm_system_creation.html#promod3.loop.ForcefieldLookup.SetPeptideBoundConnectivity">SetPeptideBoundConnectivity() (promod3.loop.ForcefieldLookup method)</a>
   </dt>
 
+  </dl></td>
+  <td style="width: 33%" valign="top"><dl>
       
   <dt><a href="sidechain/rotamer.html#promod3.sidechain.Particle.SetPolarDirection">SetPolarDirection() (promod3.sidechain.Particle method)</a>
   </dt>
@@ -3384,6 +3472,10 @@
   </dt>
 
       
+  <dt><a href="loop/structure_db.html#promod3.loop.CoordInfo.shift">shift (promod3.loop.CoordInfo attribute)</a>
+  </dt>
+
+      
   <dt><a href="modelling/gap_handling.html#promod3.modelling.StructuralGap.ShiftCTerminal">ShiftCTerminal() (promod3.modelling.StructuralGap method)</a>
   </dt>
 
@@ -3448,10 +3540,18 @@
   </dt>
 
       
+  <dt><a href="loop/structure_db.html#promod3.loop.CoordInfo.start_resnum">start_resnum (promod3.loop.CoordInfo attribute)</a>
+  </dt>
+
+      
   <dt><a href="core/runtime_profiling.html#promod3.core.StaticRuntimeProfiler.StartScoped">StartScoped() (promod3.core.StaticRuntimeProfiler static method)</a>
   </dt>
 
       
+  <dt><a href="scoring/backbone_score_env.html#promod3.scoring.BackboneScoreEnv.Stash">Stash() (promod3.scoring.BackboneScoreEnv method)</a>
+  </dt>
+
+      
   <dt><a href="core/runtime_profiling.html#promod3.core.StaticRuntimeProfiler">StaticRuntimeProfiler (class in promod3.core)</a>
   </dt>
 
@@ -3480,6 +3580,10 @@
   </dt>
 
       
+  <dt><a href="loop/structure_db.html#promod3.loop.StructureDBDataType">StructureDBDataType (class in promod3.loop)</a>
+  </dt>
+
+      
   <dt><a href="sidechain/subrotamer_optimizer.html#promod3.sidechain.SubrotamerOptimizer">SubrotamerOptimizer() (in module promod3.sidechain)</a>
   </dt>
 
@@ -3548,7 +3652,7 @@
   </dt>
 
       
-  <dt><a href="sidechain/graph.html#promod3.sidechain.RotamerGraph.TreeSolve">TreeSolve() (promod3.sidechain.RotamerGraph method)</a>
+  <dt><a href="core/graph_minimizer.html#promod3.core.GraphMinimizer.TreeSolve">TreeSolve() (promod3.core.GraphMinimizer method)</a>
   </dt>
 
   </dl></td>
@@ -3571,18 +3675,10 @@
   </dt>
 
       </dl></dd>
-      
-  <dt><a href="loop/mm_system_creation.html#promod3.loop.ForcefieldConnectivity.urey_bradley_angles">urey_bradley_angles (promod3.loop.ForcefieldConnectivity attribute)</a>
-  </dt>
-
   </dl></td>
   <td style="width: 33%" valign="top"><dl>
       
-  <dt><a href="scoring/backbone_scorers.html#promod3.scoring.CBPackingScorer.UseClassicMode">UseClassicMode() (promod3.scoring.CBPackingScorer method)</a>
-  </dt>
-
-      
-  <dt><a href="scoring/backbone_scorers.html#promod3.scoring.CBPackingScorer.UseIncludeEnvMode">UseIncludeEnvMode() (promod3.scoring.CBPackingScorer method)</a>
+  <dt><a href="loop/mm_system_creation.html#promod3.loop.ForcefieldConnectivity.urey_bradley_angles">urey_bradley_angles (promod3.loop.ForcefieldConnectivity attribute)</a>
   </dt>
 
   </dl></td>
@@ -3612,9 +3708,6 @@
       <input type="hidden" name="check_keywords" value="yes" />
       <input type="hidden" name="area" value="default" />
     </form>
-    <p class="searchtip" style="font-size: 90%">
-    Enter search terms or a module, class or function name.
-    </p>
 </div>
 <script type="text/javascript">$('#searchbox').show(0);</script>
         </div>
@@ -3622,11 +3715,11 @@
       <div class="clearer"></div>
     </div>
     <div class="footer">
-      &copy;2017, ProMod3 authors.
+      &copy;2018, ProMod3 authors.
       
       |
-      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a>
-      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.6</a>
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.4.1</a>
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
       
     </div>
 
diff --git a/doc/html/gettingstarted.html b/doc/html/gettingstarted.html
index 58aa46d167e2e9cdf9ec4730f9396b637b60f214..f984958d7fd43ff0e604a8031e37bb8b44e74eec 100644
--- a/doc/html/gettingstarted.html
+++ b/doc/html/gettingstarted.html
@@ -6,7 +6,7 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
-    <title>Getting Started &mdash; ProMod3 1.1.0 documentation</title>
+    <title>Getting Started &mdash; ProMod3 1.2.0 documentation</title>
     
     <link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
     <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
@@ -14,7 +14,7 @@
     <script type="text/javascript">
       var DOCUMENTATION_OPTIONS = {
         URL_ROOT:    './',
-        VERSION:     '1.1.0',
+        VERSION:     '1.2.0',
         COLLAPSE_INDEX: false,
         FILE_SUFFIX: '.html',
         HAS_SOURCE:  true
@@ -23,16 +23,18 @@
     <script type="text/javascript" src="_static/jquery.js"></script>
     <script type="text/javascript" src="_static/underscore.js"></script>
     <script type="text/javascript" src="_static/doctools.js"></script>
-    <link rel="top" title="ProMod3 1.1.0 documentation" href="index.html" />
+    <link rel="top" title="ProMod3 1.2.0 documentation" href="index.html" />
     <link rel="up" title="Documentation For Users" href="users.html" />
     <link rel="next" title="ProMod3 Actions" href="actions/index.html" />
     <link rel="prev" title="Documentation For Users" href="users.html" />
    
+  <link rel="stylesheet" href="_static/custom.css" type="text/css" />
   
-  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
 
   </head>
-  <body role="document">  
+  <body role="document">
+  
 
     <div class="document">
       <div class="documentwrapper">
@@ -46,27 +48,27 @@
 <p>First steps to get ProMod3 up and running:</p>
 <ol class="arabic simple">
 <li>Obtain all dependencies and compile ProMod3 with <code class="docutils literal"><span class="pre">cmake</span></code> and <code class="docutils literal"><span class="pre">make</span></code>
-(see <a class="reference internal" href="buildsystem.html#building-promod"><span>here</span></a>).</li>
+(see <a class="reference internal" href="buildsystem.html#building-promod"><span class="std std-ref">here</span></a>).</li>
 <li>Ensure that you have a <code class="docutils literal"><span class="pre">stage/bin</span></code> folder which includes a <code class="docutils literal"><span class="pre">pm</span></code> executable.
 For convenience, add the folder to your <code class="docutils literal"><span class="pre">PATH</span></code> env. variable.</li>
 <li>You can now execute ProMod3 by running the following in your terminal:</li>
 </ol>
 <blockquote>
-<div><div class="highlight-console"><div class="highlight"><pre><span class="gp">$</span> pm &lt;COMMAND&gt;
+<div><div class="highlight-console"><div class="highlight"><pre><span></span><span class="gp">$</span> pm &lt;COMMAND&gt;
 </pre></div>
 </div>
 <p>Here <code class="docutils literal"><span class="pre">&lt;COMMAND&gt;</span></code> can be:</p>
 <ul>
-<li><p class="first">a predefined &#8220;action&#8221; (see <a class="reference internal" href="actions/index.html#promod-actions"><span>here</span></a>)</p>
+<li><p class="first">a predefined &#8220;action&#8221; (see <a class="reference internal" href="actions/index.html#promod-actions"><span class="std std-ref">here</span></a>)</p>
 </li>
 <li><p class="first">the path to a python script, such as the following example:</p>
-<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">ost</span> <span class="kn">import</span> <span class="n">io</span>
-<span class="kn">from</span> <span class="nn">promod3</span> <span class="kn">import</span> <span class="n">loop</span>
+<div class="highlight-default"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">ost</span> <span class="k">import</span> <span class="n">io</span>
+<span class="kn">from</span> <span class="nn">promod3</span> <span class="k">import</span> <span class="n">loop</span>
 
-<span class="c"># generate backbone with dihedrals of a helix and store it</span>
-<span class="n">sequence</span> <span class="o">=</span> <span class="s">&quot;HELLYEAH&quot;</span>
+<span class="c1"># generate backbone with dihedrals of a helix and store it</span>
+<span class="n">sequence</span> <span class="o">=</span> <span class="s2">&quot;HELLYEAH&quot;</span>
 <span class="n">bb_list</span> <span class="o">=</span> <span class="n">loop</span><span class="o">.</span><span class="n">BackboneList</span><span class="p">(</span><span class="n">sequence</span><span class="p">)</span>
-<span class="n">io</span><span class="o">.</span><span class="n">SavePDB</span><span class="p">(</span><span class="n">bb_list</span><span class="o">.</span><span class="n">ToEntity</span><span class="p">(),</span> <span class="s">&quot;test.pdb&quot;</span><span class="p">)</span>
+<span class="n">io</span><span class="o">.</span><span class="n">SavePDB</span><span class="p">(</span><span class="n">bb_list</span><span class="o">.</span><span class="n">ToEntity</span><span class="p">(),</span> <span class="s2">&quot;test.pdb&quot;</span><span class="p">)</span>
 </pre></div>
 </div>
 <p>The execution of this script should generate a <code class="docutils literal"><span class="pre">test.pdb</span></code> file, which you
@@ -86,7 +88,7 @@ is conserved</li>
 <li>Perform loop modelling to close all gaps (see <a class="reference internal" href="loop/index.html#module-promod3.loop" title="promod3.loop: Loop Handling"><code class="xref py py-mod docutils literal"><span class="pre">loop</span></code></a> module)</li>
 <li>Reconstruct sidechains (using <a class="reference internal" href="sidechain/index.html#module-promod3.sidechain" title="promod3.sidechain: Sidechain Modelling"><code class="xref py py-mod docutils literal"><span class="pre">sidechain</span></code></a> module)</li>
 <li>Minimize energy of final model using molecular mechanics
-(using <code class="xref py py-mod docutils literal"><span class="pre">ost.mol.mm</span></code> from OST)</li>
+(using <a class="reference external" href="https://www.openstructure.org/docs/dev/mol/mm/molmm/#module-ost.mol.mm" title="(in OpenStructure v1.7.1)"><code class="xref py py-mod docutils literal"><span class="pre">ost.mol.mm</span></code></a> from OST)</li>
 </ul>
 <p>Since a good amount of time is spent in OpenMM routines to minimize energy, we
 try to use the fast and multi-threaded &#8220;CPU&#8221; platform of OpenMM (should be
@@ -138,9 +140,6 @@ not set, 1 thread will be used by default.</p>
       <input type="hidden" name="check_keywords" value="yes" />
       <input type="hidden" name="area" value="default" />
     </form>
-    <p class="searchtip" style="font-size: 90%">
-    Enter search terms or a module, class or function name.
-    </p>
 </div>
 <script type="text/javascript">$('#searchbox').show(0);</script>
         </div>
@@ -148,11 +147,11 @@ not set, 1 thread will be used by default.</p>
       <div class="clearer"></div>
     </div>
     <div class="footer">
-      &copy;2017, ProMod3 authors.
+      &copy;2018, ProMod3 authors.
       
       |
-      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a>
-      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.6</a>
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.4.1</a>
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
       
       |
       <a href="_sources/gettingstarted.txt"
diff --git a/doc/html/index.html b/doc/html/index.html
index 99a24e3a4490f694d3d4e4ddca49fb7b85a122c8..9a9a20281972b758a64c9e1976765ce31fd410cc 100644
--- a/doc/html/index.html
+++ b/doc/html/index.html
@@ -6,7 +6,7 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
-    <title>Welcome To ProMod3’s Documentation! &mdash; ProMod3 1.1.0 documentation</title>
+    <title>Welcome To ProMod3’s Documentation! &mdash; ProMod3 1.2.0 documentation</title>
     
     <link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
     <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
@@ -14,7 +14,7 @@
     <script type="text/javascript">
       var DOCUMENTATION_OPTIONS = {
         URL_ROOT:    './',
-        VERSION:     '1.1.0',
+        VERSION:     '1.2.0',
         COLLAPSE_INDEX: false,
         FILE_SUFFIX: '.html',
         HAS_SOURCE:  true
@@ -23,14 +23,16 @@
     <script type="text/javascript" src="_static/jquery.js"></script>
     <script type="text/javascript" src="_static/underscore.js"></script>
     <script type="text/javascript" src="_static/doctools.js"></script>
-    <link rel="top" title="ProMod3 1.1.0 documentation" href="#" />
+    <link rel="top" title="ProMod3 1.2.0 documentation" href="#" />
     <link rel="next" title="Documentation For Users" href="users.html" />
    
+  <link rel="stylesheet" href="_static/custom.css" type="text/css" />
   
-  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
 
   </head>
-  <body role="document">  
+  <body role="document">
+  
 
     <div class="document">
       <div class="documentwrapper">
@@ -73,9 +75,9 @@
 <div class="section" id="indices-and-tables">
 <h1>Indices And Tables<a class="headerlink" href="#indices-and-tables" title="Permalink to this headline">¶</a></h1>
 <ul class="simple">
-<li><a class="reference internal" href="genindex.html"><span>Index</span></a></li>
-<li><a class="reference internal" href="py-modindex.html"><span>Module Index</span></a></li>
-<li><a class="reference internal" href="search.html"><span>Search Page</span></a></li>
+<li><a class="reference internal" href="genindex.html"><span class="std std-ref">Index</span></a></li>
+<li><a class="reference internal" href="py-modindex.html"><span class="std std-ref">Module Index</span></a></li>
+<li><a class="reference internal" href="search.html"><span class="std std-ref">Search Page</span></a></li>
 </ul>
 </div>
 
@@ -115,9 +117,6 @@
       <input type="hidden" name="check_keywords" value="yes" />
       <input type="hidden" name="area" value="default" />
     </form>
-    <p class="searchtip" style="font-size: 90%">
-    Enter search terms or a module, class or function name.
-    </p>
 </div>
 <script type="text/javascript">$('#searchbox').show(0);</script>
         </div>
@@ -125,11 +124,11 @@
       <div class="clearer"></div>
     </div>
     <div class="footer">
-      &copy;2017, ProMod3 authors.
+      &copy;2018, ProMod3 authors.
       
       |
-      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a>
-      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.6</a>
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.4.1</a>
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
       
       |
       <a href="_sources/index.txt"
diff --git a/doc/html/loop/all_atom.html b/doc/html/loop/all_atom.html
index 88e7357757fc1066ae4c7d8287ae90582124e50b..df65f9c542ab9108208ba0e8740ebb02e80413e0 100644
--- a/doc/html/loop/all_atom.html
+++ b/doc/html/loop/all_atom.html
@@ -6,7 +6,7 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
-    <title>Handling All Atom Positions &mdash; ProMod3 1.1.0 documentation</title>
+    <title>Handling All Atom Positions &mdash; ProMod3 1.2.0 documentation</title>
     
     <link rel="stylesheet" href="../_static/alabaster.css" type="text/css" />
     <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
@@ -14,7 +14,7 @@
     <script type="text/javascript">
       var DOCUMENTATION_OPTIONS = {
         URL_ROOT:    '../',
-        VERSION:     '1.1.0',
+        VERSION:     '1.2.0',
         COLLAPSE_INDEX: false,
         FILE_SUFFIX: '.html',
         HAS_SOURCE:  true
@@ -23,16 +23,18 @@
     <script type="text/javascript" src="../_static/jquery.js"></script>
     <script type="text/javascript" src="../_static/underscore.js"></script>
     <script type="text/javascript" src="../_static/doctools.js"></script>
-    <link rel="top" title="ProMod3 1.1.0 documentation" href="../index.html" />
+    <link rel="top" title="ProMod3 1.2.0 documentation" href="../index.html" />
     <link rel="up" title="loop - Loop Handling" href="index.html" />
     <link rel="next" title="Generate ost.mol.mm systems" href="mm_system_creation.html" />
     <link rel="prev" title="Structural Data" href="structure_db.html" />
    
+  <link rel="stylesheet" href="../_static/custom.css" type="text/css" />
   
-  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
 
   </head>
-  <body role="document">  
+  <body role="document">
+  
 
     <div class="document">
       <div class="documentwrapper">
@@ -46,32 +48,32 @@
 positions of all their heavy atoms and an environment (<a class="reference internal" href="#promod3.loop.AllAtomEnv" title="promod3.loop.AllAtomEnv"><code class="xref py py-class docutils literal"><span class="pre">AllAtomEnv</span></code></a>) to
 handle changes during loop modelling.</p>
 <p>The example below showcases some operations on the two classes:</p>
-<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">ost</span> <span class="kn">import</span> <span class="n">io</span><span class="p">,</span> <span class="n">geom</span>
-<span class="kn">from</span> <span class="nn">promod3</span> <span class="kn">import</span> <span class="n">loop</span>
+<div class="highlight-default"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">ost</span> <span class="k">import</span> <span class="n">io</span><span class="p">,</span> <span class="n">geom</span>
+<span class="kn">from</span> <span class="nn">promod3</span> <span class="k">import</span> <span class="n">loop</span>
 
-<span class="c"># load example (has res. numbering starting at 1)</span>
-<span class="n">ent</span> <span class="o">=</span> <span class="n">io</span><span class="o">.</span><span class="n">LoadPDB</span><span class="p">(</span><span class="s">&quot;data/1CRN.pdb&quot;</span><span class="p">)</span>
+<span class="c1"># load example (has res. numbering starting at 1)</span>
+<span class="n">ent</span> <span class="o">=</span> <span class="n">io</span><span class="o">.</span><span class="n">LoadPDB</span><span class="p">(</span><span class="s2">&quot;data/1CRN.pdb&quot;</span><span class="p">)</span>
 <span class="n">res_list</span> <span class="o">=</span> <span class="n">ent</span><span class="o">.</span><span class="n">residues</span>
-<span class="n">seqres_str</span> <span class="o">=</span> <span class="s">&#39;&#39;</span><span class="o">.</span><span class="n">join</span><span class="p">([</span><span class="n">r</span><span class="o">.</span><span class="n">one_letter_code</span> <span class="k">for</span> <span class="n">r</span> <span class="ow">in</span> <span class="n">res_list</span><span class="p">])</span>
+<span class="n">seqres_str</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="o">.</span><span class="n">join</span><span class="p">([</span><span class="n">r</span><span class="o">.</span><span class="n">one_letter_code</span> <span class="k">for</span> <span class="n">r</span> <span class="ow">in</span> <span class="n">res_list</span><span class="p">])</span>
 
-<span class="c"># initialize an environment</span>
+<span class="c1"># initialize an environment</span>
 <span class="n">env</span> <span class="o">=</span> <span class="n">loop</span><span class="o">.</span><span class="n">AllAtomEnv</span><span class="p">(</span><span class="n">seqres_str</span><span class="p">)</span>
 <span class="n">env</span><span class="o">.</span><span class="n">SetInitialEnvironment</span><span class="p">(</span><span class="n">ent</span><span class="p">)</span>
 
-<span class="c"># get all atom position for part of it</span>
+<span class="c1"># get all atom position for part of it</span>
 <span class="n">all_atoms</span> <span class="o">=</span> <span class="n">loop</span><span class="o">.</span><span class="n">AllAtomPositions</span><span class="p">(</span><span class="n">res_list</span><span class="p">[</span><span class="mi">35</span><span class="p">:</span><span class="mi">44</span><span class="p">])</span>
-<span class="c"># change pos. at res. index 1 (= res. number 37)</span>
-<span class="n">idx_ca_res_37</span> <span class="o">=</span> <span class="n">all_atoms</span><span class="o">.</span><span class="n">GetIndex</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="s">&quot;CA&quot;</span><span class="p">)</span>
+<span class="c1"># change pos. at res. index 1 (= res. number 37)</span>
+<span class="n">idx_ca_res_37</span> <span class="o">=</span> <span class="n">all_atoms</span><span class="o">.</span><span class="n">GetIndex</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="s2">&quot;CA&quot;</span><span class="p">)</span>
 <span class="n">new_pos</span> <span class="o">=</span> <span class="n">all_atoms</span><span class="o">.</span><span class="n">GetPos</span><span class="p">(</span><span class="n">idx_ca_res_37</span><span class="p">)</span> <span class="o">+</span> <span class="n">geom</span><span class="o">.</span><span class="n">Vec3</span><span class="p">(</span><span class="mf">0.2</span><span class="p">,</span> <span class="mf">0.2</span><span class="p">,</span> <span class="mf">0.2</span><span class="p">)</span>
 <span class="n">all_atoms</span><span class="o">.</span><span class="n">SetPos</span><span class="p">(</span><span class="n">idx_ca_res_37</span><span class="p">,</span> <span class="n">new_pos</span><span class="p">)</span>
-<span class="c"># insert into ent and store updated entity</span>
+<span class="c1"># insert into ent and store updated entity</span>
 <span class="n">all_atoms</span><span class="o">.</span><span class="n">InsertInto</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="n">ent</span><span class="o">.</span><span class="n">chains</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="mi">37</span><span class="p">)</span>
-<span class="n">io</span><span class="o">.</span><span class="n">SavePDB</span><span class="p">(</span><span class="n">ent</span><span class="p">,</span> <span class="s">&quot;all_atom_pos.pdb&quot;</span><span class="p">)</span>
+<span class="n">io</span><span class="o">.</span><span class="n">SavePDB</span><span class="p">(</span><span class="n">ent</span><span class="p">,</span> <span class="s2">&quot;all_atom_pos.pdb&quot;</span><span class="p">)</span>
 
-<span class="c"># update environment with new positions</span>
+<span class="c1"># update environment with new positions</span>
 <span class="n">env</span><span class="o">.</span><span class="n">SetEnvironment</span><span class="p">(</span><span class="n">all_atoms</span><span class="p">,</span> <span class="mi">36</span><span class="p">)</span>
-<span class="c"># store all positions of environment</span>
-<span class="n">io</span><span class="o">.</span><span class="n">SavePDB</span><span class="p">(</span><span class="n">env</span><span class="o">.</span><span class="n">GetAllAtomPositions</span><span class="p">()</span><span class="o">.</span><span class="n">ToEntity</span><span class="p">(),</span> <span class="s">&quot;all_atom_env.pdb&quot;</span><span class="p">)</span>
+<span class="c1"># store all positions of environment</span>
+<span class="n">io</span><span class="o">.</span><span class="n">SavePDB</span><span class="p">(</span><span class="n">env</span><span class="o">.</span><span class="n">GetAllAtomPositions</span><span class="p">()</span><span class="o">.</span><span class="n">ToEntity</span><span class="p">(),</span> <span class="s2">&quot;all_atom_env.pdb&quot;</span><span class="p">)</span>
 </pre></div>
 </div>
 <div class="section" id="the-allatomenv-class">
@@ -88,8 +90,8 @@ new loop is being added.</p>
 <col class="field-name" />
 <col class="field-body" />
 <tbody valign="top">
-<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>seqres</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#str" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">str</span></code></a> / <a class="reference external" href="http://www.openstructure.org/docs/dev/seq/base/seq/#ost.seq.SequenceHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.seq.SequenceHandle</span></code></a> /
-<code class="xref py py-class docutils literal"><span class="pre">list</span></code> of <a class="reference external" href="https://docs.python.org/2.7/library/functions.html#str" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">str</span></code></a> / <a class="reference external" href="http://www.openstructure.org/docs/dev/seq/base/seq/#ost.seq.SequenceList" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.seq.SequenceList</span></code></a>) &#8211; Internal SEQRES to be set (single chain or list with one per
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>seqres</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#str" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">str</span></code></a> / <a class="reference external" href="https://www.openstructure.org/docs/dev/seq/base/seq/#ost.seq.SequenceHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.seq.SequenceHandle</span></code></a> /
+<code class="xref py py-class docutils literal"><span class="pre">list</span></code> of <a class="reference external" href="https://docs.python.org/2.7/library/functions.html#str" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">str</span></code></a> / <a class="reference external" href="https://www.openstructure.org/docs/dev/seq/base/seq/#ost.seq.SequenceList" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.seq.SequenceList</span></code></a>) &#8211; Internal SEQRES to be set (single chain or list with one per
 chain). Whenever setting structural data, consistency with this SEQRES is enforced.</td>
 </tr>
 </tbody>
@@ -111,7 +113,7 @@ concatenated one after each other (indexing starts at 0)</li>
 <col class="field-name" />
 <col class="field-body" />
 <tbody valign="top">
-<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>env_structure</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.EntityHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.EntityHandle</span></code></a>) &#8211; Structral data to be set as environment. The chains
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>env_structure</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.EntityHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.EntityHandle</span></code></a>) &#8211; Structral data to be set as environment. The chains
 in <em>env_structure</em> are expected to be in the same
 order as the SEQRES items provided in constructor.</td>
 </tr>
@@ -141,7 +143,7 @@ means, that positions in the env. may be reset, newly set or cleared.</p>
 <li><strong>new_env_pos</strong> (<a class="reference internal" href="#promod3.loop.AllAtomEnvPositions" title="promod3.loop.AllAtomEnvPositions"><code class="xref py py-class docutils literal"><span class="pre">AllAtomEnvPositions</span></code></a>) &#8211; Structural data to be set as environment.</li>
 <li><strong>new_pos</strong> (<a class="reference internal" href="#promod3.loop.AllAtomPositions" title="promod3.loop.AllAtomPositions"><code class="xref py py-class docutils literal"><span class="pre">AllAtomPositions</span></code></a>) &#8211; Structural data to be set as environment.</li>
 <li><strong>bb_list</strong> (<a class="reference internal" href="backbone.html#promod3.loop.BackboneList" title="promod3.loop.BackboneList"><code class="xref py py-class docutils literal"><span class="pre">BackboneList</span></code></a>) &#8211; Backbone data to be set as environment.</li>
-<li><strong>start_resnum</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a> / <a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResNum" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResNum</span></code></a>) &#8211; Res. number defining the start position in the SEQRES.</li>
+<li><strong>start_resnum</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a> / <a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResNum" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResNum</span></code></a>) &#8211; Res. number defining the start position in the SEQRES.</li>
 <li><strong>chain_idx</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Index of chain the structural data belongs to.</li>
 </ul>
 </td>
@@ -218,7 +220,7 @@ a loop to reset later with <a class="reference internal" href="#promod3.loop.All
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">SEQRES that was set in constructor (one sequence per chain).</td>
 </tr>
-<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="http://www.openstructure.org/docs/dev/seq/base/seq/#ost.seq.SequenceList" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.seq.SequenceList</span></code></a></td>
+<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="https://www.openstructure.org/docs/dev/seq/base/seq/#ost.seq.SequenceList" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.seq.SequenceList</span></code></a></td>
 </tr>
 </tbody>
 </table>
@@ -352,7 +354,7 @@ and if found set the corresponding position, otherwise we unset it.</p>
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
 <li><strong>res_index</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Residue index</li>
-<li><strong>res</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; Residue providing atoms</li>
+<li><strong>res</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; Residue providing atoms</li>
 </ul>
 </td>
 </tr>
@@ -398,7 +400,7 @@ out of bounds or if residues in the two containers are inconsistent
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
 <li><strong>index</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Set position at that index.</li>
-<li><strong>pos</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.geom.Vec3</span></code></a>) &#8211; Set position to <em>pos</em>.</li>
+<li><strong>pos</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.geom.Vec3</span></code></a>) &#8211; Set position to <em>pos</em>.</li>
 </ul>
 </td>
 </tr>
@@ -448,7 +450,7 @@ out of bounds or if residues in the two containers are inconsistent
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">Position at given index.</td>
 </tr>
-<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="http://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.geom.Vec3</span></code></a></td>
+<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="https://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.geom.Vec3</span></code></a></td>
 </tr>
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>index</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Atom position index.</td>
 </tr>
@@ -552,7 +554,7 @@ if <em>atom_name</em> is not one of that residue&#8217;s heavy atoms.</p>
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">Amino acid type of residue at index <em>res_index</em>.</td>
 </tr>
-<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="http://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.AminoAcid</span></code></a></td>
+<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="https://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.AminoAcid</span></code></a></td>
 </tr>
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>res_index</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Residue index</td>
 </tr>
@@ -831,9 +833,9 @@ atom (N, CA, C, O).</p>
 <col class="field-body" />
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">All residues packed in a single chain as an OST entity.
-Connectivity resolved with <code class="xref py py-class docutils literal"><span class="pre">ost.conop.HeuristicProcessor</span></code>.</td>
+Connectivity resolved with <a class="reference external" href="https://www.openstructure.org/docs/dev/conop/connectivity/#ost.conop.HeuristicProcessor" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.HeuristicProcessor</span></code></a>.</td>
 </tr>
-<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.EntityHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.EntityHandle</span></code></a></td>
+<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.EntityHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.EntityHandle</span></code></a></td>
 </tr>
 </tbody>
 </table>
@@ -853,8 +855,8 @@ function efficient, we require the backbone atoms (N, C, CA) to be set.</p>
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
 <li><strong>res_index</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Residue index</li>
-<li><strong>chain</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ChainHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ChainHandle</span></code></a>) &#8211; Chain into which we insert</li>
-<li><strong>start_resnum</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a> / <a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResNum" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResNum</span></code></a>) &#8211; Residue number for the inserted residue</li>
+<li><strong>chain</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ChainHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ChainHandle</span></code></a>) &#8211; Chain into which we insert</li>
+<li><strong>start_resnum</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a> / <a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResNum" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResNum</span></code></a>) &#8211; Residue number for the inserted residue</li>
 </ul>
 </td>
 </tr>
@@ -947,7 +949,7 @@ integer in the range [0, <em>XXX_NUM_HYDROGENS</em>-1].</p>
 <dt id="promod3.loop.AminoAcidLookup">
 <em class="property">class </em><code class="descclassname">promod3.loop.</code><code class="descname">AminoAcidLookup</code><a class="headerlink" href="#promod3.loop.AminoAcidLookup" title="Permalink to this definition">¶</a></dt>
 <dd><p>Collection of static methods to lookup properties of amino acid types
-(<a class="reference external" href="http://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.AminoAcid</span></code></a>), heavy atom types (<a class="reference internal" href="#promod3.loop.AminoAcidAtom" title="promod3.loop.AminoAcidAtom"><code class="xref py py-class docutils literal"><span class="pre">AminoAcidAtom</span></code></a>) and
+(<a class="reference external" href="https://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.AminoAcid</span></code></a>), heavy atom types (<a class="reference internal" href="#promod3.loop.AminoAcidAtom" title="promod3.loop.AminoAcidAtom"><code class="xref py py-class docutils literal"><span class="pre">AminoAcidAtom</span></code></a>) and
 hydrogen types (<a class="reference internal" href="#promod3.loop.AminoAcidHydrogen" title="promod3.loop.AminoAcidHydrogen"><code class="xref py py-class docutils literal"><span class="pre">AminoAcidHydrogen</span></code></a>).</p>
 <dl class="staticmethod">
 <dt id="promod3.loop.AminoAcidLookup.GetOLC">
@@ -960,7 +962,7 @@ hydrogen types (<a class="reference internal" href="#promod3.loop.AminoAcidHydro
 </tr>
 <tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/2.7/library/functions.html#str" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">str</span></code></a></td>
 </tr>
-<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>aa</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">AminoAcid</span></code></a>) &#8211; Amino acid type</td>
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>aa</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">AminoAcid</span></code></a>) &#8211; Amino acid type</td>
 </tr>
 </tbody>
 </table>
@@ -982,7 +984,7 @@ hydrogen types (<a class="reference internal" href="#promod3.loop.AminoAcidHydro
 </td>
 </tr>
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
-<li><strong>aa</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">AminoAcid</span></code></a>) &#8211; Amino acid type</li>
+<li><strong>aa</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">AminoAcid</span></code></a>) &#8211; Amino acid type</li>
 <li><strong>atom_idx</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Atom index (in [0, GetNumAtoms(aa)-1])</li>
 <li><strong>atom_name</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#str" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">str</span></code></a>) &#8211; Atom name</li>
 </ul>
@@ -1012,7 +1014,7 @@ hydrogen types (<a class="reference internal" href="#promod3.loop.AminoAcidHydro
 </td>
 </tr>
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
-<li><strong>aa</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">AminoAcid</span></code></a>) &#8211; Amino acid type</li>
+<li><strong>aa</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">AminoAcid</span></code></a>) &#8211; Amino acid type</li>
 <li><strong>atom_idx</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Atom index (in [0, GetNumHydrogens(aa)-1])</li>
 <li><strong>atom_name</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#str" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">str</span></code></a>) &#8211; Atom name</li>
 </ul>
@@ -1041,7 +1043,7 @@ atom.</p>
 </td>
 </tr>
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
-<li><strong>aa</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">AminoAcid</span></code></a>) &#8211; Amino acid type</li>
+<li><strong>aa</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">AminoAcid</span></code></a>) &#8211; Amino acid type</li>
 <li><strong>atom_name</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#str" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">str</span></code></a>) &#8211; Atom name</li>
 </ul>
 </td>
@@ -1069,7 +1071,7 @@ and atom.</p>
 </td>
 </tr>
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
-<li><strong>aa</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">AminoAcid</span></code></a>) &#8211; Amino acid type</li>
+<li><strong>aa</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">AminoAcid</span></code></a>) &#8211; Amino acid type</li>
 <li><strong>atom_name</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#str" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">str</span></code></a>) &#8211; Atom name</li>
 </ul>
 </td>
@@ -1093,7 +1095,7 @@ hydrogens of <em>aa</em>.</p>
 </tr>
 <tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a></td>
 </tr>
-<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>aa</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">AminoAcid</span></code></a>) &#8211; Amino acid type</td>
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>aa</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">AminoAcid</span></code></a>) &#8211; Amino acid type</td>
 </tr>
 </tbody>
 </table>
@@ -1125,7 +1127,7 @@ hydrogens of <em>aa</em>.</p>
 </tr>
 <tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a></td>
 </tr>
-<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>aa</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">AminoAcid</span></code></a>) &#8211; Amino acid type</td>
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>aa</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">AminoAcid</span></code></a>) &#8211; Amino acid type</td>
 </tr>
 </tbody>
 </table>
@@ -1158,7 +1160,7 @@ hydrogens of <em>aa</em>.</p>
 <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Amino acid type of the given heavy atom type</p>
 </td>
 </tr>
-<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><p class="first"><a class="reference external" href="http://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">AminoAcid</span></code></a></p>
+<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><p class="first"><a class="reference external" href="https://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">AminoAcid</span></code></a></p>
 </td>
 </tr>
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
@@ -1252,7 +1254,7 @@ when residue is peptide bound.</td>
 </tr>
 <tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a></td>
 </tr>
-<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>aa</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">AminoAcid</span></code></a>) &#8211; Amino acid type</td>
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>aa</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">AminoAcid</span></code></a>) &#8211; Amino acid type</td>
 </tr>
 <tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/2.7/library/exceptions.html#exceptions.RuntimeError" title="(in Python v2.7)"><code class="xref py py-exc docutils literal"><span class="pre">RuntimeError</span></code></a> if no such atom (i.e. PRO)</td>
 </tr>
@@ -1276,7 +1278,7 @@ when residue is N terminal.</td>
 </tr>
 <tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a></td>
 </tr>
-<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>aa</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">AminoAcid</span></code></a>) &#8211; Amino acid type</td>
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>aa</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">AminoAcid</span></code></a>) &#8211; Amino acid type</td>
 </tr>
 <tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/2.7/library/exceptions.html#exceptions.RuntimeError" title="(in Python v2.7)"><code class="xref py py-exc docutils literal"><span class="pre">RuntimeError</span></code></a> if no such atom (i.e. H3 for PRO)</td>
 </tr>
@@ -1333,9 +1335,6 @@ when residue is N terminal.</td>
       <input type="hidden" name="check_keywords" value="yes" />
       <input type="hidden" name="area" value="default" />
     </form>
-    <p class="searchtip" style="font-size: 90%">
-    Enter search terms or a module, class or function name.
-    </p>
 </div>
 <script type="text/javascript">$('#searchbox').show(0);</script>
         </div>
@@ -1343,11 +1342,11 @@ when residue is N terminal.</td>
       <div class="clearer"></div>
     </div>
     <div class="footer">
-      &copy;2017, ProMod3 authors.
+      &copy;2018, ProMod3 authors.
       
       |
-      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a>
-      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.6</a>
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.4.1</a>
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
       
       |
       <a href="../_sources/loop/all_atom.txt"
diff --git a/doc/html/loop/backbone.html b/doc/html/loop/backbone.html
index 6bad77d4feef8e70af8d8177c659f86e348f5206..096e988e0855d432d670e2d868e5e9d6da9309ab 100644
--- a/doc/html/loop/backbone.html
+++ b/doc/html/loop/backbone.html
@@ -6,7 +6,7 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
-    <title>Representing Loops &mdash; ProMod3 1.1.0 documentation</title>
+    <title>Representing Loops &mdash; ProMod3 1.2.0 documentation</title>
     
     <link rel="stylesheet" href="../_static/alabaster.css" type="text/css" />
     <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
@@ -14,7 +14,7 @@
     <script type="text/javascript">
       var DOCUMENTATION_OPTIONS = {
         URL_ROOT:    '../',
-        VERSION:     '1.1.0',
+        VERSION:     '1.2.0',
         COLLAPSE_INDEX: false,
         FILE_SUFFIX: '.html',
         HAS_SOURCE:  true
@@ -23,16 +23,18 @@
     <script type="text/javascript" src="../_static/jquery.js"></script>
     <script type="text/javascript" src="../_static/underscore.js"></script>
     <script type="text/javascript" src="../_static/doctools.js"></script>
-    <link rel="top" title="ProMod3 1.1.0 documentation" href="../index.html" />
+    <link rel="top" title="ProMod3 1.2.0 documentation" href="../index.html" />
     <link rel="up" title="loop - Loop Handling" href="index.html" />
     <link rel="next" title="Sampling Dihedral Angles" href="torsion_sampler.html" />
     <link rel="prev" title="loop - Loop Handling" href="index.html" />
    
+  <link rel="stylesheet" href="../_static/custom.css" type="text/css" />
   
-  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
 
   </head>
-  <body role="document">  
+  <body role="document">
+  
 
     <div class="document">
       <div class="documentwrapper">
@@ -44,27 +46,27 @@
 <p>The most simple representation of structural information in ProMod3 is the
 <a class="reference internal" href="#promod3.loop.BackboneList" title="promod3.loop.BackboneList"><code class="xref py py-class docutils literal"><span class="pre">BackboneList</span></code></a>. It provides a way to store the backbone positions of
 residues. They provide structural manipulations, they can be manipulated and
-converted from, to, or inserted to a <a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.EntityHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.EntityHandle</span></code></a>.</p>
-<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">ost</span> <span class="kn">import</span> <span class="n">io</span>
-<span class="kn">from</span> <span class="nn">ost</span> <span class="kn">import</span> <span class="n">conop</span>
-<span class="kn">from</span> <span class="nn">promod3</span> <span class="kn">import</span> <span class="n">loop</span>
+converted from, to, or inserted to a <a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.EntityHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.EntityHandle</span></code></a>.</p>
+<div class="highlight-default"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">ost</span> <span class="k">import</span> <span class="n">io</span>
+<span class="kn">from</span> <span class="nn">ost</span> <span class="k">import</span> <span class="n">conop</span>
+<span class="kn">from</span> <span class="nn">promod3</span> <span class="k">import</span> <span class="n">loop</span>
 
-<span class="n">sequence</span> <span class="o">=</span> <span class="s">&quot;AAAAAAAA&quot;</span>
+<span class="n">sequence</span> <span class="o">=</span> <span class="s2">&quot;AAAAAAAA&quot;</span>
 
-<span class="c"># the backbone gets initially constructed with backbone dihedrals</span>
-<span class="c"># typical for helices</span>
+<span class="c1"># the backbone gets initially constructed with backbone dihedrals</span>
+<span class="c1"># typical for helices</span>
 <span class="n">bb_list</span> <span class="o">=</span> <span class="n">loop</span><span class="o">.</span><span class="n">BackboneList</span><span class="p">(</span><span class="n">sequence</span><span class="p">)</span>
 
-<span class="c"># let&#39;s have a look at the set dihedral angles</span>
+<span class="c1"># let&#39;s have a look at the set dihedral angles</span>
 <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">bb_list</span><span class="p">)):</span>
-    <span class="k">print</span> <span class="s">&quot;Looking at position </span><span class="si">%d</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">i</span>
+    <span class="nb">print</span> <span class="s2">&quot;Looking at position </span><span class="si">%d</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="n">i</span>
     <span class="k">if</span> <span class="n">i</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">:</span>
-        <span class="k">print</span> <span class="s">&quot;phi: </span><span class="si">%.4f</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">bb_list</span><span class="o">.</span><span class="n">GetPhiTorsion</span><span class="p">(</span><span class="n">i</span><span class="p">)</span>
+        <span class="nb">print</span> <span class="s2">&quot;phi: </span><span class="si">%.4f</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="n">bb_list</span><span class="o">.</span><span class="n">GetPhiTorsion</span><span class="p">(</span><span class="n">i</span><span class="p">)</span>
     <span class="k">if</span> <span class="n">i</span> <span class="o">&lt;</span> <span class="nb">len</span><span class="p">(</span><span class="n">bb_list</span><span class="p">)</span><span class="o">-</span><span class="mi">1</span><span class="p">:</span>
-        <span class="k">print</span> <span class="s">&quot;psi: </span><span class="si">%.4f</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">bb_list</span><span class="o">.</span><span class="n">GetPsiTorsion</span><span class="p">(</span><span class="n">i</span><span class="p">)</span>
+        <span class="nb">print</span> <span class="s2">&quot;psi: </span><span class="si">%.4f</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="n">bb_list</span><span class="o">.</span><span class="n">GetPsiTorsion</span><span class="p">(</span><span class="n">i</span><span class="p">)</span>
 
 
-<span class="c"># we now use a TorsionSampler to set random dihedral angles</span>
+<span class="c1"># we now use a TorsionSampler to set random dihedral angles</span>
 <span class="n">torsion_sampler</span> <span class="o">=</span> <span class="n">loop</span><span class="o">.</span><span class="n">LoadTorsionSampler</span><span class="p">()</span>
 <span class="n">idx</span> <span class="o">=</span> <span class="n">torsion_sampler</span><span class="o">.</span><span class="n">GetHistogramIndex</span><span class="p">(</span><span class="n">conop</span><span class="o">.</span><span class="n">ALA</span><span class="p">,</span> 
                                         <span class="n">conop</span><span class="o">.</span><span class="n">ALA</span><span class="p">,</span> 
@@ -76,8 +78,8 @@ converted from, to, or inserted to a <a class="reference external" href="http://
     <span class="k">if</span> <span class="n">i</span> <span class="o">&lt;</span> <span class="nb">len</span><span class="p">(</span><span class="n">bb_list</span><span class="p">)</span><span class="o">-</span><span class="mi">1</span><span class="p">:</span>
         <span class="n">bb_list</span><span class="o">.</span><span class="n">SetPsiTorsion</span><span class="p">(</span><span class="n">i</span><span class="p">,</span> <span class="n">dihedrals</span><span class="p">[</span><span class="mi">1</span><span class="p">])</span>
 
-<span class="c"># let&#39;s save down the randomized fragment</span>
-<span class="n">io</span><span class="o">.</span><span class="n">SavePDB</span><span class="p">(</span><span class="n">bb_list</span><span class="o">.</span><span class="n">ToEntity</span><span class="p">(),</span> <span class="s">&quot;randomized_fragment.pdb&quot;</span><span class="p">)</span>
+<span class="c1"># let&#39;s save down the randomized fragment</span>
+<span class="n">io</span><span class="o">.</span><span class="n">SavePDB</span><span class="p">(</span><span class="n">bb_list</span><span class="o">.</span><span class="n">ToEntity</span><span class="p">(),</span> <span class="s2">&quot;randomized_fragment.pdb&quot;</span><span class="p">)</span>
 </pre></div>
 </div>
 <div class="section" id="the-backbonelist-class">
@@ -158,7 +160,7 @@ code which is not one of the 20 default amino acids or if
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
 <li><strong>sequence</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#str" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">str</span></code></a>) &#8211; Sequence of created BackboneList</li>
-<li><strong>residues</strong> (<code class="xref py py-class docutils literal"><span class="pre">list</span></code>) &#8211; List of <a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a> objects from
+<li><strong>residues</strong> (<code class="xref py py-class docutils literal"><span class="pre">list</span></code>) &#8211; List of <a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a> objects from
 which the backbone positions are extracted.</li>
 </ul>
 </td>
@@ -182,7 +184,7 @@ a residue not providing all necessary positions.</p>
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The whole backbone list converted to a density map.</td>
 </tr>
-<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="http://www.openstructure.org/docs/dev/img/base/img/#ost.img.ImageHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.img.ImageHandle</span></code></a></td>
+<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="https://www.openstructure.org/docs/dev/img/base/img/#ost.img.ImageHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.img.ImageHandle</span></code></a></td>
 </tr>
 </tbody>
 </table>
@@ -192,7 +194,7 @@ a residue not providing all necessary positions.</p>
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
 <li><strong>padding</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>) &#8211; </li>
-<li><strong>sampling</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">Vec3</span></code></a>) &#8211; </li>
+<li><strong>sampling</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">Vec3</span></code></a>) &#8211; </li>
 <li><strong>resolution</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>) &#8211; </li>
 <li><strong>high_resolution</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#bool" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">bool</span></code></a>) &#8211; </li>
 </ul>
@@ -211,7 +213,7 @@ a residue not providing all necessary positions.</p>
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The whole backbone list converted to an OST entity.</td>
 </tr>
-<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.EntityHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.EntityHandle</span></code></a></td>
+<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.EntityHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.EntityHandle</span></code></a></td>
 </tr>
 </tbody>
 </table>
@@ -228,8 +230,8 @@ be replaced, otherwise they will be added to the entity.</p>
 <col class="field-body" />
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
-<li><strong>chain</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ChainHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ChainHandle</span></code></a>) &#8211; The chain</li>
-<li><strong>start_resnum</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a> / <a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResNum" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResNum</span></code></a>) &#8211; Residue number defining the start location of insertion</li>
+<li><strong>chain</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ChainHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ChainHandle</span></code></a>) &#8211; The chain</li>
+<li><strong>start_resnum</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a> / <a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResNum" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResNum</span></code></a>) &#8211; Residue number defining the start location of insertion</li>
 </ul>
 </td>
 </tr>
@@ -245,7 +247,7 @@ be replaced, otherwise they will be added to the entity.</p>
 <col class="field-body" />
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
-<li><strong>map</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/img/base/img/#ost.img.ImageHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.img.ImageHandle</span></code></a>) &#8211; </li>
+<li><strong>map</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/img/base/img/#ost.img.ImageHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.img.ImageHandle</span></code></a>) &#8211; </li>
 <li><strong>resolution</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>) &#8211; </li>
 <li><strong>high_resolution</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#bool" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">bool</span></code></a>) &#8211; </li>
 </ul>
@@ -264,7 +266,7 @@ be replaced, otherwise they will be added to the entity.</p>
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"></td>
 </tr>
-<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="http://www.openstructure.org/docs/dev/geom/composite/#ost.geom.AlignedCuboid" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.geom.AlignedCuboid</span></code></a></td>
+<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="https://www.openstructure.org/docs/dev/geom/composite/#ost.geom.AlignedCuboid" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.geom.AlignedCuboid</span></code></a></td>
 </tr>
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>all_atom</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#bool" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">bool</span></code></a>) &#8211; </td>
 </tr>
@@ -367,7 +369,7 @@ actual fragment at specified <em>index</em></p>
 <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">Position of nitrogen / alpha carbon / beta carbon / carbon / oxygen
 atom for residue at given index.</td>
 </tr>
-<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="http://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">Vec3</span></code></a></td>
+<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="https://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">Vec3</span></code></a></td>
 </tr>
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>index</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Residue index.</td>
 </tr>
@@ -392,7 +394,7 @@ atom for residue at given index.</td>
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
 <li><strong>index</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Residue index.</li>
-<li><strong>pos</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">Vec3</span></code></a>) &#8211; Set position of nitrogen / alpha carbon / beta carbon / carbon
+<li><strong>pos</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">Vec3</span></code></a>) &#8211; Set position of nitrogen / alpha carbon / beta carbon / carbon
 / oxygen atom to this.</li>
 </ul>
 </td>
@@ -444,7 +446,7 @@ atom for residue at given index.</td>
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">Amino acid type of the residue at given index.</td>
 </tr>
-<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="http://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.AminoAcid</span></code></a></td>
+<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="https://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.AminoAcid</span></code></a></td>
 </tr>
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>index</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Residue index.</td>
 </tr>
@@ -461,7 +463,7 @@ atom for residue at given index.</td>
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
 <li><strong>index</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Residue index.</li>
-<li><strong>aa</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.AminoAcid</span></code></a>) &#8211; Set amino acid type of the residue to this.</li>
+<li><strong>aa</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.AminoAcid</span></code></a>) &#8211; Set amino acid type of the residue to this.</li>
 </ul>
 </td>
 </tr>
@@ -487,12 +489,12 @@ and set the amino acid type according to the given one letter code.</p>
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
 <li><strong>index</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Residue index.</li>
-<li><strong>res</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ResidueHandle</span></code></a>) &#8211; Residue from which to extract backbone atom positions</li>
-<li><strong>n_pos</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">Vec3</span></code></a>) &#8211; Set position of nitrogen atom to this.</li>
-<li><strong>ca_pos</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">Vec3</span></code></a>) &#8211; Set position of alpha carbon atom to this.</li>
-<li><strong>cb_pos</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">Vec3</span></code></a>) &#8211; Set position of beta carbon atom to this.</li>
-<li><strong>c_pos</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">Vec3</span></code></a>) &#8211; Set position of carbon atom to this.</li>
-<li><strong>o_pos</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">Vec3</span></code></a>) &#8211; Set position of oxygen atom to this.</li>
+<li><strong>res</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ResidueHandle</span></code></a>) &#8211; Residue from which to extract backbone atom positions</li>
+<li><strong>n_pos</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">Vec3</span></code></a>) &#8211; Set position of nitrogen atom to this.</li>
+<li><strong>ca_pos</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">Vec3</span></code></a>) &#8211; Set position of alpha carbon atom to this.</li>
+<li><strong>cb_pos</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">Vec3</span></code></a>) &#8211; Set position of beta carbon atom to this.</li>
+<li><strong>c_pos</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">Vec3</span></code></a>) &#8211; Set position of carbon atom to this.</li>
+<li><strong>o_pos</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">Vec3</span></code></a>) &#8211; Set position of oxygen atom to this.</li>
 <li><strong>olc</strong> (<code class="xref py py-class docutils literal"><span class="pre">char</span></code>) &#8211; Set one letter code of the residue to this.</li>
 </ul>
 </td>
@@ -562,12 +564,12 @@ to the given one letter code.</p>
 <col class="field-body" />
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
-<li><strong>res</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ResidueHandle</span></code></a>) &#8211; Residue from which to extract backbone atom positions</li>
-<li><strong>n_pos</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">Vec3</span></code></a>) &#8211; Set position of nitrogen atom to this.</li>
-<li><strong>ca_pos</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">Vec3</span></code></a>) &#8211; Set position of alpha carbon atom to this.</li>
-<li><strong>cb_pos</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">Vec3</span></code></a>) &#8211; Set position of beta carbon atom to this.</li>
-<li><strong>c_pos</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">Vec3</span></code></a>) &#8211; Set position of carbon atom to this.</li>
-<li><strong>o_pos</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">Vec3</span></code></a>) &#8211; Set position of oxygen atom to this.</li>
+<li><strong>res</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ResidueHandle</span></code></a>) &#8211; Residue from which to extract backbone atom positions</li>
+<li><strong>n_pos</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">Vec3</span></code></a>) &#8211; Set position of nitrogen atom to this.</li>
+<li><strong>ca_pos</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">Vec3</span></code></a>) &#8211; Set position of alpha carbon atom to this.</li>
+<li><strong>cb_pos</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">Vec3</span></code></a>) &#8211; Set position of beta carbon atom to this.</li>
+<li><strong>c_pos</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">Vec3</span></code></a>) &#8211; Set position of carbon atom to this.</li>
+<li><strong>o_pos</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">Vec3</span></code></a>) &#8211; Set position of oxygen atom to this.</li>
 <li><strong>olc</strong> (<code class="xref py py-class docutils literal"><span class="pre">char</span></code>) &#8211; Set one letter code of the residue to this.</li>
 </ul>
 </td>
@@ -631,7 +633,7 @@ reconstructed if the residue handle is valid.</p>
 <col class="field-name" />
 <col class="field-body" />
 <tbody valign="top">
-<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>after_c_stem</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; Residue following the C stem (C stem residue is last
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>after_c_stem</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; Residue following the C stem (C stem residue is last
 element of this backbone list)</td>
 </tr>
 </tbody>
@@ -648,7 +650,7 @@ element of this backbone list)</td>
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
 <li><strong>index</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Residue index.</li>
-<li><strong>transform</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/geom/mat/#ost.geom.Mat4" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.geom.Mat4</span></code></a>) &#8211; The transformation</li>
+<li><strong>transform</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/geom/mat/#ost.geom.Mat4" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.geom.Mat4</span></code></a>) &#8211; The transformation</li>
 </ul>
 </td>
 </tr>
@@ -668,7 +670,7 @@ element of this backbone list)</td>
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
 <li><strong>from</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Start index.</li>
 <li><strong>to</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; End index (one past last residue to transform).</li>
-<li><strong>transform</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/geom/mat/#ost.geom.Mat4" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.geom.Mat4</span></code></a>) &#8211; The transformation</li>
+<li><strong>transform</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/geom/mat/#ost.geom.Mat4" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.geom.Mat4</span></code></a>) &#8211; The transformation</li>
 </ul>
 </td>
 </tr>
@@ -684,7 +686,7 @@ element of this backbone list)</td>
 <col class="field-name" />
 <col class="field-body" />
 <tbody valign="top">
-<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>transform</strong> (<code class="xref py py-class docutils literal"><span class="pre">ost.geom.Transform</span></code> / <a class="reference external" href="http://www.openstructure.org/docs/dev/geom/mat/#ost.geom.Mat4" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.geom.Mat4</span></code></a>) &#8211; The transformation</td>
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>transform</strong> (<code class="xref py py-class docutils literal"><span class="pre">ost.geom.Transform</span></code> / <a class="reference external" href="https://www.openstructure.org/docs/dev/geom/mat/#ost.geom.Mat4" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.geom.Mat4</span></code></a>) &#8211; The transformation</td>
 </tr>
 </tbody>
 </table>
@@ -704,12 +706,12 @@ residue <em>other_index</em> of <em>other</em> backbone list considering the
 positions of the N, CA and C atoms.</p>
 </td>
 </tr>
-<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><p class="first"><a class="reference external" href="http://www.openstructure.org/docs/dev/geom/mat/#ost.geom.Mat4" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.geom.Mat4</span></code></a></p>
+<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><p class="first"><a class="reference external" href="https://www.openstructure.org/docs/dev/geom/mat/#ost.geom.Mat4" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.geom.Mat4</span></code></a></p>
 </td>
 </tr>
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
 <li><strong>index</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Residue index.</li>
-<li><strong>res</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; The other residue.</li>
+<li><strong>res</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; The other residue.</li>
 <li><strong>other</strong> (<a class="reference internal" href="#promod3.loop.BackboneList" title="promod3.loop.BackboneList"><code class="xref py py-class docutils literal"><span class="pre">BackboneList</span></code></a>) &#8211; The other backbone list.</li>
 <li><strong>other_index</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Residue index in <em>other</em> backbone list.</li>
 </ul>
@@ -729,7 +731,7 @@ positions of the N, CA and C atoms.</p>
 <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">Get minimum RMSD transformation of CA positions of this backbone
 list onto CA positions of <em>other</em> backbone list.</td>
 </tr>
-<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="http://www.openstructure.org/docs/dev/geom/mat/#ost.geom.Mat4" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.geom.Mat4</span></code></a></td>
+<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="https://www.openstructure.org/docs/dev/geom/mat/#ost.geom.Mat4" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.geom.Mat4</span></code></a></td>
 </tr>
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>other</strong> (<a class="reference internal" href="#promod3.loop.BackboneList" title="promod3.loop.BackboneList"><code class="xref py py-class docutils literal"><span class="pre">BackboneList</span></code></a>) &#8211; The other backbone list.</td>
 </tr>
@@ -994,9 +996,6 @@ backbone list.</td>
       <input type="hidden" name="check_keywords" value="yes" />
       <input type="hidden" name="area" value="default" />
     </form>
-    <p class="searchtip" style="font-size: 90%">
-    Enter search terms or a module, class or function name.
-    </p>
 </div>
 <script type="text/javascript">$('#searchbox').show(0);</script>
         </div>
@@ -1004,11 +1003,11 @@ backbone list.</td>
       <div class="clearer"></div>
     </div>
     <div class="footer">
-      &copy;2017, ProMod3 authors.
+      &copy;2018, ProMod3 authors.
       
       |
-      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a>
-      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.6</a>
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.4.1</a>
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
       
       |
       <a href="../_sources/loop/backbone.txt"
diff --git a/doc/html/loop/index.html b/doc/html/loop/index.html
index 26fc9a364cac64b1de012f48f2c7f886312da19b..4ceff047a047b214b7ec544b3426b6026963b818 100644
--- a/doc/html/loop/index.html
+++ b/doc/html/loop/index.html
@@ -6,7 +6,7 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
-    <title>loop - Loop Handling &mdash; ProMod3 1.1.0 documentation</title>
+    <title>loop - Loop Handling &mdash; ProMod3 1.2.0 documentation</title>
     
     <link rel="stylesheet" href="../_static/alabaster.css" type="text/css" />
     <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
@@ -14,7 +14,7 @@
     <script type="text/javascript">
       var DOCUMENTATION_OPTIONS = {
         URL_ROOT:    '../',
-        VERSION:     '1.1.0',
+        VERSION:     '1.2.0',
         COLLAPSE_INDEX: false,
         FILE_SUFFIX: '.html',
         HAS_SOURCE:  true
@@ -23,16 +23,18 @@
     <script type="text/javascript" src="../_static/jquery.js"></script>
     <script type="text/javascript" src="../_static/underscore.js"></script>
     <script type="text/javascript" src="../_static/doctools.js"></script>
-    <link rel="top" title="ProMod3 1.1.0 documentation" href="../index.html" />
+    <link rel="top" title="ProMod3 1.2.0 documentation" href="../index.html" />
     <link rel="up" title="Documentation For Users" href="../users.html" />
     <link rel="next" title="Representing Loops" href="backbone.html" />
-    <link rel="prev" title="All Atom Scorers" href="../scoring/all_atom_scorers.html" />
+    <link rel="prev" title="Other Scoring Functions" href="../scoring/other_scoring_functions.html" />
    
+  <link rel="stylesheet" href="../_static/custom.css" type="text/css" />
   
-  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
 
   </head>
-  <body role="document">  
+  <body role="document">
+  
 
     <div class="document">
       <div class="documentwrapper">
@@ -44,14 +46,14 @@
 <p>Tools and algorithms for loop handling. This module provides ways for
 representation of peptides and to obtain fragments to potentially use as
 loops. The following example should give you an idea of what can be done:</p>
-<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">ost</span> <span class="kn">import</span> <span class="n">io</span><span class="p">,</span> <span class="n">seq</span>
-<span class="kn">from</span> <span class="nn">promod3</span> <span class="kn">import</span> <span class="n">loop</span>
+<div class="highlight-default"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">ost</span> <span class="k">import</span> <span class="n">io</span><span class="p">,</span> <span class="n">seq</span>
+<span class="kn">from</span> <span class="nn">promod3</span> <span class="k">import</span> <span class="n">loop</span>
 
-<span class="c"># load an example structure</span>
-<span class="n">prot</span> <span class="o">=</span> <span class="n">io</span><span class="o">.</span><span class="n">LoadPDB</span><span class="p">(</span><span class="s">&#39;data/1CRN.pdb&#39;</span><span class="p">)</span>
+<span class="c1"># load an example structure</span>
+<span class="n">prot</span> <span class="o">=</span> <span class="n">io</span><span class="o">.</span><span class="n">LoadPDB</span><span class="p">(</span><span class="s1">&#39;data/1CRN.pdb&#39;</span><span class="p">)</span>
 
-<span class="c"># extract some additional information</span>
-<span class="n">seqres</span> <span class="o">=</span> <span class="s">&#39;&#39;</span><span class="o">.</span><span class="n">join</span><span class="p">([</span><span class="n">r</span><span class="o">.</span><span class="n">one_letter_code</span> <span class="k">for</span> <span class="n">r</span> <span class="ow">in</span> <span class="n">prot</span><span class="o">.</span><span class="n">residues</span><span class="p">])</span>
+<span class="c1"># extract some additional information</span>
+<span class="n">seqres</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="o">.</span><span class="n">join</span><span class="p">([</span><span class="n">r</span><span class="o">.</span><span class="n">one_letter_code</span> <span class="k">for</span> <span class="n">r</span> <span class="ow">in</span> <span class="n">prot</span><span class="o">.</span><span class="n">residues</span><span class="p">])</span>
 <span class="n">frag_pos</span> <span class="o">=</span> <span class="mi">35</span>
 <span class="n">frag_length</span> <span class="o">=</span> <span class="mi">9</span>
 <span class="n">frag_seq</span> <span class="o">=</span> <span class="n">seqres</span><span class="p">[</span><span class="n">frag_pos</span><span class="p">:</span><span class="n">frag_pos</span><span class="o">+</span><span class="n">frag_length</span><span class="p">]</span>
@@ -60,29 +62,29 @@ loops. The following example should give you an idea of what can be done:</p>
 <span class="n">n_stem</span> <span class="o">=</span> <span class="n">prot</span><span class="o">.</span><span class="n">residues</span><span class="p">[</span><span class="n">frag_pos</span><span class="p">]</span>
 <span class="n">c_stem</span> <span class="o">=</span> <span class="n">prot</span><span class="o">.</span><span class="n">residues</span><span class="p">[</span><span class="n">frag_pos</span><span class="o">+</span><span class="n">frag_length</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span>
 
-<span class="c"># extract potential loops from fragment database based on geometry</span>
+<span class="c1"># extract potential loops from fragment database based on geometry</span>
 <span class="n">frag_db</span> <span class="o">=</span> <span class="n">loop</span><span class="o">.</span><span class="n">LoadFragDB</span><span class="p">()</span>
 <span class="n">fragments</span> <span class="o">=</span> <span class="n">frag_db</span><span class="o">.</span><span class="n">SearchDB</span><span class="p">(</span><span class="n">n_stem</span><span class="p">,</span> <span class="n">c_stem</span><span class="p">,</span> <span class="n">frag_length</span><span class="p">)</span>
-<span class="k">print</span> <span class="s">&quot;Num. fragments found in FragDB: </span><span class="si">%d</span><span class="s">&quot;</span> <span class="o">%</span> <span class="nb">len</span><span class="p">(</span><span class="n">fragments</span><span class="p">)</span>
-<span class="c"># compare with reference</span>
+<span class="nb">print</span> <span class="s2">&quot;Num. fragments found in FragDB: </span><span class="si">%d</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="nb">len</span><span class="p">(</span><span class="n">fragments</span><span class="p">)</span>
+<span class="c1"># compare with reference</span>
 <span class="n">struct_db</span> <span class="o">=</span> <span class="n">loop</span><span class="o">.</span><span class="n">LoadStructureDB</span><span class="p">()</span>
 <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">fragments</span><span class="p">)):</span>
-    <span class="c"># get structure from structural database</span>
+    <span class="c1"># get structure from structural database</span>
     <span class="n">bb_list</span> <span class="o">=</span> <span class="n">struct_db</span><span class="o">.</span><span class="n">GetBackboneList</span><span class="p">(</span><span class="n">n_stem</span><span class="p">,</span> <span class="n">c_stem</span><span class="p">,</span>
                                         <span class="n">fragments</span><span class="p">[</span><span class="n">i</span><span class="p">],</span> <span class="n">frag_seq</span><span class="p">)</span>
-    <span class="n">ca_rmsd</span> <span class="o">=</span> <span class="n">bb_list</span><span class="o">.</span><span class="n">CARMSD</span><span class="p">(</span><span class="n">ref_backbone</span><span class="p">,</span> <span class="bp">True</span><span class="p">)</span>
-    <span class="k">print</span> <span class="s">&quot;-&gt; fragment </span><span class="si">%d</span><span class="s"> has CA RMSD of </span><span class="si">%.3f</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">i</span><span class="p">,</span> <span class="n">ca_rmsd</span><span class="p">)</span>
+    <span class="n">ca_rmsd</span> <span class="o">=</span> <span class="n">bb_list</span><span class="o">.</span><span class="n">CARMSD</span><span class="p">(</span><span class="n">ref_backbone</span><span class="p">,</span> <span class="kc">True</span><span class="p">)</span>
+    <span class="nb">print</span> <span class="s2">&quot;-&gt; fragment </span><span class="si">%d</span><span class="s2"> has CA RMSD of </span><span class="si">%.3f</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">i</span><span class="p">,</span> <span class="n">ca_rmsd</span><span class="p">)</span>
 
-<span class="c"># extract potential loops from fragment database based on sequence</span>
+<span class="c1"># extract potential loops from fragment database based on sequence</span>
 <span class="n">fragger</span> <span class="o">=</span> <span class="n">loop</span><span class="o">.</span><span class="n">Fragger</span><span class="p">(</span><span class="n">frag_seq</span><span class="p">)</span>
-<span class="c"># for simplicity we just use a sequence similarity score</span>
+<span class="c1"># for simplicity we just use a sequence similarity score</span>
 <span class="n">fragger</span><span class="o">.</span><span class="n">AddSeqSimParameters</span><span class="p">(</span><span class="mf">1.0</span><span class="p">,</span> <span class="n">seq</span><span class="o">.</span><span class="n">alg</span><span class="o">.</span><span class="n">BLOSUM62</span><span class="p">)</span>
 <span class="n">fragger</span><span class="o">.</span><span class="n">Fill</span><span class="p">(</span><span class="n">struct_db</span><span class="p">,</span> <span class="mf">1.0</span><span class="p">,</span> <span class="mi">5</span><span class="p">)</span>
-<span class="k">print</span> <span class="s">&quot;Num. fragments found in Fragger: </span><span class="si">%d</span><span class="s">&quot;</span> <span class="o">%</span> <span class="nb">len</span><span class="p">(</span><span class="n">fragger</span><span class="p">)</span>
-<span class="c"># compare fraggers with reference</span>
+<span class="nb">print</span> <span class="s2">&quot;Num. fragments found in Fragger: </span><span class="si">%d</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="nb">len</span><span class="p">(</span><span class="n">fragger</span><span class="p">)</span>
+<span class="c1"># compare fraggers with reference</span>
 <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">fragger</span><span class="p">)):</span>
-    <span class="n">ca_rmsd</span> <span class="o">=</span> <span class="n">fragger</span><span class="p">[</span><span class="n">i</span><span class="p">]</span><span class="o">.</span><span class="n">CARMSD</span><span class="p">(</span><span class="n">ref_backbone</span><span class="p">,</span> <span class="bp">True</span><span class="p">)</span>
-    <span class="k">print</span> <span class="s">&quot;-&gt; fragment </span><span class="si">%d</span><span class="s"> has CA RMSD of </span><span class="si">%.3f</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">i</span><span class="p">,</span> <span class="n">ca_rmsd</span><span class="p">)</span>
+    <span class="n">ca_rmsd</span> <span class="o">=</span> <span class="n">fragger</span><span class="p">[</span><span class="n">i</span><span class="p">]</span><span class="o">.</span><span class="n">CARMSD</span><span class="p">(</span><span class="n">ref_backbone</span><span class="p">,</span> <span class="kc">True</span><span class="p">)</span>
+    <span class="nb">print</span> <span class="s2">&quot;-&gt; fragment </span><span class="si">%d</span><span class="s2"> has CA RMSD of </span><span class="si">%.3f</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">i</span><span class="p">,</span> <span class="n">ca_rmsd</span><span class="p">)</span>
 </pre></div>
 </div>
 <p>Contents:</p>
@@ -132,7 +134,7 @@ loops. The following example should give you an idea of what can be done:</p>
 <ul>
   <li><a href="../index.html">Documentation overview</a><ul>
   <li><a href="../users.html">Documentation For Users</a><ul>
-      <li>Previous: <a href="../scoring/all_atom_scorers.html" title="previous chapter">All Atom Scorers</a></li>
+      <li>Previous: <a href="../scoring/other_scoring_functions.html" title="previous chapter">Other Scoring Functions</a></li>
       <li>Next: <a href="backbone.html" title="next chapter">Representing Loops</a></li>
   </ul></li>
   </ul></li>
@@ -153,9 +155,6 @@ loops. The following example should give you an idea of what can be done:</p>
       <input type="hidden" name="check_keywords" value="yes" />
       <input type="hidden" name="area" value="default" />
     </form>
-    <p class="searchtip" style="font-size: 90%">
-    Enter search terms or a module, class or function name.
-    </p>
 </div>
 <script type="text/javascript">$('#searchbox').show(0);</script>
         </div>
@@ -163,11 +162,11 @@ loops. The following example should give you an idea of what can be done:</p>
       <div class="clearer"></div>
     </div>
     <div class="footer">
-      &copy;2017, ProMod3 authors.
+      &copy;2018, ProMod3 authors.
       
       |
-      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a>
-      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.6</a>
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.4.1</a>
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
       
       |
       <a href="../_sources/loop/index.txt"
diff --git a/doc/html/loop/load_loop_objects.html b/doc/html/loop/load_loop_objects.html
index 56f91dea84cc704904c77f5eb31e1cdb7f96a875..8425953c8165937468f1c690d1e44d38250cfe99 100644
--- a/doc/html/loop/load_loop_objects.html
+++ b/doc/html/loop/load_loop_objects.html
@@ -6,7 +6,7 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
-    <title>Loading Precomputed Objects &mdash; ProMod3 1.1.0 documentation</title>
+    <title>Loading Precomputed Objects &mdash; ProMod3 1.2.0 documentation</title>
     
     <link rel="stylesheet" href="../_static/alabaster.css" type="text/css" />
     <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
@@ -14,7 +14,7 @@
     <script type="text/javascript">
       var DOCUMENTATION_OPTIONS = {
         URL_ROOT:    '../',
-        VERSION:     '1.1.0',
+        VERSION:     '1.2.0',
         COLLAPSE_INDEX: false,
         FILE_SUFFIX: '.html',
         HAS_SOURCE:  true
@@ -23,16 +23,18 @@
     <script type="text/javascript" src="../_static/jquery.js"></script>
     <script type="text/javascript" src="../_static/underscore.js"></script>
     <script type="text/javascript" src="../_static/doctools.js"></script>
-    <link rel="top" title="ProMod3 1.1.0 documentation" href="../index.html" />
+    <link rel="top" title="ProMod3 1.2.0 documentation" href="../index.html" />
     <link rel="up" title="loop - Loop Handling" href="index.html" />
     <link rel="next" title="core - ProMod3 Core Functionality" href="../core/index.html" />
     <link rel="prev" title="Generate ost.mol.mm systems" href="mm_system_creation.html" />
    
+  <link rel="stylesheet" href="../_static/custom.css" type="text/css" />
   
-  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
 
   </head>
-  <body role="document">  
+  <body role="document">
+  
 
     <div class="document">
       <div class="documentwrapper">
@@ -201,9 +203,6 @@ Proteins, 62(4):892–908, Mar 2006.</dd>
       <input type="hidden" name="check_keywords" value="yes" />
       <input type="hidden" name="area" value="default" />
     </form>
-    <p class="searchtip" style="font-size: 90%">
-    Enter search terms or a module, class or function name.
-    </p>
 </div>
 <script type="text/javascript">$('#searchbox').show(0);</script>
         </div>
@@ -211,11 +210,11 @@ Proteins, 62(4):892–908, Mar 2006.</dd>
       <div class="clearer"></div>
     </div>
     <div class="footer">
-      &copy;2017, ProMod3 authors.
+      &copy;2018, ProMod3 authors.
       
       |
-      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a>
-      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.6</a>
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.4.1</a>
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
       
       |
       <a href="../_sources/loop/load_loop_objects.txt"
diff --git a/doc/html/loop/mm_system_creation.html b/doc/html/loop/mm_system_creation.html
index 0c214fb25876f02900cc6f80891671864c4882a5..38cdf31e4748d13ed4624067799504894827ea98 100644
--- a/doc/html/loop/mm_system_creation.html
+++ b/doc/html/loop/mm_system_creation.html
@@ -6,7 +6,7 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
-    <title>Generate ost.mol.mm systems &mdash; ProMod3 1.1.0 documentation</title>
+    <title>Generate ost.mol.mm systems &mdash; ProMod3 1.2.0 documentation</title>
     
     <link rel="stylesheet" href="../_static/alabaster.css" type="text/css" />
     <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
@@ -14,7 +14,7 @@
     <script type="text/javascript">
       var DOCUMENTATION_OPTIONS = {
         URL_ROOT:    '../',
-        VERSION:     '1.1.0',
+        VERSION:     '1.2.0',
         COLLAPSE_INDEX: false,
         FILE_SUFFIX: '.html',
         HAS_SOURCE:  true
@@ -23,16 +23,18 @@
     <script type="text/javascript" src="../_static/jquery.js"></script>
     <script type="text/javascript" src="../_static/underscore.js"></script>
     <script type="text/javascript" src="../_static/doctools.js"></script>
-    <link rel="top" title="ProMod3 1.1.0 documentation" href="../index.html" />
+    <link rel="top" title="ProMod3 1.2.0 documentation" href="../index.html" />
     <link rel="up" title="loop - Loop Handling" href="index.html" />
     <link rel="next" title="Loading Precomputed Objects" href="load_loop_objects.html" />
     <link rel="prev" title="Handling All Atom Positions" href="all_atom.html" />
    
+  <link rel="stylesheet" href="../_static/custom.css" type="text/css" />
   
-  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
 
   </head>
-  <body role="document">  
+  <body role="document">
+  
 
     <div class="document">
       <div class="documentwrapper">
@@ -40,49 +42,49 @@
           <div class="body" role="main">
             
   <div class="section" id="generate-ost-mol-mm-systems">
-<h1>Generate <code class="xref py py-mod docutils literal"><span class="pre">ost.mol.mm</span></code> systems<a class="headerlink" href="#generate-ost-mol-mm-systems" title="Permalink to this headline">¶</a></h1>
-<p>To simplify the creation of <code class="xref py py-mod docutils literal"><span class="pre">ost.mol.mm</span></code> / OpenMM simulations for loops in
+<h1>Generate <a class="reference external" href="https://www.openstructure.org/docs/dev/mol/mm/molmm/#module-ost.mol.mm" title="(in OpenStructure v1.7.1)"><code class="xref py py-mod docutils literal"><span class="pre">ost.mol.mm</span></code></a> systems<a class="headerlink" href="#generate-ost-mol-mm-systems" title="Permalink to this headline">¶</a></h1>
+<p>To simplify the creation of <a class="reference external" href="https://www.openstructure.org/docs/dev/mol/mm/molmm/#module-ost.mol.mm" title="(in OpenStructure v1.7.1)"><code class="xref py py-mod docutils literal"><span class="pre">ost.mol.mm</span></code></a> / OpenMM simulations for loops in
 proteins, we define a system creator for loops (<a class="reference internal" href="#promod3.loop.MmSystemCreator" title="promod3.loop.MmSystemCreator"><code class="xref py py-class docutils literal"><span class="pre">MmSystemCreator</span></code></a>) and a
 specialized forcefield lookup for amino acids (<a class="reference internal" href="#promod3.loop.ForcefieldLookup" title="promod3.loop.ForcefieldLookup"><code class="xref py py-class docutils literal"><span class="pre">ForcefieldLookup</span></code></a>).</p>
 <p>The example below showcases the creation and use of an MM system:</p>
-<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">ost</span> <span class="kn">import</span> <span class="n">io</span><span class="p">,</span> <span class="n">geom</span>
-<span class="kn">from</span> <span class="nn">promod3</span> <span class="kn">import</span> <span class="n">loop</span>
+<div class="highlight-default"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">ost</span> <span class="k">import</span> <span class="n">io</span><span class="p">,</span> <span class="n">geom</span>
+<span class="kn">from</span> <span class="nn">promod3</span> <span class="k">import</span> <span class="n">loop</span>
 
-<span class="c"># setup system creator</span>
+<span class="c1"># setup system creator</span>
 <span class="n">ff_lookup</span> <span class="o">=</span> <span class="n">loop</span><span class="o">.</span><span class="n">ForcefieldLookup</span><span class="o">.</span><span class="n">GetDefault</span><span class="p">()</span>
 <span class="n">mm_sys</span> <span class="o">=</span> <span class="n">loop</span><span class="o">.</span><span class="n">MmSystemCreator</span><span class="p">(</span><span class="n">ff_lookup</span><span class="p">)</span>
 
-<span class="c"># load example (has res. numbering starting at 1)</span>
-<span class="n">ent</span> <span class="o">=</span> <span class="n">io</span><span class="o">.</span><span class="n">LoadPDB</span><span class="p">(</span><span class="s">&quot;data/1CRN.pdb&quot;</span><span class="p">)</span>
+<span class="c1"># load example (has res. numbering starting at 1)</span>
+<span class="n">ent</span> <span class="o">=</span> <span class="n">io</span><span class="o">.</span><span class="n">LoadPDB</span><span class="p">(</span><span class="s2">&quot;data/1CRN.pdb&quot;</span><span class="p">)</span>
 <span class="n">res_list</span> <span class="o">=</span> <span class="n">ent</span><span class="o">.</span><span class="n">residues</span>
 <span class="n">num_residues</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="n">res_list</span><span class="p">)</span>
 
-<span class="c"># get all atom positions for full protein</span>
+<span class="c1"># get all atom positions for full protein</span>
 <span class="n">all_atoms</span> <span class="o">=</span> <span class="n">loop</span><span class="o">.</span><span class="n">AllAtomPositions</span><span class="p">(</span><span class="n">res_list</span><span class="p">)</span>
-<span class="c"># here full structure in res_indices but in practice this could</span>
-<span class="c"># be just a subset of residues relevant to the loop of interest</span>
+<span class="c1"># here full structure in res_indices but in practice this could</span>
+<span class="c1"># be just a subset of residues relevant to the loop of interest</span>
 <span class="n">res_indices</span> <span class="o">=</span> <span class="nb">range</span><span class="p">(</span><span class="n">num_residues</span><span class="p">)</span>
-<span class="c"># define two loops (indices into res_indices list)</span>
+<span class="c1"># define two loops (indices into res_indices list)</span>
 <span class="n">loop_start_indices</span> <span class="o">=</span> <span class="p">[</span><span class="mi">10</span><span class="p">,</span> <span class="mi">20</span><span class="p">]</span>
 <span class="n">loop_lengths</span> <span class="o">=</span> <span class="p">[</span><span class="mi">6</span><span class="p">,</span> <span class="mi">4</span><span class="p">]</span>
-<span class="c"># define which of the res_indices is terminal</span>
-<span class="n">is_n_ter</span> <span class="o">=</span> <span class="p">[</span><span class="bp">True</span><span class="p">]</span> <span class="o">+</span> <span class="p">[</span><span class="bp">False</span><span class="p">]</span> <span class="o">*</span> <span class="p">(</span><span class="n">num_residues</span> <span class="o">-</span> <span class="mi">1</span><span class="p">)</span>
-<span class="n">is_c_ter</span> <span class="o">=</span> <span class="p">[</span><span class="bp">False</span><span class="p">]</span> <span class="o">*</span> <span class="p">(</span><span class="n">num_residues</span> <span class="o">-</span> <span class="mi">1</span><span class="p">)</span> <span class="o">+</span> <span class="p">[</span><span class="bp">True</span><span class="p">]</span>
-<span class="c"># get disulfid bridges</span>
+<span class="c1"># define which of the res_indices is terminal</span>
+<span class="n">is_n_ter</span> <span class="o">=</span> <span class="p">[</span><span class="kc">True</span><span class="p">]</span> <span class="o">+</span> <span class="p">[</span><span class="kc">False</span><span class="p">]</span> <span class="o">*</span> <span class="p">(</span><span class="n">num_residues</span> <span class="o">-</span> <span class="mi">1</span><span class="p">)</span>
+<span class="n">is_c_ter</span> <span class="o">=</span> <span class="p">[</span><span class="kc">False</span><span class="p">]</span> <span class="o">*</span> <span class="p">(</span><span class="n">num_residues</span> <span class="o">-</span> <span class="mi">1</span><span class="p">)</span> <span class="o">+</span> <span class="p">[</span><span class="kc">True</span><span class="p">]</span>
+<span class="c1"># get disulfid bridges</span>
 <span class="n">disulfid_bridges</span> <span class="o">=</span> <span class="n">mm_sys</span><span class="o">.</span><span class="n">GetDisulfidBridges</span><span class="p">(</span><span class="n">all_atoms</span><span class="p">,</span> <span class="n">res_indices</span><span class="p">)</span>
-<span class="c"># setup MM system</span>
+<span class="c1"># setup MM system</span>
 <span class="n">mm_sys</span><span class="o">.</span><span class="n">SetupSystem</span><span class="p">(</span><span class="n">all_atoms</span><span class="p">,</span> <span class="n">res_indices</span><span class="p">,</span> <span class="n">loop_start_indices</span><span class="p">,</span>
                    <span class="n">loop_lengths</span><span class="p">,</span> <span class="n">is_n_ter</span><span class="p">,</span> <span class="n">is_c_ter</span><span class="p">,</span> <span class="n">disulfid_bridges</span><span class="p">)</span>
 
-<span class="c"># run simulation</span>
+<span class="c1"># run simulation</span>
 <span class="n">sim</span> <span class="o">=</span> <span class="n">mm_sys</span><span class="o">.</span><span class="n">GetSimulation</span><span class="p">()</span>
-<span class="k">print</span> <span class="s">&quot;Potential energy before: </span><span class="si">%g</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">sim</span><span class="o">.</span><span class="n">GetPotentialEnergy</span><span class="p">()</span>
+<span class="nb">print</span> <span class="s2">&quot;Potential energy before: </span><span class="si">%g</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="n">sim</span><span class="o">.</span><span class="n">GetPotentialEnergy</span><span class="p">()</span>
 <span class="n">sim</span><span class="o">.</span><span class="n">ApplySD</span><span class="p">(</span><span class="mf">0.01</span><span class="p">,</span> <span class="mi">100</span><span class="p">)</span>
-<span class="k">print</span> <span class="s">&quot;Potential energy after: </span><span class="si">%g</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">sim</span><span class="o">.</span><span class="n">GetPotentialEnergy</span><span class="p">()</span>
+<span class="nb">print</span> <span class="s2">&quot;Potential energy after: </span><span class="si">%g</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="n">sim</span><span class="o">.</span><span class="n">GetPotentialEnergy</span><span class="p">()</span>
 
-<span class="c"># extract new loop positions and store it</span>
+<span class="c1"># extract new loop positions and store it</span>
 <span class="n">mm_sys</span><span class="o">.</span><span class="n">ExtractLoopPositions</span><span class="p">(</span><span class="n">all_atoms</span><span class="p">,</span> <span class="n">res_indices</span><span class="p">)</span>
-<span class="n">io</span><span class="o">.</span><span class="n">SavePDB</span><span class="p">(</span><span class="n">all_atoms</span><span class="o">.</span><span class="n">ToEntity</span><span class="p">(),</span> <span class="s">&quot;mm_sys_output.pdb&quot;</span><span class="p">)</span>
+<span class="n">io</span><span class="o">.</span><span class="n">SavePDB</span><span class="p">(</span><span class="n">all_atoms</span><span class="o">.</span><span class="n">ToEntity</span><span class="p">(),</span> <span class="s2">&quot;mm_sys_output.pdb&quot;</span><span class="p">)</span>
 </pre></div>
 </div>
 <div class="admonition note">
@@ -286,7 +288,7 @@ acid types for <em>out_pos[res_indices[i]]</em> and <em>all_pos[res_indices[i]]<
 <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">Simulation object setup by <a class="reference internal" href="#promod3.loop.MmSystemCreator.SetupSystem" title="promod3.loop.MmSystemCreator.SetupSystem"><code class="xref py py-meth docutils literal"><span class="pre">SetupSystem()</span></code></a>. Use this to run
 MM simulations.</td>
 </tr>
-<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="http://www.openstructure.org/docs/dev/mol/mm/simulation/#ost.mol.mm.Simulation" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.mm.Simulation</span></code></a></td>
+<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="https://www.openstructure.org/docs/dev/mol/mm/simulation/#ost.mol.mm.Simulation" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.mm.Simulation</span></code></a></td>
 </tr>
 </tbody>
 </table>
@@ -433,7 +435,7 @@ FF specific data for amino acids in a protein. We distinguish amino acid types
 <dl class="class">
 <dt id="promod3.loop.ForcefieldLookup">
 <em class="property">class </em><code class="descclassname">promod3.loop.</code><code class="descname">ForcefieldLookup</code><a class="headerlink" href="#promod3.loop.ForcefieldLookup" title="Permalink to this definition">¶</a></dt>
-<dd><p>This class provides all functionality to generate <a class="reference external" href="http://www.openstructure.org/docs/dev/mol/mm/simulation/#ost.mol.mm.Simulation" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.mm.Simulation</span></code></a> objects. Specifically, we can:</p>
+<dd><p>This class provides all functionality to generate <a class="reference external" href="https://www.openstructure.org/docs/dev/mol/mm/simulation/#ost.mol.mm.Simulation" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.mm.Simulation</span></code></a> objects. Specifically, we can:</p>
 <ul class="simple">
 <li>get a consistent indexing of each atom of each residue in [<em>0, N-1</em>], where
 <em>N</em> = <a class="reference internal" href="#promod3.loop.ForcefieldLookup.GetNumAtoms" title="promod3.loop.ForcefieldLookup.GetNumAtoms"><code class="xref py py-meth docutils literal"><span class="pre">GetNumAtoms()</span></code></a> (note that only OXT indexing depends on whether a
@@ -511,7 +513,7 @@ less machine-dependent).</p>
 <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference internal" href="#promod3.loop.ForcefieldLookup" title="promod3.loop.ForcefieldLookup"><code class="xref py py-class docutils literal"><span class="pre">ForcefieldLookup</span></code></a></td>
 </tr>
 <tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/2.7/library/exceptions.html#exceptions.RuntimeError" title="(in Python v2.7)"><code class="xref py py-exc docutils literal"><span class="pre">RuntimeError</span></code></a> if file cannot be opened or if
-file cannot be parsed (see <a class="reference internal" href="../portableIO.html#portableio"><span>here</span></a> for details).</td>
+file cannot be parsed (see <a class="reference internal" href="../portableIO.html#portableio"><span class="std std-ref">here</span></a> for details).</td>
 </tr>
 </tbody>
 </table>
@@ -523,7 +525,7 @@ file cannot be parsed (see <a class="reference internal" href="../portableIO.htm
 <dt id="promod3.loop.ForcefieldLookup.SavePortable">
 <code class="descname">SavePortable</code><span class="sig-paren">(</span><em>filename</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.loop.ForcefieldLookup.SavePortable" title="Permalink to this definition">¶</a></dt>
 <dd><p>Saves a raw / portable binary representation. Use portable files for
-distribution and convert locally to raw files. See <a class="reference internal" href="../portableIO.html#portableio"><span>here</span></a>
+distribution and convert locally to raw files. See <a class="reference internal" href="../portableIO.html#portableio"><span class="std std-ref">here</span></a>
 for details.</p>
 <table class="docutils field-list" frame="void" rules="none">
 <col class="field-name" />
@@ -546,7 +548,7 @@ for details.</p>
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">Amino acid type for given <em>ff_aa</em></td>
 </tr>
-<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="http://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.AminoAcid</span></code></a></td>
+<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="https://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.AminoAcid</span></code></a></td>
 </tr>
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>ff_aa</strong> (<a class="reference internal" href="#promod3.loop.ForcefieldAminoAcid" title="promod3.loop.ForcefieldAminoAcid"><code class="xref py py-class docutils literal"><span class="pre">ForcefieldAminoAcid</span></code></a>) &#8211; Forcefield-specific amino acid type</td>
 </tr>
@@ -662,7 +664,7 @@ for details.</p>
 <col class="field-body" />
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">Dampening factor for LJ 1,4 interactions (see
-<a class="reference external" href="http://www.openstructure.org/docs/dev/mol/mm/topology/#ost.mol.mm.Topology.SetFudgeLJ" title="(in OpenStructure v1.6.0)"><code class="xref py py-meth docutils literal"><span class="pre">ost.mol.mm.Topology.SetFudgeLJ()</span></code></a>)</td>
+<a class="reference external" href="https://www.openstructure.org/docs/dev/mol/mm/topology/#ost.mol.mm.Topology.SetFudgeLJ" title="(in OpenStructure v1.7.1)"><code class="xref py py-meth docutils literal"><span class="pre">ost.mol.mm.Topology.SetFudgeLJ()</span></code></a>)</td>
 </tr>
 <tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a></td>
 </tr>
@@ -678,7 +680,7 @@ for details.</p>
 <col class="field-body" />
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">Dampening factor for electrostatic 1,4 interactions (see
-<a class="reference external" href="http://www.openstructure.org/docs/dev/mol/mm/topology/#ost.mol.mm.Topology.SetFudgeQQ" title="(in OpenStructure v1.6.0)"><code class="xref py py-meth docutils literal"><span class="pre">ost.mol.mm.Topology.SetFudgeQQ()</span></code></a>)</td>
+<a class="reference external" href="https://www.openstructure.org/docs/dev/mol/mm/topology/#ost.mol.mm.Topology.SetFudgeQQ" title="(in OpenStructure v1.7.1)"><code class="xref py py-meth docutils literal"><span class="pre">ost.mol.mm.Topology.SetFudgeQQ()</span></code></a>)</td>
 </tr>
 <tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a></td>
 </tr>
@@ -693,7 +695,7 @@ for details.</p>
 <col class="field-name" />
 <col class="field-body" />
 <tbody valign="top">
-<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Mass for each atom (see <a class="reference external" href="http://www.openstructure.org/docs/dev/mol/mm/topology/#ost.mol.mm.Topology.SetMasses" title="(in OpenStructure v1.6.0)"><code class="xref py py-meth docutils literal"><span class="pre">ost.mol.mm.Topology.SetMasses()</span></code></a>)</p>
+<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Mass for each atom (see <a class="reference external" href="https://www.openstructure.org/docs/dev/mol/mm/topology/#ost.mol.mm.Topology.SetMasses" title="(in OpenStructure v1.7.1)"><code class="xref py py-meth docutils literal"><span class="pre">ost.mol.mm.Topology.SetMasses()</span></code></a>)</p>
 </td>
 </tr>
 <tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><p class="first"><code class="xref py py-class docutils literal"><span class="pre">list</span></code> of <a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a> (length = <a class="reference internal" href="#promod3.loop.ForcefieldLookup.GetNumAtoms" title="promod3.loop.ForcefieldLookup.GetNumAtoms"><code class="xref py py-meth docutils literal"><span class="pre">GetNumAtoms()</span></code></a>)</p>
@@ -717,7 +719,7 @@ for details.</p>
 <col class="field-name" />
 <col class="field-body" />
 <tbody valign="top">
-<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Charge for each atom (see <a class="reference external" href="http://www.openstructure.org/docs/dev/mol/mm/topology/#ost.mol.mm.Topology.SetCharges" title="(in OpenStructure v1.6.0)"><code class="xref py py-meth docutils literal"><span class="pre">ost.mol.mm.Topology.SetCharges()</span></code></a>)</p>
+<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Charge for each atom (see <a class="reference external" href="https://www.openstructure.org/docs/dev/mol/mm/topology/#ost.mol.mm.Topology.SetCharges" title="(in OpenStructure v1.7.1)"><code class="xref py py-meth docutils literal"><span class="pre">ost.mol.mm.Topology.SetCharges()</span></code></a>)</p>
 </td>
 </tr>
 <tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><p class="first"><code class="xref py py-class docutils literal"><span class="pre">list</span></code> of <a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a> (length = <a class="reference internal" href="#promod3.loop.ForcefieldLookup.GetNumAtoms" title="promod3.loop.ForcefieldLookup.GetNumAtoms"><code class="xref py py-meth docutils literal"><span class="pre">GetNumAtoms()</span></code></a>)</p>
@@ -742,7 +744,7 @@ for details.</p>
 <col class="field-body" />
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Sigma in nm for each atom
-(see <a class="reference external" href="http://www.openstructure.org/docs/dev/mol/mm/topology/#ost.mol.mm.Topology.SetSigmas" title="(in OpenStructure v1.6.0)"><code class="xref py py-meth docutils literal"><span class="pre">ost.mol.mm.Topology.SetSigmas()</span></code></a>)</p>
+(see <a class="reference external" href="https://www.openstructure.org/docs/dev/mol/mm/topology/#ost.mol.mm.Topology.SetSigmas" title="(in OpenStructure v1.7.1)"><code class="xref py py-meth docutils literal"><span class="pre">ost.mol.mm.Topology.SetSigmas()</span></code></a>)</p>
 </td>
 </tr>
 <tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><p class="first"><code class="xref py py-class docutils literal"><span class="pre">list</span></code> of <a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a> (length = <a class="reference internal" href="#promod3.loop.ForcefieldLookup.GetNumAtoms" title="promod3.loop.ForcefieldLookup.GetNumAtoms"><code class="xref py py-meth docutils literal"><span class="pre">GetNumAtoms()</span></code></a>)</p>
@@ -767,7 +769,7 @@ for details.</p>
 <col class="field-body" />
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Epsilon in kJ/mol for each atom
-(see <a class="reference external" href="http://www.openstructure.org/docs/dev/mol/mm/topology/#ost.mol.mm.Topology.SetEpsilons" title="(in OpenStructure v1.6.0)"><code class="xref py py-meth docutils literal"><span class="pre">ost.mol.mm.Topology.SetEpsilons()</span></code></a>)</p>
+(see <a class="reference external" href="https://www.openstructure.org/docs/dev/mol/mm/topology/#ost.mol.mm.Topology.SetEpsilons" title="(in OpenStructure v1.7.1)"><code class="xref py py-meth docutils literal"><span class="pre">ost.mol.mm.Topology.SetEpsilons()</span></code></a>)</p>
 </td>
 </tr>
 <tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><p class="first"><code class="xref py py-class docutils literal"><span class="pre">list</span></code> of <a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a> (length = <a class="reference internal" href="#promod3.loop.ForcefieldLookup.GetNumAtoms" title="promod3.loop.ForcefieldLookup.GetNumAtoms"><code class="xref py py-meth docutils literal"><span class="pre">GetNumAtoms()</span></code></a>)</p>
@@ -913,7 +915,7 @@ for details.</p>
 <dt id="promod3.loop.ForcefieldAminoAcid">
 <em class="property">class </em><code class="descclassname">promod3.loop.</code><code class="descname">ForcefieldAminoAcid</code><a class="headerlink" href="#promod3.loop.ForcefieldAminoAcid" title="Permalink to this definition">¶</a></dt>
 <dd><p>Enumerates the amino acid types for forcefields. The first 20 values
-correspond to the 20 values of <a class="reference external" href="http://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.AminoAcid</span></code></a>. Additionally,
+correspond to the 20 values of <a class="reference external" href="https://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.AminoAcid</span></code></a>. Additionally,
 there are values for disulfid bridges (<em>FF_CYS2</em>), d-protonated histidine
 (<em>FF_HISD</em>, default for <em>ost.conop.HIS</em> is <em>FF_HISE</em>) and <em>FF_XXX</em> for unknown
 types. The full list of values is:</p>
@@ -930,7 +932,7 @@ types. The full list of values is:</p>
 <dd><p>Contains lists of bonds, angles, dihedrals, impropers and LJ pairs (exclusions
 are the combination of all bonds and 1,3 pairs of angles and are not stored
 separately). Each type of connectivity has it&#8217;s own class (see below) storing
-indices and parameters to be used for methods of <a class="reference external" href="http://www.openstructure.org/docs/dev/mol/mm/topology/#ost.mol.mm.Topology" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.mm.Topology</span></code></a>.
+indices and parameters to be used for methods of <a class="reference external" href="https://www.openstructure.org/docs/dev/mol/mm/topology/#ost.mol.mm.Topology" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.mm.Topology</span></code></a>.
 The indexing of atoms for internal connectivities is in [<em>0, N-1</em>], where <em>N</em>
 = <a class="reference internal" href="#promod3.loop.ForcefieldLookup.GetNumAtoms" title="promod3.loop.ForcefieldLookup.GetNumAtoms"><code class="xref py py-meth docutils literal"><span class="pre">ForcefieldLookup.GetNumAtoms()</span></code></a>. For connectivities of pairs of
 residues, atoms of the first residue are in [<em>0, N1-1</em>] and atoms of the
@@ -1040,7 +1042,7 @@ False, False)</em>.</p>
 <dl class="class">
 <dt id="promod3.loop.ForcefieldBondInfo">
 <em class="property">class </em><code class="descclassname">promod3.loop.</code><code class="descname">ForcefieldBondInfo</code><a class="headerlink" href="#promod3.loop.ForcefieldBondInfo" title="Permalink to this definition">¶</a></dt>
-<dd><p>Define harmonic bond (see <a class="reference external" href="http://www.openstructure.org/docs/dev/mol/mm/topology/#ost.mol.mm.Topology.AddHarmonicBond" title="(in OpenStructure v1.6.0)"><code class="xref py py-meth docutils literal"><span class="pre">ost.mol.mm.Topology.AddHarmonicBond()</span></code></a>)</p>
+<dd><p>Define harmonic bond (see <a class="reference external" href="https://www.openstructure.org/docs/dev/mol/mm/topology/#ost.mol.mm.Topology.AddHarmonicBond" title="(in OpenStructure v1.7.1)"><code class="xref py py-meth docutils literal"><span class="pre">ost.mol.mm.Topology.AddHarmonicBond()</span></code></a>)</p>
 <dl class="attribute">
 <dt id="promod3.loop.ForcefieldBondInfo.index_one">
 <code class="descname">index_one</code><a class="headerlink" href="#promod3.loop.ForcefieldBondInfo.index_one" title="Permalink to this definition">¶</a></dt>
@@ -1102,7 +1104,7 @@ False, False)</em>.</p>
 <dl class="class">
 <dt id="promod3.loop.ForcefieldHarmonicAngleInfo">
 <em class="property">class </em><code class="descclassname">promod3.loop.</code><code class="descname">ForcefieldHarmonicAngleInfo</code><a class="headerlink" href="#promod3.loop.ForcefieldHarmonicAngleInfo" title="Permalink to this definition">¶</a></dt>
-<dd><p>Define harmonic angle (see <a class="reference external" href="http://www.openstructure.org/docs/dev/mol/mm/topology/#ost.mol.mm.Topology.AddHarmonicAngle" title="(in OpenStructure v1.6.0)"><code class="xref py py-meth docutils literal"><span class="pre">ost.mol.mm.Topology.AddHarmonicAngle()</span></code></a>)</p>
+<dd><p>Define harmonic angle (see <a class="reference external" href="https://www.openstructure.org/docs/dev/mol/mm/topology/#ost.mol.mm.Topology.AddHarmonicAngle" title="(in OpenStructure v1.7.1)"><code class="xref py py-meth docutils literal"><span class="pre">ost.mol.mm.Topology.AddHarmonicAngle()</span></code></a>)</p>
 <dl class="attribute">
 <dt id="promod3.loop.ForcefieldHarmonicAngleInfo.index_one">
 <code class="descname">index_one</code><a class="headerlink" href="#promod3.loop.ForcefieldHarmonicAngleInfo.index_one" title="Permalink to this definition">¶</a></dt>
@@ -1179,7 +1181,7 @@ False, False)</em>.</p>
 <dt id="promod3.loop.ForcefieldUreyBradleyAngleInfo">
 <em class="property">class </em><code class="descclassname">promod3.loop.</code><code class="descname">ForcefieldUreyBradleyAngleInfo</code><a class="headerlink" href="#promod3.loop.ForcefieldUreyBradleyAngleInfo" title="Permalink to this definition">¶</a></dt>
 <dd><p>Define Urey-Bradley angle
-(see <a class="reference external" href="http://www.openstructure.org/docs/dev/mol/mm/topology/#ost.mol.mm.Topology.AddUreyBradleyAngle" title="(in OpenStructure v1.6.0)"><code class="xref py py-meth docutils literal"><span class="pre">ost.mol.mm.Topology.AddUreyBradleyAngle()</span></code></a>)</p>
+(see <a class="reference external" href="https://www.openstructure.org/docs/dev/mol/mm/topology/#ost.mol.mm.Topology.AddUreyBradleyAngle" title="(in OpenStructure v1.7.1)"><code class="xref py py-meth docutils literal"><span class="pre">ost.mol.mm.Topology.AddUreyBradleyAngle()</span></code></a>)</p>
 <dl class="attribute">
 <dt id="promod3.loop.ForcefieldUreyBradleyAngleInfo.index_one">
 <code class="descname">index_one</code><a class="headerlink" href="#promod3.loop.ForcefieldUreyBradleyAngleInfo.index_one" title="Permalink to this definition">¶</a></dt>
@@ -1284,8 +1286,8 @@ False, False)</em>.</p>
 <dt id="promod3.loop.ForcefieldPeriodicDihedralInfo">
 <em class="property">class </em><code class="descclassname">promod3.loop.</code><code class="descname">ForcefieldPeriodicDihedralInfo</code><a class="headerlink" href="#promod3.loop.ForcefieldPeriodicDihedralInfo" title="Permalink to this definition">¶</a></dt>
 <dd><p>Define periodic dihedral or improper (see
-<a class="reference external" href="http://www.openstructure.org/docs/dev/mol/mm/topology/#ost.mol.mm.Topology.AddPeriodicDihedral" title="(in OpenStructure v1.6.0)"><code class="xref py py-meth docutils literal"><span class="pre">ost.mol.mm.Topology.AddPeriodicDihedral()</span></code></a> and
-<a class="reference external" href="http://www.openstructure.org/docs/dev/mol/mm/topology/#ost.mol.mm.Topology.AddPeriodicImproper" title="(in OpenStructure v1.6.0)"><code class="xref py py-meth docutils literal"><span class="pre">ost.mol.mm.Topology.AddPeriodicImproper()</span></code></a>)</p>
+<a class="reference external" href="https://www.openstructure.org/docs/dev/mol/mm/topology/#ost.mol.mm.Topology.AddPeriodicDihedral" title="(in OpenStructure v1.7.1)"><code class="xref py py-meth docutils literal"><span class="pre">ost.mol.mm.Topology.AddPeriodicDihedral()</span></code></a> and
+<a class="reference external" href="https://www.openstructure.org/docs/dev/mol/mm/topology/#ost.mol.mm.Topology.AddPeriodicImproper" title="(in OpenStructure v1.7.1)"><code class="xref py py-meth docutils literal"><span class="pre">ost.mol.mm.Topology.AddPeriodicImproper()</span></code></a>)</p>
 <dl class="attribute">
 <dt id="promod3.loop.ForcefieldPeriodicDihedralInfo.index_one">
 <code class="descname">index_one</code><a class="headerlink" href="#promod3.loop.ForcefieldPeriodicDihedralInfo.index_one" title="Permalink to this definition">¶</a></dt>
@@ -1389,7 +1391,7 @@ False, False)</em>.</p>
 <dl class="class">
 <dt id="promod3.loop.ForcefieldHarmonicImproperInfo">
 <em class="property">class </em><code class="descclassname">promod3.loop.</code><code class="descname">ForcefieldHarmonicImproperInfo</code><a class="headerlink" href="#promod3.loop.ForcefieldHarmonicImproperInfo" title="Permalink to this definition">¶</a></dt>
-<dd><p>Define harmonic improper (see <a class="reference external" href="http://www.openstructure.org/docs/dev/mol/mm/topology/#ost.mol.mm.Topology.AddHarmonicImproper" title="(in OpenStructure v1.6.0)"><code class="xref py py-meth docutils literal"><span class="pre">ost.mol.mm.Topology.AddHarmonicImproper()</span></code></a>)</p>
+<dd><p>Define harmonic improper (see <a class="reference external" href="https://www.openstructure.org/docs/dev/mol/mm/topology/#ost.mol.mm.Topology.AddHarmonicImproper" title="(in OpenStructure v1.7.1)"><code class="xref py py-meth docutils literal"><span class="pre">ost.mol.mm.Topology.AddHarmonicImproper()</span></code></a>)</p>
 <dl class="attribute">
 <dt id="promod3.loop.ForcefieldHarmonicImproperInfo.index_one">
 <code class="descname">index_one</code><a class="headerlink" href="#promod3.loop.ForcefieldHarmonicImproperInfo.index_one" title="Permalink to this definition">¶</a></dt>
@@ -1479,7 +1481,7 @@ False, False)</em>.</p>
 <dl class="class">
 <dt id="promod3.loop.ForcefieldLJPairInfo">
 <em class="property">class </em><code class="descclassname">promod3.loop.</code><code class="descname">ForcefieldLJPairInfo</code><a class="headerlink" href="#promod3.loop.ForcefieldLJPairInfo" title="Permalink to this definition">¶</a></dt>
-<dd><p>Define LJ pair (see <a class="reference external" href="http://www.openstructure.org/docs/dev/mol/mm/topology/#ost.mol.mm.Topology.AddLJPair" title="(in OpenStructure v1.6.0)"><code class="xref py py-meth docutils literal"><span class="pre">ost.mol.mm.Topology.AddLJPair()</span></code></a>)</p>
+<dd><p>Define LJ pair (see <a class="reference external" href="https://www.openstructure.org/docs/dev/mol/mm/topology/#ost.mol.mm.Topology.AddLJPair" title="(in OpenStructure v1.7.1)"><code class="xref py py-meth docutils literal"><span class="pre">ost.mol.mm.Topology.AddLJPair()</span></code></a>)</p>
 <dl class="attribute">
 <dt id="promod3.loop.ForcefieldLJPairInfo.index_one">
 <code class="descname">index_one</code><a class="headerlink" href="#promod3.loop.ForcefieldLJPairInfo.index_one" title="Permalink to this definition">¶</a></dt>
@@ -1583,9 +1585,6 @@ False, False)</em>.</p>
       <input type="hidden" name="check_keywords" value="yes" />
       <input type="hidden" name="area" value="default" />
     </form>
-    <p class="searchtip" style="font-size: 90%">
-    Enter search terms or a module, class or function name.
-    </p>
 </div>
 <script type="text/javascript">$('#searchbox').show(0);</script>
         </div>
@@ -1593,11 +1592,11 @@ False, False)</em>.</p>
       <div class="clearer"></div>
     </div>
     <div class="footer">
-      &copy;2017, ProMod3 authors.
+      &copy;2018, ProMod3 authors.
       
       |
-      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a>
-      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.6</a>
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.4.1</a>
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
       
       |
       <a href="../_sources/loop/mm_system_creation.txt"
diff --git a/doc/html/loop/structure_db.html b/doc/html/loop/structure_db.html
index 3cd58befeece6c7b0a2c8e9667378dd6f46fb7ba..9e2c5705f18ee62396096e5fb1a4622a9ff814dc 100644
--- a/doc/html/loop/structure_db.html
+++ b/doc/html/loop/structure_db.html
@@ -6,7 +6,7 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
-    <title>Structural Data &mdash; ProMod3 1.1.0 documentation</title>
+    <title>Structural Data &mdash; ProMod3 1.2.0 documentation</title>
     
     <link rel="stylesheet" href="../_static/alabaster.css" type="text/css" />
     <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
@@ -14,7 +14,7 @@
     <script type="text/javascript">
       var DOCUMENTATION_OPTIONS = {
         URL_ROOT:    '../',
-        VERSION:     '1.1.0',
+        VERSION:     '1.2.0',
         COLLAPSE_INDEX: false,
         FILE_SUFFIX: '.html',
         HAS_SOURCE:  true
@@ -23,16 +23,18 @@
     <script type="text/javascript" src="../_static/jquery.js"></script>
     <script type="text/javascript" src="../_static/underscore.js"></script>
     <script type="text/javascript" src="../_static/doctools.js"></script>
-    <link rel="top" title="ProMod3 1.1.0 documentation" href="../index.html" />
+    <link rel="top" title="ProMod3 1.2.0 documentation" href="../index.html" />
     <link rel="up" title="loop - Loop Handling" href="index.html" />
     <link rel="next" title="Handling All Atom Positions" href="all_atom.html" />
     <link rel="prev" title="Sampling Dihedral Angles" href="torsion_sampler.html" />
    
+  <link rel="stylesheet" href="../_static/custom.css" type="text/css" />
   
-  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
 
   </head>
-  <body role="document">  
+  <body role="document">
+  
 
     <div class="document">
       <div class="documentwrapper">
@@ -41,57 +43,89 @@
             
   <div class="section" id="structural-data">
 <h1>Structural Data<a class="headerlink" href="#structural-data" title="Permalink to this headline">¶</a></h1>
-<p>The structural database serves as a container for structural backbone
-and profile data. It can be filled with chains of pdb structures with their
-corresponding profiles as they are produced by the HHSuite tools <a class="reference internal" href="#soding2005" id="id1">[soding2005]</a>.
-Structural and profile data get complemented by with additional information.
-Following features get stored on a per residue basis:</p>
-<ul class="simple">
-<li>The amino acid one letter code</li>
-<li>The coordinates of the backbone atoms (N,CA,C,O)</li>
+<p>The structural database serves as a container for structural backbone and
+sequence data. Custom accessor objects can be implemented that relate
+arbitrary features to structural data. Examples provided by ProMod3 include
+accession using matching stem geometry (see: <a class="reference internal" href="#promod3.loop.FragDB" title="promod3.loop.FragDB"><code class="xref py py-class docutils literal"><span class="pre">FragDB</span></code></a>) or sequence
+features (see: <a class="reference internal" href="#promod3.loop.Fragger" title="promod3.loop.Fragger"><code class="xref py py-class docutils literal"><span class="pre">Fragger</span></code></a>).
+Besides backbone and sequence data, derived features can
+optionally be stored. E.g. sequence profiles or secondary structure information.
+Optional data includes:</p>
+<blockquote>
+<div><ul class="simple">
 <li>The phi/psi dihedral angles</li>
 <li>The secondary structure state as defined by dssp</li>
 <li>The solvent accessibility in square Angstrom</li>
-<li>The residue depth defined as the average distance from all atoms of a
-residue to the closest surface vertex as calculated by msms <a class="reference internal" href="#sanner1996" id="id2">[sanner1996]</a>.
-This is a simplified version of the residue depth as discussed in
-<a class="reference internal" href="#chakravarty1999" id="id3">[chakravarty1999]</a> and gets directly calculated when structural information
-gets added to the StructureDB.</li>
 <li>The amino acid frequencies as given by an input sequence profile</li>
+<li>The residue depth - The residue depth is defined as the minimum distance of
+a residue towards any of the exposed residues.
+Distances are calculated using CB positions (artificially constructed in case
+of glycine) and exposed is defined as:
+relative solvent accessibility &gt; 25% and at least one atom being exposed
+to the OUTER surface. To determine whether an atom is part of that outer
+surface, the full structure is placed into a 3D grid and a flood fill
+algorithm is used to determine the atoms of interest.
+Internal cavities are excluded by using this approach. This is a simplified
+version of the residue depth as discussed in <a class="reference internal" href="#chakravarty1999" id="id1">[chakravarty1999]</a> and gets
+directly calculated when structural information is added to the StructureDB.</li>
 <li>The amino acid frequency derived from structural alignments as described
-in <a class="reference internal" href="#zhou2005" id="id4">[zhou2005]</a> - Since the calculation of such a profile already requires a
+in <a class="reference internal" href="#zhou2005" id="id2">[zhou2005]</a> - Since the calculation of such a profile already requires a
 StructureDB, we end up in a hen and egg problem here... When adding
 structural information to the StructureDB, the according memory gets
 just allocated and set to zero. The usage of this information
 is therefore only meaningful if you calculate these profiles
 and manually set them (or load the provided default database).</li>
 </ul>
+</div></blockquote>
 <div class="section" id="defining-chains-and-fragments">
 <h2>Defining Chains and Fragments<a class="headerlink" href="#defining-chains-and-fragments" title="Permalink to this headline">¶</a></h2>
 <dl class="class">
 <dt id="promod3.loop.CoordInfo">
 <em class="property">class </em><code class="descclassname">promod3.loop.</code><code class="descname">CoordInfo</code><a class="headerlink" href="#promod3.loop.CoordInfo" title="Permalink to this definition">¶</a></dt>
 <dd><p>The CoordInfo gets automatically generated when new chains are added to
-the structural database. It contains internal information of how
-the according chain is stored in the database.</p>
+the structural database. It contains internal information of how a
+connected stretch of residues is stored in the database.</p>
+<dl class="attribute">
+<dt id="promod3.loop.CoordInfo.id">
+<code class="descname">id</code><a class="headerlink" href="#promod3.loop.CoordInfo.id" title="Permalink to this definition">¶</a></dt>
+<dd><p>An id string specified when adding the corresponding stretch to the
+structure db</p>
+</dd></dl>
+
 <dl class="attribute">
-<dt id="promod3.loop.CoordInfo.pdb_id">
-<code class="descname">pdb_id</code><a class="headerlink" href="#promod3.loop.CoordInfo.pdb_id" title="Permalink to this definition">¶</a></dt>
-<dd><p>A character residue string containing the 4 character pdb_id and the
-1 character chain_id. (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#str" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">str</span></code></a>)</p>
+<dt id="promod3.loop.CoordInfo.chain_name">
+<code class="descname">chain_name</code><a class="headerlink" href="#promod3.loop.CoordInfo.chain_name" title="Permalink to this definition">¶</a></dt>
+<dd><p>A chain name string specified when adding the corresponding stretch to the
+structure db</p>
 </dd></dl>
 
 <dl class="attribute">
 <dt id="promod3.loop.CoordInfo.offset">
 <code class="descname">offset</code><a class="headerlink" href="#promod3.loop.CoordInfo.offset" title="Permalink to this definition">¶</a></dt>
-<dd><p>All residues of the added structures are stored in a linear memory layout.
-The offset parameter tells us where it exactly starts. (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>)</p>
+<dd><p>All residues of the added stretch are stored in a linear memory layout.
+The offset parameter tells us where it exactly starts in the global data
+structure. (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>)</p>
 </dd></dl>
 
 <dl class="attribute">
 <dt id="promod3.loop.CoordInfo.size">
 <code class="descname">size</code><a class="headerlink" href="#promod3.loop.CoordInfo.size" title="Permalink to this definition">¶</a></dt>
-<dd><p>The length of the stretch of residues. (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>)</p>
+<dd><p>The number of residues in that stretch (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>)</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="promod3.loop.CoordInfo.start_resnum">
+<code class="descname">start_resnum</code><a class="headerlink" href="#promod3.loop.CoordInfo.start_resnum" title="Permalink to this definition">¶</a></dt>
+<dd><p>Residue number of first residue in the added stretch. The residue number
+is relative to the SEQRES provided in the input profile when adding the
+stuff to the structure db.</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="promod3.loop.CoordInfo.shift">
+<code class="descname">shift</code><a class="headerlink" href="#promod3.loop.CoordInfo.shift" title="Permalink to this definition">¶</a></dt>
+<dd><p>Translation from original coordinates that has been applied before storing
+structural information in db.</p>
 </dd></dl>
 
 </dd></dl>
@@ -99,7 +133,8 @@ The offset parameter tells us where it exactly starts. (<a class="reference exte
 <dl class="class">
 <dt id="promod3.loop.FragmentInfo">
 <em class="property">class </em><code class="descclassname">promod3.loop.</code><code class="descname">FragmentInfo</code><span class="sig-paren">(</span><em>chain_index</em>, <em>offset</em>, <em>length</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.loop.FragmentInfo" title="Permalink to this definition">¶</a></dt>
-<dd><p>The FragmentInfo defines a fragment in the structural database.</p>
+<dd><p>The FragmentInfo defines any fragment in the structural database. If you
+implement your own accessor object, thats the information you want to store.</p>
 <table class="docutils field-list" frame="void" rules="none">
 <col class="field-name" />
 <col class="field-body" />
@@ -116,13 +151,14 @@ The offset parameter tells us where it exactly starts. (<a class="reference exte
 <dl class="attribute">
 <dt id="promod3.loop.FragmentInfo.chain_index">
 <code class="descname">chain_index</code><a class="headerlink" href="#promod3.loop.FragmentInfo.chain_index" title="Permalink to this definition">¶</a></dt>
-<dd><p>The index of the chain (defined by <a class="reference internal" href="#promod3.loop.CoordInfo" title="promod3.loop.CoordInfo"><code class="xref py py-class docutils literal"><span class="pre">CoordInfo</span></code></a>) in the structure db this particle belongs to. (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>)</p>
+<dd><p>The index of the chain (defined by <a class="reference internal" href="#promod3.loop.CoordInfo" title="promod3.loop.CoordInfo"><code class="xref py py-class docutils literal"><span class="pre">CoordInfo</span></code></a>) in the structure db
+this particle belongs to. (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>)</p>
 </dd></dl>
 
 <dl class="attribute">
 <dt id="promod3.loop.FragmentInfo.offset">
 <code class="descname">offset</code><a class="headerlink" href="#promod3.loop.FragmentInfo.offset" title="Permalink to this definition">¶</a></dt>
-<dd><p>Index of residue in <strong>chain</strong> the fragment starts. (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>)</p>
+<dd><p>Index of residue in <strong>chain</strong> the fragment starts. (0-based, <a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>)</p>
 </dd></dl>
 
 <dl class="attribute">
@@ -138,97 +174,141 @@ The offset parameter tells us where it exactly starts. (<a class="reference exte
 <h2>The Structure Database<a class="headerlink" href="#the-structure-database" title="Permalink to this headline">¶</a></h2>
 <p>The following code example demonstrates how to create a structural database
 and fill it with content.</p>
-<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">promod3</span> <span class="kn">import</span> <span class="n">loop</span>
-<span class="kn">from</span> <span class="nn">ost</span> <span class="kn">import</span> <span class="n">io</span>
+<div class="highlight-default"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">promod3</span> <span class="k">import</span> <span class="n">loop</span>
+<span class="kn">from</span> <span class="nn">ost</span> <span class="k">import</span> <span class="n">io</span><span class="p">,</span> <span class="n">seq</span>
 <span class="kn">import</span> <span class="nn">os</span>
 
-<span class="c"># we also need the external tools dssp and msms, you have to make</span>
-<span class="c"># sure that they are somewhere in your PATH</span>
-<span class="kn">from</span> <span class="nn">ost.bindings</span> <span class="kn">import</span> <span class="n">dssp</span>
-<span class="kn">from</span> <span class="nn">ost.bindings</span> <span class="kn">import</span> <span class="n">msms</span>
-
-<span class="n">structure_db</span> <span class="o">=</span> <span class="n">loop</span><span class="o">.</span><span class="n">StructureDB</span><span class="p">()</span>
+<span class="c1"># StructureDB where all data get extracted</span>
+<span class="n">structure_db_one</span> <span class="o">=</span> <span class="n">loop</span><span class="o">.</span><span class="n">StructureDB</span><span class="p">(</span><span class="n">loop</span><span class="o">.</span><span class="n">StructureDBDataType</span><span class="o">.</span><span class="n">All</span><span class="p">)</span>
 
-<span class="c"># lets fill in some structures. It gets assumed, that all required</span>
-<span class="c"># data lies in the following directories</span>
-<span class="n">structure_dir</span> <span class="o">=</span> <span class="s">&quot;data&quot;</span>
-<span class="n">prof_dir</span> <span class="o">=</span> <span class="s">&quot;data&quot;</span>
+<span class="c1"># StructureDB where we only have the default data </span>
+<span class="c1"># (positions and sequence) plus residue depths and dihedrals.</span>
+<span class="c1"># In order to pass the required flags, we use a bitwise or.</span>
+<span class="n">structure_db_two</span> <span class="o">=</span> <span class="n">loop</span><span class="o">.</span><span class="n">StructureDB</span><span class="p">(</span>
+                   <span class="n">loop</span><span class="o">.</span><span class="n">StructureDBDataType</span><span class="o">.</span><span class="n">ResidueDepths</span> <span class="o">|</span>
+                   <span class="n">loop</span><span class="o">.</span><span class="n">StructureDBDataType</span><span class="o">.</span><span class="n">Dihedrals</span><span class="p">)</span>
 
-<span class="c"># the first 4 letters are suposed to be the pdb id, and the last one</span>
-<span class="c"># the corresponding chain name. The naming of the files in the</span>
-<span class="c"># directories is e.g. 1CRN.pdb for the structure and 1CRNA.hhm for</span>
-<span class="c"># the profile. Please note, that the structure can contain several</span>
-<span class="c"># chains, whereas the hhm file is only for that specific chain.</span>
-<span class="n">ids</span> <span class="o">=</span> <span class="p">[</span><span class="s">&quot;1CRNA&quot;</span><span class="p">,</span> <span class="s">&quot;1AKIA&quot;</span><span class="p">]</span>
+<span class="c1"># Lets fill in some structures. It gets assumed, that all required</span>
+<span class="c1"># data lies in the following directories.</span>
+<span class="n">structure_dir</span> <span class="o">=</span> <span class="s2">&quot;data&quot;</span>
+<span class="n">prof_dir</span> <span class="o">=</span> <span class="s2">&quot;data&quot;</span>
 
-<span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="n">ids</span><span class="p">:</span>
+<span class="c1"># The naming of the files in the directories is e.g. 1CRN.pdb for </span>
+<span class="c1"># the structure and 1CRNA.hhm for the profile. Please note, </span>
+<span class="c1"># that the structure can contain several chains, whereas the hhm </span>
+<span class="c1"># file is only for that specific chain.</span>
+<span class="n">structure_ids</span> <span class="o">=</span> <span class="p">[</span><span class="s2">&quot;1CRN&quot;</span><span class="p">,</span> <span class="s2">&quot;1AKI&quot;</span><span class="p">]</span>
+<span class="n">chain_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">&quot;A&quot;</span><span class="p">,</span> <span class="s2">&quot;A&quot;</span><span class="p">]</span>
 
-    <span class="n">pdb_id</span> <span class="o">=</span> <span class="n">i</span><span class="p">[:</span><span class="mi">4</span><span class="p">]</span>
-    <span class="n">chain_id</span> <span class="o">=</span> <span class="n">i</span><span class="p">[</span><span class="mi">4</span><span class="p">]</span>
+<span class="k">for</span> <span class="n">s_id</span><span class="p">,</span> <span class="n">ch_name</span> <span class="ow">in</span> <span class="nb">zip</span><span class="p">(</span><span class="n">structure_ids</span><span class="p">,</span> <span class="n">chain_names</span><span class="p">):</span>
 
-    <span class="c"># join together the data paths</span>
-    <span class="n">structure_path</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">structure_dir</span><span class="p">,</span> <span class="n">pdb_id</span> <span class="o">+</span> <span class="s">&quot;.pdb&quot;</span><span class="p">)</span>
-    <span class="n">prof_path</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">prof_dir</span><span class="p">,</span> <span class="n">pdb_id</span> <span class="o">+</span> <span class="n">chain_id</span> <span class="o">+</span> <span class="s">&quot;.hhm&quot;</span><span class="p">)</span>
+    <span class="c1"># Join together the data paths.</span>
+    <span class="n">structure_path</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">structure_dir</span><span class="p">,</span> <span class="n">s_id</span> <span class="o">+</span> <span class="s2">&quot;.pdb&quot;</span><span class="p">)</span>
+    <span class="n">prof_path</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">prof_dir</span><span class="p">,</span> <span class="n">s_id</span> <span class="o">+</span> <span class="n">ch_name</span> <span class="o">+</span> <span class="s2">&quot;.hhm&quot;</span><span class="p">)</span>
 
-    <span class="c"># let&#39;s load the structure</span>
-    <span class="n">structure</span> <span class="o">=</span> <span class="n">io</span><span class="o">.</span><span class="n">LoadPDB</span><span class="p">(</span><span class="n">structure_path</span><span class="p">)</span><span class="o">.</span><span class="n">Select</span><span class="p">(</span><span class="s">&quot;peptide=True&quot;</span><span class="p">)</span>
-    <span class="n">single_chain_structure</span> <span class="o">=</span> <span class="n">structure</span><span class="o">.</span><span class="n">Select</span><span class="p">(</span><span class="s">&quot;cname=&quot;</span> <span class="o">+</span> <span class="n">chain_id</span><span class="p">)</span>
+    <span class="c1"># Let&#39;s load the structure.</span>
+    <span class="n">structure</span> <span class="o">=</span> <span class="n">io</span><span class="o">.</span><span class="n">LoadPDB</span><span class="p">(</span><span class="n">structure_path</span><span class="p">)</span><span class="o">.</span><span class="n">Select</span><span class="p">(</span><span class="s2">&quot;peptide=True&quot;</span><span class="p">)</span>
     
-    <span class="c"># and the according profile in hhm format</span>
+    <span class="c1"># And the according profile in hhm format.</span>
     <span class="n">prof</span> <span class="o">=</span> <span class="n">io</span><span class="o">.</span><span class="n">LoadSequenceProfile</span><span class="p">(</span><span class="n">prof_path</span><span class="p">)</span>
 
-    <span class="c"># we run dssp in a way, that the secondary structure, as well as</span>
-    <span class="c"># the solvent accessibily gets assigned</span>
-    <span class="n">dssp</span><span class="o">.</span><span class="n">AssignDSSP</span><span class="p">(</span><span class="n">structure</span><span class="p">,</span> <span class="n">extract_burial_status</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>
-
-    <span class="c"># as a final step we need the surface as calculated by msms</span>
-    <span class="n">surf</span> <span class="o">=</span> <span class="n">msms</span><span class="o">.</span><span class="n">CalculateSurface</span><span class="p">(</span><span class="n">structure</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span>
-
-    <span class="c"># let&#39;s add it! Please note, that we calculated solvent </span>
-    <span class="c"># accessiblity / secondary structure and surface on the full</span>
-    <span class="c"># structure but only add one of the chains.</span>
-    <span class="n">structure_db</span><span class="o">.</span><span class="n">AddCoordinates</span><span class="p">(</span><span class="n">pdb_id</span><span class="p">,</span> <span class="n">chain_id</span><span class="p">,</span>
-                                <span class="n">single_chain_structure</span><span class="o">.</span><span class="n">chains</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> 
-                                <span class="n">surf</span><span class="p">,</span> <span class="n">prof</span><span class="p">)</span>
-
-<span class="c"># we now have two structures in the database...</span>
-
-<span class="c"># Please note, that there is no profile derived from structures</span>
-<span class="c"># assigned yet. To demonstrate, we use our small db to derive</span>
-<span class="c"># profiles.</span>
-<span class="n">src_db</span> <span class="o">=</span> <span class="n">structure_db</span>
-<span class="c"># In practice you might want to use the default StructureDB instead:</span>
-<span class="c"># src_db = loop.LoadStructureDB()</span>
-
-<span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="n">structure_db</span><span class="o">.</span><span class="n">GetNumCoords</span><span class="p">()):</span>
-    <span class="c"># get the CoordInfo for chain with index i </span>
-    <span class="n">coord_info</span> <span class="o">=</span> <span class="n">structure_db</span><span class="o">.</span><span class="n">GetCoordInfo</span><span class="p">(</span><span class="n">i</span><span class="p">)</span>
-    <span class="c"># define a fragment, that covers the full length</span>
+    <span class="c1"># For simplicity we use as SEQRES the sequence from the profile.</span>
+    <span class="c1"># In this case the numbering of the structures already matches.</span>
+    <span class="n">seqres</span> <span class="o">=</span> <span class="n">seq</span><span class="o">.</span><span class="n">CreateSequence</span><span class="p">(</span><span class="n">ch_name</span><span class="p">,</span> <span class="n">prof</span><span class="o">.</span><span class="n">sequence</span><span class="p">)</span>
+
+    <span class="c1"># Add the stuff to the first StructureDB</span>
+    <span class="n">structure_db_one</span><span class="o">.</span><span class="n">AddCoordinates</span><span class="p">(</span><span class="n">s_id</span><span class="p">,</span> <span class="n">ch_name</span><span class="p">,</span> <span class="n">structure</span><span class="p">,</span> 
+                                    <span class="n">seqres</span><span class="p">,</span> <span class="n">prof</span><span class="p">)</span>
+
+    <span class="c1"># Add the stuff to the second StructureDB, </span>
+    <span class="c1"># No profile required here...</span>
+    <span class="n">structure_db_two</span><span class="o">.</span><span class="n">AddCoordinates</span><span class="p">(</span><span class="n">s_id</span><span class="p">,</span> <span class="n">ch_name</span><span class="p">,</span> <span class="n">structure</span><span class="p">,</span> 
+                                    <span class="n">seqres</span><span class="p">)</span>
+
+                                
+<span class="c1"># We now have two structures in both databases...</span>
+
+<span class="c1"># Please note, that there is no profile derived from structures</span>
+<span class="c1"># assigned yet to structure_db_one, the memory is only allocated</span>
+<span class="c1"># and set to zero. In structure_db_two, there&#39;ll never be stored a </span>
+<span class="c1"># structure profile as we did not initialize it accordingly. </span>
+<span class="c1"># However, we can still use its coordinates and residue depths to</span>
+<span class="c1"># generate profiles!  </span>
+<span class="c1"># To demonstrate, we use our structure_db_two to derive profiles </span>
+<span class="c1"># and set them in structure_db_one.</span>
+
+<span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="n">structure_db_one</span><span class="o">.</span><span class="n">GetNumCoords</span><span class="p">()):</span>
+
+    <span class="c1"># get the CoordInfo for chain with index i </span>
+    <span class="n">coord_info</span> <span class="o">=</span> <span class="n">structure_db_one</span><span class="o">.</span><span class="n">GetCoordInfo</span><span class="p">(</span><span class="n">i</span><span class="p">)</span>
+
+    <span class="c1"># define a fragment, that covers the full length</span>
     <span class="n">frag_info</span> <span class="o">=</span> <span class="n">loop</span><span class="o">.</span><span class="n">FragmentInfo</span><span class="p">(</span><span class="n">i</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">coord_info</span><span class="o">.</span><span class="n">size</span><span class="p">)</span>
-    <span class="c"># generate a profile based on the structural data in the src_db</span>
-    <span class="n">prof</span> <span class="o">=</span> <span class="n">src_db</span><span class="o">.</span><span class="n">GenerateStructureProfile</span><span class="p">(</span><span class="n">structure_db</span><span class="p">,</span> <span class="n">frag_info</span><span class="p">)</span>
-    <span class="c"># and add it to the previously created structure_db</span>
-    <span class="n">structure_db</span><span class="o">.</span><span class="n">SetStructureProfile</span><span class="p">(</span><span class="n">i</span><span class="p">,</span> <span class="n">prof</span><span class="p">)</span>
 
-<span class="c"># That&#39;s it! Let&#39;s save it down...</span>
-<span class="n">structure_db</span><span class="o">.</span><span class="n">Save</span><span class="p">(</span><span class="s">&quot;my_db.dat&quot;</span><span class="p">)</span>
+    <span class="c1"># extract all required information</span>
+    <span class="n">sequence</span> <span class="o">=</span> <span class="n">structure_db_one</span><span class="o">.</span><span class="n">GetSequence</span><span class="p">(</span><span class="n">frag_info</span><span class="p">)</span>
+    <span class="n">bb_list</span> <span class="o">=</span> <span class="n">structure_db_one</span><span class="o">.</span><span class="n">GetBackboneList</span><span class="p">(</span><span class="n">frag_info</span><span class="p">,</span> <span class="n">sequence</span><span class="p">)</span>
+    <span class="n">res_depths</span> <span class="o">=</span> <span class="n">structure_db_one</span><span class="o">.</span><span class="n">GetResidueDepths</span><span class="p">(</span><span class="n">frag_info</span><span class="p">)</span>
+
+    <span class="c1"># generate structure profiles based on structure_db_two</span>
+    <span class="n">prof</span> <span class="o">=</span> <span class="n">structure_db_two</span><span class="o">.</span><span class="n">GenerateStructureProfile</span><span class="p">(</span><span class="n">bb_list</span><span class="p">,</span> 
+                                                     <span class="n">res_depths</span><span class="p">)</span>
+    <span class="c1"># and add it to the previously created structure_db</span>
+    <span class="n">structure_db_one</span><span class="o">.</span><span class="n">SetStructureProfile</span><span class="p">(</span><span class="n">i</span><span class="p">,</span> <span class="n">prof</span><span class="p">)</span>
+
+<span class="c1"># That&#39;s it! Let&#39;s save both databases down.</span>
+<span class="c1"># structure_db_two will use much less memory, as it contains less data. </span>
+<span class="c1"># Sidenote: We&#39;re saving the portable version. If you intent to use </span>
+<span class="c1"># your database only on one system, the Save / Load functions should</span>
+<span class="c1"># be preferred, as the loading will be much faster.</span>
+<span class="n">structure_db_one</span><span class="o">.</span><span class="n">SavePortable</span><span class="p">(</span><span class="s2">&quot;my_db_one.dat&quot;</span><span class="p">)</span>
+<span class="n">structure_db_two</span><span class="o">.</span><span class="n">SavePortable</span><span class="p">(</span><span class="s2">&quot;my_db_two.dat&quot;</span><span class="p">)</span>
 </pre></div>
 </div>
-<p>Calculating the structural profiles is highly expensive and heavily depends on
+<p>Calculating the structural profiles is expensive and heavily depends on
 the size of the database used as source. If you want to do this for a larger
 database, you might want to consider two things:</p>
 <ol class="arabic simple">
-<li>Use a database of limited size as structural source (something
+<li>Use a database of limited size to generate the actual profiles (something
 in between 5000 and 10000 nonredundant chains is enough)</li>
-<li>Use the <a class="reference external" href="http://www.openstructure.org/docs/dev/seq/base/seq/#ost.seq.ProfileDB" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.seq.ProfileDB</span></code></a> to gather profiles produced from jobs
+<li>Use the <a class="reference external" href="https://www.openstructure.org/docs/dev/seq/base/seq/#ost.seq.ProfileDB" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.seq.ProfileDB</span></code></a> to gather profiles produced from jobs
 running in parallel</li>
 </ol>
+<dl class="class">
+<dt id="promod3.loop.StructureDBDataType">
+<em class="property">class </em><code class="descclassname">promod3.loop.</code><code class="descname">StructureDBDataType</code><a class="headerlink" href="#promod3.loop.StructureDBDataType" title="Permalink to this definition">¶</a></dt>
+<dd><p>The StructureDBDataType enum has to be passed at initialization of a
+StructureDB in order to define what data you want to store additionally
+to backbone coordinates and sequence.
+If you want to store all data possible, use All. If you only want a subset,
+you can combine some of the datatypes with a bitwise or operation
+(see example script for StructureDB). One important note:
+If you enable AAFrequenciesStruct, the actual information is not automatically
+assigned. Only the according memory is allocated and set to zero, the actual
+information must be assigned manually (see example script again...).</p>
+<p>All, Dihedrals, SolventAccessibilities, ResidueDepths, DSSP, AAFrequencies,
+AAFrequenciesStruct</p>
+</dd></dl>
+
 <dl class="class">
 <dt id="promod3.loop.StructureDB">
-<em class="property">class </em><code class="descclassname">promod3.loop.</code><code class="descname">StructureDB</code><a class="headerlink" href="#promod3.loop.StructureDB" title="Permalink to this definition">¶</a></dt>
-<dd><dl class="staticmethod">
+<em class="property">class </em><code class="descclassname">promod3.loop.</code><code class="descname">StructureDB</code><span class="sig-paren">(</span><em>data_to_store</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.loop.StructureDB" title="Permalink to this definition">¶</a></dt>
+<dd><p>Generates an empty StructureDB that can be filled with content through
+<a class="reference internal" href="#promod3.loop.StructureDB.AddCoordinates" title="promod3.loop.StructureDB.AddCoordinates"><code class="xref py py-func docutils literal"><span class="pre">AddCoordinates()</span></code></a>. The information extracted there is defined by
+<em>data_to_store</em>. Have a look at the <a class="reference internal" href="#promod3.loop.StructureDBDataType" title="promod3.loop.StructureDBDataType"><code class="xref py py-class docutils literal"><span class="pre">StructureDBDataType</span></code></a>
+documentation and at the example script...</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>data_to_store</strong> (<a class="reference internal" href="#promod3.loop.StructureDBDataType" title="promod3.loop.StructureDBDataType"><code class="xref py py-class docutils literal"><span class="pre">StructureDBDataType</span></code></a>) &#8211; Specifies what data to store in the database, several
+flags can be combined with a bitwise or operator.</td>
+</tr>
+</tbody>
+</table>
+<dl class="staticmethod">
 <dt id="promod3.loop.StructureDB.Load">
-<em class="property">static </em><code class="descname">Load</code><span class="sig-paren">(</span><em>filename</em>, <em>load_frequencies=True</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.loop.StructureDB.Load" title="Permalink to this definition">¶</a></dt>
+<em class="property">static </em><code class="descname">Load</code><span class="sig-paren">(</span><em>filename</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.loop.StructureDB.Load" title="Permalink to this definition">¶</a></dt>
 <dt id="promod3.loop.StructureDB.LoadPortable">
 <em class="property">static </em><code class="descname">LoadPortable</code><span class="sig-paren">(</span><em>filename</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.loop.StructureDB.LoadPortable" title="Permalink to this definition">¶</a></dt>
 <dd><p>Loads raw binary file generated with <a class="reference internal" href="#promod3.loop.StructureDB.Save" title="promod3.loop.StructureDB.Save"><code class="xref py py-meth docutils literal"><span class="pre">Save()</span></code></a> (optimized for fast
@@ -238,26 +318,14 @@ less machine-dependent).</p>
 <col class="field-name" />
 <col class="field-body" />
 <tbody valign="top">
-<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
-<li><strong>filename</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#str" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">str</span></code></a>) &#8211; Path to the file from which to load the database.</li>
-<li><strong>load_frequencies</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#bool" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">bool</span></code></a>) &#8211; If True, the full database including profile
-information for every position gets loaded.
-A database without profiles loads faster and
-requires less memory. But it&#8217;s not possible
-to add new coordinates or call one of the
-profile dependent functions.</li>
-</ul>
-</td>
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>filename</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#str" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">str</span></code></a>) &#8211; Path to the file from which to load the database.</td>
 </tr>
-<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The loaded data base</p>
-</td>
+<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The loaded data base</td>
 </tr>
-<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first"><a class="reference internal" href="#promod3.loop.StructureDB" title="promod3.loop.StructureDB"><code class="xref py py-class docutils literal"><span class="pre">StructureDB</span></code></a></p>
-</td>
+<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference internal" href="#promod3.loop.StructureDB" title="promod3.loop.StructureDB"><code class="xref py py-class docutils literal"><span class="pre">StructureDB</span></code></a></td>
 </tr>
-<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last"><a class="reference external" href="https://docs.python.org/2.7/library/exceptions.html#exceptions.RuntimeError" title="(in Python v2.7)"><code class="xref py py-exc docutils literal"><span class="pre">RuntimeError</span></code></a> if file cannot be opened or if
-file cannot be parsed (see <a class="reference internal" href="../portableIO.html#portableio"><span>here</span></a> for details).</p>
-</td>
+<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/2.7/library/exceptions.html#exceptions.RuntimeError" title="(in Python v2.7)"><code class="xref py py-exc docutils literal"><span class="pre">RuntimeError</span></code></a> if file cannot be opened or if
+file cannot be parsed (see <a class="reference internal" href="../portableIO.html#portableio"><span class="std std-ref">here</span></a> for details).</td>
 </tr>
 </tbody>
 </table>
@@ -269,7 +337,7 @@ file cannot be parsed (see <a class="reference internal" href="../portableIO.htm
 <dt id="promod3.loop.StructureDB.SavePortable">
 <code class="descname">SavePortable</code><span class="sig-paren">(</span><em>filename</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.loop.StructureDB.SavePortable" title="Permalink to this definition">¶</a></dt>
 <dd><p>Saves a raw / portable binary representation. Use portable files for
-distribution and convert locally to raw files. See <a class="reference internal" href="../portableIO.html#portableio"><span>here</span></a>
+distribution and convert locally to raw files. See <a class="reference internal" href="../portableIO.html#portableio"><span class="std std-ref">here</span></a>
 for details.</p>
 <table class="docutils field-list" frame="void" rules="none">
 <col class="field-name" />
@@ -277,9 +345,25 @@ for details.</p>
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>filename</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#str" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">str</span></code></a>) &#8211; Path to the file where the database will be saved</td>
 </tr>
-<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/2.7/library/exceptions.html#exceptions.RuntimeError" title="(in Python v2.7)"><code class="xref py py-exc docutils literal"><span class="pre">RuntimeError</span></code></a> if file cannot be opened or if
-db has been loaded with load_frequencies=False (enforces only
-complete databases to be saved down)</td>
+<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/2.7/library/exceptions.html#exceptions.RuntimeError" title="(in Python v2.7)"><code class="xref py py-exc docutils literal"><span class="pre">RuntimeError</span></code></a> if file cannot be opened</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="method">
+<dt id="promod3.loop.StructureDB.HasData">
+<code class="descname">HasData</code><span class="sig-paren">(</span><em>data_type</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.loop.StructureDB.HasData" title="Permalink to this definition">¶</a></dt>
+<dd><p>Checks, whether requested data type is available in the current database.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>data_type</strong> (<a class="reference internal" href="#promod3.loop.StructureDBDataType" title="promod3.loop.StructureDBDataType"><code class="xref py py-class docutils literal"><span class="pre">StructureDBDataType</span></code></a>) &#8211; Data type to check</td>
+</tr>
+<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">Whether the requested datatype is available</td>
+</tr>
+<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/2.7/library/functions.html#bool" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">bool</span></code></a></td>
 </tr>
 </tbody>
 </table>
@@ -287,47 +371,62 @@ complete databases to be saved down)</td>
 
 <dl class="method">
 <dt id="promod3.loop.StructureDB.AddCoordinates">
-<code class="descname">AddCoordinates</code><span class="sig-paren">(</span><em>pdb_id</em>, <em>chain_name</em>, <em>chain</em>, <em>surf</em>, <em>prof</em>, <em>solvent_accessibility_string=&quot;solvent_accessibility&quot;</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.loop.StructureDB.AddCoordinates" title="Permalink to this definition">¶</a></dt>
-<dd><p>This method takes a structural chain and searches the longest stretch of
-connected residues containing all necessary backbone atoms. This stretch
-gets then added to the database. Due to technical reasons, The maximal
-extent along one of the base axis cannot exceed 650 A.
-Following features are expected to be set on a per residue level in <em>chain</em>:
-The secondary structure (e.g. call <code class="xref py py-meth docutils literal"><span class="pre">ost.mol.alg.AssignSecStruct()</span></code> on the
-full <a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.EntityView" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.EntityView</span></code></a> the <em>chain</em> belongs to) and
-the solvent accessibility assigned using a float property with name
-<em>solvent_accessibility_string</em> as name on a per residue level (e.g. call
-<code class="xref py py-meth docutils literal"><span class="pre">ost.mol.alg.Accessibility()</span></code> on the full <a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.EntityView" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.EntityView</span></code></a>
-the chain belongs to and take care to pass the appropriate
-<em>solvent_accessibility_string</em>).</p>
+<code class="descname">AddCoordinates</code><span class="sig-paren">(</span><em>id</em>, <em>chain_name</em>, <em>ent</em>, <em>seqres</em>, <em>prof=None</em>, <em>only_longest_stretch=True</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.loop.StructureDB.AddCoordinates" title="Permalink to this definition">¶</a></dt>
+<dd><p>This method takes an entity and adds coordinates and the sequence
+of one of its chains to the structural database. Additionally, all
+data as specified at the initialization of the database is extracted
+fully automatically by considering the full <em>ent</em> (e.g. when
+calculating solvent accessibilities etc.).
+The only exception is AAFrequencies, where a valid sequence profile
+is expected in <em>prof</em> that has matching sequence with <em>seqres</em>
+All residues in chain with name <em>chain_name</em> must have residue numbers
+that directly relate them to the <em>seqres</em> with an indexing scheme
+starting from one.
+If this is not the case, an error gets thrown. You might want to
+consider to use <code class="xref py py-meth docutils literal"><span class="pre">ost.seq.Renumber()</span></code> for proper numbering.
+Based on consecutive numbering and additionally checking for valid
+peptide bonds, connected stretches are identified
+and every added connected stretch gets its own entry with
+<a class="reference internal" href="#promod3.loop.CoordInfo" title="promod3.loop.CoordInfo"><code class="xref py py-class docutils literal"><span class="pre">CoordInfo</span></code></a> as a descriptor.
+To avoid cluttering the database with many small fragments, the flag:
+<em>only_longest_stretch</em> can be used. Set it to False if all
+connected stretches of chain with name <em>chain_name</em> should be added.
+There is one final catch you have to consider: Due to the internal
+lossy data compression for the positions, the extent in x, y and
+z - direction for every connected stretch is limited to 655A. This should
+be sufficient for most structures, but stretches exceeding this maximum
+are discarded. For storing the structural data given these restraints,
+a translation is applied that gets stored as the <em>shift</em> attribute
+in the according <a class="reference internal" href="#promod3.loop.CoordInfo" title="promod3.loop.CoordInfo"><code class="xref py py-class docutils literal"><span class="pre">CoordInfo</span></code></a> object.</p>
 <table class="docutils field-list" frame="void" rules="none">
 <col class="field-name" />
 <col class="field-body" />
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
-<li><strong>pdb_id</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#str" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">str</span></code></a>) &#8211; 4-letter code of the structure the chain belongs to</li>
-<li><strong>chain_name</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#str" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">str</span></code></a>) &#8211; Name of the chain consisting of one letter</li>
-<li><strong>chain</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ChainView" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ChainView</span></code></a>) &#8211; The actual chain</li>
-<li><strong>surf</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/surface/#ost.mol.SurfaceHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.SurfaceHandle</span></code></a>) &#8211; A surface describing the solvent accessible surface
-(we advise you to provide a surface estimated with the
-full <a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.EntityView" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.EntityView</span></code></a> the <em>chain</em> belongs to)</li>
-<li><strong>prof</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/seq/base/seq/#ost.seq.ProfileHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.seq.ProfileHandle</span></code></a>) &#8211; Profile information for this <em>chain</em>.</li>
-<li><strong>solvent_accessibility_string</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#str" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">str</span></code></a>) &#8211; Name of float property where the
-solvent accessibilities are stored
-on a per residue basis in <em>chain</em></li>
+<li><strong>id</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#str" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">str</span></code></a>) &#8211; identifier of the added structure (e.g. pdb id)</li>
+<li><strong>chain_name</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#str" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">str</span></code></a>) &#8211; Name of the chain in <em>ent</em> you want to add</li>
+<li><strong>ent</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.EntityView" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.EntityView</span></code></a>) &#8211; The full entity that must contain a chain named
+as specified by <em>chain_name</em>.</li>
+<li><strong>seqres</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/seq/base/seq/#ost.seq.SequenceHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.seq.SequenceHandle</span></code></a>) &#8211; The reference sequence of chain with name <em>chain_name</em></li>
+<li><strong>prof</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/seq/base/seq/#ost.seq.ProfileHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.seq.ProfileHandle</span></code></a>) &#8211; Profile information for the chain with name
+<em>chain_name</em>. The profile sequence must match <em>seqres</em>.</li>
+<li><strong>only_longest_stretch</strong> &#8211; Flag whether you want to add only the longest
+connected stretch of residues are all connected
+stretches of residues</li>
 </ul>
 </td>
 </tr>
-<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">DB index of added chain.</p>
+<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">indices of added stretches in db</p>
 </td>
 </tr>
-<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first"><a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a></p>
+<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first"><code class="xref py py-class docutils literal"><span class="pre">list</span></code> of <cite>int</cite></p>
 </td>
 </tr>
-<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last"><a class="reference external" href="https://docs.python.org/2.7/library/exceptions.html#exceptions.RuntimeError" title="(in Python v2.7)"><code class="xref py py-exc docutils literal"><span class="pre">RuntimeError</span></code></a> if size of chain is too large,
-when db has been loaded with load_frequencies=False or when the
-ATOMSEQ form the <em>chain</em> can&#8217;t be aligned with the SEQRES from
-the <em>prof</em>.</p>
+<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last"><a class="reference external" href="https://docs.python.org/2.7/library/exceptions.html#exceptions.RuntimeError" title="(in Python v2.7)"><code class="xref py py-exc docutils literal"><span class="pre">RuntimeError</span></code></a> if the residues in chain with
+name <em>chain_name</em> do not match <em>seqres</em> given the
+residue numbers, when AAFrequencies have to to be extracted and
+the sequence in <em>prof</em> does not match the <em>seqres</em> or <em>prof</em> is
+invalid.</p>
 </td>
 </tr>
 </tbody>
@@ -335,22 +434,43 @@ the <em>prof</em>.</p>
 </dd></dl>
 
 <dl class="method">
-<dt id="promod3.loop.StructureDB.GetCoordIndex">
-<code class="descname">GetCoordIndex</code><span class="sig-paren">(</span><em>pdb_id</em>, <em>chain_name</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.loop.StructureDB.GetCoordIndex" title="Permalink to this definition">¶</a></dt>
+<dt id="promod3.loop.StructureDB.RemoveCoordinates">
+<code class="descname">RemoveCoordinates</code><span class="sig-paren">(</span><em>coord_idx</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.loop.StructureDB.RemoveCoordinates" title="Permalink to this definition">¶</a></dt>
+<dd><p>Removes coordinates at specified location and all its associated data. This
+has an impact on the offset values of all <a class="reference internal" href="#promod3.loop.CoordInfo" title="promod3.loop.CoordInfo"><code class="xref py py-class docutils literal"><span class="pre">CoordInfo</span></code></a> objects
+that are internally stored afterwards and on the actual coord indices
+(all shifted by one). So make sure that you adapt your data access
+accordingly!</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>coord_idx</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Specifies coordinates to be removed</td>
+</tr>
+<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/2.7/library/exceptions.html#exceptions.RuntimeError" title="(in Python v2.7)"><code class="xref py py-exc docutils literal"><span class="pre">RuntimeError</span></code></a> if <em>coord_idx</em> is invalid</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="method">
+<dt id="promod3.loop.StructureDB.GetCoordIdx">
+<code class="descname">GetCoordIdx</code><span class="sig-paren">(</span><em>id</em>, <em>chain_name</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.loop.StructureDB.GetCoordIdx" title="Permalink to this definition">¶</a></dt>
 <dd><table class="docutils field-list" frame="void" rules="none">
 <col class="field-name" />
 <col class="field-body" />
 <tbody valign="top">
-<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The StructureDB index (in [0, <a class="reference internal" href="#promod3.loop.StructureDB.GetNumCoords" title="promod3.loop.StructureDB.GetNumCoords"><code class="xref py py-meth docutils literal"><span class="pre">GetNumCoords()</span></code></a>-1]) of the
-chain of interest, -1 if it cannot be found.</p>
+<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The StructureDB indices (in [0, <a class="reference internal" href="#promod3.loop.StructureDB.GetNumCoords" title="promod3.loop.StructureDB.GetNumCoords"><code class="xref py py-meth docutils literal"><span class="pre">GetNumCoords()</span></code></a>-1]) of
+of all coords (connected stretches) with matching
+<em>id</em> / <em>chain_name</em>.</p>
 </td>
 </tr>
-<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><p class="first"><a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a></p>
+<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><p class="first"><code class="xref py py-class docutils literal"><span class="pre">list</span></code> of <a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a></p>
 </td>
 </tr>
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
-<li><strong>pdb_id</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#str" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">str</span></code></a>) &#8211; 4-letter code of the structure the chain belongs to</li>
-<li><strong>chain_name</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#str" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">str</span></code></a>) &#8211; Name of the chain consisting of one letter</li>
+<li><strong>id</strong> &#8211; Identifier given when calling <a class="reference internal" href="#promod3.loop.StructureDB.AddCoordinates" title="promod3.loop.StructureDB.AddCoordinates"><code class="xref py py-meth docutils literal"><span class="pre">AddCoordinates()</span></code></a></li>
+<li><strong>chain_name</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#str" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">str</span></code></a>) &#8211; Name of chain given when calling <a class="reference internal" href="#promod3.loop.StructureDB.AddCoordinates" title="promod3.loop.StructureDB.AddCoordinates"><code class="xref py py-meth docutils literal"><span class="pre">AddCoordinates()</span></code></a></li>
 </ul>
 </td>
 </tr>
@@ -365,7 +485,8 @@ chain of interest, -1 if it cannot be found.</p>
 <col class="field-name" />
 <col class="field-body" />
 <tbody valign="top">
-<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">Object describing the chain with index <em>idx</em>.</td>
+<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">Object describing the stretch of connected residues with
+index <em>idx</em>.</td>
 </tr>
 <tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference internal" href="#promod3.loop.CoordInfo" title="promod3.loop.CoordInfo"><code class="xref py py-class docutils literal"><span class="pre">CoordInfo</span></code></a></td>
 </tr>
@@ -375,6 +496,28 @@ chain of interest, -1 if it cannot be found.</p>
 </table>
 </dd></dl>
 
+<dl class="method">
+<dt id="promod3.loop.StructureDB.GetNumCoords">
+<code class="descname">GetNumCoords</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#promod3.loop.StructureDB.GetNumCoords" title="Permalink to this definition">¶</a></dt>
+<dd><table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">Number of connected stretches of residues that have been added to
+the database.</td>
+</tr>
+<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a></td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="method">
+<dt id="promod3.loop.StructureDB.PrintStatistics">
+<code class="descname">PrintStatistics</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#promod3.loop.StructureDB.PrintStatistics" title="Permalink to this definition">¶</a></dt>
+<dd><p>Prints out some information about the db.</p>
+</dd></dl>
+
 <dl class="method">
 <dt id="promod3.loop.StructureDB.GetBackboneList">
 <code class="descname">GetBackboneList</code><span class="sig-paren">(</span><em>fragment</em>, <em>sequence</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.loop.StructureDB.GetBackboneList" title="Permalink to this definition">¶</a></dt>
@@ -393,44 +536,23 @@ chain of interest, -1 if it cannot be found.</p>
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
 <li><strong>fragment</strong> (<a class="reference internal" href="#promod3.loop.FragmentInfo" title="promod3.loop.FragmentInfo"><code class="xref py py-class docutils literal"><span class="pre">FragmentInfo</span></code></a>) &#8211; Fragment definition from which to extract positions.</li>
 <li><strong>sequence</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#str" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">str</span></code></a>) &#8211; Sequence to set for the returned backbone list.</li>
-<li><strong>n_stem</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; Positions on which the backbone list&#8217;s N-terminus should be
+<li><strong>n_stem</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; Positions on which the backbone list&#8217;s N-terminus should be
 superposed onto.</li>
-<li><strong>c_stem</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; Positions on which the backbone list&#8217;s C-terminus should be
+<li><strong>c_stem</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; Positions on which the backbone list&#8217;s C-terminus should be
 superposed onto.</li>
 </ul>
 </td>
 </tr>
 <tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last"><a class="reference external" href="https://docs.python.org/2.7/library/exceptions.html#exceptions.RuntimeError" title="(in Python v2.7)"><code class="xref py py-exc docutils literal"><span class="pre">RuntimeError</span></code></a> if fragment is invalid (happens
-if the fragment does not fully fit into one of the chains in the
-database) or if <em>sequence</em> contains a one letter code which is not
-one of the 20 default amino acids.</p>
+if the fragment does not fully fit into one of the connected
+stretches in the database) or if <em>sequence</em> contains a one letter
+code which is not one of the 20 default amino acids.</p>
 </td>
 </tr>
 </tbody>
 </table>
 </dd></dl>
 
-<dl class="method">
-<dt id="promod3.loop.StructureDB.GetNumCoords">
-<code class="descname">GetNumCoords</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#promod3.loop.StructureDB.GetNumCoords" title="Permalink to this definition">¶</a></dt>
-<dd><table class="docutils field-list" frame="void" rules="none">
-<col class="field-name" />
-<col class="field-body" />
-<tbody valign="top">
-<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">Number of chains that have been added to the database.</td>
-</tr>
-<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a></td>
-</tr>
-</tbody>
-</table>
-</dd></dl>
-
-<dl class="method">
-<dt id="promod3.loop.StructureDB.PrintStatistics">
-<code class="descname">PrintStatistics</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#promod3.loop.StructureDB.PrintStatistics" title="Permalink to this definition">¶</a></dt>
-<dd><p>Prints out some information about the db.</p>
-</dd></dl>
-
 <dl class="method">
 <dt id="promod3.loop.StructureDB.GetSequence">
 <code class="descname">GetSequence</code><span class="sig-paren">(</span><em>fragment</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.loop.StructureDB.GetSequence" title="Permalink to this definition">¶</a></dt>
@@ -446,7 +568,7 @@ one of the 20 default amino acids.</p>
 </tr>
 <tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/2.7/library/exceptions.html#exceptions.RuntimeError" title="(in Python v2.7)"><code class="xref py py-exc docutils literal"><span class="pre">RuntimeError</span></code></a> if fragment is invalid. This is
 the case when the fragment does not fully fit into one of the
-chains in the database.</td>
+connected stretches of residues in the database.</td>
 </tr>
 </tbody>
 </table>
@@ -465,9 +587,10 @@ chains in the database.</td>
 </tr>
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>fragment</strong> (<a class="reference internal" href="#promod3.loop.FragmentInfo" title="promod3.loop.FragmentInfo"><code class="xref py py-class docutils literal"><span class="pre">FragmentInfo</span></code></a>) &#8211; Fragment definition from which to extract the states.</td>
 </tr>
-<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/2.7/library/exceptions.html#exceptions.RuntimeError" title="(in Python v2.7)"><code class="xref py py-exc docutils literal"><span class="pre">RuntimeError</span></code></a> if fragment is invalid. This is
+<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/2.7/library/exceptions.html#exceptions.RuntimeError" title="(in Python v2.7)"><code class="xref py py-exc docutils literal"><span class="pre">RuntimeError</span></code></a> if database does not contain dssp
+data or if fragment is invalid. This is
 the case when the fragment does not fully fit into one of the
-chains in the database.</td>
+connected stretches of residues in the database.</td>
 </tr>
 </tbody>
 </table>
@@ -486,9 +609,10 @@ chains in the database.</td>
 </tr>
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>fragment</strong> (<a class="reference internal" href="#promod3.loop.FragmentInfo" title="promod3.loop.FragmentInfo"><code class="xref py py-class docutils literal"><span class="pre">FragmentInfo</span></code></a>) &#8211; Fragment definition from which to extract the dihedrals.</td>
 </tr>
-<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/2.7/library/exceptions.html#exceptions.RuntimeError" title="(in Python v2.7)"><code class="xref py py-exc docutils literal"><span class="pre">RuntimeError</span></code></a> if fragment is invalid. This is
+<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/2.7/library/exceptions.html#exceptions.RuntimeError" title="(in Python v2.7)"><code class="xref py py-exc docutils literal"><span class="pre">RuntimeError</span></code></a> if database does not contain
+dihedral angle data or if fragment is invalid. This is
 the case when the fragment does not fully fit into one of the
-chains in the database.</td>
+connected stretches of residues in the database.</td>
 </tr>
 </tbody>
 </table>
@@ -508,9 +632,10 @@ chains in the database.</td>
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>fragment</strong> (<a class="reference internal" href="#promod3.loop.FragmentInfo" title="promod3.loop.FragmentInfo"><code class="xref py py-class docutils literal"><span class="pre">FragmentInfo</span></code></a>) &#8211; Fragment definition from which to extract the residue
 depths</td>
 </tr>
-<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/2.7/library/exceptions.html#exceptions.RuntimeError" title="(in Python v2.7)"><code class="xref py py-exc docutils literal"><span class="pre">RuntimeError</span></code></a> if fragment is invalid. This is
+<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/2.7/library/exceptions.html#exceptions.RuntimeError" title="(in Python v2.7)"><code class="xref py py-exc docutils literal"><span class="pre">RuntimeError</span></code></a> if database does not contain
+residue depth data or if fragment is invalid. This is
 the case when the fragment does not fully fit into one of the
-chains in the database.</td>
+connected stretches of residues in the database.</td>
 </tr>
 </tbody>
 </table>
@@ -531,9 +656,10 @@ as calculated by dssp.</td>
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>fragment</strong> (<a class="reference internal" href="#promod3.loop.FragmentInfo" title="promod3.loop.FragmentInfo"><code class="xref py py-class docutils literal"><span class="pre">FragmentInfo</span></code></a>) &#8211; Fragment definition from which to extract the solvent
 accessibilities</td>
 </tr>
-<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/2.7/library/exceptions.html#exceptions.RuntimeError" title="(in Python v2.7)"><code class="xref py py-exc docutils literal"><span class="pre">RuntimeError</span></code></a> if fragment is invalid. This is
+<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/2.7/library/exceptions.html#exceptions.RuntimeError" title="(in Python v2.7)"><code class="xref py py-exc docutils literal"><span class="pre">RuntimeError</span></code></a> if database does not contain
+solvent accessibility data or if fragment is invalid. This is
 the case when the fragment does not fully fit into one of the
-chains in the database.</td>
+connected stretches of residues in the database.</td>
 </tr>
 </tbody>
 </table>
@@ -549,14 +675,15 @@ chains in the database.</td>
 <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The sequence profile for the residues defined by <em>fragment</em> with
 the BLOSUM62 probabilities as NULL model.</td>
 </tr>
-<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="http://www.openstructure.org/docs/dev/seq/base/seq/#ost.seq.ProfileHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.seq.ProfileHandle</span></code></a></td>
+<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="https://www.openstructure.org/docs/dev/seq/base/seq/#ost.seq.ProfileHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.seq.ProfileHandle</span></code></a></td>
 </tr>
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>fragment</strong> (<a class="reference internal" href="#promod3.loop.FragmentInfo" title="promod3.loop.FragmentInfo"><code class="xref py py-class docutils literal"><span class="pre">FragmentInfo</span></code></a>) &#8211; Fragment definition from which to extract the sequence
 profile</td>
 </tr>
-<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/2.7/library/exceptions.html#exceptions.RuntimeError" title="(in Python v2.7)"><code class="xref py py-exc docutils literal"><span class="pre">RuntimeError</span></code></a> if fragment is invalid. This is
+<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/2.7/library/exceptions.html#exceptions.RuntimeError" title="(in Python v2.7)"><code class="xref py py-exc docutils literal"><span class="pre">RuntimeError</span></code></a> if database does not cotain
+aa frequency data or if fragment is invalid. This is
 the case when the fragment does not fully fit into one of the
-chains in the database.</td>
+connected stretches of residues in the database.</td>
 </tr>
 </tbody>
 </table>
@@ -572,14 +699,15 @@ chains in the database.</td>
 <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The structure profile for the residues defined by <em>fragment</em> with
 the BLOSUM62 probabilities as NULL model.</td>
 </tr>
-<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="http://www.openstructure.org/docs/dev/seq/base/seq/#ost.seq.ProfileHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.seq.ProfileHandle</span></code></a></td>
+<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="https://www.openstructure.org/docs/dev/seq/base/seq/#ost.seq.ProfileHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.seq.ProfileHandle</span></code></a></td>
 </tr>
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>fragment</strong> (<a class="reference internal" href="#promod3.loop.FragmentInfo" title="promod3.loop.FragmentInfo"><code class="xref py py-class docutils literal"><span class="pre">FragmentInfo</span></code></a>) &#8211; Fragment definition from which to extract the structure
 profile</td>
 </tr>
-<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/2.7/library/exceptions.html#exceptions.RuntimeError" title="(in Python v2.7)"><code class="xref py py-exc docutils literal"><span class="pre">RuntimeError</span></code></a> if fragment is invalid. This is
+<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/2.7/library/exceptions.html#exceptions.RuntimeError" title="(in Python v2.7)"><code class="xref py py-exc docutils literal"><span class="pre">RuntimeError</span></code></a> if database does not contain
+aa frequencies struct data or if fragment is invalid. This is
 the case when the fragment does not fully fit into one of the
-chains in the database.</td>
+connected stretches of residues in the database.</td>
 </tr>
 </tbody>
 </table>
@@ -587,18 +715,18 @@ chains in the database.</td>
 
 <dl class="method">
 <dt id="promod3.loop.StructureDB.GenerateStructureProfile">
-<code class="descname">GenerateStructureProfile</code><span class="sig-paren">(</span><em>other_db</em>, <em>fragment</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.loop.StructureDB.GenerateStructureProfile" title="Permalink to this definition">¶</a></dt>
-<dd><p>Takes the CA positions and residue depths for <em>fragment</em> defined from
-<em>other_db</em> to calculate a structure profile using the full internal
-structural data of this database with their corresponding residue depths.</p>
+<code class="descname">GenerateStructureProfile</code><span class="sig-paren">(</span><em>bb_list</em>, <em>residue_depths</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.loop.StructureDB.GenerateStructureProfile" title="Permalink to this definition">¶</a></dt>
+<dd><p>Calculates a structure profile for <em>bb_list</em> with given <em>residue_depths</em>
+using the full internal data of this StructureDB.</p>
 <table class="docutils field-list" frame="void" rules="none">
 <col class="field-name" />
 <col class="field-body" />
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
-<li><strong>fragment</strong> (<a class="reference internal" href="#promod3.loop.FragmentInfo" title="promod3.loop.FragmentInfo"><code class="xref py py-class docutils literal"><span class="pre">FragmentInfo</span></code></a>) &#8211; Fragment definition from <em>other_db</em>.</li>
-<li><strong>other_db</strong> (<a class="reference internal" href="#promod3.loop.StructureDB" title="promod3.loop.StructureDB"><code class="xref py py-class docutils literal"><span class="pre">StructureDB</span></code></a>) &#8211; Structural database from which we extract CA positions and
-residue depths for <em>fragment</em>.</li>
+<li><strong>bb_list</strong> (<a class="reference internal" href="backbone.html#promod3.loop.BackboneList" title="promod3.loop.BackboneList"><code class="xref py py-class docutils literal"><span class="pre">BackboneList</span></code></a>) &#8211; Positions for which to calculate the structural profile</li>
+<li><strong>residue_depths</strong> (<code class="xref py py-class docutils literal"><span class="pre">list</span></code> of <a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>) &#8211; The residue depth for each residue in <em>bb_list</em>
+as you would extract it from any StructureDB
+containing that data.</li>
 </ul>
 </td>
 </tr>
@@ -606,11 +734,12 @@ residue depths for <em>fragment</em>.</li>
 probabilities as NULL model.</p>
 </td>
 </tr>
-<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first"><a class="reference external" href="http://www.openstructure.org/docs/dev/seq/base/seq/#ost.seq.ProfileHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.seq.ProfileHandle</span></code></a></p>
+<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first"><a class="reference external" href="https://www.openstructure.org/docs/dev/seq/base/seq/#ost.seq.ProfileHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.seq.ProfileHandle</span></code></a></p>
 </td>
 </tr>
 <tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last"><a class="reference external" href="https://docs.python.org/2.7/library/exceptions.html#exceptions.RuntimeError" title="(in Python v2.7)"><code class="xref py py-exc docutils literal"><span class="pre">RuntimeError</span></code></a> if <em>bb_list</em> and
-<em>residue_depths</em> differ in size or when their size is 0</p>
+<em>residue_depths</em> differ in size, when their size is 0
+or when database does not contain aa frequencies struct data.</p>
 </td>
 </tr>
 </tbody>
@@ -619,23 +748,24 @@ probabilities as NULL model.</p>
 
 <dl class="method">
 <dt id="promod3.loop.StructureDB.SetStructureProfile">
-<code class="descname">SetStructureProfile</code><span class="sig-paren">(</span><em>chain_idx</em>, <em>prof</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.loop.StructureDB.SetStructureProfile" title="Permalink to this definition">¶</a></dt>
+<code class="descname">SetStructureProfile</code><span class="sig-paren">(</span><em>coord_idx</em>, <em>prof</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.loop.StructureDB.SetStructureProfile" title="Permalink to this definition">¶</a></dt>
 <dd><p>Takes the <em>prof</em> and sets the corresponding StructureProfile
-frequencies in entry with <em>chain_idx</em></p>
+frequencies in entry with <em>coord_idx</em></p>
 <table class="docutils field-list" frame="void" rules="none">
 <col class="field-name" />
 <col class="field-body" />
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
-<li><strong>prof</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/seq/base/seq/#ost.seq.ProfileHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.seq.ProfileHandle</span></code></a>) &#8211; Source of profile frequencies</li>
-<li><strong>chain_idx</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; StructureDB index of entry for which to set frequencies
+<li><strong>prof</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/seq/base/seq/#ost.seq.ProfileHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.seq.ProfileHandle</span></code></a>) &#8211; Source of profile frequencies</li>
+<li><strong>coord_idx</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; StructureDB index of entry for which to set frequencies
 (in [0, <a class="reference internal" href="#promod3.loop.StructureDB.GetNumCoords" title="promod3.loop.StructureDB.GetNumCoords"><code class="xref py py-meth docutils literal"><span class="pre">GetNumCoords()</span></code></a>-1])</li>
 </ul>
 </td>
 </tr>
-<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last"><a class="reference external" href="https://docs.python.org/2.7/library/exceptions.html#exceptions.RuntimeError" title="(in Python v2.7)"><code class="xref py py-exc docutils literal"><span class="pre">RuntimeError</span></code></a> if <em>chain_idx</em> does not match
-any entry in the db or when the size of the <em>prof</em> does not
-exactly match the size of entry at <em>chain_idx</em></p>
+<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last"><a class="reference external" href="https://docs.python.org/2.7/library/exceptions.html#exceptions.RuntimeError" title="(in Python v2.7)"><code class="xref py py-exc docutils literal"><span class="pre">RuntimeError</span></code></a> if <em>coord_idx</em> does not match
+any entry in the db, when the size of the <em>prof</em> does not
+exactly match the size of entry at <em>coord_idx</em> or when database
+does not contain aa frequency struct data.</p>
 </td>
 </tr>
 </tbody>
@@ -677,40 +807,40 @@ between the N-stem C atom and the C-stem N atom). It can therefore be searched
 for fragments matching a certain geometry of N and C stems. The bins are
 accessed through a hash table, making searching the database ultra fast.</p>
 <p>This example illustrates how to create a custom FragDB based on a StructureDB:</p>
-<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">ost</span> <span class="kn">import</span> <span class="n">io</span>
-<span class="kn">from</span> <span class="nn">promod3</span> <span class="kn">import</span> <span class="n">loop</span>
+<div class="highlight-default"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">ost</span> <span class="k">import</span> <span class="n">io</span>
+<span class="kn">from</span> <span class="nn">promod3</span> <span class="k">import</span> <span class="n">loop</span>
 
-<span class="c"># let&#39;s load the default structure_db </span>
-<span class="n">structure_db</span> <span class="o">=</span> <span class="n">loop</span><span class="o">.</span><span class="n">StructureDB</span><span class="o">.</span><span class="n">LoadPortable</span><span class="p">(</span><span class="s">&quot;data/port_str_db.dat&quot;</span><span class="p">)</span>
-<span class="c"># in practice you might want to use the default StructureDB instead:</span>
-<span class="c"># structure_db = loop.LoadStructureDB()</span>
+<span class="c1"># let&#39;s load the default structure_db </span>
+<span class="n">structure_db</span> <span class="o">=</span> <span class="n">loop</span><span class="o">.</span><span class="n">StructureDB</span><span class="o">.</span><span class="n">LoadPortable</span><span class="p">(</span><span class="s2">&quot;data/port_str_db.dat&quot;</span><span class="p">)</span>
+<span class="c1"># in practice you might want to use the default StructureDB instead:</span>
+<span class="c1"># structure_db = loop.LoadStructureDB()</span>
 
-<span class="c"># and our beloved crambin...</span>
-<span class="n">structure</span> <span class="o">=</span> <span class="n">io</span><span class="o">.</span><span class="n">LoadPDB</span><span class="p">(</span><span class="s">&#39;data/1CRN.pdb&#39;</span><span class="p">)</span>
+<span class="c1"># and our beloved crambin...</span>
+<span class="n">structure</span> <span class="o">=</span> <span class="n">io</span><span class="o">.</span><span class="n">LoadPDB</span><span class="p">(</span><span class="s1">&#39;data/1CRN.pdb&#39;</span><span class="p">)</span>
 
-<span class="c"># we now want to connect the residue with index 17 and 21</span>
+<span class="c1"># we now want to connect the residue with index 17 and 21</span>
 <span class="n">sub_res_list</span> <span class="o">=</span> <span class="n">structure</span><span class="o">.</span><span class="n">residues</span><span class="p">[</span><span class="mi">17</span><span class="p">:</span><span class="mi">22</span><span class="p">]</span>
 <span class="n">n_stem</span> <span class="o">=</span> <span class="n">sub_res_list</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
 <span class="n">c_stem</span> <span class="o">=</span> <span class="n">sub_res_list</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span>
-<span class="n">frag_seq</span> <span class="o">=</span> <span class="s">&#39;&#39;</span><span class="o">.</span><span class="n">join</span><span class="p">([</span><span class="n">r</span><span class="o">.</span><span class="n">one_letter_code</span> <span class="k">for</span> <span class="n">r</span> <span class="ow">in</span> <span class="n">sub_res_list</span><span class="p">])</span>
+<span class="n">frag_seq</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="o">.</span><span class="n">join</span><span class="p">([</span><span class="n">r</span><span class="o">.</span><span class="n">one_letter_code</span> <span class="k">for</span> <span class="n">r</span> <span class="ow">in</span> <span class="n">sub_res_list</span><span class="p">])</span>
 
-<span class="c"># a custom FragDB can be built to identify fragments</span>
-<span class="c"># fulfilling these particular geometric constraints</span>
+<span class="c1"># a custom FragDB can be built to identify fragments</span>
+<span class="c1"># fulfilling these particular geometric constraints</span>
 <span class="n">frag_db</span> <span class="o">=</span> <span class="n">loop</span><span class="o">.</span><span class="n">FragDB</span><span class="p">(</span><span class="mf">1.0</span><span class="p">,</span> <span class="mi">20</span><span class="p">)</span>
 
-<span class="c"># at this point we add all possible fragments of length 5 </span>
-<span class="c"># with an RMSD threshold of 0.5</span>
+<span class="c1"># at this point we add all possible fragments of length 5 </span>
+<span class="c1"># with an RMSD threshold of 0.5</span>
 <span class="n">frag_db</span><span class="o">.</span><span class="n">AddFragments</span><span class="p">(</span><span class="mi">5</span><span class="p">,</span> <span class="mf">0.5</span><span class="p">,</span> <span class="n">structure_db</span><span class="p">)</span>
 
-<span class="c"># the FragDB can now be used to extract FragmentInfo objects to</span>
-<span class="c"># finally query the StructureDB</span>
+<span class="c1"># the FragDB can now be used to extract FragmentInfo objects to</span>
+<span class="c1"># finally query the StructureDB</span>
 <span class="n">fragment_infos</span> <span class="o">=</span> <span class="n">frag_db</span><span class="o">.</span><span class="n">SearchDB</span><span class="p">(</span><span class="n">n_stem</span><span class="p">,</span> <span class="n">c_stem</span><span class="p">,</span> <span class="mi">5</span><span class="p">)</span>
 
-<span class="c"># get the fragments in form of BackboneList objects and store them</span>
+<span class="c1"># get the fragments in form of BackboneList objects and store them</span>
 <span class="k">for</span> <span class="n">i</span><span class="p">,</span><span class="n">f_i</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">fragment_infos</span><span class="p">):</span>
     <span class="n">bb_list</span> <span class="o">=</span> <span class="n">structure_db</span><span class="o">.</span><span class="n">GetBackboneList</span><span class="p">(</span><span class="n">n_stem</span><span class="p">,</span> <span class="n">c_stem</span><span class="p">,</span>
                                            <span class="n">f_i</span><span class="p">,</span> <span class="n">frag_seq</span><span class="p">)</span>
-    <span class="n">io</span><span class="o">.</span><span class="n">SavePDB</span><span class="p">(</span><span class="n">bb_list</span><span class="o">.</span><span class="n">ToEntity</span><span class="p">(),</span> <span class="nb">str</span><span class="p">(</span><span class="n">i</span><span class="p">)</span> <span class="o">+</span> <span class="s">&quot;.pdb&quot;</span><span class="p">)</span>
+    <span class="n">io</span><span class="o">.</span><span class="n">SavePDB</span><span class="p">(</span><span class="n">bb_list</span><span class="o">.</span><span class="n">ToEntity</span><span class="p">(),</span> <span class="nb">str</span><span class="p">(</span><span class="n">i</span><span class="p">)</span> <span class="o">+</span> <span class="s2">&quot;.pdb&quot;</span><span class="p">)</span>
 </pre></div>
 </div>
 <dl class="class">
@@ -747,7 +877,7 @@ less machine-dependent).</p>
 <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference internal" href="#promod3.loop.FragDB" title="promod3.loop.FragDB"><code class="xref py py-class docutils literal"><span class="pre">FragDB</span></code></a></td>
 </tr>
 <tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/2.7/library/exceptions.html#exceptions.RuntimeError" title="(in Python v2.7)"><code class="xref py py-exc docutils literal"><span class="pre">RuntimeError</span></code></a> if file cannot be opened or if
-file cannot be parsed (see <a class="reference internal" href="../portableIO.html#portableio"><span>here</span></a> for details).</td>
+file cannot be parsed (see <a class="reference internal" href="../portableIO.html#portableio"><span class="std std-ref">here</span></a> for details).</td>
 </tr>
 </tbody>
 </table>
@@ -759,7 +889,7 @@ file cannot be parsed (see <a class="reference internal" href="../portableIO.htm
 <dt id="promod3.loop.FragDB.SavePortable">
 <code class="descname">SavePortable</code><span class="sig-paren">(</span><em>filename</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.loop.FragDB.SavePortable" title="Permalink to this definition">¶</a></dt>
 <dd><p>Saves a raw / portable binary representation. Use portable files for
-distribution and convert locally to raw files. See <a class="reference internal" href="../portableIO.html#portableio"><span>here</span></a>
+distribution and convert locally to raw files. See <a class="reference internal" href="../portableIO.html#portableio"><span class="std std-ref">here</span></a>
 for details.</p>
 <table class="docutils field-list" frame="void" rules="none">
 <col class="field-name" />
@@ -922,8 +1052,8 @@ and <strong>c_stem</strong> and of the same length as the <strong>frag_size</str
 <col class="field-body" />
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
-<li><strong>n_stem</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; The N-stem</li>
-<li><strong>c_stem</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; The C-stem</li>
+<li><strong>n_stem</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; The N-stem</li>
+<li><strong>c_stem</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; The C-stem</li>
 <li><strong>frag_size</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Number of residues of the fragment</li>
 <li><strong>extra_bins</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Whether to extend the search to include fragments from
 <em>extra_bins</em> additional bins surrounding the bin given by
@@ -963,9 +1093,9 @@ Calculates the avg. substitution matrix based sequence similarity of amino acids
 when comparing a potential fragment from the <a class="reference internal" href="#promod3.loop.StructureDB" title="promod3.loop.StructureDB"><code class="xref py py-class docutils literal"><span class="pre">StructureDB</span></code></a> and the target
 sequence</li>
 <li><strong>SSAgree</strong>:
-Calculates the avg. agreement of the predicted secondary structure by PSIPRED <a class="reference internal" href="#jones1999" id="id5">[Jones1999]</a>
-and the dssp <a class="reference internal" href="#kabsch1983" id="id6">[kabsch1983]</a> assignment stored in the <a class="reference internal" href="#promod3.loop.StructureDB" title="promod3.loop.StructureDB"><code class="xref py py-class docutils literal"><span class="pre">StructureDB</span></code></a>.
-The Agreement term is based on a probabilistic approach also used in HHSearch <a class="reference internal" href="#soding2005" id="id7">[soding2005]</a>.</li>
+Calculates the avg. agreement of the predicted secondary structure by PSIPRED <a class="reference internal" href="#jones1999" id="id3">[Jones1999]</a>
+and the dssp <a class="reference internal" href="#kabsch1983" id="id4">[kabsch1983]</a> assignment stored in the <a class="reference internal" href="#promod3.loop.StructureDB" title="promod3.loop.StructureDB"><code class="xref py py-class docutils literal"><span class="pre">StructureDB</span></code></a>.
+The Agreement term is based on a probabilistic approach also used in HHSearch <a class="reference internal" href="#soding2005" id="id5">[soding2005]</a>.</li>
 <li><strong>TorsionProbability</strong>:
 Calculates the avg. probability of observing the phi/psi dihedral angles of a potential
 fragment from the <a class="reference internal" href="#promod3.loop.StructureDB" title="promod3.loop.StructureDB"><code class="xref py py-class docutils literal"><span class="pre">StructureDB</span></code></a> given the target sequence. The probabilities are
@@ -980,51 +1110,51 @@ fragment from the <a class="reference internal" href="#promod3.loop.StructureDB"
 in between them. The scores are calculated as L1 distances between the profile columns.
 In this case, the amino acid frequencies extracted from structural alignments are used.</li>
 </ul>
-<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">ost</span> <span class="kn">import</span> <span class="n">io</span><span class="p">,</span> <span class="n">seq</span>
-<span class="kn">from</span> <span class="nn">promod3</span> <span class="kn">import</span> <span class="n">loop</span>
+<div class="highlight-default"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">ost</span> <span class="k">import</span> <span class="n">io</span><span class="p">,</span> <span class="n">seq</span>
+<span class="kn">from</span> <span class="nn">promod3</span> <span class="k">import</span> <span class="n">loop</span>
 
-<span class="c"># load an example structure</span>
-<span class="n">prot</span> <span class="o">=</span> <span class="n">io</span><span class="o">.</span><span class="n">LoadPDB</span><span class="p">(</span><span class="s">&#39;data/1CRN.pdb&#39;</span><span class="p">)</span>
+<span class="c1"># load an example structure</span>
+<span class="n">prot</span> <span class="o">=</span> <span class="n">io</span><span class="o">.</span><span class="n">LoadPDB</span><span class="p">(</span><span class="s1">&#39;data/1CRN.pdb&#39;</span><span class="p">)</span>
 
-<span class="c"># extract some additional information</span>
-<span class="n">seqres</span> <span class="o">=</span> <span class="s">&#39;&#39;</span><span class="o">.</span><span class="n">join</span><span class="p">([</span><span class="n">r</span><span class="o">.</span><span class="n">one_letter_code</span> <span class="k">for</span> <span class="n">r</span> <span class="ow">in</span> <span class="n">prot</span><span class="o">.</span><span class="n">residues</span><span class="p">])</span>
+<span class="c1"># extract some additional information</span>
+<span class="n">seqres</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="o">.</span><span class="n">join</span><span class="p">([</span><span class="n">r</span><span class="o">.</span><span class="n">one_letter_code</span> <span class="k">for</span> <span class="n">r</span> <span class="ow">in</span> <span class="n">prot</span><span class="o">.</span><span class="n">residues</span><span class="p">])</span>
 <span class="n">frag_pos</span> <span class="o">=</span> <span class="mi">35</span>
 <span class="n">frag_length</span> <span class="o">=</span> <span class="mi">9</span>
 <span class="n">frag_seq</span> <span class="o">=</span> <span class="n">seqres</span><span class="p">[</span><span class="n">frag_pos</span><span class="p">:</span><span class="n">frag_pos</span><span class="o">+</span><span class="n">frag_length</span><span class="p">]</span>
 <span class="n">frag_residues</span> <span class="o">=</span> <span class="n">prot</span><span class="o">.</span><span class="n">residues</span><span class="p">[</span><span class="n">frag_pos</span><span class="p">:</span><span class="n">frag_pos</span><span class="o">+</span><span class="n">frag_length</span><span class="p">]</span>
 <span class="n">ref_backbone</span> <span class="o">=</span> <span class="n">loop</span><span class="o">.</span><span class="n">BackboneList</span><span class="p">(</span><span class="n">frag_seq</span><span class="p">,</span> <span class="n">frag_residues</span><span class="p">)</span>
 
-<span class="c"># let&#39;s load the StructureDB and a substitution matrix</span>
+<span class="c1"># let&#39;s load the StructureDB and a substitution matrix</span>
 <span class="n">db</span> <span class="o">=</span> <span class="n">loop</span><span class="o">.</span><span class="n">LoadStructureDB</span><span class="p">()</span>
 <span class="n">subst_matrix</span> <span class="o">=</span> <span class="n">seq</span><span class="o">.</span><span class="n">alg</span><span class="o">.</span><span class="n">BLOSUM62</span>
 
-<span class="c"># the fragger object needs to be initialized with its target sequence</span>
+<span class="c1"># the fragger object needs to be initialized with its target sequence</span>
 <span class="n">fragger</span> <span class="o">=</span> <span class="n">loop</span><span class="o">.</span><span class="n">Fragger</span><span class="p">(</span><span class="n">frag_seq</span><span class="p">)</span>
 
-<span class="c"># we could now add an arbitrary number of parameters from different</span>
-<span class="c"># features for now we only go for the sequence similarity score</span>
+<span class="c1"># we could now add an arbitrary number of parameters from different</span>
+<span class="c1"># features for now we only go for the sequence similarity score</span>
 <span class="n">fragger</span><span class="o">.</span><span class="n">AddSeqSimParameters</span><span class="p">(</span><span class="mf">1.0</span><span class="p">,</span> <span class="n">subst_matrix</span><span class="p">)</span>
 
-<span class="c"># the Fragger can finally be filled by providing a StructureDB</span>
+<span class="c1"># the Fragger can finally be filled by providing a StructureDB</span>
 <span class="n">fragger</span><span class="o">.</span><span class="n">Fill</span><span class="p">(</span><span class="n">db</span><span class="p">,</span> <span class="mf">1.0</span><span class="p">,</span> <span class="mi">100</span><span class="p">)</span>
 
-<span class="c"># let&#39;s see how good the fragments are...</span>
+<span class="c1"># let&#39;s see how good the fragments are...</span>
 <span class="n">below_three</span> <span class="o">=</span> <span class="mi">0</span>
 <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">fragger</span><span class="p">)):</span>
-    <span class="n">ca_rmsd</span> <span class="o">=</span> <span class="n">fragger</span><span class="p">[</span><span class="n">i</span><span class="p">]</span><span class="o">.</span><span class="n">CARMSD</span><span class="p">(</span><span class="n">ref_backbone</span><span class="p">,</span><span class="bp">True</span><span class="p">)</span>
-    <span class="k">print</span> <span class="s">&quot;Fragment </span><span class="si">%d</span><span class="s"> has CA RMSD of </span><span class="si">%.3f</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">i</span><span class="p">,</span> <span class="n">ca_rmsd</span><span class="p">)</span>
+    <span class="n">ca_rmsd</span> <span class="o">=</span> <span class="n">fragger</span><span class="p">[</span><span class="n">i</span><span class="p">]</span><span class="o">.</span><span class="n">CARMSD</span><span class="p">(</span><span class="n">ref_backbone</span><span class="p">,</span><span class="kc">True</span><span class="p">)</span>
+    <span class="nb">print</span> <span class="s2">&quot;Fragment </span><span class="si">%d</span><span class="s2"> has CA RMSD of </span><span class="si">%.3f</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">i</span><span class="p">,</span> <span class="n">ca_rmsd</span><span class="p">)</span>
     <span class="k">if</span> <span class="n">ca_rmsd</span> <span class="o">&lt;</span> <span class="mf">3.0</span><span class="p">:</span>
         <span class="n">below_three</span> <span class="o">+=</span> <span class="mi">1</span>
 
 <span class="n">fraction</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="n">below_three</span><span class="p">)</span><span class="o">/</span><span class="nb">len</span><span class="p">(</span><span class="n">fragger</span><span class="p">)</span>
-<span class="k">print</span> <span class="s">&quot;Fraction of fragments below 3A: </span><span class="si">%.2f</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">fraction</span>
+<span class="nb">print</span> <span class="s2">&quot;Fraction of fragments below 3A: </span><span class="si">%.2f</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="n">fraction</span>
 
-<span class="c"># add into a cached map with ID based on frag_pos</span>
+<span class="c1"># add into a cached map with ID based on frag_pos</span>
 <span class="n">fragger_map</span> <span class="o">=</span> <span class="n">loop</span><span class="o">.</span><span class="n">FraggerMap</span><span class="p">()</span>
 <span class="k">if</span> <span class="ow">not</span> <span class="n">fragger_map</span><span class="o">.</span><span class="n">Contains</span><span class="p">(</span><span class="n">frag_pos</span><span class="p">):</span>
 	<span class="n">fragger_map</span><span class="p">[</span><span class="n">frag_pos</span><span class="p">]</span> <span class="o">=</span> <span class="n">fragger</span>
-<span class="c"># store it for future use</span>
-<span class="n">fragger_map</span><span class="o">.</span><span class="n">SaveBB</span><span class="p">(</span><span class="s">&quot;frag_map.dat&quot;</span><span class="p">)</span>
+<span class="c1"># store it for future use</span>
+<span class="n">fragger_map</span><span class="o">.</span><span class="n">SaveBB</span><span class="p">(</span><span class="s2">&quot;frag_map.dat&quot;</span><span class="p">)</span>
 </pre></div>
 </div>
 <dl class="class">
@@ -1147,7 +1277,7 @@ linked to this object.</li>
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
 <li><strong>w</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>) &#8211; linear weight</li>
-<li><strong>prof</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/seq/base/seq/#ost.seq.ProfileHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.seq.ProfileHandle</span></code></a>) &#8211; Profile for the fraggers target_sequence</li>
+<li><strong>prof</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/seq/base/seq/#ost.seq.ProfileHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.seq.ProfileHandle</span></code></a>) &#8211; Profile for the fraggers target_sequence</li>
 </ul>
 </td>
 </tr>
@@ -1165,7 +1295,7 @@ linked to this object.</li>
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
 <li><strong>w</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>) &#8211; linear weight</li>
-<li><strong>prof</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/seq/base/seq/#ost.seq.ProfileHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.seq.ProfileHandle</span></code></a>) &#8211; Profile for the fraggers target_sequence</li>
+<li><strong>prof</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/seq/base/seq/#ost.seq.ProfileHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.seq.ProfileHandle</span></code></a>) &#8211; Profile for the fraggers target_sequence</li>
 </ul>
 </td>
 </tr>
@@ -1567,37 +1697,31 @@ to <strong>to</strong>, not including <strong>to</strong> itself</p>
 <table class="docutils citation" frame="void" id="soding2005" rules="none">
 <colgroup><col class="label" /><col /></colgroup>
 <tbody valign="top">
-<tr><td class="label">[soding2005]</td><td><em>(<a class="fn-backref" href="#id1">1</a>, <a class="fn-backref" href="#id7">2</a>)</em> Söding J (2005). Protein homology detection by HMM-HMM comparison. Bioinformatics 21 (7): 951–960.</td></tr>
-</tbody>
-</table>
-<table class="docutils citation" frame="void" id="sanner1996" rules="none">
-<colgroup><col class="label" /><col /></colgroup>
-<tbody valign="top">
-<tr><td class="label"><a class="fn-backref" href="#id2">[sanner1996]</a></td><td>Sanner M, Olson AJ, Spehner JC (1996). Reduced Surface: an Efficient Way to Compute Molecular Surfaces. Biopolymers 38 (3): 305-320.</td></tr>
+<tr><td class="label"><a class="fn-backref" href="#id5">[soding2005]</a></td><td>Söding J (2005). Protein homology detection by HMM-HMM comparison. Bioinformatics 21 (7): 951–960.</td></tr>
 </tbody>
 </table>
 <table class="docutils citation" frame="void" id="chakravarty1999" rules="none">
 <colgroup><col class="label" /><col /></colgroup>
 <tbody valign="top">
-<tr><td class="label"><a class="fn-backref" href="#id3">[chakravarty1999]</a></td><td>Chakravarty S, Varadarajan R (1999). Residue depth: a novel parameter for the analysis of protein structure and stability. Structure 7 (7): 723–732.</td></tr>
+<tr><td class="label"><a class="fn-backref" href="#id1">[chakravarty1999]</a></td><td>Chakravarty S, Varadarajan R (1999). Residue depth: a novel parameter for the analysis of protein structure and stability. Structure 7 (7): 723–732.</td></tr>
 </tbody>
 </table>
 <table class="docutils citation" frame="void" id="zhou2005" rules="none">
 <colgroup><col class="label" /><col /></colgroup>
 <tbody valign="top">
-<tr><td class="label"><a class="fn-backref" href="#id4">[zhou2005]</a></td><td>Zhou H, Zhou Y (2005). Fold Recognition by Combining Sequence Profiles Derived From Evolution and From Depth-Dependent Structural Alignment of Fragments. Proteins 58 (2): 321–328.</td></tr>
+<tr><td class="label"><a class="fn-backref" href="#id2">[zhou2005]</a></td><td>Zhou H, Zhou Y (2005). Fold Recognition by Combining Sequence Profiles Derived From Evolution and From Depth-Dependent Structural Alignment of Fragments. Proteins 58 (2): 321–328.</td></tr>
 </tbody>
 </table>
 <table class="docutils citation" frame="void" id="jones1999" rules="none">
 <colgroup><col class="label" /><col /></colgroup>
 <tbody valign="top">
-<tr><td class="label"><a class="fn-backref" href="#id5">[Jones1999]</a></td><td>Jones DT (1999) Protein secondary structure prediction based on position-specific scoring matrices. J. Mol. Biol. 292: 195-202.</td></tr>
+<tr><td class="label"><a class="fn-backref" href="#id3">[Jones1999]</a></td><td>Jones DT (1999) Protein secondary structure prediction based on position-specific scoring matrices. J. Mol. Biol. 292: 195-202.</td></tr>
 </tbody>
 </table>
 <table class="docutils citation" frame="void" id="kabsch1983" rules="none">
 <colgroup><col class="label" /><col /></colgroup>
 <tbody valign="top">
-<tr><td class="label"><a class="fn-backref" href="#id6">[kabsch1983]</a></td><td>Kabsch W, Sander C (1983) Dictionary of protein secondary structure: pattern recognition of hydrogen-bonded and geometrical features. Biopolymers 22 2577-2637.</td></tr>
+<tr><td class="label"><a class="fn-backref" href="#id4">[kabsch1983]</a></td><td>Kabsch W, Sander C (1983) Dictionary of protein secondary structure: pattern recognition of hydrogen-bonded and geometrical features. Biopolymers 22 2577-2637.</td></tr>
 </tbody>
 </table>
 </div>
@@ -1648,9 +1772,6 @@ to <strong>to</strong>, not including <strong>to</strong> itself</p>
       <input type="hidden" name="check_keywords" value="yes" />
       <input type="hidden" name="area" value="default" />
     </form>
-    <p class="searchtip" style="font-size: 90%">
-    Enter search terms or a module, class or function name.
-    </p>
 </div>
 <script type="text/javascript">$('#searchbox').show(0);</script>
         </div>
@@ -1658,11 +1779,11 @@ to <strong>to</strong>, not including <strong>to</strong> itself</p>
       <div class="clearer"></div>
     </div>
     <div class="footer">
-      &copy;2017, ProMod3 authors.
+      &copy;2018, ProMod3 authors.
       
       |
-      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a>
-      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.6</a>
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.4.1</a>
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
       
       |
       <a href="../_sources/loop/structure_db.txt"
diff --git a/doc/html/loop/torsion_sampler.html b/doc/html/loop/torsion_sampler.html
index b74d69f2abcffb9915d106d749bc10a39a861a27..c9d75287ca27196ad6349d2f16c1aeb7a3c7df34 100644
--- a/doc/html/loop/torsion_sampler.html
+++ b/doc/html/loop/torsion_sampler.html
@@ -6,7 +6,7 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
-    <title>Sampling Dihedral Angles &mdash; ProMod3 1.1.0 documentation</title>
+    <title>Sampling Dihedral Angles &mdash; ProMod3 1.2.0 documentation</title>
     
     <link rel="stylesheet" href="../_static/alabaster.css" type="text/css" />
     <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
@@ -14,7 +14,7 @@
     <script type="text/javascript">
       var DOCUMENTATION_OPTIONS = {
         URL_ROOT:    '../',
-        VERSION:     '1.1.0',
+        VERSION:     '1.2.0',
         COLLAPSE_INDEX: false,
         FILE_SUFFIX: '.html',
         HAS_SOURCE:  true
@@ -23,16 +23,18 @@
     <script type="text/javascript" src="../_static/jquery.js"></script>
     <script type="text/javascript" src="../_static/underscore.js"></script>
     <script type="text/javascript" src="../_static/doctools.js"></script>
-    <link rel="top" title="ProMod3 1.1.0 documentation" href="../index.html" />
+    <link rel="top" title="ProMod3 1.2.0 documentation" href="../index.html" />
     <link rel="up" title="loop - Loop Handling" href="index.html" />
     <link rel="next" title="Structural Data" href="structure_db.html" />
     <link rel="prev" title="Representing Loops" href="backbone.html" />
    
+  <link rel="stylesheet" href="../_static/custom.css" type="text/css" />
   
-  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
 
   </head>
-  <body role="document">  
+  <body role="document">
+  
 
     <div class="document">
       <div class="documentwrapper">
@@ -54,23 +56,23 @@ most methods which need to access a specific distribution can either take 3
 residue names or an index as input.</p>
 <p>As a showcase example, we randomly sample from a given torsion sample and
 store the resulting samples as a scatter plot:</p>
-<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">promod3</span> <span class="kn">import</span> <span class="n">loop</span>
-<span class="kn">from</span> <span class="nn">ost</span> <span class="kn">import</span> <span class="n">conop</span>
-<span class="c"># this requires matplotlib and numpy</span>
+<div class="highlight-default"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">promod3</span> <span class="k">import</span> <span class="n">loop</span>
+<span class="kn">from</span> <span class="nn">ost</span> <span class="k">import</span> <span class="n">conop</span>
+<span class="c1"># this requires matplotlib and numpy</span>
 <span class="kn">import</span> <span class="nn">matplotlib</span>
-<span class="c"># change next line, if you wish to use a GUI-based plot-output</span>
-<span class="n">matplotlib</span><span class="o">.</span><span class="n">use</span><span class="p">(</span><span class="s">&quot;Agg&quot;</span><span class="p">)</span>
-<span class="kn">import</span> <span class="nn">matplotlib.pyplot</span> <span class="kn">as</span> <span class="nn">plt</span>
-<span class="kn">import</span> <span class="nn">numpy</span> <span class="kn">as</span> <span class="nn">np</span>
+<span class="c1"># change next line, if you wish to use a GUI-based plot-output</span>
+<span class="n">matplotlib</span><span class="o">.</span><span class="n">use</span><span class="p">(</span><span class="s2">&quot;Agg&quot;</span><span class="p">)</span>
+<span class="kn">import</span> <span class="nn">matplotlib.pyplot</span> <span class="k">as</span> <span class="nn">plt</span>
+<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
 
-<span class="c"># load a default sampler</span>
+<span class="c1"># load a default sampler</span>
 <span class="n">t_sampler</span> <span class="o">=</span> <span class="n">loop</span><span class="o">.</span><span class="n">LoadTorsionSampler</span><span class="p">()</span>
 
-<span class="c"># dihedral angles will be stored in here</span>
+<span class="c1"># dihedral angles will be stored in here</span>
 <span class="n">phi</span> <span class="o">=</span> <span class="nb">list</span><span class="p">()</span>
 <span class="n">psi</span> <span class="o">=</span> <span class="nb">list</span><span class="p">()</span>
 
-<span class="c"># draw from a random distribution</span>
+<span class="c1"># draw from a random distribution</span>
 <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">1000</span><span class="p">):</span>
     <span class="n">dihedral_pair</span> <span class="o">=</span> <span class="n">t_sampler</span><span class="o">.</span><span class="n">Draw</span><span class="p">(</span><span class="n">conop</span><span class="o">.</span><span class="n">ALA</span><span class="p">,</span> 
                                    <span class="n">conop</span><span class="o">.</span><span class="n">PRO</span><span class="p">,</span> 
@@ -78,16 +80,16 @@ store the resulting samples as a scatter plot:</p>
     <span class="n">phi</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">dihedral_pair</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span>
     <span class="n">psi</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">dihedral_pair</span><span class="p">[</span><span class="mi">1</span><span class="p">])</span>
 
-<span class="c"># and plot it</span>
+<span class="c1"># and plot it</span>
 <span class="n">plt</span><span class="o">.</span><span class="n">xlim</span><span class="p">(</span><span class="o">-</span><span class="n">np</span><span class="o">.</span><span class="n">pi</span><span class="p">,</span> <span class="n">np</span><span class="o">.</span><span class="n">pi</span><span class="p">)</span>
 <span class="n">plt</span><span class="o">.</span><span class="n">ylim</span><span class="p">(</span><span class="o">-</span><span class="n">np</span><span class="o">.</span><span class="n">pi</span><span class="p">,</span> <span class="n">np</span><span class="o">.</span><span class="n">pi</span><span class="p">)</span>
-<span class="n">plt</span><span class="o">.</span><span class="n">plot</span><span class="p">(</span><span class="n">phi</span><span class="p">,</span> <span class="n">psi</span><span class="p">,</span> <span class="s">&#39;.&#39;</span><span class="p">)</span>
-<span class="n">plt</span><span class="o">.</span><span class="n">xlabel</span><span class="p">(</span><span class="s">&quot;phi&quot;</span><span class="p">,</span> <span class="n">fontsize</span><span class="o">=</span><span class="s">&#39;large&#39;</span><span class="p">)</span>
-<span class="n">plt</span><span class="o">.</span><span class="n">ylabel</span><span class="p">(</span><span class="s">&quot;psi&quot;</span><span class="p">,</span> <span class="n">fontsize</span><span class="o">=</span><span class="s">&#39;large&#39;</span><span class="p">)</span>
-<span class="n">plt</span><span class="o">.</span><span class="n">title</span><span class="p">(</span><span class="s">&quot;ALA-PRO-ALA&quot;</span><span class="p">)</span>
+<span class="n">plt</span><span class="o">.</span><span class="n">plot</span><span class="p">(</span><span class="n">phi</span><span class="p">,</span> <span class="n">psi</span><span class="p">,</span> <span class="s1">&#39;.&#39;</span><span class="p">)</span>
+<span class="n">plt</span><span class="o">.</span><span class="n">xlabel</span><span class="p">(</span><span class="s2">&quot;phi&quot;</span><span class="p">,</span> <span class="n">fontsize</span><span class="o">=</span><span class="s1">&#39;large&#39;</span><span class="p">)</span>
+<span class="n">plt</span><span class="o">.</span><span class="n">ylabel</span><span class="p">(</span><span class="s2">&quot;psi&quot;</span><span class="p">,</span> <span class="n">fontsize</span><span class="o">=</span><span class="s1">&#39;large&#39;</span><span class="p">)</span>
+<span class="n">plt</span><span class="o">.</span><span class="n">title</span><span class="p">(</span><span class="s2">&quot;ALA-PRO-ALA&quot;</span><span class="p">)</span>
 
-<span class="c"># store plot as png file</span>
-<span class="n">plt</span><span class="o">.</span><span class="n">savefig</span><span class="p">(</span><span class="s">&quot;torsion_plot.png&quot;</span><span class="p">)</span>
+<span class="c1"># store plot as png file</span>
+<span class="n">plt</span><span class="o">.</span><span class="n">savefig</span><span class="p">(</span><span class="s2">&quot;torsion_plot.png&quot;</span><span class="p">)</span>
 </pre></div>
 </div>
 <div class="section" id="defining-amino-acid-triplets">
@@ -136,7 +138,7 @@ acids not matching any of the group definitions.</p>
 <col class="field-name" />
 <col class="field-body" />
 <tbody valign="top">
-<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>view</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.EntityView" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.EntityView</span></code></a>) &#8211; structure from which parameters will be extracted</td>
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>view</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.EntityView" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.EntityView</span></code></a>) &#8211; structure from which parameters will be extracted</td>
 </tr>
 </tbody>
 </table>
@@ -173,7 +175,7 @@ less machine-dependent).</p>
 </td>
 </tr>
 <tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last"><a class="reference external" href="https://docs.python.org/2.7/library/exceptions.html#exceptions.RuntimeError" title="(in Python v2.7)"><code class="xref py py-exc docutils literal"><span class="pre">RuntimeError</span></code></a> if file cannot be opened or if
-file cannot be parsed (see <a class="reference internal" href="../portableIO.html#portableio"><span>here</span></a> for details).</p>
+file cannot be parsed (see <a class="reference internal" href="../portableIO.html#portableio"><span class="std std-ref">here</span></a> for details).</p>
 </td>
 </tr>
 </tbody>
@@ -186,7 +188,7 @@ file cannot be parsed (see <a class="reference internal" href="../portableIO.htm
 <dt id="promod3.loop.TorsionSampler.SavePortable">
 <code class="descname">SavePortable</code><span class="sig-paren">(</span><em>filename</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.loop.TorsionSampler.SavePortable" title="Permalink to this definition">¶</a></dt>
 <dd><p>Saves a raw / portable binary representation. Use portable files for
-distribution and convert locally to raw files. See <a class="reference internal" href="../portableIO.html#portableio"><span>here</span></a>
+distribution and convert locally to raw files. See <a class="reference internal" href="../portableIO.html#portableio"><span class="std std-ref">here</span></a>
 for details.</p>
 <table class="docutils field-list" frame="void" rules="none">
 <col class="field-name" />
@@ -208,9 +210,9 @@ for details.</p>
 <col class="field-body" />
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
-<li><strong>before</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.AminoAcid</span></code></a>) &#8211; id of the residue before <em>central</em></li>
-<li><strong>central</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.AminoAcid</span></code></a>) &#8211; id of the residue for the central residue</li>
-<li><strong>after</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.AminoAcid</span></code></a>) &#8211; id of the residue after <em>central</em></li>
+<li><strong>before</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.AminoAcid</span></code></a>) &#8211; id of the residue before <em>central</em></li>
+<li><strong>central</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.AminoAcid</span></code></a>) &#8211; id of the residue for the central residue</li>
+<li><strong>after</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.AminoAcid</span></code></a>) &#8211; id of the residue after <em>central</em></li>
 </ul>
 </td>
 </tr>
@@ -250,9 +252,9 @@ standard amino acid</td>
 <col class="field-body" />
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
-<li><strong>before</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.AminoAcid</span></code></a>) &#8211; id of the residue before <em>central</em></li>
-<li><strong>central</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.AminoAcid</span></code></a>) &#8211; id of the residue for which torsion angles will be drawn</li>
-<li><strong>after</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.AminoAcid</span></code></a>) &#8211; id of the residue after <em>central</em></li>
+<li><strong>before</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.AminoAcid</span></code></a>) &#8211; id of the residue before <em>central</em></li>
+<li><strong>central</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.AminoAcid</span></code></a>) &#8211; id of the residue for which torsion angles will be drawn</li>
+<li><strong>after</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.AminoAcid</span></code></a>) &#8211; id of the residue after <em>central</em></li>
 </ul>
 </td>
 </tr>
@@ -288,9 +290,9 @@ standard amino acid</td>
 <col class="field-body" />
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
-<li><strong>before</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.AminoAcid</span></code></a>) &#8211; id of the residue before <em>central</em></li>
-<li><strong>central</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.AminoAcid</span></code></a>) &#8211; id of the residue for which the <em>phi</em> will be drawn</li>
-<li><strong>after</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.AminoAcid</span></code></a>) &#8211; id of the residue after <em>central</em></li>
+<li><strong>before</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.AminoAcid</span></code></a>) &#8211; id of the residue before <em>central</em></li>
+<li><strong>central</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.AminoAcid</span></code></a>) &#8211; id of the residue for which the <em>phi</em> will be drawn</li>
+<li><strong>after</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.AminoAcid</span></code></a>) &#8211; id of the residue after <em>central</em></li>
 <li><strong>psi</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>) &#8211; <em>psi</em> angle</li>
 </ul>
 </td>
@@ -332,9 +334,9 @@ standard amino acid</td>
 <col class="field-body" />
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
-<li><strong>before</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.AminoAcid</span></code></a>) &#8211; id of the residue before <em>central</em></li>
-<li><strong>central</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.AminoAcid</span></code></a>) &#8211; id of the residue for which the <em>psi</em> angle will be drawn</li>
-<li><strong>after</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.AminoAcid</span></code></a>) &#8211; id of the residue after <em>central</em></li>
+<li><strong>before</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.AminoAcid</span></code></a>) &#8211; id of the residue before <em>central</em></li>
+<li><strong>central</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.AminoAcid</span></code></a>) &#8211; id of the residue for which the <em>psi</em> angle will be drawn</li>
+<li><strong>after</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.AminoAcid</span></code></a>) &#8211; id of the residue after <em>central</em></li>
 <li><strong>phi</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>) &#8211; <em>phi</em> angle</li>
 </ul>
 </td>
@@ -376,9 +378,9 @@ standard amino acid</td>
 <col class="field-body" />
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
-<li><strong>before</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.AminoAcid</span></code></a>) &#8211; id of the residue before <em>central</em></li>
-<li><strong>central</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.AminoAcid</span></code></a>) &#8211; id of the residue for which the probability is calculated.</li>
-<li><strong>after</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.AminoAcid</span></code></a>) &#8211; id of the residue after <em>central</em></li>
+<li><strong>before</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.AminoAcid</span></code></a>) &#8211; id of the residue before <em>central</em></li>
+<li><strong>central</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.AminoAcid</span></code></a>) &#8211; id of the residue for which the probability is calculated.</li>
+<li><strong>after</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.AminoAcid</span></code></a>) &#8211; id of the residue after <em>central</em></li>
 <li><strong>phi</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>) &#8211; phi angle</li>
 <li><strong>psi</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>) &#8211; psi angle</li>
 </ul>
@@ -422,9 +424,9 @@ standard amino acid</td>
 <col class="field-body" />
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
-<li><strong>before</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.AminoAcid</span></code></a>) &#8211; id of the residue before <em>central</em></li>
-<li><strong>central</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.AminoAcid</span></code></a>) &#8211; id of the residue for which the probability is calculated.</li>
-<li><strong>after</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.AminoAcid</span></code></a>) &#8211; id of the residue after <em>central</em></li>
+<li><strong>before</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.AminoAcid</span></code></a>) &#8211; id of the residue before <em>central</em></li>
+<li><strong>central</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.AminoAcid</span></code></a>) &#8211; id of the residue for which the probability is calculated.</li>
+<li><strong>after</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.AminoAcid</span></code></a>) &#8211; id of the residue after <em>central</em></li>
 <li><strong>phi</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>) &#8211; phi angle</li>
 <li><strong>psi</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>) &#8211; psi angle</li>
 </ul>
@@ -446,9 +448,9 @@ standard amino acid</td>
 <col class="field-body" />
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
-<li><strong>before</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.AminoAcid</span></code></a>) &#8211; id of the residue before <em>central</em></li>
-<li><strong>central</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.AminoAcid</span></code></a>) &#8211; id of the residue for which the probability is calculated.</li>
-<li><strong>after</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.AminoAcid</span></code></a>) &#8211; id of the residue after <em>central</em></li>
+<li><strong>before</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.AminoAcid</span></code></a>) &#8211; id of the residue before <em>central</em></li>
+<li><strong>central</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.AminoAcid</span></code></a>) &#8211; id of the residue for which the probability is calculated.</li>
+<li><strong>after</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.AminoAcid</span></code></a>) &#8211; id of the residue after <em>central</em></li>
 <li><strong>psi</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>) &#8211; phi angle</li>
 <li><strong>phi</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>) &#8211; psi angle</li>
 </ul>
@@ -580,9 +582,6 @@ standard amino acid</td>
       <input type="hidden" name="check_keywords" value="yes" />
       <input type="hidden" name="area" value="default" />
     </form>
-    <p class="searchtip" style="font-size: 90%">
-    Enter search terms or a module, class or function name.
-    </p>
 </div>
 <script type="text/javascript">$('#searchbox').show(0);</script>
         </div>
@@ -590,11 +589,11 @@ standard amino acid</td>
       <div class="clearer"></div>
     </div>
     <div class="footer">
-      &copy;2017, ProMod3 authors.
+      &copy;2018, ProMod3 authors.
       
       |
-      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a>
-      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.6</a>
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.4.1</a>
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
       
       |
       <a href="../_sources/loop/torsion_sampler.txt"
diff --git a/doc/html/modelling/algorithms.html b/doc/html/modelling/algorithms.html
index 38468c44ec13aa3c4aa4dbcb41263e7bda7d9045..0cd8be8702bde9b8f390725a811a36e6c272ea21 100644
--- a/doc/html/modelling/algorithms.html
+++ b/doc/html/modelling/algorithms.html
@@ -6,7 +6,7 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
-    <title>Modelling Algorithms &mdash; ProMod3 1.1.0 documentation</title>
+    <title>Modelling Algorithms &mdash; ProMod3 1.2.0 documentation</title>
     
     <link rel="stylesheet" href="../_static/alabaster.css" type="text/css" />
     <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
@@ -14,7 +14,7 @@
     <script type="text/javascript">
       var DOCUMENTATION_OPTIONS = {
         URL_ROOT:    '../',
-        VERSION:     '1.1.0',
+        VERSION:     '1.2.0',
         COLLAPSE_INDEX: false,
         FILE_SUFFIX: '.html',
         HAS_SOURCE:  true
@@ -23,16 +23,18 @@
     <script type="text/javascript" src="../_static/jquery.js"></script>
     <script type="text/javascript" src="../_static/underscore.js"></script>
     <script type="text/javascript" src="../_static/doctools.js"></script>
-    <link rel="top" title="ProMod3 1.1.0 documentation" href="../index.html" />
+    <link rel="top" title="ProMod3 1.2.0 documentation" href="../index.html" />
     <link rel="up" title="modelling - Protein Modelling" href="index.html" />
     <link rel="next" title="sidechain - Sidechain Modelling" href="../sidechain/index.html" />
     <link rel="prev" title="Sidechain Reconstruction" href="sidechain_reconstruction.html" />
    
+  <link rel="stylesheet" href="../_static/custom.css" type="text/css" />
   
-  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
 
   </head>
-  <body role="document">  
+  <body role="document">
+  
 
     <div class="document">
       <div class="documentwrapper">
@@ -59,11 +61,9 @@ iterative superposition multiple times by using a sliding window to select the
 initial subset and gathers all unique results. These results can be very
 similar and only differ by single positions. The algorithm therefore reduces
 the amount of solutions by merging them based on a threshold of similarity.
-If the sum of matching positions within the distance threshold divided by
-the maximum length of the two solutions is above a cluster thresh, the two
-solutions get merged by producing a common solution containing the shared
-positions. As a final result, the algorithm therefore detects common rigid
-subsets of positions.</p>
+The similarity is defined by the fraction of positions in solution A that are
+also present in solution B. As a final result, the algorithm therefore detects
+common rigid subsets of positions.</p>
 <dl class="method">
 <dt id="promod3.modelling.RigidBlocks">
 <code class="descclassname">promod3.modelling.</code><code class="descname">RigidBlocks</code><span class="sig-paren">(</span><em>bb_list_one</em>, <em>bb_list_two</em><span class="optional">[</span>, <em>window_length = 12</em>, <em>max_iterations=20</em>, <em>distance_thresh=3.0</em>, <em>cluster_thresh=0.9</em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#promod3.modelling.RigidBlocks" title="Permalink to this definition">¶</a></dt>
@@ -94,7 +94,7 @@ of the solutions</li>
 indices of the common subsets (rigid blocks) relative
 to the input <a class="reference internal" href="../loop/backbone.html#promod3.loop.BackboneList" title="promod3.loop.BackboneList"><code class="xref py py-class docutils literal"><span class="pre">promod3.loop.BackboneList</span></code></a> objects
 and the second element being a <code class="xref py py-class docutils literal"><span class="pre">list</span></code> of
-<a class="reference external" href="http://www.openstructure.org/docs/dev/geom/mat/#ost.geom.Mat4" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.geom.Mat4</span></code></a> defining the transformations to
+<a class="reference external" href="https://www.openstructure.org/docs/dev/geom/mat/#ost.geom.Mat4" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.geom.Mat4</span></code></a> defining the transformations to
 superpose the according positions in <strong>bb_list_one</strong>
 onto <strong>bb_list_two</strong></p>
 </td>
@@ -112,7 +112,7 @@ onto <strong>bb_list_two</strong></p>
 <col class="field-body" />
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
-<li><strong>aln</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/seq/base/seq/#ost.seq.AlignmentHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.seq.AlignmentHandle</span></code></a>) &#8211; An alignment with attached <a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.EntityView" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.EntityView</span></code></a>
+<li><strong>aln</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/seq/base/seq/#ost.seq.AlignmentHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.seq.AlignmentHandle</span></code></a>) &#8211; An alignment with attached <a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.EntityView" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.EntityView</span></code></a>
 objects from which the positions are extracted</li>
 <li><strong>seq_idx_one</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; The idx of the first sequence from which the CA
 positions will be extracted</li>
@@ -133,9 +133,9 @@ of the solutions</li>
 <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><code class="xref py py-class docutils literal"><span class="pre">tuple</span></code> with the first element being a
 <code class="xref py py-class docutils literal"><span class="pre">list</span></code> of <code class="xref py py-class docutils literal"><span class="pre">list</span></code> defining the
 column indices of the common subsets (rigid blocks)
-relative to the input <a class="reference external" href="http://www.openstructure.org/docs/dev/seq/base/seq/#ost.seq.AlignmentHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.seq.AlignmentHandle</span></code></a>
+relative to the input <a class="reference external" href="https://www.openstructure.org/docs/dev/seq/base/seq/#ost.seq.AlignmentHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.seq.AlignmentHandle</span></code></a>
 and the second element being a <code class="xref py py-class docutils literal"><span class="pre">list</span></code> of
-<a class="reference external" href="http://www.openstructure.org/docs/dev/geom/mat/#ost.geom.Mat4" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.geom.Mat4</span></code></a> defining the transformations to
+<a class="reference external" href="https://www.openstructure.org/docs/dev/geom/mat/#ost.geom.Mat4" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.geom.Mat4</span></code></a> defining the transformations to
 superpose the according positions from the first
 sequence onto the second sequence.</p>
 </td>
@@ -172,7 +172,7 @@ of the solutions</li>
 indices of the common subsets (rigid blocks) relative
 to the input <code class="xref py py-class docutils literal"><span class="pre">ost.geom.Vec3List</span></code> objects
 and the second element being a <code class="xref py py-class docutils literal"><span class="pre">list</span></code> of
-<a class="reference external" href="http://www.openstructure.org/docs/dev/geom/mat/#ost.geom.Mat4" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.geom.Mat4</span></code></a> defining the transformations to
+<a class="reference external" href="https://www.openstructure.org/docs/dev/geom/mat/#ost.geom.Mat4" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.geom.Mat4</span></code></a> defining the transformations to
 superpose the according positions in <strong>pos_one</strong>
 onto <strong>pos_two</strong></p>
 </td>
@@ -235,8 +235,8 @@ Weird things are happening otherwise.</p>
 <col class="field-body" />
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
-<li><strong>sequence</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#str" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">str</span></code></a>/<a class="reference external" href="http://www.openstructure.org/docs/dev/seq/base/seq/#ost.seq.SequenceHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.seq.SequenceHandle</span></code></a>) &#8211; SEQRES for this chain</li>
-<li><strong>profile</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/seq/base/seq/#ost.seq.ProfileHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.seq.ProfileHandle</span></code></a>) &#8211; Sequence profile for this chain.</li>
+<li><strong>sequence</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#str" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">str</span></code></a>/<a class="reference external" href="https://www.openstructure.org/docs/dev/seq/base/seq/#ost.seq.SequenceHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.seq.SequenceHandle</span></code></a>) &#8211; SEQRES for this chain</li>
+<li><strong>profile</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/seq/base/seq/#ost.seq.ProfileHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.seq.ProfileHandle</span></code></a>) &#8211; Sequence profile for this chain.</li>
 <li><strong>psipred_pred</strong> (<a class="reference internal" href="../loop/structure_db.html#promod3.loop.PsipredPrediction" title="promod3.loop.PsipredPrediction"><code class="xref py py-class docutils literal"><span class="pre">promod3.loop.PsipredPrediction</span></code></a>) &#8211; Psipred prediction for this chain.</li>
 <li><strong>fragment_length</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Length (num. residues) of fragments to be extracted.</li>
 <li><strong>fragments_per_position</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Number of fragments to be extracted at each
@@ -313,7 +313,7 @@ used when <cite>filename</cite> was saved.</p>
 
 <dl class="function">
 <dt id="promod3.modelling.GenerateDeNovoTrajectories">
-<code class="descclassname">promod3.modelling.</code><code class="descname">GenerateDeNovoTrajectories</code><span class="sig-paren">(</span><em>sequence</em>, <em>num_trajectories=200</em>, <em>avg_sampling_per_position=600</em>, <em>profile=None</em>, <em>psipred_prediction=None</em>, <em>fragment_handler=None</em>, <em>scorer=None</em>, <em>scoring_weights=None</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/promod3/modelling/_denovo.html#GenerateDeNovoTrajectories"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#promod3.modelling.GenerateDeNovoTrajectories" title="Permalink to this definition">¶</a></dt>
+<code class="descclassname">promod3.modelling.</code><code class="descname">GenerateDeNovoTrajectories</code><span class="sig-paren">(</span><em>sequence</em>, <em>num_trajectories=200</em>, <em>avg_sampling_per_position=600</em>, <em>profile=None</em>, <em>psipred_prediction=None</em>, <em>fragment_handler=None</em>, <em>scorer=None</em>, <em>scorer_env=None</em>, <em>scoring_weights=None</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/promod3/modelling/_denovo.html#GenerateDeNovoTrajectories"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#promod3.modelling.GenerateDeNovoTrajectories" title="Permalink to this definition">¶</a></dt>
 <dd><p>Example de novo modelling pipeline based on Fragment sampling and
 backbone scoring. Take this as a starting point for more advanced
 de novo procedures.</p>
@@ -328,7 +328,7 @@ want to generate</li>
 <li><strong>avg_sampling_per_position</strong> &#8211; Number of Monte Carlo sampling steps
 the total number is: 
 len(<strong>sequence</strong>) * <strong>avg_sampling_per_position</strong></li>
-<li><strong>profile</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/seq/base/seq/#ost.seq.ProfileHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.seq.ProfileHandle</span></code></a>) &#8211; The sequence profile for <strong>sequence</strong>. This increases the 
+<li><strong>profile</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/seq/base/seq/#ost.seq.ProfileHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.seq.ProfileHandle</span></code></a>) &#8211; The sequence profile for <strong>sequence</strong>. This increases the 
 fragment search performance.</li>
 <li><strong>psipred_prediction</strong> (<a class="reference internal" href="../loop/structure_db.html#promod3.loop.PsipredPrediction" title="promod3.loop.PsipredPrediction"><code class="xref py py-class docutils literal"><span class="pre">promod3.loop.PsipredPrediction</span></code></a>) &#8211; The psipred prediction for <strong>sequence</strong>. This
 increases the fragment search performance</li>
@@ -342,6 +342,8 @@ get used instead.</li>
 default one gets loaded with default objects with
 following keys: clash, reduced, cb_packing, hbond, cbeta, 
 torsion and pairwise</li>
+<li><strong>scorer_env</strong> (<a class="reference internal" href="../scoring/backbone_score_env.html#promod3.scoring.BackboneScoreEnv" title="promod3.scoring.BackboneScoreEnv"><code class="xref py py-class docutils literal"><span class="pre">promod3.scoring.BackboneScoreEnv</span></code></a>) &#8211; The scoring env that relates to <strong>scorer</strong>
+This environment will be changed!</li>
 <li><strong>scoring_weights</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/stdtypes.html#dict" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">dict</span></code></a>) &#8211; Linear weights for different scores. If not provided,
 the output of ScoringWeights.GetWeights() is used.
 Please note, that the weights must be consistent
@@ -402,9 +404,6 @@ with the keys of the scores in <strong>scorer</strong></li>
       <input type="hidden" name="check_keywords" value="yes" />
       <input type="hidden" name="area" value="default" />
     </form>
-    <p class="searchtip" style="font-size: 90%">
-    Enter search terms or a module, class or function name.
-    </p>
 </div>
 <script type="text/javascript">$('#searchbox').show(0);</script>
         </div>
@@ -412,11 +411,11 @@ with the keys of the scores in <strong>scorer</strong></li>
       <div class="clearer"></div>
     </div>
     <div class="footer">
-      &copy;2017, ProMod3 authors.
+      &copy;2018, ProMod3 authors.
       
       |
-      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a>
-      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.6</a>
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.4.1</a>
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
       
       |
       <a href="../_sources/modelling/algorithms.txt"
diff --git a/doc/html/modelling/gap_handling.html b/doc/html/modelling/gap_handling.html
index 916d24a1617cf48a310fc932dd1a2904acf28c82..032f3350c35708976935479acb04659939e587f6 100644
--- a/doc/html/modelling/gap_handling.html
+++ b/doc/html/modelling/gap_handling.html
@@ -6,7 +6,7 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
-    <title>Handling Gaps &mdash; ProMod3 1.1.0 documentation</title>
+    <title>Handling Gaps &mdash; ProMod3 1.2.0 documentation</title>
     
     <link rel="stylesheet" href="../_static/alabaster.css" type="text/css" />
     <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
@@ -14,7 +14,7 @@
     <script type="text/javascript">
       var DOCUMENTATION_OPTIONS = {
         URL_ROOT:    '../',
-        VERSION:     '1.1.0',
+        VERSION:     '1.2.0',
         COLLAPSE_INDEX: false,
         FILE_SUFFIX: '.html',
         HAS_SOURCE:  true
@@ -23,16 +23,18 @@
     <script type="text/javascript" src="../_static/jquery.js"></script>
     <script type="text/javascript" src="../_static/underscore.js"></script>
     <script type="text/javascript" src="../_static/doctools.js"></script>
-    <link rel="top" title="ProMod3 1.1.0 documentation" href="../index.html" />
+    <link rel="top" title="ProMod3 1.2.0 documentation" href="../index.html" />
     <link rel="up" title="modelling - Protein Modelling" href="index.html" />
     <link rel="next" title="Handling Loop Candidates" href="loop_candidates.html" />
     <link rel="prev" title="Model Checking" href="model_checking.html" />
    
+  <link rel="stylesheet" href="../_static/custom.css" type="text/css" />
   
-  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
 
   </head>
-  <body role="document">  
+  <body role="document">
+  
 
     <div class="document">
       <div class="documentwrapper">
@@ -58,8 +60,8 @@ invalid residue handles to <cite>before</cite> or <cite>after</cite>.</p>
 <col class="field-body" />
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
-<li><strong>before</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; Fills <a class="reference internal" href="#promod3.modelling.StructuralGap.before" title="promod3.modelling.StructuralGap.before"><code class="xref py py-attr docutils literal"><span class="pre">before</span></code></a></li>
-<li><strong>after</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; Fills <a class="reference internal" href="#promod3.modelling.StructuralGap.after" title="promod3.modelling.StructuralGap.after"><code class="xref py py-attr docutils literal"><span class="pre">after</span></code></a></li>
+<li><strong>before</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; Fills <a class="reference internal" href="#promod3.modelling.StructuralGap.before" title="promod3.modelling.StructuralGap.before"><code class="xref py py-attr docutils literal"><span class="pre">before</span></code></a></li>
+<li><strong>after</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; Fills <a class="reference internal" href="#promod3.modelling.StructuralGap.after" title="promod3.modelling.StructuralGap.after"><code class="xref py py-attr docutils literal"><span class="pre">after</span></code></a></li>
 <li><strong>seq</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#str" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">str</span></code></a>) &#8211; Fills <a class="reference internal" href="#promod3.modelling.StructuralGap.seq" title="promod3.modelling.StructuralGap.seq"><code class="xref py py-attr docutils literal"><span class="pre">seq</span></code></a></li>
 </ul>
 </td>
@@ -114,7 +116,7 @@ are valid and:</p>
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">Chain, the gap is belonging to</td>
 </tr>
-<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ChainHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ChainHandle</span></code></a></td>
+<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ChainHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ChainHandle</span></code></a></td>
 </tr>
 </tbody>
 </table>
@@ -265,13 +267,13 @@ extend the gap past another gap.</p>
 <dl class="attribute">
 <dt id="promod3.modelling.StructuralGap.before">
 <code class="descname">before</code><a class="headerlink" href="#promod3.modelling.StructuralGap.before" title="Permalink to this definition">¶</a></dt>
-<dd><p>Residue before the gap (read-only, <a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>)</p>
+<dd><p>Residue before the gap (read-only, <a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>)</p>
 </dd></dl>
 
 <dl class="attribute">
 <dt id="promod3.modelling.StructuralGap.after">
 <code class="descname">after</code><a class="headerlink" href="#promod3.modelling.StructuralGap.after" title="Permalink to this definition">¶</a></dt>
-<dd><p>Residue after the gap (read-only, <a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>)</p>
+<dd><p>Residue after the gap (read-only, <a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>)</p>
 </dd></dl>
 
 <dl class="attribute">
@@ -298,7 +300,7 @@ False if no new extension possible.</p>
 <dt id="promod3.modelling.GapExtender">
 <em class="property">class </em><code class="descclassname">promod3.modelling.</code><code class="descname">GapExtender</code><span class="sig-paren">(</span><em>gap</em>, <em>seqres</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.modelling.GapExtender" title="Permalink to this definition">¶</a></dt>
 <dd><p>The extender cycles through the following steps:</p>
-<div class="highlight-none"><div class="highlight"><pre>   -
+<div class="highlight-none"><div class="highlight"><pre><span></span>   -
   --
    --
  ---
@@ -316,7 +318,7 @@ False if no new extension possible.</p>
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
 <li><strong>gap</strong> (<a class="reference internal" href="#promod3.modelling.StructuralGap" title="promod3.modelling.StructuralGap"><code class="xref py py-class docutils literal"><span class="pre">StructuralGap</span></code></a>) &#8211; The gap which will be extended by <a class="reference internal" href="#promod3.modelling.GapExtender.Extend" title="promod3.modelling.GapExtender.Extend"><code class="xref py py-meth docutils literal"><span class="pre">Extend()</span></code></a>.</li>
-<li><strong>seqres</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#str" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">str</span></code></a> / <a class="reference external" href="http://www.openstructure.org/docs/dev/seq/base/seq/#ost.seq.SequenceHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.seq.SequenceHandle</span></code></a>) &#8211; The full sequence of the chain, the gap is associated with.</li>
+<li><strong>seqres</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#str" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">str</span></code></a> / <a class="reference external" href="https://www.openstructure.org/docs/dev/seq/base/seq/#ost.seq.SequenceHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.seq.SequenceHandle</span></code></a>) &#8211; The full sequence of the chain, the gap is associated with.</li>
 </ul>
 </td>
 </tr>
@@ -357,7 +359,7 @@ valid termini.</td>
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
 <li><strong>gap</strong> (<a class="reference internal" href="#promod3.modelling.StructuralGap" title="promod3.modelling.StructuralGap"><code class="xref py py-class docutils literal"><span class="pre">StructuralGap</span></code></a>) &#8211; The gap which will be extended by <a class="reference internal" href="#promod3.modelling.FullGapExtender.Extend" title="promod3.modelling.FullGapExtender.Extend"><code class="xref py py-meth docutils literal"><span class="pre">Extend()</span></code></a>.</li>
-<li><strong>seqres</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#str" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">str</span></code></a> / <a class="reference external" href="http://www.openstructure.org/docs/dev/seq/base/seq/#ost.seq.SequenceHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.seq.SequenceHandle</span></code></a>) &#8211; The full sequence of the chain, the gap is associated with.</li>
+<li><strong>seqres</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#str" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">str</span></code></a> / <a class="reference external" href="https://www.openstructure.org/docs/dev/seq/base/seq/#ost.seq.SequenceHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.seq.SequenceHandle</span></code></a>) &#8211; The full sequence of the chain, the gap is associated with.</li>
 <li><strong>max_length</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; <ul>
 <li>If -1, all possible non-terminal gaps are returned.</li>
 <li>If &gt;= 0, this restricts the max. gap-length
@@ -410,7 +412,7 @@ score = num_gap_extensions * <cite>extension_penalty</cite> + sum( <cite>penalti
 <li><strong>gap</strong> (<a class="reference internal" href="#promod3.modelling.StructuralGap" title="promod3.modelling.StructuralGap"><code class="xref py py-class docutils literal"><span class="pre">StructuralGap</span></code></a>) &#8211; The gap which will be extended by <a class="reference internal" href="#promod3.modelling.ScoringGapExtender.Extend" title="promod3.modelling.ScoringGapExtender.Extend"><code class="xref py py-meth docutils literal"><span class="pre">Extend()</span></code></a>.</li>
 <li><strong>extension_penalty</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>) &#8211; Penalty for length of gap.</li>
 <li><strong>penalties</strong> (<code class="xref py py-class docutils literal"><span class="pre">list</span></code> of <a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>) &#8211; Penalty for each residue added to gap.</li>
-<li><strong>seqres</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#str" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">str</span></code></a> / <a class="reference external" href="http://www.openstructure.org/docs/dev/seq/base/seq/#ost.seq.SequenceHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.seq.SequenceHandle</span></code></a>) &#8211; The full sequence of the chain, the gap is associated with.</li>
+<li><strong>seqres</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#str" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">str</span></code></a> / <a class="reference external" href="https://www.openstructure.org/docs/dev/seq/base/seq/#ost.seq.SequenceHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.seq.SequenceHandle</span></code></a>) &#8211; The full sequence of the chain, the gap is associated with.</li>
 <li><strong>max_length</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; <ul>
 <li>If -2, <a class="reference internal" href="#promod3.modelling.GapExtender" title="promod3.modelling.GapExtender"><code class="xref py py-class docutils literal"><span class="pre">GapExtender</span></code></a> is used instead of <a class="reference internal" href="#promod3.modelling.FullGapExtender" title="promod3.modelling.FullGapExtender"><code class="xref py py-class docutils literal"><span class="pre">FullGapExtender</span></code></a>
 (i.e. it stops at gaps and termini).</li>
@@ -643,9 +645,6 @@ gaps of different chains or an N-terminal gap with a C-terminal gap.</p>
       <input type="hidden" name="check_keywords" value="yes" />
       <input type="hidden" name="area" value="default" />
     </form>
-    <p class="searchtip" style="font-size: 90%">
-    Enter search terms or a module, class or function name.
-    </p>
 </div>
 <script type="text/javascript">$('#searchbox').show(0);</script>
         </div>
@@ -653,11 +652,11 @@ gaps of different chains or an N-terminal gap with a C-terminal gap.</p>
       <div class="clearer"></div>
     </div>
     <div class="footer">
-      &copy;2017, ProMod3 authors.
+      &copy;2018, ProMod3 authors.
       
       |
-      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a>
-      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.6</a>
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.4.1</a>
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
       
       |
       <a href="../_sources/modelling/gap_handling.txt"
diff --git a/doc/html/modelling/index.html b/doc/html/modelling/index.html
index 6760e8c8f9de9611a3f6c785bf48e46c6aac9f9d..79fbb0d1cc6ff30dd9e85dc0aebdb05f2097a5e4 100644
--- a/doc/html/modelling/index.html
+++ b/doc/html/modelling/index.html
@@ -6,7 +6,7 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
-    <title>modelling - Protein Modelling &mdash; ProMod3 1.1.0 documentation</title>
+    <title>modelling - Protein Modelling &mdash; ProMod3 1.2.0 documentation</title>
     
     <link rel="stylesheet" href="../_static/alabaster.css" type="text/css" />
     <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
@@ -14,7 +14,7 @@
     <script type="text/javascript">
       var DOCUMENTATION_OPTIONS = {
         URL_ROOT:    '../',
-        VERSION:     '1.1.0',
+        VERSION:     '1.2.0',
         COLLAPSE_INDEX: false,
         FILE_SUFFIX: '.html',
         HAS_SOURCE:  true
@@ -23,16 +23,18 @@
     <script type="text/javascript" src="../_static/jquery.js"></script>
     <script type="text/javascript" src="../_static/underscore.js"></script>
     <script type="text/javascript" src="../_static/doctools.js"></script>
-    <link rel="top" title="ProMod3 1.1.0 documentation" href="../index.html" />
+    <link rel="top" title="ProMod3 1.2.0 documentation" href="../index.html" />
     <link rel="up" title="Documentation For Users" href="../users.html" />
     <link rel="next" title="Modelling Pipeline" href="pipeline.html" />
     <link rel="prev" title="Building ProMod3" href="../buildsystem.html" />
    
+  <link rel="stylesheet" href="../_static/custom.css" type="text/css" />
   
-  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
 
   </head>
-  <body role="document">  
+  <body role="document">
+  
 
     <div class="document">
       <div class="documentwrapper">
@@ -48,18 +50,18 @@ capabilities to extract useful template data for the target and to fill the
 remaining structural data to create a full model of the target. In its simplest
 form, you can use a target-template alignment and a template structure to create
 a model fully automatically as follows:</p>
-<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">ost</span> <span class="kn">import</span> <span class="n">io</span>
-<span class="kn">from</span> <span class="nn">promod3</span> <span class="kn">import</span> <span class="n">modelling</span>
+<div class="highlight-default"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">ost</span> <span class="k">import</span> <span class="n">io</span>
+<span class="kn">from</span> <span class="nn">promod3</span> <span class="k">import</span> <span class="n">modelling</span>
 
-<span class="c"># get raw model</span>
-<span class="n">tpl</span> <span class="o">=</span> <span class="n">io</span><span class="o">.</span><span class="n">LoadPDB</span><span class="p">(</span><span class="s">&#39;data/1crn_cut.pdb&#39;</span><span class="p">)</span>
-<span class="n">aln</span> <span class="o">=</span> <span class="n">io</span><span class="o">.</span><span class="n">LoadAlignment</span><span class="p">(</span><span class="s">&#39;data/1crn.fasta&#39;</span><span class="p">)</span>
+<span class="c1"># get raw model</span>
+<span class="n">tpl</span> <span class="o">=</span> <span class="n">io</span><span class="o">.</span><span class="n">LoadPDB</span><span class="p">(</span><span class="s1">&#39;data/1crn_cut.pdb&#39;</span><span class="p">)</span>
+<span class="n">aln</span> <span class="o">=</span> <span class="n">io</span><span class="o">.</span><span class="n">LoadAlignment</span><span class="p">(</span><span class="s1">&#39;data/1crn.fasta&#39;</span><span class="p">)</span>
 <span class="n">aln</span><span class="o">.</span><span class="n">AttachView</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="n">tpl</span><span class="o">.</span><span class="n">CreateFullView</span><span class="p">())</span>
 <span class="n">mhandle</span> <span class="o">=</span> <span class="n">modelling</span><span class="o">.</span><span class="n">BuildRawModel</span><span class="p">(</span><span class="n">aln</span><span class="p">)</span>
 
-<span class="c"># build final model</span>
+<span class="c1"># build final model</span>
 <span class="n">final_model</span> <span class="o">=</span> <span class="n">modelling</span><span class="o">.</span><span class="n">BuildFromRawModel</span><span class="p">(</span><span class="n">mhandle</span><span class="p">)</span>
-<span class="n">io</span><span class="o">.</span><span class="n">SavePDB</span><span class="p">(</span><span class="n">final_model</span><span class="p">,</span> <span class="s">&#39;model.pdb&#39;</span><span class="p">)</span>
+<span class="n">io</span><span class="o">.</span><span class="n">SavePDB</span><span class="p">(</span><span class="n">final_model</span><span class="p">,</span> <span class="s1">&#39;model.pdb&#39;</span><span class="p">)</span>
 </pre></div>
 </div>
 <p>The various steps involved in protein modelling are described here:</p>
@@ -148,9 +150,6 @@ a model fully automatically as follows:</p>
       <input type="hidden" name="check_keywords" value="yes" />
       <input type="hidden" name="area" value="default" />
     </form>
-    <p class="searchtip" style="font-size: 90%">
-    Enter search terms or a module, class or function name.
-    </p>
 </div>
 <script type="text/javascript">$('#searchbox').show(0);</script>
         </div>
@@ -158,11 +157,11 @@ a model fully automatically as follows:</p>
       <div class="clearer"></div>
     </div>
     <div class="footer">
-      &copy;2017, ProMod3 authors.
+      &copy;2018, ProMod3 authors.
       
       |
-      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a>
-      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.6</a>
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.4.1</a>
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
       
       |
       <a href="../_sources/modelling/index.txt"
diff --git a/doc/html/modelling/loop_candidates.html b/doc/html/modelling/loop_candidates.html
index 411f6291eb8c6e3e75449d21e66646eb648fb8b2..b1803ae6baaba3a96330a07192ae2987307a9f9b 100644
--- a/doc/html/modelling/loop_candidates.html
+++ b/doc/html/modelling/loop_candidates.html
@@ -6,7 +6,7 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
-    <title>Handling Loop Candidates &mdash; ProMod3 1.1.0 documentation</title>
+    <title>Handling Loop Candidates &mdash; ProMod3 1.2.0 documentation</title>
     
     <link rel="stylesheet" href="../_static/alabaster.css" type="text/css" />
     <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
@@ -14,7 +14,7 @@
     <script type="text/javascript">
       var DOCUMENTATION_OPTIONS = {
         URL_ROOT:    '../',
-        VERSION:     '1.1.0',
+        VERSION:     '1.2.0',
         COLLAPSE_INDEX: false,
         FILE_SUFFIX: '.html',
         HAS_SOURCE:  true
@@ -23,16 +23,18 @@
     <script type="text/javascript" src="../_static/jquery.js"></script>
     <script type="text/javascript" src="../_static/underscore.js"></script>
     <script type="text/javascript" src="../_static/doctools.js"></script>
-    <link rel="top" title="ProMod3 1.1.0 documentation" href="../index.html" />
+    <link rel="top" title="ProMod3 1.2.0 documentation" href="../index.html" />
     <link rel="up" title="modelling - Protein Modelling" href="index.html" />
     <link rel="next" title="Fitting Loops Into Gaps" href="loop_closing.html" />
     <link rel="prev" title="Handling Gaps" href="gap_handling.html" />
    
+  <link rel="stylesheet" href="../_static/custom.css" type="text/css" />
   
-  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
 
   </head>
-  <body role="document">  
+  <body role="document">
+  
 
     <div class="document">
       <div class="documentwrapper">
@@ -47,59 +49,59 @@ filled manually or generated using static filling functions using the
 functionality from the <a class="reference internal" href="../loop/structure_db.html#promod3.loop.FragDB" title="promod3.loop.FragDB"><code class="xref py py-class docutils literal"><span class="pre">FragDB</span></code></a> or Monte Carlo algorithms.
 Once it contains candidates you can apply closing, scoring or clustering
 algorithms on all loop candidates. Example:</p>
-<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">ost</span> <span class="kn">import</span> <span class="n">io</span>
-<span class="kn">from</span> <span class="nn">promod3</span> <span class="kn">import</span> <span class="n">loop</span><span class="p">,</span> <span class="n">scoring</span><span class="p">,</span> <span class="n">modelling</span>
+<div class="highlight-default"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">ost</span> <span class="k">import</span> <span class="n">io</span>
+<span class="kn">from</span> <span class="nn">promod3</span> <span class="k">import</span> <span class="n">loop</span><span class="p">,</span> <span class="n">scoring</span><span class="p">,</span> <span class="n">modelling</span>
 
-<span class="c"># let&#39;s load a crambin structure from the pdb</span>
-<span class="n">crambin</span> <span class="o">=</span> <span class="n">io</span><span class="o">.</span><span class="n">LoadPDB</span><span class="p">(</span><span class="s">&#39;data/1CRN.pdb&#39;</span><span class="p">)</span>
-<span class="n">SEQRES</span> <span class="o">=</span> <span class="s">&#39;&#39;</span><span class="o">.</span><span class="n">join</span><span class="p">([</span><span class="n">r</span><span class="o">.</span><span class="n">one_letter_code</span> <span class="k">for</span> <span class="n">r</span> <span class="ow">in</span> <span class="n">crambin</span><span class="o">.</span><span class="n">residues</span><span class="p">])</span>
+<span class="c1"># let&#39;s load a crambin structure from the pdb</span>
+<span class="n">crambin</span> <span class="o">=</span> <span class="n">io</span><span class="o">.</span><span class="n">LoadPDB</span><span class="p">(</span><span class="s1">&#39;data/1CRN.pdb&#39;</span><span class="p">)</span>
+<span class="n">SEQRES</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="o">.</span><span class="n">join</span><span class="p">([</span><span class="n">r</span><span class="o">.</span><span class="n">one_letter_code</span> <span class="k">for</span> <span class="n">r</span> <span class="ow">in</span> <span class="n">crambin</span><span class="o">.</span><span class="n">residues</span><span class="p">])</span>
 
-<span class="c"># this is the sequence we want to remodel</span>
+<span class="c1"># this is the sequence we want to remodel</span>
 <span class="n">loop_seq</span> <span class="o">=</span> <span class="n">SEQRES</span><span class="p">[</span><span class="mi">23</span><span class="p">:</span><span class="mi">31</span><span class="p">]</span>
 
-<span class="c"># let&#39;s define the stem residues</span>
+<span class="c1"># let&#39;s define the stem residues</span>
 <span class="n">n_stem</span> <span class="o">=</span> <span class="n">crambin</span><span class="o">.</span><span class="n">residues</span><span class="p">[</span><span class="mi">23</span><span class="p">]</span>
 <span class="n">c_stem</span> <span class="o">=</span> <span class="n">crambin</span><span class="o">.</span><span class="n">residues</span><span class="p">[</span><span class="mi">30</span><span class="p">]</span>
 
-<span class="c"># we use the StructureDB as source for structural information</span>
+<span class="c1"># we use the StructureDB as source for structural information</span>
 <span class="n">structure_db</span> <span class="o">=</span> <span class="n">loop</span><span class="o">.</span><span class="n">LoadStructureDB</span><span class="p">()</span>
 
-<span class="c"># the FragDB allows to access the StructureDB based on geometric </span>
-<span class="c"># features of the loop stem residue</span>
+<span class="c1"># the FragDB allows to access the StructureDB based on geometric </span>
+<span class="c1"># features of the loop stem residue</span>
 <span class="n">frag_db</span> <span class="o">=</span> <span class="n">loop</span><span class="o">.</span><span class="n">LoadFragDB</span><span class="p">()</span>
 
-<span class="c"># the LoopCandidates allow to handle several loops at once</span>
-<span class="c"># we directly want to find potential loop candidates from the</span>
-<span class="c"># previously loaded databases</span>
+<span class="c1"># the LoopCandidates allow to handle several loops at once</span>
+<span class="c1"># we directly want to find potential loop candidates from the</span>
+<span class="c1"># previously loaded databases</span>
 <span class="n">loop_candidates</span> <span class="o">=</span> <span class="n">modelling</span><span class="o">.</span><span class="n">LoopCandidates</span><span class="o">.</span><span class="n">FillFromDatabase</span><span class="p">(</span>\
                     <span class="n">n_stem</span><span class="p">,</span> <span class="n">c_stem</span><span class="p">,</span> <span class="n">loop_seq</span><span class="p">,</span> <span class="n">frag_db</span><span class="p">,</span> <span class="n">structure_db</span><span class="p">)</span>
 
-<span class="c"># candidates usually don&#39;t match exactly the required stem coords.</span>
-<span class="c"># CCD (Cyclic Coordinate Descent) is one way to enforce this match.</span>
+<span class="c1"># candidates usually don&#39;t match exactly the required stem coords.</span>
+<span class="c1"># CCD (Cyclic Coordinate Descent) is one way to enforce this match.</span>
 <span class="n">loop_candidates</span><span class="o">.</span><span class="n">ApplyCCD</span><span class="p">(</span><span class="n">n_stem</span><span class="p">,</span> <span class="n">c_stem</span><span class="p">)</span>
 
-<span class="c"># setup backbone scorer with clash and cbeta scoring</span>
+<span class="c1"># setup backbone scorer with clash and cbeta scoring</span>
 <span class="n">score_env</span> <span class="o">=</span> <span class="n">scoring</span><span class="o">.</span><span class="n">BackboneScoreEnv</span><span class="p">(</span><span class="n">SEQRES</span><span class="p">)</span>
 <span class="n">score_env</span><span class="o">.</span><span class="n">SetInitialEnvironment</span><span class="p">(</span><span class="n">crambin</span><span class="p">)</span>
 <span class="n">scorer</span> <span class="o">=</span> <span class="n">scoring</span><span class="o">.</span><span class="n">BackboneOverallScorer</span><span class="p">()</span>
-<span class="n">scorer</span><span class="p">[</span><span class="s">&quot;cbeta&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">scoring</span><span class="o">.</span><span class="n">LoadCBetaScorer</span><span class="p">()</span>
-<span class="n">scorer</span><span class="p">[</span><span class="s">&quot;clash&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">scoring</span><span class="o">.</span><span class="n">ClashScorer</span><span class="p">()</span>
+<span class="n">scorer</span><span class="p">[</span><span class="s2">&quot;cbeta&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">scoring</span><span class="o">.</span><span class="n">LoadCBetaScorer</span><span class="p">()</span>
+<span class="n">scorer</span><span class="p">[</span><span class="s2">&quot;clash&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">scoring</span><span class="o">.</span><span class="n">ClashScorer</span><span class="p">()</span>
 <span class="n">scorer</span><span class="o">.</span><span class="n">AttachEnvironment</span><span class="p">(</span><span class="n">score_env</span><span class="p">)</span>
 
-<span class="c"># the scorer can then be used on the LoopCandidates object to</span>
-<span class="c"># calculate desired scores (here: cbeta &amp; clash, start resnum = 24)</span>
+<span class="c1"># the scorer can then be used on the LoopCandidates object to</span>
+<span class="c1"># calculate desired scores (here: cbeta &amp; clash, start resnum = 24)</span>
 <span class="n">bb_scores</span> <span class="o">=</span> <span class="n">modelling</span><span class="o">.</span><span class="n">ScoreContainer</span><span class="p">()</span>
-<span class="n">loop_candidates</span><span class="o">.</span><span class="n">CalculateBackboneScores</span><span class="p">(</span><span class="n">bb_scores</span><span class="p">,</span> <span class="n">scorer</span><span class="p">,</span>
-                                        <span class="p">[</span><span class="s">&quot;cbeta&quot;</span><span class="p">,</span> <span class="s">&quot;clash&quot;</span><span class="p">],</span> <span class="mi">24</span><span class="p">)</span>
-<span class="c"># we finally perform a weighted linear combination of the scores,</span>
-<span class="c"># pick the best one, insert it into our structure and save it</span>
-<span class="n">weights</span> <span class="o">=</span> <span class="p">{</span><span class="s">&quot;cbeta&quot;</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span> <span class="s">&quot;clash&quot;</span><span class="p">:</span> <span class="mi">1</span><span class="p">}</span>
+<span class="n">loop_candidates</span><span class="o">.</span><span class="n">CalculateBackboneScores</span><span class="p">(</span><span class="n">bb_scores</span><span class="p">,</span> <span class="n">scorer</span><span class="p">,</span> <span class="n">score_env</span><span class="p">,</span>
+                                        <span class="p">[</span><span class="s2">&quot;cbeta&quot;</span><span class="p">,</span> <span class="s2">&quot;clash&quot;</span><span class="p">],</span> <span class="mi">24</span><span class="p">)</span>
+<span class="c1"># we finally perform a weighted linear combination of the scores,</span>
+<span class="c1"># pick the best one, insert it into our structure and save it</span>
+<span class="n">weights</span> <span class="o">=</span> <span class="p">{</span><span class="s2">&quot;cbeta&quot;</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span> <span class="s2">&quot;clash&quot;</span><span class="p">:</span> <span class="mi">1</span><span class="p">}</span>
 <span class="n">scores</span> <span class="o">=</span> <span class="n">bb_scores</span><span class="o">.</span><span class="n">LinearCombine</span><span class="p">(</span><span class="n">weights</span><span class="p">)</span>
 <span class="n">min_score</span> <span class="o">=</span> <span class="nb">min</span><span class="p">(</span><span class="n">scores</span><span class="p">)</span>
 <span class="n">min_candidate</span> <span class="o">=</span> <span class="n">scores</span><span class="o">.</span><span class="n">index</span><span class="p">(</span><span class="n">min_score</span><span class="p">)</span>
 <span class="n">bb_list</span> <span class="o">=</span> <span class="n">loop_candidates</span><span class="p">[</span><span class="n">min_candidate</span><span class="p">]</span>
 <span class="n">bb_list</span><span class="o">.</span><span class="n">InsertInto</span><span class="p">(</span><span class="n">crambin</span><span class="o">.</span><span class="n">chains</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">n_stem</span><span class="o">.</span><span class="n">GetNumber</span><span class="p">())</span>
-<span class="n">io</span><span class="o">.</span><span class="n">SavePDB</span><span class="p">(</span><span class="n">crambin</span><span class="p">,</span> <span class="s">&quot;modified_crambin.pdb&quot;</span><span class="p">)</span>
+<span class="n">io</span><span class="o">.</span><span class="n">SavePDB</span><span class="p">(</span><span class="n">crambin</span><span class="p">,</span> <span class="s2">&quot;modified_crambin.pdb&quot;</span><span class="p">)</span>
 </pre></div>
 </div>
 <div class="section" id="the-loopcandidates-class">
@@ -130,8 +132,8 @@ a fragment database.</p>
 <col class="field-body" />
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
-<li><strong>n_stem</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; The residue at the N-terminal end of the loop</li>
-<li><strong>c_stem</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; The residue at the C-terminal end of the loop</li>
+<li><strong>n_stem</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; The residue at the N-terminal end of the loop</li>
+<li><strong>c_stem</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; The residue at the C-terminal end of the loop</li>
 <li><strong>seq</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#str" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">str</span></code></a>) &#8211; The sequence of residues to be added including the
 <em>n_stem</em> and <em>c_stem</em></li>
 <li><strong>frag_db</strong> (<a class="reference internal" href="../loop/structure_db.html#promod3.loop.FragDB" title="promod3.loop.FragDB"><code class="xref py py-class docutils literal"><span class="pre">FragDB</span></code></a>) &#8211; The fragment database</li>
@@ -163,6 +165,14 @@ atoms.</p>
 <em class="property">static </em><code class="descname">FillFromMonteCarloSampler</code><span class="sig-paren">(</span><em>initial_bb</em>, <em>seq</em>, <em>num_loops</em>, <em>steps</em>, <em>sampler</em>, <em>closer</em>, <em>scorer</em>, <em>cooler</em>, <em>random_seed=0</em><span class="sig-paren">)</span></dt>
 <dd><p>Uses Monte Carlo simulated annealing to sample the loop to be modelled.
 If <em>initial_bb</em> is given, every Monte Carlo run starts from that configuration.</p>
+<div class="admonition warning">
+<p class="first admonition-title">Warning</p>
+<p class="last">The <a class="reference internal" href="../scoring/backbone_score_env.html#promod3.scoring.BackboneScoreEnv" title="promod3.scoring.BackboneScoreEnv"><code class="xref py py-class docutils literal"><span class="pre">BackboneScoreEnv</span></code></a>
+attached to <em>scorer</em> will be altered in the specified stretch.
+You might consider the Stash / Pop mechanism of the
+<a class="reference internal" href="../scoring/backbone_score_env.html#promod3.scoring.BackboneScoreEnv" title="promod3.scoring.BackboneScoreEnv"><code class="xref py py-class docutils literal"><span class="pre">BackboneScoreEnv</span></code></a> to restore to the
+original state once the sampling is done.</p>
+</div>
 <table class="docutils field-list" frame="void" rules="none">
 <col class="field-name" />
 <col class="field-body" />
@@ -173,10 +183,10 @@ If <em>initial_bb</em> is given, every Monte Carlo run starts from that configur
 <li><strong>num_loops</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Number of loop candidates to return</li>
 <li><strong>steps</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Number of MC steps to perform for each loop candidate
 generated</li>
-<li><strong>sampler</strong> (<a class="reference internal" href="monte_carlo.html#mc-sampler-object"><span>Sampler Object</span></a>) &#8211; Used to generate a new configuration at each MC step</li>
-<li><strong>closer</strong> (<a class="reference internal" href="monte_carlo.html#mc-closer-object"><span>Closer Object</span></a>) &#8211; Used to close the loop after each MC step</li>
-<li><strong>scorer</strong> (<a class="reference internal" href="monte_carlo.html#mc-scorer-object"><span>Scorer Object</span></a>) &#8211; Used to score the generated configurations at each MC step</li>
-<li><strong>cooler</strong> (<a class="reference internal" href="monte_carlo.html#mc-cooler-object"><span>Cooler Object</span></a>) &#8211; Controls the temperature profile of the simulated annealing</li>
+<li><strong>sampler</strong> (<a class="reference internal" href="monte_carlo.html#mc-sampler-object"><span class="std std-ref">Sampler Object</span></a>) &#8211; Used to generate a new configuration at each MC step</li>
+<li><strong>closer</strong> (<a class="reference internal" href="monte_carlo.html#mc-closer-object"><span class="std std-ref">Closer Object</span></a>) &#8211; Used to close the loop after each MC step</li>
+<li><strong>scorer</strong> (<a class="reference internal" href="monte_carlo.html#mc-scorer-object"><span class="std std-ref">Scorer Object</span></a>) &#8211; Used to score the generated configurations at each MC step</li>
+<li><strong>cooler</strong> (<a class="reference internal" href="monte_carlo.html#mc-cooler-object"><span class="std std-ref">Cooler Object</span></a>) &#8211; Controls the temperature profile of the simulated annealing</li>
 <li><strong>random_seed</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Seed to feed the random number generator for
 accepting/rejecting proposed monte carlo steps.
 For every monte carlo run, the random number generator
@@ -234,9 +244,9 @@ not depending on a metropolis criterium.</p>
 <col class="field-body" />
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
-<li><strong>n_stem</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; Residue defining the n-stem positions every candidate
+<li><strong>n_stem</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; Residue defining the n-stem positions every candidate
 should match. See <a class="reference internal" href="loop_closing.html#promod3.modelling.CCD.CCD" title="promod3.modelling.CCD.CCD"><code class="xref py py-meth docutils literal"><span class="pre">CCD()</span></code></a>.</li>
-<li><strong>c_stem</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; Residue defining the c-stem positions every candidate
+<li><strong>c_stem</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; Residue defining the c-stem positions every candidate
 should match. See <a class="reference internal" href="loop_closing.html#promod3.modelling.CCD.CCD" title="promod3.modelling.CCD.CCD"><code class="xref py py-meth docutils literal"><span class="pre">CCD()</span></code></a>.</li>
 <li><strong>torsion_sampler</strong> (<a class="reference internal" href="../loop/torsion_sampler.html#promod3.loop.TorsionSampler" title="promod3.loop.TorsionSampler"><code class="xref py py-class docutils literal"><span class="pre">TorsionSampler</span></code></a> / <code class="xref py py-class docutils literal"><span class="pre">list</span></code>
 of <a class="reference internal" href="../loop/torsion_sampler.html#promod3.loop.TorsionSampler" title="promod3.loop.TorsionSampler"><code class="xref py py-class docutils literal"><span class="pre">TorsionSampler</span></code></a>) &#8211; A torsion sampler (used for all residues) or a list
@@ -278,9 +288,9 @@ candidate. This leads to an increase in number of loops.</p>
 <col class="field-body" />
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
-<li><strong>n_stem</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; Residue defining the n-stem positions every candidate
+<li><strong>n_stem</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; Residue defining the n-stem positions every candidate
 should match</li>
-<li><strong>c_stem</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; Residue defining the c-stem positions every candidate
+<li><strong>c_stem</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; Residue defining the c-stem positions every candidate
 should match</li>
 <li><strong>pivot_one</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; First pivot residue</li>
 <li><strong>pivot_two</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Second pivot residue</li>
@@ -303,9 +313,13 @@ useful to keep track of scores and other data extracted before.</p>
 
 <dl class="method">
 <dt id="promod3.modelling.LoopCandidates.CalculateBackboneScores">
-<code class="descname">CalculateBackboneScores</code><span class="sig-paren">(</span><em>score_container</em>, <em>scorer</em>, <em>start_resnum</em>, <em>chain_idx=0</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.modelling.LoopCandidates.CalculateBackboneScores" title="Permalink to this definition">¶</a></dt>
+<code class="descname">CalculateBackboneScores</code><span class="sig-paren">(</span><em>score_container</em>, <em>scorer</em>, <em>scorer_env</em>, <em>start_resnum</em>, <em>chain_idx=0</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.modelling.LoopCandidates.CalculateBackboneScores" title="Permalink to this definition">¶</a></dt>
+<dt>
+<code class="descname">CalculateBackboneScores</code><span class="sig-paren">(</span><em>score_container</em>, <em>scorer</em>, <em>scorer_env</em>, <em>keys</em>, <em>start_resnum</em>, <em>chain_idx=0</em><span class="sig-paren">)</span></dt>
 <dt>
-<code class="descname">CalculateBackboneScores</code><span class="sig-paren">(</span><em>score_container</em>, <em>scorer</em>, <em>keys</em>, <em>start_resnum</em>, <em>chain_idx=0</em><span class="sig-paren">)</span></dt>
+<code class="descname">CalculateBackboneScores</code><span class="sig-paren">(</span><em>score_container</em>, <em>mhandle</em>, <em>start_resnum</em>, <em>chain_idx=0</em><span class="sig-paren">)</span></dt>
+<dt>
+<code class="descname">CalculateBackboneScores</code><span class="sig-paren">(</span><em>score_container</em>, <em>mhandle</em>, <em>keys</em>, <em>start_resnum</em>, <em>chain_idx=0</em><span class="sig-paren">)</span></dt>
 <dt id="promod3.modelling.LoopCandidates.CalculateAllAtomScores">
 <code class="descname">CalculateAllAtomScores</code><span class="sig-paren">(</span><em>score_container</em>, <em>mhandle</em>, <em>start_resnum</em>, <em>chain_idx=0</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.modelling.LoopCandidates.CalculateAllAtomScores" title="Permalink to this definition">¶</a></dt>
 <dt>
@@ -322,7 +336,9 @@ Note that (unless otherwise noted) a lower &#8220;score&#8221; is better!</p>
 key names (or the ones from <a class="reference internal" href="#promod3.modelling.ScoringWeights" title="promod3.modelling.ScoringWeights"><code class="xref py py-class docutils literal"><span class="pre">ScoringWeights</span></code></a>)</li>
 <li><strong>scorer</strong> (<a class="reference internal" href="../scoring/backbone_scorers.html#promod3.scoring.BackboneOverallScorer" title="promod3.scoring.BackboneOverallScorer"><code class="xref py py-class docutils literal"><span class="pre">BackboneOverallScorer</span></code></a>) &#8211; Backbone scoring object with set environment for the
 particular loop modelling problem.</li>
-<li><strong>mhandle</strong> (<a class="reference internal" href="pipeline.html#promod3.modelling.ModellingHandle" title="promod3.modelling.ModellingHandle"><code class="xref py py-class docutils literal"><span class="pre">ModellingHandle</span></code></a>) &#8211; Modelling handle set up for all atom scoring (see
+<li><strong>scorer_env</strong> (<a class="reference internal" href="../scoring/backbone_score_env.html#promod3.scoring.BackboneScoreEnv" title="promod3.scoring.BackboneScoreEnv"><code class="xref py py-class docutils literal"><span class="pre">BackboneScoreEnv</span></code></a>) &#8211; The scoring environment attached to <em>scorer</em></li>
+<li><strong>mhandle</strong> (<a class="reference internal" href="pipeline.html#promod3.modelling.ModellingHandle" title="promod3.modelling.ModellingHandle"><code class="xref py py-class docutils literal"><span class="pre">ModellingHandle</span></code></a>) &#8211; Modelling handle set up scoring (see
+<a class="reference internal" href="pipeline.html#promod3.modelling.SetupDefaultBackboneScoring" title="promod3.modelling.SetupDefaultBackboneScoring"><code class="xref py py-func docutils literal"><span class="pre">SetupDefaultBackboneScoring()</span></code></a>
 <a class="reference internal" href="pipeline.html#promod3.modelling.SetupDefaultAllAtomScoring" title="promod3.modelling.SetupDefaultAllAtomScoring"><code class="xref py py-func docutils literal"><span class="pre">SetupDefaultAllAtomScoring()</span></code></a>).</li>
 <li><strong>keys</strong> (<code class="xref py py-class docutils literal"><span class="pre">list</span></code> of <a class="reference external" href="https://docs.python.org/2.7/library/functions.html#str" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">str</span></code></a>) &#8211; Keys of the desired scorers. If not given, we use the set of
 keys given by <a class="reference internal" href="#promod3.modelling.ScoringWeights.GetBackboneScoringKeys" title="promod3.modelling.ScoringWeights.GetBackboneScoringKeys"><code class="xref py py-meth docutils literal"><span class="pre">ScoringWeights.GetBackboneScoringKeys()</span></code></a> /
@@ -348,7 +364,7 @@ anything is raised when calculating the scores.</p>
 <code class="descname">CalculateStructureProfileScores</code><span class="sig-paren">(</span><em>score_container</em>, <em>structure_db</em>, <em>prof</em>, <em>offset=0</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.modelling.LoopCandidates.CalculateStructureProfileScores" title="Permalink to this definition">¶</a></dt>
 <dd><p>Calculates a score comparing the given profile <em>prof</em> starting at <em>offset</em>
 with the sequence / structure profile of each candidate as extracted from
-<em>structure_db</em> (see <a class="reference external" href="http://www.openstructure.org/docs/dev/seq/base/seq/#ost.seq.ProfileHandle.GetAverageScore" title="(in OpenStructure v1.6.0)"><code class="xref py py-meth docutils literal"><span class="pre">ost.seq.ProfileHandle.GetAverageScore()</span></code></a> for
+<em>structure_db</em> (see <a class="reference external" href="https://www.openstructure.org/docs/dev/seq/base/seq/#ost.seq.ProfileHandle.GetAverageScore" title="(in OpenStructure v1.7.1)"><code class="xref py py-meth docutils literal"><span class="pre">ost.seq.ProfileHandle.GetAverageScore()</span></code></a> for
 details, <em>prof.null_model</em> is used for weighting).</p>
 <p>Note that for profile scores a higher &#8220;score&#8221; is better! So take care when
 combining this to other scores, where it is commonly the other way around.</p>
@@ -364,7 +380,7 @@ with this DB).</p>
 <li><strong>score_container</strong> (<a class="reference internal" href="#promod3.modelling.ScoreContainer" title="promod3.modelling.ScoreContainer"><code class="xref py py-class docutils literal"><span class="pre">ScoreContainer</span></code></a>) &#8211; Add scores to this score container using the default
 key name defined in <a class="reference internal" href="#promod3.modelling.ScoringWeights" title="promod3.modelling.ScoringWeights"><code class="xref py py-class docutils literal"><span class="pre">ScoringWeights</span></code></a></li>
 <li><strong>structural_db</strong> (<a class="reference internal" href="../loop/structure_db.html#promod3.loop.StructureDB" title="promod3.loop.StructureDB"><code class="xref py py-class docutils literal"><span class="pre">StructureDB</span></code></a>) &#8211; Structural database used in <a class="reference internal" href="#promod3.modelling.LoopCandidates.FillFromDatabase" title="promod3.modelling.LoopCandidates.FillFromDatabase"><code class="xref py py-meth docutils literal"><span class="pre">FillFromDatabase()</span></code></a></li>
-<li><strong>prof</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/seq/base/seq/#ost.seq.ProfileHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.seq.ProfileHandle</span></code></a>) &#8211; Profile information for target.</li>
+<li><strong>prof</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/seq/base/seq/#ost.seq.ProfileHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.seq.ProfileHandle</span></code></a>) &#8211; Profile information for target.</li>
 <li><strong>offset</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Loop starts at index <em>offset</em> in <em>prof</em>.</li>
 </ul>
 </td>
@@ -396,8 +412,8 @@ positions and the corresponding atoms in <em>c_stem</em>.</p>
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
 <li><strong>score_container</strong> (<a class="reference internal" href="#promod3.modelling.ScoreContainer" title="promod3.modelling.ScoreContainer"><code class="xref py py-class docutils literal"><span class="pre">ScoreContainer</span></code></a>) &#8211; Add scores to this score container using the default
 key name defined in <a class="reference internal" href="#promod3.modelling.ScoringWeights" title="promod3.modelling.ScoringWeights"><code class="xref py py-class docutils literal"><span class="pre">ScoringWeights</span></code></a></li>
-<li><strong>n_stem</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; The residue at the N-terminal end of the loop.</li>
-<li><strong>c_stem</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; The residue at the C-terminal end of the loop.</li>
+<li><strong>n_stem</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; The residue at the N-terminal end of the loop.</li>
+<li><strong>c_stem</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; The residue at the C-terminal end of the loop.</li>
 </ul>
 </td>
 </tr>
@@ -801,11 +817,17 @@ matching keys).</p>
 <dd><p>Globally accessible set of weights to be used in scoring. This also defines
 a consistent naming of keys used for backbone and all atom scorers as set up
 by <a class="reference internal" href="pipeline.html#promod3.modelling.SetupDefaultBackboneScoring" title="promod3.modelling.SetupDefaultBackboneScoring"><code class="xref py py-func docutils literal"><span class="pre">SetupDefaultBackboneScoring()</span></code></a> and <a class="reference internal" href="pipeline.html#promod3.modelling.SetupDefaultAllAtomScoring" title="promod3.modelling.SetupDefaultAllAtomScoring"><code class="xref py py-func docutils literal"><span class="pre">SetupDefaultAllAtomScoring()</span></code></a>.</p>
+<p>Different sets of weights are available. You can get general weights
+that have been optimized for a non redundant set of loops with lengths [3,14]
+(including stem residues). The alternative is to get weights that have only
+been optimized on a length specific subset of loops. By default you get
+different weights for following lengths: [0,1,2,3,4], [5,6], [7,8], [9,10],
+[11,12], [13,14].</p>
 <p>If you choose to modify the weights, please ensure to set consistently named
 keys in here and to use consistently named scorers and scoring computations!</p>
 <dl class="staticmethod">
 <dt id="promod3.modelling.ScoringWeights.GetWeights">
-<em class="property">static </em><code class="descname">GetWeights</code><span class="sig-paren">(</span><em>with_db=False</em>, <em>with_aa=False</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.modelling.ScoringWeights.GetWeights" title="Permalink to this definition">¶</a></dt>
+<em class="property">static </em><code class="descname">GetWeights</code><span class="sig-paren">(</span><em>with_db=False</em>, <em>with_aa=False</em>, <em>length_dependent=False</em>, <em>loop_length=-1</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.modelling.ScoringWeights.GetWeights" title="Permalink to this definition">¶</a></dt>
 <dd><table class="docutils field-list" frame="void" rules="none">
 <col class="field-name" />
 <col class="field-body" />
@@ -813,7 +835,9 @@ keys in here and to use consistently named scorers and scoring computations!</p>
 <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Named weights to be used when scoring loop candidates. The default
 weights were optimized to give the best performance when choosing
 the loop candidate with the lowest combined score. Each set of
-weights includes (different) backbone scoring weights.</p>
+weights includes (different) backbone scoring weights, that are
+optionally only trained on a subset of loops with corresponding
+loop length.</p>
 </td>
 </tr>
 <tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><p class="first"><a class="reference external" href="https://docs.python.org/2.7/library/stdtypes.html#dict" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">dict</span></code></a> (keys: <a class="reference external" href="https://docs.python.org/2.7/library/functions.html#str" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">str</span></code></a>, values: <a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>)</p>
@@ -823,6 +847,11 @@ weights includes (different) backbone scoring weights.</p>
 <li><strong>with_db</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#bool" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">bool</span></code></a>) &#8211; True to choose a set of weights including DB specific scores
 (stem RMSD and profile scores)</li>
 <li><strong>with_aa</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#bool" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">bool</span></code></a>) &#8211; True to choose a set of weights including all atom scores</li>
+<li><strong>length_dependent</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#bool" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">bool</span></code></a>) &#8211; Whether to use general weights or their length
+length dependent counterparts.</li>
+<li><strong>loop_length</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Length of full loop. If no weights are available for
+this length or when <em>loop_length</em> is -1, the general
+weights are returned.</li>
 </ul>
 </td>
 </tr>
@@ -832,13 +861,13 @@ weights includes (different) backbone scoring weights.</p>
 
 <dl class="staticmethod">
 <dt id="promod3.modelling.ScoringWeights.SetWeights">
-<em class="property">static </em><code class="descname">SetWeights</code><span class="sig-paren">(</span><em>with_db</em>, <em>with_aa</em>, <em>weights</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.modelling.ScoringWeights.SetWeights" title="Permalink to this definition">¶</a></dt>
+<em class="property">static </em><code class="descname">SetWeights</code><span class="sig-paren">(</span><em>with_db</em>, <em>with_aa</em>, <em>weights</em>, <em>length_dependent=False</em>, <em>loop_length=-1</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.modelling.ScoringWeights.SetWeights" title="Permalink to this definition">¶</a></dt>
 <dd><p>Overwrite a set of weights as returned by <a class="reference internal" href="#promod3.modelling.ScoringWeights.GetWeights" title="promod3.modelling.ScoringWeights.GetWeights"><code class="xref py py-meth docutils literal"><span class="pre">GetWeights()</span></code></a>.</p>
 </dd></dl>
 
 <dl class="staticmethod">
 <dt id="promod3.modelling.ScoringWeights.GetBackboneWeights">
-<em class="property">static </em><code class="descname">GetBackboneWeights</code><span class="sig-paren">(</span><em>with_db=False</em>, <em>with_aa=False</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.modelling.ScoringWeights.GetBackboneWeights" title="Permalink to this definition">¶</a></dt>
+<em class="property">static </em><code class="descname">GetBackboneWeights</code><span class="sig-paren">(</span><em>with_db=False</em>, <em>with_aa=False</em>, <em>length_dependent=False</em>, <em>loop_length=-1</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.modelling.ScoringWeights.GetBackboneWeights" title="Permalink to this definition">¶</a></dt>
 <dd><table class="docutils field-list" frame="void" rules="none">
 <col class="field-name" />
 <col class="field-body" />
@@ -853,6 +882,8 @@ weights includes (different) backbone scoring weights.</p>
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
 <li><strong>with_db</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#bool" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">bool</span></code></a>) &#8211; As in <a class="reference internal" href="#promod3.modelling.ScoringWeights.GetWeights" title="promod3.modelling.ScoringWeights.GetWeights"><code class="xref py py-meth docutils literal"><span class="pre">GetWeights()</span></code></a></li>
 <li><strong>with_aa</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#bool" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">bool</span></code></a>) &#8211; As in <a class="reference internal" href="#promod3.modelling.ScoringWeights.GetWeights" title="promod3.modelling.ScoringWeights.GetWeights"><code class="xref py py-meth docutils literal"><span class="pre">GetWeights()</span></code></a></li>
+<li><strong>length_dependent</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#bool" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">bool</span></code></a>) &#8211; As in <a class="reference internal" href="#promod3.modelling.ScoringWeights.GetWeights" title="promod3.modelling.ScoringWeights.GetWeights"><code class="xref py py-meth docutils literal"><span class="pre">GetWeights()</span></code></a></li>
+<li><strong>loop_length</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; As in <a class="reference internal" href="#promod3.modelling.ScoringWeights.GetWeights" title="promod3.modelling.ScoringWeights.GetWeights"><code class="xref py py-meth docutils literal"><span class="pre">GetWeights()</span></code></a></li>
 </ul>
 </td>
 </tr>
@@ -862,17 +893,24 @@ weights includes (different) backbone scoring weights.</p>
 
 <dl class="staticmethod">
 <dt id="promod3.modelling.ScoringWeights.GetAllAtomWeights">
-<em class="property">static </em><code class="descname">GetAllAtomWeights</code><span class="sig-paren">(</span><em>with_db=False</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.modelling.ScoringWeights.GetAllAtomWeights" title="Permalink to this definition">¶</a></dt>
+<em class="property">static </em><code class="descname">GetAllAtomWeights</code><span class="sig-paren">(</span><em>with_db=False</em>, <em>length_dependent=False</em>, <em>loop_length=-1</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.modelling.ScoringWeights.GetAllAtomWeights" title="Permalink to this definition">¶</a></dt>
 <dd><table class="docutils field-list" frame="void" rules="none">
 <col class="field-name" />
 <col class="field-body" />
 <tbody valign="top">
-<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">Subset of <a class="reference internal" href="#promod3.modelling.ScoringWeights.GetWeights" title="promod3.modelling.ScoringWeights.GetWeights"><code class="xref py py-meth docutils literal"><span class="pre">GetWeights()</span></code></a> for all atom scoring as in
-<code class="xref py py-meth docutils literal"><span class="pre">scoring.AllAtomOverallScorer.CalculateLinearCombination()</span></code>.</td>
+<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Subset of <a class="reference internal" href="#promod3.modelling.ScoringWeights.GetWeights" title="promod3.modelling.ScoringWeights.GetWeights"><code class="xref py py-meth docutils literal"><span class="pre">GetWeights()</span></code></a> for all atom scoring as in
+<code class="xref py py-meth docutils literal"><span class="pre">scoring.AllAtomOverallScorer.CalculateLinearCombination()</span></code>.</p>
+</td>
 </tr>
-<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/2.7/library/stdtypes.html#dict" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">dict</span></code></a> (keys: <a class="reference external" href="https://docs.python.org/2.7/library/functions.html#str" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">str</span></code></a>, values: <a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>)</td>
+<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><p class="first"><a class="reference external" href="https://docs.python.org/2.7/library/stdtypes.html#dict" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">dict</span></code></a> (keys: <a class="reference external" href="https://docs.python.org/2.7/library/functions.html#str" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">str</span></code></a>, values: <a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>)</p>
+</td>
 </tr>
-<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>with_db</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#bool" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">bool</span></code></a>) &#8211; As in <a class="reference internal" href="#promod3.modelling.ScoringWeights.GetWeights" title="promod3.modelling.ScoringWeights.GetWeights"><code class="xref py py-meth docutils literal"><span class="pre">GetWeights()</span></code></a></td>
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
+<li><strong>with_db</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#bool" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">bool</span></code></a>) &#8211; As in <a class="reference internal" href="#promod3.modelling.ScoringWeights.GetWeights" title="promod3.modelling.ScoringWeights.GetWeights"><code class="xref py py-meth docutils literal"><span class="pre">GetWeights()</span></code></a></li>
+<li><strong>length_dependent</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#bool" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">bool</span></code></a>) &#8211; As in <a class="reference internal" href="#promod3.modelling.ScoringWeights.GetWeights" title="promod3.modelling.ScoringWeights.GetWeights"><code class="xref py py-meth docutils literal"><span class="pre">GetWeights()</span></code></a></li>
+<li><strong>loop_length</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; As in <a class="reference internal" href="#promod3.modelling.ScoringWeights.GetWeights" title="promod3.modelling.ScoringWeights.GetWeights"><code class="xref py py-meth docutils literal"><span class="pre">GetWeights()</span></code></a></li>
+</ul>
+</td>
 </tr>
 </tbody>
 </table>
@@ -960,93 +998,92 @@ gap for a model. This shows the combined usage of <a class="reference internal"
 keep a consistent modelling environment, <a class="reference internal" href="#promod3.modelling.LoopCandidates" title="promod3.modelling.LoopCandidates"><code class="xref py py-class docutils literal"><span class="pre">LoopCandidates</span></code></a> with its
 scoring routines, <a class="reference internal" href="#promod3.modelling.ScoreContainer" title="promod3.modelling.ScoreContainer"><code class="xref py py-class docutils literal"><span class="pre">ScoreContainer</span></code></a> for keeping track of scores and
 <a class="reference internal" href="#promod3.modelling.ScoringWeights" title="promod3.modelling.ScoringWeights"><code class="xref py py-class docutils literal"><span class="pre">ScoringWeights</span></code></a> to combine scores:</p>
-<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">ost</span> <span class="kn">import</span> <span class="n">io</span><span class="p">,</span> <span class="n">seq</span>
-<span class="kn">from</span> <span class="nn">promod3</span> <span class="kn">import</span> <span class="n">modelling</span><span class="p">,</span> <span class="n">loop</span>
-
-<span class="c"># setup raw model</span>
-<span class="n">tpl</span> <span class="o">=</span> <span class="n">io</span><span class="o">.</span><span class="n">LoadPDB</span><span class="p">(</span><span class="s">&#39;data/1crn_cut.pdb&#39;</span><span class="p">)</span>
-<span class="n">seq_trg</span> <span class="o">=</span> <span class="s">&#39;TTCCPSIVARSNFNVCRLPGTPEAICATYTGCIIIPGATCPGDYAN&#39;</span>
-<span class="n">seq_tpl</span> <span class="o">=</span> <span class="s">&#39;TTCCPSIVARSNFNVCRLPGTPEA------GCIIIPGATCPGDYAN&#39;</span>
-<span class="n">aln</span> <span class="o">=</span> <span class="n">seq</span><span class="o">.</span><span class="n">CreateAlignment</span><span class="p">(</span><span class="n">seq</span><span class="o">.</span><span class="n">CreateSequence</span><span class="p">(</span><span class="s">&#39;trg&#39;</span><span class="p">,</span> <span class="n">seq_trg</span><span class="p">),</span>
-                          <span class="n">seq</span><span class="o">.</span><span class="n">CreateSequence</span><span class="p">(</span><span class="s">&#39;tpl&#39;</span><span class="p">,</span> <span class="n">seq_tpl</span><span class="p">))</span>
+<div class="highlight-default"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">ost</span> <span class="k">import</span> <span class="n">io</span><span class="p">,</span> <span class="n">seq</span>
+<span class="kn">from</span> <span class="nn">promod3</span> <span class="k">import</span> <span class="n">modelling</span><span class="p">,</span> <span class="n">loop</span>
+
+<span class="c1"># setup raw model</span>
+<span class="n">tpl</span> <span class="o">=</span> <span class="n">io</span><span class="o">.</span><span class="n">LoadPDB</span><span class="p">(</span><span class="s1">&#39;data/1crn_cut.pdb&#39;</span><span class="p">)</span>
+<span class="n">seq_trg</span> <span class="o">=</span> <span class="s1">&#39;TTCCPSIVARSNFNVCRLPGTPEAICATYTGCIIIPGATCPGDYAN&#39;</span>
+<span class="n">seq_tpl</span> <span class="o">=</span> <span class="s1">&#39;TTCCPSIVARSNFNVCRLPGTPEA------GCIIIPGATCPGDYAN&#39;</span>
+<span class="n">aln</span> <span class="o">=</span> <span class="n">seq</span><span class="o">.</span><span class="n">CreateAlignment</span><span class="p">(</span><span class="n">seq</span><span class="o">.</span><span class="n">CreateSequence</span><span class="p">(</span><span class="s1">&#39;trg&#39;</span><span class="p">,</span> <span class="n">seq_trg</span><span class="p">),</span>
+                          <span class="n">seq</span><span class="o">.</span><span class="n">CreateSequence</span><span class="p">(</span><span class="s1">&#39;tpl&#39;</span><span class="p">,</span> <span class="n">seq_tpl</span><span class="p">))</span>
 <span class="n">aln</span><span class="o">.</span><span class="n">AttachView</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="n">tpl</span><span class="o">.</span><span class="n">CreateFullView</span><span class="p">())</span>
 <span class="n">mhandle</span> <span class="o">=</span> <span class="n">modelling</span><span class="o">.</span><span class="n">BuildRawModel</span><span class="p">(</span><span class="n">aln</span><span class="p">)</span>
-<span class="k">print</span><span class="p">(</span><span class="s">&quot;Number of gaps in raw model: </span><span class="si">%d</span><span class="s">&quot;</span> <span class="o">%</span> <span class="nb">len</span><span class="p">(</span><span class="n">mhandle</span><span class="o">.</span><span class="n">gaps</span><span class="p">))</span>
+<span class="nb">print</span><span class="p">(</span><span class="s2">&quot;Number of gaps in raw model: </span><span class="si">%d</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="nb">len</span><span class="p">(</span><span class="n">mhandle</span><span class="o">.</span><span class="n">gaps</span><span class="p">))</span>
 
-<span class="c"># setup default scorers for modelling handle</span>
+<span class="c1"># setup default scorers for modelling handle</span>
 <span class="n">modelling</span><span class="o">.</span><span class="n">SetupDefaultBackboneScoring</span><span class="p">(</span><span class="n">mhandle</span><span class="p">)</span>
 <span class="n">modelling</span><span class="o">.</span><span class="n">SetupDefaultAllAtomScoring</span><span class="p">(</span><span class="n">mhandle</span><span class="p">)</span>
 
-<span class="c"># setup databases</span>
+<span class="c1"># setup databases</span>
 <span class="n">frag_db</span> <span class="o">=</span> <span class="n">loop</span><span class="o">.</span><span class="n">LoadFragDB</span><span class="p">()</span>
 <span class="n">structure_db</span> <span class="o">=</span> <span class="n">loop</span><span class="o">.</span><span class="n">LoadStructureDB</span><span class="p">()</span>
 <span class="n">torsion_sampler</span> <span class="o">=</span> <span class="n">loop</span><span class="o">.</span><span class="n">LoadTorsionSamplerCoil</span><span class="p">()</span>
 
-<span class="c"># get data for gap to close</span>
+<span class="c1"># get data for gap to close</span>
 <span class="n">gap</span> <span class="o">=</span> <span class="n">mhandle</span><span class="o">.</span><span class="n">gaps</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">Copy</span><span class="p">()</span>
-<span class="k">print</span><span class="p">(</span><span class="s">&quot;Gap to close: </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="nb">str</span><span class="p">(</span><span class="n">gap</span><span class="p">))</span>
+<span class="nb">print</span><span class="p">(</span><span class="s2">&quot;Gap to close: </span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="nb">str</span><span class="p">(</span><span class="n">gap</span><span class="p">))</span>
 <span class="n">n_stem</span> <span class="o">=</span> <span class="n">gap</span><span class="o">.</span><span class="n">before</span>
 <span class="n">c_stem</span> <span class="o">=</span> <span class="n">gap</span><span class="o">.</span><span class="n">after</span>
 <span class="n">start_resnum</span> <span class="o">=</span> <span class="n">n_stem</span><span class="o">.</span><span class="n">GetNumber</span><span class="p">()</span><span class="o">.</span><span class="n">GetNum</span><span class="p">()</span>
-<span class="n">start_idx</span> <span class="o">=</span> <span class="n">start_resnum</span> <span class="o">-</span> <span class="mi">1</span>   <span class="c"># res. num. starts at 1</span>
+<span class="n">start_idx</span> <span class="o">=</span> <span class="n">start_resnum</span> <span class="o">-</span> <span class="mi">1</span>   <span class="c1"># res. num. starts at 1</span>
 
-<span class="c"># get loop candidates from FragDB</span>
+<span class="c1"># get loop candidates from FragDB</span>
 <span class="n">candidates</span> <span class="o">=</span> <span class="n">modelling</span><span class="o">.</span><span class="n">LoopCandidates</span><span class="o">.</span><span class="n">FillFromDatabase</span><span class="p">(</span>\
                 <span class="n">n_stem</span><span class="p">,</span> <span class="n">c_stem</span><span class="p">,</span> <span class="n">gap</span><span class="o">.</span><span class="n">full_seq</span><span class="p">,</span> <span class="n">frag_db</span><span class="p">,</span> <span class="n">structure_db</span><span class="p">)</span>
-<span class="k">print</span><span class="p">(</span><span class="s">&quot;Number of loop candidates: </span><span class="si">%d</span><span class="s">&quot;</span> <span class="o">%</span> <span class="nb">len</span><span class="p">(</span><span class="n">candidates</span><span class="p">))</span>
+<span class="nb">print</span><span class="p">(</span><span class="s2">&quot;Number of loop candidates: </span><span class="si">%d</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="nb">len</span><span class="p">(</span><span class="n">candidates</span><span class="p">))</span>
 
-<span class="c"># all scores will be kept in a score container which we update</span>
+<span class="c1"># all scores will be kept in a score container which we update</span>
 <span class="n">all_scores</span> <span class="o">=</span> <span class="n">modelling</span><span class="o">.</span><span class="n">ScoreContainer</span><span class="p">()</span>
-<span class="c"># the keys used to identify scores are globally defined</span>
-<span class="k">print</span><span class="p">(</span><span class="s">&quot;Stem RMSD key = &#39;</span><span class="si">%s</span><span class="s">&#39;&quot;</span> \
+<span class="c1"># the keys used to identify scores are globally defined</span>
+<span class="nb">print</span><span class="p">(</span><span class="s2">&quot;Stem RMSD key = &#39;</span><span class="si">%s</span><span class="s2">&#39;&quot;</span> \
       <span class="o">%</span> <span class="n">modelling</span><span class="o">.</span><span class="n">ScoringWeights</span><span class="o">.</span><span class="n">GetStemRMSDsKey</span><span class="p">())</span>
-<span class="k">print</span><span class="p">(</span><span class="s">&quot;Profile keys = [&#39;</span><span class="si">%s</span><span class="s">&#39;, &#39;</span><span class="si">%s</span><span class="s">&#39;]&quot;</span> \
+<span class="nb">print</span><span class="p">(</span><span class="s2">&quot;Profile keys = [&#39;</span><span class="si">%s</span><span class="s2">&#39;, &#39;</span><span class="si">%s</span><span class="s2">&#39;]&quot;</span> \
       <span class="o">%</span> <span class="p">(</span><span class="n">modelling</span><span class="o">.</span><span class="n">ScoringWeights</span><span class="o">.</span><span class="n">GetSequenceProfileScoresKey</span><span class="p">(),</span>
          <span class="n">modelling</span><span class="o">.</span><span class="n">ScoringWeights</span><span class="o">.</span><span class="n">GetStructureProfileScoresKey</span><span class="p">()))</span>
-<span class="k">print</span><span class="p">(</span><span class="s">&quot;Backbone scoring keys = </span><span class="si">%s</span><span class="s">&quot;</span> \
+<span class="nb">print</span><span class="p">(</span><span class="s2">&quot;Backbone scoring keys = </span><span class="si">%s</span><span class="s2">&quot;</span> \
       <span class="o">%</span> <span class="nb">str</span><span class="p">(</span><span class="n">modelling</span><span class="o">.</span><span class="n">ScoringWeights</span><span class="o">.</span><span class="n">GetBackboneScoringKeys</span><span class="p">()))</span>
-<span class="k">print</span><span class="p">(</span><span class="s">&quot;All atom scoring keys = </span><span class="si">%s</span><span class="s">&quot;</span> \
+<span class="nb">print</span><span class="p">(</span><span class="s2">&quot;All atom scoring keys = </span><span class="si">%s</span><span class="s2">&quot;</span> \
       <span class="o">%</span> <span class="nb">str</span><span class="p">(</span><span class="n">modelling</span><span class="o">.</span><span class="n">ScoringWeights</span><span class="o">.</span><span class="n">GetAllAtomScoringKeys</span><span class="p">()))</span>
 
-<span class="c"># get stem RMSDs for each candidate (i.e. how well does it fit?)</span>
-<span class="c"># -&gt; this must be done before CCD to be meaningful</span>
+<span class="c1"># get stem RMSDs for each candidate (i.e. how well does it fit?)</span>
+<span class="c1"># -&gt; this must be done before CCD to be meaningful</span>
 <span class="n">candidates</span><span class="o">.</span><span class="n">CalculateStemRMSDs</span><span class="p">(</span><span class="n">all_scores</span><span class="p">,</span> <span class="n">n_stem</span><span class="p">,</span> <span class="n">c_stem</span><span class="p">)</span>
 
-<span class="c"># close the candidates with CCD</span>
+<span class="c1"># close the candidates with CCD</span>
 <span class="n">orig_indices</span> <span class="o">=</span> <span class="n">candidates</span><span class="o">.</span><span class="n">ApplyCCD</span><span class="p">(</span><span class="n">n_stem</span><span class="p">,</span> <span class="n">c_stem</span><span class="p">,</span> <span class="n">torsion_sampler</span><span class="p">)</span>
-<span class="k">print</span><span class="p">(</span><span class="s">&quot;Number of closed loop candidates: </span><span class="si">%d</span><span class="s">&quot;</span> <span class="o">%</span> <span class="nb">len</span><span class="p">(</span><span class="n">candidates</span><span class="p">))</span>
+<span class="nb">print</span><span class="p">(</span><span class="s2">&quot;Number of closed loop candidates: </span><span class="si">%d</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="nb">len</span><span class="p">(</span><span class="n">candidates</span><span class="p">))</span>
 
-<span class="c"># get subset of previously computed scores</span>
+<span class="c1"># get subset of previously computed scores</span>
 <span class="n">all_scores</span> <span class="o">=</span> <span class="n">all_scores</span><span class="o">.</span><span class="n">Extract</span><span class="p">(</span><span class="n">orig_indices</span><span class="p">)</span>
 
-<span class="c"># add profile scores (needs profile for target sequence)</span>
-<span class="n">prof</span> <span class="o">=</span> <span class="n">io</span><span class="o">.</span><span class="n">LoadSequenceProfile</span><span class="p">(</span><span class="s">&quot;data/1CRNA.hhm&quot;</span><span class="p">)</span>
+<span class="c1"># add profile scores (needs profile for target sequence)</span>
+<span class="n">prof</span> <span class="o">=</span> <span class="n">io</span><span class="o">.</span><span class="n">LoadSequenceProfile</span><span class="p">(</span><span class="s2">&quot;data/1CRNA.hhm&quot;</span><span class="p">)</span>
 <span class="n">candidates</span><span class="o">.</span><span class="n">CalculateSequenceProfileScores</span><span class="p">(</span><span class="n">all_scores</span><span class="p">,</span> <span class="n">structure_db</span><span class="p">,</span>
                                           <span class="n">prof</span><span class="p">,</span> <span class="n">start_idx</span><span class="p">)</span>
 <span class="n">candidates</span><span class="o">.</span><span class="n">CalculateStructureProfileScores</span><span class="p">(</span><span class="n">all_scores</span><span class="p">,</span> <span class="n">structure_db</span><span class="p">,</span>
                                            <span class="n">prof</span><span class="p">,</span> <span class="n">start_idx</span><span class="p">)</span>
-<span class="c"># add backbone scores</span>
-<span class="n">scorer</span> <span class="o">=</span> <span class="n">mhandle</span><span class="o">.</span><span class="n">backbone_scorer</span>
-<span class="n">candidates</span><span class="o">.</span><span class="n">CalculateBackboneScores</span><span class="p">(</span><span class="n">all_scores</span><span class="p">,</span> <span class="n">scorer</span><span class="p">,</span> <span class="n">start_resnum</span><span class="p">)</span>
-<span class="c"># add all atom scores</span>
+<span class="c1"># add backbone scores</span>
+<span class="n">candidates</span><span class="o">.</span><span class="n">CalculateBackboneScores</span><span class="p">(</span><span class="n">all_scores</span><span class="p">,</span> <span class="n">mhandle</span><span class="p">,</span> <span class="n">start_resnum</span><span class="p">)</span>
+<span class="c1"># add all atom scores</span>
 <span class="n">candidates</span><span class="o">.</span><span class="n">CalculateAllAtomScores</span><span class="p">(</span><span class="n">all_scores</span><span class="p">,</span> <span class="n">mhandle</span><span class="p">,</span> <span class="n">start_resnum</span><span class="p">)</span>
 
-<span class="c"># use default weights to combine scores</span>
-<span class="n">weights</span> <span class="o">=</span> <span class="n">modelling</span><span class="o">.</span><span class="n">ScoringWeights</span><span class="o">.</span><span class="n">GetWeights</span><span class="p">(</span><span class="n">with_db</span><span class="o">=</span><span class="bp">True</span><span class="p">,</span>
-                                              <span class="n">with_aa</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>
+<span class="c1"># use default weights to combine scores</span>
+<span class="n">weights</span> <span class="o">=</span> <span class="n">modelling</span><span class="o">.</span><span class="n">ScoringWeights</span><span class="o">.</span><span class="n">GetWeights</span><span class="p">(</span><span class="n">with_db</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span>
+                                              <span class="n">with_aa</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
 <span class="n">scores</span> <span class="o">=</span> <span class="n">all_scores</span><span class="o">.</span><span class="n">LinearCombine</span><span class="p">(</span><span class="n">weights</span><span class="p">)</span>
 
-<span class="c"># rank them (best = lowest &quot;score&quot;)</span>
+<span class="c1"># rank them (best = lowest &quot;score&quot;)</span>
 <span class="n">arg_sorted_scores</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">([(</span><span class="n">v</span><span class="p">,</span><span class="n">i</span><span class="p">)</span> <span class="k">for</span> <span class="n">i</span><span class="p">,</span><span class="n">v</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">scores</span><span class="p">)])</span>
-<span class="k">print</span><span class="p">(</span><span class="s">&quot;Ranked candidates: score, index&quot;</span><span class="p">)</span>
+<span class="nb">print</span><span class="p">(</span><span class="s2">&quot;Ranked candidates: score, index&quot;</span><span class="p">)</span>
 <span class="k">for</span> <span class="n">v</span><span class="p">,</span><span class="n">i</span> <span class="ow">in</span> <span class="n">arg_sorted_scores</span><span class="p">:</span>
-  <span class="k">print</span><span class="p">(</span><span class="s">&quot;</span><span class="si">%g</span><span class="s">, </span><span class="si">%d</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">v</span><span class="p">,</span><span class="n">i</span><span class="p">))</span>
+  <span class="nb">print</span><span class="p">(</span><span class="s2">&quot;</span><span class="si">%g</span><span class="s2">, </span><span class="si">%d</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">v</span><span class="p">,</span><span class="n">i</span><span class="p">))</span>
 
-<span class="c"># insert best into model, update scorers and clear gaps</span>
+<span class="c1"># insert best into model, update scorers and clear gaps</span>
 <span class="n">best_candidate</span> <span class="o">=</span> <span class="n">candidates</span><span class="p">[</span><span class="n">arg_sorted_scores</span><span class="p">[</span><span class="mi">0</span><span class="p">][</span><span class="mi">1</span><span class="p">]]</span>
 <span class="n">modelling</span><span class="o">.</span><span class="n">InsertLoopClearGaps</span><span class="p">(</span><span class="n">mhandle</span><span class="p">,</span> <span class="n">best_candidate</span><span class="p">,</span> <span class="n">gap</span><span class="p">)</span>
-<span class="k">print</span><span class="p">(</span><span class="s">&quot;Number of gaps in closed model: </span><span class="si">%d</span><span class="s">&quot;</span> <span class="o">%</span> <span class="nb">len</span><span class="p">(</span><span class="n">mhandle</span><span class="o">.</span><span class="n">gaps</span><span class="p">))</span>
-<span class="n">io</span><span class="o">.</span><span class="n">SavePDB</span><span class="p">(</span><span class="n">mhandle</span><span class="o">.</span><span class="n">model</span><span class="p">,</span> <span class="s">&quot;model.pdb&quot;</span><span class="p">)</span>
+<span class="nb">print</span><span class="p">(</span><span class="s2">&quot;Number of gaps in closed model: </span><span class="si">%d</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="nb">len</span><span class="p">(</span><span class="n">mhandle</span><span class="o">.</span><span class="n">gaps</span><span class="p">))</span>
+<span class="n">io</span><span class="o">.</span><span class="n">SavePDB</span><span class="p">(</span><span class="n">mhandle</span><span class="o">.</span><span class="n">model</span><span class="p">,</span> <span class="s2">&quot;model.pdb&quot;</span><span class="p">)</span>
 </pre></div>
 </div>
 </div>
@@ -1095,9 +1132,6 @@ scoring routines, <a class="reference internal" href="#promod3.modelling.ScoreCo
       <input type="hidden" name="check_keywords" value="yes" />
       <input type="hidden" name="area" value="default" />
     </form>
-    <p class="searchtip" style="font-size: 90%">
-    Enter search terms or a module, class or function name.
-    </p>
 </div>
 <script type="text/javascript">$('#searchbox').show(0);</script>
         </div>
@@ -1105,11 +1139,11 @@ scoring routines, <a class="reference internal" href="#promod3.modelling.ScoreCo
       <div class="clearer"></div>
     </div>
     <div class="footer">
-      &copy;2017, ProMod3 authors.
+      &copy;2018, ProMod3 authors.
       
       |
-      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a>
-      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.6</a>
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.4.1</a>
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
       
       |
       <a href="../_sources/modelling/loop_candidates.txt"
diff --git a/doc/html/modelling/loop_closing.html b/doc/html/modelling/loop_closing.html
index 6c740a42b4a178d4631dec8b11877fdf935647b4..d6e5827539347b83e178f2de00f6fbfc0a8fd73c 100644
--- a/doc/html/modelling/loop_closing.html
+++ b/doc/html/modelling/loop_closing.html
@@ -6,7 +6,7 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
-    <title>Fitting Loops Into Gaps &mdash; ProMod3 1.1.0 documentation</title>
+    <title>Fitting Loops Into Gaps &mdash; ProMod3 1.2.0 documentation</title>
     
     <link rel="stylesheet" href="../_static/alabaster.css" type="text/css" />
     <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
@@ -14,7 +14,7 @@
     <script type="text/javascript">
       var DOCUMENTATION_OPTIONS = {
         URL_ROOT:    '../',
-        VERSION:     '1.1.0',
+        VERSION:     '1.2.0',
         COLLAPSE_INDEX: false,
         FILE_SUFFIX: '.html',
         HAS_SOURCE:  true
@@ -23,16 +23,18 @@
     <script type="text/javascript" src="../_static/jquery.js"></script>
     <script type="text/javascript" src="../_static/underscore.js"></script>
     <script type="text/javascript" src="../_static/doctools.js"></script>
-    <link rel="top" title="ProMod3 1.1.0 documentation" href="../index.html" />
+    <link rel="top" title="ProMod3 1.2.0 documentation" href="../index.html" />
     <link rel="up" title="modelling - Protein Modelling" href="index.html" />
     <link rel="next" title="Generating Loops De Novo" href="monte_carlo.html" />
     <link rel="prev" title="Handling Loop Candidates" href="loop_candidates.html" />
    
+  <link rel="stylesheet" href="../_static/custom.css" type="text/css" />
   
-  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
 
   </head>
-  <body role="document">  
+  <body role="document">
+  
 
     <div class="document">
       <div class="documentwrapper">
@@ -81,11 +83,11 @@ to avoid moving into unfavourable regions of the backbone dihedrals.</p>
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
 <li><strong>sequence</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#str" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">str</span></code></a>) &#8211; Sequence of the backbones to be closed</li>
-<li><strong>n_stem</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; Residue defining the n_stem.
+<li><strong>n_stem</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; Residue defining the n_stem.
 If the residue before <em>n_stem</em> doesn&#8217;t exist, the
 torsion sampler will use a default residue (ALA) and
 and phi angle (-1.0472) to evaluate the first angle.</li>
-<li><strong>c_stem</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; Residue defining the c_stem.
+<li><strong>c_stem</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; Residue defining the c_stem.
 If the residue after <em>c_stem</em> doesn&#8217;t exist, the
 torsion sampler will use a default residue (ALA) and
 psi angle (-0.7854) to evaluate the last angle.</li>
@@ -122,8 +124,8 @@ This is faster but might lead to weird backbone dihedral pairs.</p>
 <col class="field-body" />
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
-<li><strong>n_stem</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; Residue defining the n_stem</li>
-<li><strong>c_stem</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; Residue defining the c_stem</li>
+<li><strong>n_stem</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; Residue defining the n_stem</li>
+<li><strong>c_stem</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; Residue defining the c_stem</li>
 <li><strong>max_steps</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Maximal number of iterations</li>
 <li><strong>rmsd_cutoff</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>) &#8211; The algorithm stops as soon as the c_stem of the loop to
 be  closed has RMSD below the given <em>c_stem</em></li>
@@ -282,7 +284,11 @@ should be kept rigid during relaxation.</li>
 <dl class="method">
 <dt id="promod3.modelling.BackboneRelaxer.Run">
 <code class="descname">Run</code><span class="sig-paren">(</span><em>bb_list</em>, <em>steps=100</em>, <em>stop_criterion=0.01</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.modelling.BackboneRelaxer.Run" title="Permalink to this definition">¶</a></dt>
-<dd><p>Performs steepest descent on given BackboneList.</p>
+<dd><p>Performs steepest descent on given BackboneList. The function possibly fails
+if there are particles (almost) on top of each other, resulting in NaN
+positions in the OpenMM system. The positions of <strong>bb_list</strong> are not touched
+in this case and the function returns an infinit potential energy.
+In Python you can check for that with float(&#8220;inf&#8221;).</p>
 <table class="docutils field-list" frame="void" rules="none">
 <col class="field-name" />
 <col class="field-body" />
@@ -296,7 +302,7 @@ relaxation aborts.</li>
 </ul>
 </td>
 </tr>
-<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Forcefield energy upon relaxation</p>
+<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Forcefield energy upon relaxation, infinity in case of OpenMM Error</p>
 </td>
 </tr>
 <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first"><a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a></p>
@@ -320,7 +326,7 @@ size or sequence as the initial one.</p>
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
 <li><strong>idx</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Idx of residue</li>
-<li><strong>pos</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.geom.Vec3</span></code></a>) &#8211; Restraint Position (in Angstrom)</li>
+<li><strong>pos</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.geom.Vec3</span></code></a>) &#8211; Restraint Position (in Angstrom)</li>
 <li><strong>force_constant</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>) &#8211; Force constant in kJ/mol/nm^2</li>
 </ul>
 </td>
@@ -342,7 +348,7 @@ size or sequence as the initial one.</p>
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
 <li><strong>idx</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Idx of residue</li>
-<li><strong>pos</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.geom.Vec3</span></code></a>) &#8211; Restraint Position (in Angstrom)</li>
+<li><strong>pos</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.geom.Vec3</span></code></a>) &#8211; Restraint Position (in Angstrom)</li>
 <li><strong>force_constant</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>) &#8211; Force constant in kJ/mol/nm^2</li>
 </ul>
 </td>
@@ -365,7 +371,7 @@ doesn&#8217;t do anything if specified residue is a glycine</p>
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
 <li><strong>idx</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Idx of residue</li>
-<li><strong>pos</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.geom.Vec3</span></code></a>) &#8211; Restraint Position (in Angstrom)</li>
+<li><strong>pos</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.geom.Vec3</span></code></a>) &#8211; Restraint Position (in Angstrom)</li>
 <li><strong>force_constant</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>) &#8211; Force constant in kJ/mol/nm^2</li>
 </ul>
 </td>
@@ -387,7 +393,7 @@ doesn&#8217;t do anything if specified residue is a glycine</p>
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
 <li><strong>idx</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Idx of residue</li>
-<li><strong>pos</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.geom.Vec3</span></code></a>) &#8211; Restraint Position (in Angstrom)</li>
+<li><strong>pos</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.geom.Vec3</span></code></a>) &#8211; Restraint Position (in Angstrom)</li>
 <li><strong>force_constant</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>) &#8211; Force constant in kJ/mol/nm^2</li>
 </ul>
 </td>
@@ -409,7 +415,7 @@ doesn&#8217;t do anything if specified residue is a glycine</p>
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
 <li><strong>idx</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Idx of residue</li>
-<li><strong>pos</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.geom.Vec3</span></code></a>) &#8211; Restraint Position (in Angstrom)</li>
+<li><strong>pos</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.geom.Vec3</span></code></a>) &#8211; Restraint Position (in Angstrom)</li>
 <li><strong>force_constant</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>) &#8211; Force constant in kJ/mol/nm^2</li>
 </ul>
 </td>
@@ -464,33 +470,33 @@ means no cutoff.</td>
 <a class="reference internal" href="sidechain_reconstruction.html#promod3.modelling.SidechainReconstructor" title="promod3.modelling.SidechainReconstructor"><code class="xref py py-class docutils literal"><span class="pre">SidechainReconstructor</span></code></a>, it may be desired to
 quickly relax the loop. The <a class="reference internal" href="#promod3.modelling.AllAtomRelaxer" title="promod3.modelling.AllAtomRelaxer"><code class="xref py py-class docutils literal"><span class="pre">AllAtomRelaxer</span></code></a> class takes care of that.</p>
 <p>Example usage:</p>
-<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">ost</span> <span class="kn">import</span> <span class="n">io</span>
-<span class="kn">from</span> <span class="nn">promod3</span> <span class="kn">import</span> <span class="n">modelling</span><span class="p">,</span> <span class="n">loop</span>
+<div class="highlight-default"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">ost</span> <span class="k">import</span> <span class="n">io</span>
+<span class="kn">from</span> <span class="nn">promod3</span> <span class="k">import</span> <span class="n">modelling</span><span class="p">,</span> <span class="n">loop</span>
 
-<span class="c"># load example (has res. numbering starting at 1)</span>
-<span class="n">prot</span> <span class="o">=</span> <span class="n">io</span><span class="o">.</span><span class="n">LoadPDB</span><span class="p">(</span><span class="s">&#39;data/1CRN.pdb&#39;</span><span class="p">)</span>
+<span class="c1"># load example (has res. numbering starting at 1)</span>
+<span class="n">prot</span> <span class="o">=</span> <span class="n">io</span><span class="o">.</span><span class="n">LoadPDB</span><span class="p">(</span><span class="s1">&#39;data/1CRN.pdb&#39;</span><span class="p">)</span>
 <span class="n">res_list</span> <span class="o">=</span> <span class="n">prot</span><span class="o">.</span><span class="n">residues</span>
-<span class="n">seqres_str</span> <span class="o">=</span> <span class="s">&#39;&#39;</span><span class="o">.</span><span class="n">join</span><span class="p">([</span><span class="n">r</span><span class="o">.</span><span class="n">one_letter_code</span> <span class="k">for</span> <span class="n">r</span> <span class="ow">in</span> <span class="n">res_list</span><span class="p">])</span>
+<span class="n">seqres_str</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="o">.</span><span class="n">join</span><span class="p">([</span><span class="n">r</span><span class="o">.</span><span class="n">one_letter_code</span> <span class="k">for</span> <span class="n">r</span> <span class="ow">in</span> <span class="n">res_list</span><span class="p">])</span>
 
-<span class="c"># initialize AllAtom environment and sidechain reconstructor</span>
+<span class="c1"># initialize AllAtom environment and sidechain reconstructor</span>
 <span class="n">env</span> <span class="o">=</span> <span class="n">loop</span><span class="o">.</span><span class="n">AllAtomEnv</span><span class="p">(</span><span class="n">seqres_str</span><span class="p">)</span>
 <span class="n">env</span><span class="o">.</span><span class="n">SetInitialEnvironment</span><span class="p">(</span><span class="n">prot</span><span class="p">)</span>
 <span class="n">sc_rec</span> <span class="o">=</span> <span class="n">modelling</span><span class="o">.</span><span class="n">SidechainReconstructor</span><span class="p">()</span>
 <span class="n">sc_rec</span><span class="o">.</span><span class="n">AttachEnvironment</span><span class="p">(</span><span class="n">env</span><span class="p">)</span>
 
-<span class="c"># &quot;reconstruct&quot; subset (res. num. 6..10) -&gt; sidechains kept here</span>
+<span class="c1"># &quot;reconstruct&quot; subset (res. num. 6..10) -&gt; sidechains kept here</span>
 <span class="n">sc_result</span> <span class="o">=</span> <span class="n">sc_rec</span><span class="o">.</span><span class="n">Reconstruct</span><span class="p">(</span><span class="mi">6</span><span class="p">,</span> <span class="mi">5</span><span class="p">)</span>
-<span class="c"># setup sys creator</span>
+<span class="c1"># setup sys creator</span>
 <span class="n">ff_lookup</span> <span class="o">=</span> <span class="n">loop</span><span class="o">.</span><span class="n">ForcefieldLookup</span><span class="o">.</span><span class="n">GetDefault</span><span class="p">()</span>
 <span class="n">mm_sys</span> <span class="o">=</span> <span class="n">loop</span><span class="o">.</span><span class="n">MmSystemCreator</span><span class="p">(</span><span class="n">ff_lookup</span><span class="p">)</span>
 <span class="n">relaxer</span> <span class="o">=</span> <span class="n">modelling</span><span class="o">.</span><span class="n">AllAtomRelaxer</span><span class="p">(</span><span class="n">sc_result</span><span class="p">,</span> <span class="n">mm_sys</span><span class="p">)</span>
-<span class="c"># relax loop</span>
+<span class="c1"># relax loop</span>
 <span class="n">pot_e</span> <span class="o">=</span> <span class="n">relaxer</span><span class="o">.</span><span class="n">Run</span><span class="p">(</span><span class="n">sc_result</span><span class="p">,</span> <span class="mi">300</span><span class="p">,</span> <span class="mf">0.1</span><span class="p">)</span>
-<span class="k">print</span> <span class="s">&quot;Potential energy after: </span><span class="si">%g</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">pot_e</span>
-<span class="c"># update environment with solution</span>
+<span class="nb">print</span> <span class="s2">&quot;Potential energy after: </span><span class="si">%g</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="n">pot_e</span>
+<span class="c1"># update environment with solution</span>
 <span class="n">env</span><span class="o">.</span><span class="n">SetEnvironment</span><span class="p">(</span><span class="n">sc_result</span><span class="o">.</span><span class="n">env_pos</span><span class="p">)</span>
-<span class="c"># store all positions of environment</span>
-<span class="n">io</span><span class="o">.</span><span class="n">SavePDB</span><span class="p">(</span><span class="n">env</span><span class="o">.</span><span class="n">GetAllAtomPositions</span><span class="p">()</span><span class="o">.</span><span class="n">ToEntity</span><span class="p">(),</span> <span class="s">&#39;aa_relax_test.pdb&#39;</span><span class="p">)</span>
+<span class="c1"># store all positions of environment</span>
+<span class="n">io</span><span class="o">.</span><span class="n">SavePDB</span><span class="p">(</span><span class="n">env</span><span class="o">.</span><span class="n">GetAllAtomPositions</span><span class="p">()</span><span class="o">.</span><span class="n">ToEntity</span><span class="p">(),</span> <span class="s1">&#39;aa_relax_test.pdb&#39;</span><span class="p">)</span>
 </pre></div>
 </div>
 <dl class="class">
@@ -515,7 +521,11 @@ system creator, which takes care of generating a simulation object.</p>
 <dt id="promod3.modelling.AllAtomRelaxer.Run">
 <code class="descname">Run</code><span class="sig-paren">(</span><em>sc_data</em>, <em>steps=100</em>, <em>stop_criterion=0.01</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.modelling.AllAtomRelaxer.Run" title="Permalink to this definition">¶</a></dt>
 <dd><p>Performs steepest descent for this system and writes updated positions into
-<em>sc_data.env_pos.all_pos</em>.</p>
+<em>sc_data.env_pos.all_pos</em>. The function possibly fails
+if there are particles (almost) on top of each other, resulting in NaN
+positions in the OpenMM system. The positions of <em>sc_data.env_pos.all_pos</em>
+are not touched in this case and the function returns an infinit potential
+energy. In Python you can check for that with float(&#8220;inf&#8221;).</p>
 <table class="docutils field-list" frame="void" rules="none">
 <col class="field-name" />
 <col class="field-body" />
@@ -528,7 +538,7 @@ that threshold, the relaxation aborts.</li>
 </ul>
 </td>
 </tr>
-<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Potential energy after relaxation</p>
+<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Potential energy after relaxation, infinity in case of OpenMM Error</p>
 </td>
 </tr>
 <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first"><a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a></p>
@@ -638,9 +648,6 @@ the one given in the constructor.</td>
       <input type="hidden" name="check_keywords" value="yes" />
       <input type="hidden" name="area" value="default" />
     </form>
-    <p class="searchtip" style="font-size: 90%">
-    Enter search terms or a module, class or function name.
-    </p>
 </div>
 <script type="text/javascript">$('#searchbox').show(0);</script>
         </div>
@@ -648,11 +655,11 @@ the one given in the constructor.</td>
       <div class="clearer"></div>
     </div>
     <div class="footer">
-      &copy;2017, ProMod3 authors.
+      &copy;2018, ProMod3 authors.
       
       |
-      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a>
-      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.6</a>
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.4.1</a>
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
       
       |
       <a href="../_sources/modelling/loop_closing.txt"
diff --git a/doc/html/modelling/model_checking.html b/doc/html/modelling/model_checking.html
index ef3d3396534f0b22419b019bf9cb10aee814dc23..914620c01d9b7ab91692936ea61927682e9a7a87 100644
--- a/doc/html/modelling/model_checking.html
+++ b/doc/html/modelling/model_checking.html
@@ -6,7 +6,7 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
-    <title>Model Checking &mdash; ProMod3 1.1.0 documentation</title>
+    <title>Model Checking &mdash; ProMod3 1.2.0 documentation</title>
     
     <link rel="stylesheet" href="../_static/alabaster.css" type="text/css" />
     <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
@@ -14,7 +14,7 @@
     <script type="text/javascript">
       var DOCUMENTATION_OPTIONS = {
         URL_ROOT:    '../',
-        VERSION:     '1.1.0',
+        VERSION:     '1.2.0',
         COLLAPSE_INDEX: false,
         FILE_SUFFIX: '.html',
         HAS_SOURCE:  true
@@ -23,16 +23,18 @@
     <script type="text/javascript" src="../_static/jquery.js"></script>
     <script type="text/javascript" src="../_static/underscore.js"></script>
     <script type="text/javascript" src="../_static/doctools.js"></script>
-    <link rel="top" title="ProMod3 1.1.0 documentation" href="../index.html" />
+    <link rel="top" title="ProMod3 1.2.0 documentation" href="../index.html" />
     <link rel="up" title="modelling - Protein Modelling" href="index.html" />
     <link rel="next" title="Handling Gaps" href="gap_handling.html" />
     <link rel="prev" title="Modelling Pipeline" href="pipeline.html" />
    
+  <link rel="stylesheet" href="../_static/custom.css" type="text/css" />
   
-  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
 
   </head>
-  <body role="document">  
+  <body role="document">
+  
 
     <div class="document">
       <div class="documentwrapper">
@@ -55,14 +57,14 @@ three of the atoms exist (center and radii are estimated then).</p>
 <col class="field-name" />
 <col class="field-body" />
 <tbody valign="top">
-<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>ent</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.EntityHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">EntityHandle</span></code></a> or <a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.EntityView" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">EntityView</span></code></a>) &#8211; Structure for which to detect rings.</td>
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>ent</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.EntityHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">EntityHandle</span></code></a> or <a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.EntityView" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">EntityView</span></code></a>) &#8211; Structure for which to detect rings.</td>
 </tr>
 <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><code class="xref py py-class docutils literal"><span class="pre">list</span></code> of rings to perform ring checks. Each ring is a named
 tuple with:
-center (<a class="reference external" href="http://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">Vec3</span></code></a>),
-plane (<a class="reference external" href="http://www.openstructure.org/docs/dev/geom/composite/#ost.geom.Plane" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">Plane</span></code></a>),
+center (<a class="reference external" href="https://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">Vec3</span></code></a>),
+plane (<a class="reference external" href="https://www.openstructure.org/docs/dev/geom/composite/#ost.geom.Plane" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">Plane</span></code></a>),
 radius (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>),
-residue (<a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ResidueHandle</span></code></a>).</td>
+residue (<a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ResidueHandle</span></code></a>).</td>
 </tr>
 </tbody>
 </table>
@@ -78,11 +80,11 @@ residue (<a class="reference external" href="http://www.openstructure.org/docs/d
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
 <li><strong>rings</strong> &#8211; List of rings as provided by <a class="reference internal" href="#promod3.modelling.GetRings" title="promod3.modelling.GetRings"><code class="xref py py-func docutils literal"><span class="pre">GetRings()</span></code></a>.</li>
-<li><strong>ent</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.EntityHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">EntityHandle</span></code></a> or <a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.EntityView" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">EntityView</span></code></a>) &#8211; Structure for which to detect punches.</li>
+<li><strong>ent</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.EntityHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">EntityHandle</span></code></a> or <a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.EntityView" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">EntityView</span></code></a>) &#8211; Structure for which to detect punches.</li>
 </ul>
 </td>
 </tr>
-<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><code class="xref py py-class docutils literal"><span class="pre">list</span></code> of residues (<a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ResidueHandle</span></code></a>) which
+<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><code class="xref py py-class docutils literal"><span class="pre">list</span></code> of residues (<a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ResidueHandle</span></code></a>) which
 have a punched ring.</p>
 </td>
 </tr>
@@ -101,7 +103,7 @@ This check is faster than using <a class="reference internal" href="#promod3.mod
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
 <li><strong>rings</strong> &#8211; List of rings as provided by <a class="reference internal" href="#promod3.modelling.GetRings" title="promod3.modelling.GetRings"><code class="xref py py-func docutils literal"><span class="pre">GetRings()</span></code></a>.</li>
-<li><strong>ent</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.EntityHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">EntityHandle</span></code></a> or <a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.EntityView" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">EntityView</span></code></a>) &#8211; Structure for which to detect punches.</li>
+<li><strong>ent</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.EntityHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">EntityHandle</span></code></a> or <a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.EntityView" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">EntityView</span></code></a>) &#8211; Structure for which to detect punches.</li>
 </ul>
 </td>
 </tr>
@@ -126,7 +128,7 @@ This check is faster than using <a class="reference internal" href="#promod3.mod
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
 <li><strong>candidates</strong> (<code class="xref py py-class docutils literal"><span class="pre">LoopCandidates</span></code>) &#8211; Loop candidates meant to fill <em>gap</em> within <em>model</em>.
 Offending candidates are removed from this list.</li>
-<li><strong>model</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.EntityHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">EntityHandle</span></code></a>) &#8211; Model for which loop is to be filled.</li>
+<li><strong>model</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.EntityHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">EntityHandle</span></code></a>) &#8211; Model for which loop is to be filled.</li>
 <li><strong>gap</strong> (<a class="reference internal" href="gap_handling.html#promod3.modelling.StructuralGap" title="promod3.modelling.StructuralGap"><code class="xref py py-class docutils literal"><span class="pre">StructuralGap</span></code></a>.) &#8211; Gap for which loop is to be filled.</li>
 <li><strong>orig_indices</strong> (<code class="xref py py-class docutils literal"><span class="pre">list</span></code>) &#8211; Mapping to old indexing of candidates. If given, it
 must have as many elements as <em>candidates</em>.</li>
@@ -152,9 +154,9 @@ See <a class="reference internal" href="#promod3.modelling.FilterCandidates" tit
 <code class="descclassname">promod3.modelling.</code><code class="descname">RunMolProbity</code><span class="sig-paren">(</span><em>target_pdb</em>, <em>molprobity_bin=None</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/promod3/modelling/_molprobity.html#RunMolProbity"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#promod3.modelling.RunMolProbity" title="Permalink to this definition">¶</a></dt>
 <dd><p>Run <code class="docutils literal"><span class="pre">MolProbity</span></code> from <code class="docutils literal"><span class="pre">Phenix</span></code> on a given PDB file.</p>
 <p>MolProbity score computation: (formula from molprobity source code)</p>
-<div class="highlight-python"><div class="highlight"><pre><span class="n">clashscore</span> <span class="o">=</span> <span class="n">result</span><span class="p">[</span><span class="s">&quot;Clashscore&quot;</span><span class="p">]</span>
-<span class="n">rota_out</span> <span class="o">=</span> <span class="n">result</span><span class="p">[</span><span class="s">&quot;Rotamer outliers&quot;</span><span class="p">]</span>
-<span class="n">rama_iffy</span> <span class="o">=</span> <span class="mf">100.</span> <span class="o">-</span> <span class="n">result</span><span class="p">[</span><span class="s">&quot;Ramachandran favored&quot;</span><span class="p">]</span>
+<div class="highlight-python"><div class="highlight"><pre><span></span><span class="n">clashscore</span> <span class="o">=</span> <span class="n">result</span><span class="p">[</span><span class="s2">&quot;Clashscore&quot;</span><span class="p">]</span>
+<span class="n">rota_out</span> <span class="o">=</span> <span class="n">result</span><span class="p">[</span><span class="s2">&quot;Rotamer outliers&quot;</span><span class="p">]</span>
+<span class="n">rama_iffy</span> <span class="o">=</span> <span class="mf">100.</span> <span class="o">-</span> <span class="n">result</span><span class="p">[</span><span class="s2">&quot;Ramachandran favored&quot;</span><span class="p">]</span>
 <span class="n">mpscore</span> <span class="o">=</span> <span class="p">((</span> <span class="mf">0.426</span> <span class="o">*</span> <span class="n">math</span><span class="o">.</span><span class="n">log</span><span class="p">(</span><span class="mi">1</span> <span class="o">+</span> <span class="n">clashscore</span><span class="p">)</span> <span class="p">)</span> <span class="o">+</span>
          <span class="p">(</span> <span class="mf">0.33</span> <span class="o">*</span> <span class="n">math</span><span class="o">.</span><span class="n">log</span><span class="p">(</span><span class="mi">1</span> <span class="o">+</span> <span class="nb">max</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">rota_out</span> <span class="o">-</span> <span class="mi">1</span><span class="p">))</span> <span class="p">)</span> <span class="o">+</span>
          <span class="p">(</span> <span class="mf">0.25</span> <span class="o">*</span> <span class="n">math</span><span class="o">.</span><span class="n">log</span><span class="p">(</span><span class="mi">1</span> <span class="o">+</span> <span class="nb">max</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">rama_iffy</span> <span class="o">-</span> <span class="mi">2</span><span class="p">))</span> <span class="p">))</span> <span class="o">+</span> <span class="mf">0.5</span>
@@ -191,7 +193,7 @@ with <code class="docutils literal"><span class="pre">MolProbity</span> <span cl
 <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first"><a class="reference external" href="https://docs.python.org/2.7/library/stdtypes.html#dict" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">dict</span></code></a></p>
 </td>
 </tr>
-<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last"><a class="reference external" href="http://www.openstructure.org/docs/dev/base/settings/#ost.settings.FileNotFound" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">FileNotFound</span></code></a> if the &#8220;phenix.molprobity&#8221;
+<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last"><a class="reference external" href="https://www.openstructure.org/docs/dev/base/settings/#ost.settings.FileNotFound" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">FileNotFound</span></code></a> if the &#8220;phenix.molprobity&#8221;
 executable is not found.</p>
 </td>
 </tr>
@@ -208,7 +210,7 @@ executable is not found.</p>
 <col class="field-name" />
 <col class="field-body" />
 <tbody valign="top">
-<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>ost_ent</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.EntityHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">Entity</span></code></a>) &#8211; OST entity on which to do analysis.</td>
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>ost_ent</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.EntityHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">Entity</span></code></a>) &#8211; OST entity on which to do analysis.</td>
 </tr>
 </tbody>
 </table>
@@ -273,9 +275,6 @@ executable is not found.</p>
       <input type="hidden" name="check_keywords" value="yes" />
       <input type="hidden" name="area" value="default" />
     </form>
-    <p class="searchtip" style="font-size: 90%">
-    Enter search terms or a module, class or function name.
-    </p>
 </div>
 <script type="text/javascript">$('#searchbox').show(0);</script>
         </div>
@@ -283,11 +282,11 @@ executable is not found.</p>
       <div class="clearer"></div>
     </div>
     <div class="footer">
-      &copy;2017, ProMod3 authors.
+      &copy;2018, ProMod3 authors.
       
       |
-      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a>
-      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.6</a>
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.4.1</a>
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
       
       |
       <a href="../_sources/modelling/model_checking.txt"
diff --git a/doc/html/modelling/monte_carlo.html b/doc/html/modelling/monte_carlo.html
index c3239cb82b334f9c53cda4c07dfd39faff17e065..6732e2a0fa011a0b43ada5c9968d35caabf3e393 100644
--- a/doc/html/modelling/monte_carlo.html
+++ b/doc/html/modelling/monte_carlo.html
@@ -6,7 +6,7 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
-    <title>Generating Loops De Novo &mdash; ProMod3 1.1.0 documentation</title>
+    <title>Generating Loops De Novo &mdash; ProMod3 1.2.0 documentation</title>
     
     <link rel="stylesheet" href="../_static/alabaster.css" type="text/css" />
     <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
@@ -14,7 +14,7 @@
     <script type="text/javascript">
       var DOCUMENTATION_OPTIONS = {
         URL_ROOT:    '../',
-        VERSION:     '1.1.0',
+        VERSION:     '1.2.0',
         COLLAPSE_INDEX: false,
         FILE_SUFFIX: '.html',
         HAS_SOURCE:  true
@@ -23,16 +23,18 @@
     <script type="text/javascript" src="../_static/jquery.js"></script>
     <script type="text/javascript" src="../_static/underscore.js"></script>
     <script type="text/javascript" src="../_static/doctools.js"></script>
-    <link rel="top" title="ProMod3 1.1.0 documentation" href="../index.html" />
+    <link rel="top" title="ProMod3 1.2.0 documentation" href="../index.html" />
     <link rel="up" title="modelling - Protein Modelling" href="index.html" />
     <link rel="next" title="Sidechain Reconstruction" href="sidechain_reconstruction.html" />
     <link rel="prev" title="Fitting Loops Into Gaps" href="loop_closing.html" />
    
+  <link rel="stylesheet" href="../_static/custom.css" type="text/css" />
   
-  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
 
   </head>
-  <body role="document">  
+  <body role="document">
+  
 
     <div class="document">
       <div class="documentwrapper">
@@ -46,66 +48,67 @@ novo structure candidates for loops or N-/C-Termini. Every iteration of the
 sampling process consists basically of four steps and we define objects for
 each step:</p>
 <ul class="simple">
-<li><a class="reference internal" href="#mc-sampler-object"><span>Sampler Object</span></a>: Propose new conformation</li>
-<li><a class="reference internal" href="#mc-closer-object"><span>Closer Object</span></a>: Adapt new conformation to the environment</li>
-<li><a class="reference internal" href="#mc-scorer-object"><span>Scorer Object</span></a>: Score the new conformation</li>
-<li><a class="reference internal" href="#mc-cooler-object"><span>Cooler Object</span></a>: Accept/Reject new conformation based on the score and
+<li><a class="reference internal" href="#mc-sampler-object"><span class="std std-ref">Sampler Object</span></a>: Propose new conformation</li>
+<li><a class="reference internal" href="#mc-closer-object"><span class="std std-ref">Closer Object</span></a>: Adapt new conformation to the environment</li>
+<li><a class="reference internal" href="#mc-scorer-object"><span class="std std-ref">Scorer Object</span></a>: Score the new conformation</li>
+<li><a class="reference internal" href="#mc-cooler-object"><span class="std std-ref">Cooler Object</span></a>: Accept/Reject new conformation based on the score and
 a temperature controlled Metropolis criterion</li>
 </ul>
 <p>These steps can be arbitrarily combined to generate custom Monte Carlo sampling
 pipelines. This combination either happens manually or by using the convenient
 <a class="reference internal" href="#promod3.modelling.SampleMonteCarlo" title="promod3.modelling.SampleMonteCarlo"><code class="xref py py-func docutils literal"><span class="pre">SampleMonteCarlo()</span></code></a> function. For example, here we show how to apply Monte
 Carlo sampling to the N-terminal part of crambin:</p>
-<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">ost</span> <span class="kn">import</span> <span class="n">io</span>
-<span class="kn">from</span> <span class="nn">promod3</span> <span class="kn">import</span> <span class="n">loop</span><span class="p">,</span> <span class="n">scoring</span><span class="p">,</span> <span class="n">modelling</span>
-<span class="kn">import</span> <span class="nn">numpy</span> <span class="kn">as</span> <span class="nn">np</span>
+<div class="highlight-default"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">ost</span> <span class="k">import</span> <span class="n">io</span>
+<span class="kn">from</span> <span class="nn">promod3</span> <span class="k">import</span> <span class="n">loop</span><span class="p">,</span> <span class="n">scoring</span><span class="p">,</span> <span class="n">modelling</span>
+<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
 
-<span class="c"># setup protein</span>
-<span class="n">prot</span> <span class="o">=</span> <span class="n">io</span><span class="o">.</span><span class="n">LoadPDB</span><span class="p">(</span><span class="s">&#39;data/1CRN.pdb&#39;</span><span class="p">)</span>
+<span class="c1"># setup protein</span>
+<span class="n">prot</span> <span class="o">=</span> <span class="n">io</span><span class="o">.</span><span class="n">LoadPDB</span><span class="p">(</span><span class="s1">&#39;data/1CRN.pdb&#39;</span><span class="p">)</span>
 
 <span class="n">chain_index</span> <span class="o">=</span> <span class="mi">0</span>
 <span class="n">start_resnum</span> <span class="o">=</span> <span class="mi">1</span>
 <span class="n">terminal_len</span> <span class="o">=</span> <span class="mi">8</span>
 
-<span class="n">seqres</span> <span class="o">=</span> <span class="s">&#39;&#39;</span><span class="o">.</span><span class="n">join</span><span class="p">([</span><span class="n">r</span><span class="o">.</span><span class="n">one_letter_code</span> <span class="k">for</span> <span class="n">r</span> <span class="ow">in</span> <span class="n">prot</span><span class="o">.</span><span class="n">residues</span><span class="p">])</span>
+<span class="n">seqres</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="o">.</span><span class="n">join</span><span class="p">([</span><span class="n">r</span><span class="o">.</span><span class="n">one_letter_code</span> <span class="k">for</span> <span class="n">r</span> <span class="ow">in</span> <span class="n">prot</span><span class="o">.</span><span class="n">residues</span><span class="p">])</span>
 <span class="n">terminal_seqres</span> <span class="o">=</span> <span class="n">seqres</span><span class="p">[:</span><span class="n">terminal_len</span><span class="p">]</span>
 
-<span class="c"># setup mc_sampler</span>
+<span class="c1"># setup mc_sampler</span>
 <span class="n">torsion_sampler</span> <span class="o">=</span> <span class="n">loop</span><span class="o">.</span><span class="n">LoadTorsionSampler</span><span class="p">()</span>
 <span class="n">mc_sampler</span> <span class="o">=</span> <span class="n">modelling</span><span class="o">.</span><span class="n">SoftSampler</span><span class="p">(</span><span class="n">terminal_seqres</span><span class="p">,</span> <span class="n">torsion_sampler</span><span class="p">,</span>
                                    <span class="mf">10.0</span> <span class="o">/</span> <span class="mi">180</span> <span class="o">*</span> <span class="n">np</span><span class="o">.</span><span class="n">pi</span><span class="p">)</span>
 
-<span class="c"># setup mc_closer</span>
+<span class="c1"># setup mc_closer</span>
 <span class="n">mc_closer</span> <span class="o">=</span> <span class="n">modelling</span><span class="o">.</span><span class="n">NTerminalCloser</span><span class="p">(</span><span class="n">prot</span><span class="o">.</span><span class="n">residues</span><span class="p">[</span><span class="n">terminal_len</span><span class="o">-</span><span class="mi">1</span><span class="p">])</span>
 
-<span class="c"># setup backbone scorer with clash and cbeta scoring</span>
+<span class="c1"># setup backbone scorer with clash and cbeta scoring</span>
 <span class="n">score_env</span> <span class="o">=</span> <span class="n">scoring</span><span class="o">.</span><span class="n">BackboneScoreEnv</span><span class="p">(</span><span class="n">seqres</span><span class="p">)</span>
 <span class="n">score_env</span><span class="o">.</span><span class="n">SetInitialEnvironment</span><span class="p">(</span><span class="n">prot</span><span class="p">)</span>
 <span class="n">scorer</span> <span class="o">=</span> <span class="n">scoring</span><span class="o">.</span><span class="n">BackboneOverallScorer</span><span class="p">()</span>
-<span class="n">scorer</span><span class="p">[</span><span class="s">&quot;cbeta&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">scoring</span><span class="o">.</span><span class="n">LoadCBetaScorer</span><span class="p">()</span>
-<span class="n">scorer</span><span class="p">[</span><span class="s">&quot;clash&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">scoring</span><span class="o">.</span><span class="n">ClashScorer</span><span class="p">()</span>
+<span class="n">scorer</span><span class="p">[</span><span class="s2">&quot;cbeta&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">scoring</span><span class="o">.</span><span class="n">LoadCBetaScorer</span><span class="p">()</span>
+<span class="n">scorer</span><span class="p">[</span><span class="s2">&quot;clash&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">scoring</span><span class="o">.</span><span class="n">ClashScorer</span><span class="p">()</span>
 <span class="n">scorer</span><span class="o">.</span><span class="n">AttachEnvironment</span><span class="p">(</span><span class="n">score_env</span><span class="p">)</span>
 
-<span class="c"># set up mc_scorer</span>
+<span class="c1"># set up mc_scorer</span>
 <span class="n">weights</span> <span class="o">=</span> <span class="nb">dict</span><span class="p">()</span>
-<span class="n">weights</span><span class="p">[</span><span class="s">&quot;cbeta&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="mf">10.0</span>
-<span class="n">weights</span><span class="p">[</span><span class="s">&quot;clash&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="mf">0.1</span>
-<span class="n">mc_scorer</span> <span class="o">=</span> <span class="n">modelling</span><span class="o">.</span><span class="n">LinearScorer</span><span class="p">(</span><span class="n">scorer</span><span class="p">,</span> <span class="n">start_resnum</span><span class="p">,</span>
+<span class="n">weights</span><span class="p">[</span><span class="s2">&quot;cbeta&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="mf">10.0</span>
+<span class="n">weights</span><span class="p">[</span><span class="s2">&quot;clash&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="mf">0.1</span>
+<span class="n">mc_scorer</span> <span class="o">=</span> <span class="n">modelling</span><span class="o">.</span><span class="n">LinearScorer</span><span class="p">(</span><span class="n">scorer</span><span class="p">,</span> <span class="n">score_env</span><span class="p">,</span>
+                                   <span class="n">start_resnum</span><span class="p">,</span> <span class="n">terminal_len</span><span class="p">,</span>
                                    <span class="n">chain_index</span><span class="p">,</span> <span class="n">weights</span><span class="p">)</span>
 
-<span class="c"># setup mc_cooler</span>
+<span class="c1"># setup mc_cooler</span>
 <span class="n">mc_cooler</span> <span class="o">=</span> <span class="n">modelling</span><span class="o">.</span><span class="n">ExponentialCooler</span><span class="p">(</span><span class="mi">100</span><span class="p">,</span> <span class="mi">100</span><span class="p">,</span> <span class="mf">0.9</span><span class="p">)</span>
 
-<span class="c"># create BackboneList from n-terminus</span>
+<span class="c1"># create BackboneList from n-terminus</span>
 <span class="n">bb_list</span> <span class="o">=</span> <span class="n">loop</span><span class="o">.</span><span class="n">BackboneList</span><span class="p">(</span><span class="n">terminal_seqres</span><span class="p">,</span>
                             <span class="n">prot</span><span class="o">.</span><span class="n">residues</span><span class="p">[:</span><span class="n">terminal_len</span><span class="p">])</span>
 
-<span class="c"># shake it!</span>
+<span class="c1"># shake it!</span>
 <span class="n">modelling</span><span class="o">.</span><span class="n">SampleMonteCarlo</span><span class="p">(</span><span class="n">mc_sampler</span><span class="p">,</span> <span class="n">mc_closer</span><span class="p">,</span> <span class="n">mc_scorer</span><span class="p">,</span>
-                           <span class="n">mc_cooler</span><span class="p">,</span> <span class="mi">10000</span><span class="p">,</span> <span class="n">bb_list</span><span class="p">,</span> <span class="bp">False</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
+                           <span class="n">mc_cooler</span><span class="p">,</span> <span class="mi">10000</span><span class="p">,</span> <span class="n">bb_list</span><span class="p">,</span> <span class="kc">False</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
 
-<span class="c"># save down the result</span>
-<span class="n">io</span><span class="o">.</span><span class="n">SavePDB</span><span class="p">(</span><span class="n">bb_list</span><span class="o">.</span><span class="n">ToEntity</span><span class="p">(),</span> <span class="s">&quot;sampled_frag.pdb&quot;</span><span class="p">)</span>
+<span class="c1"># save down the result</span>
+<span class="n">io</span><span class="o">.</span><span class="n">SavePDB</span><span class="p">(</span><span class="n">bb_list</span><span class="o">.</span><span class="n">ToEntity</span><span class="p">(),</span> <span class="s2">&quot;sampled_frag.pdb&quot;</span><span class="p">)</span>
 </pre></div>
 </div>
 <dl class="method">
@@ -124,12 +127,12 @@ ever encountered or the last accepted proposal.</p>
 <col class="field-body" />
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
-<li><strong>sampler</strong> (<a class="reference internal" href="#mc-sampler-object"><span>Sampler Object</span></a>) &#8211; Sampler object capable of initializing and altering
+<li><strong>sampler</strong> (<a class="reference internal" href="#mc-sampler-object"><span class="std std-ref">Sampler Object</span></a>) &#8211; Sampler object capable of initializing and altering
 conformations.</li>
-<li><strong>closer</strong> (<a class="reference internal" href="#mc-closer-object"><span>Closer Object</span></a>) &#8211; Closer object to adapt a new conformation to
+<li><strong>closer</strong> (<a class="reference internal" href="#mc-closer-object"><span class="std std-ref">Closer Object</span></a>) &#8211; Closer object to adapt a new conformation to
 the environment.</li>
-<li><strong>scorer</strong> (<a class="reference internal" href="#mc-scorer-object"><span>Scorer Object</span></a>) &#8211; Scorer object to score new loop conformations.</li>
-<li><strong>cooler</strong> (<a class="reference internal" href="#mc-cooler-object"><span>Cooler Object</span></a>) &#8211; Cooler object to control the temperature of the
+<li><strong>scorer</strong> (<a class="reference internal" href="#mc-scorer-object"><span class="std std-ref">Scorer Object</span></a>) &#8211; Scorer object to score new loop conformations.</li>
+<li><strong>cooler</strong> (<a class="reference internal" href="#mc-cooler-object"><span class="std std-ref">Cooler Object</span></a>) &#8211; Cooler object to control the temperature of the
 Monte Carlo trajectory.</li>
 <li><strong>steps</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Number of Monte Carlo iterations to be performed.</li>
 <li><strong>bb_list</strong> (<a class="reference internal" href="../loop/backbone.html#promod3.loop.BackboneList" title="promod3.loop.BackboneList"><code class="xref py py-class docutils literal"><span class="pre">BackboneList</span></code></a>) &#8211; The chosen conformation gets stored here.</li>
@@ -410,9 +413,9 @@ avoid moving into unfavourable phi/psi ranges.</p>
 <col class="field-body" />
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
-<li><strong>n_stem</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; Defining stem positions the closed conformation
+<li><strong>n_stem</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; Defining stem positions the closed conformation
 should adapt. See <a class="reference internal" href="loop_closing.html#promod3.modelling.CCD.CCD" title="promod3.modelling.CCD.CCD"><code class="xref py py-meth docutils literal"><span class="pre">CCD()</span></code></a>.</li>
-<li><strong>c_stem</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; Defining stem positions the closed conformation
+<li><strong>c_stem</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; Defining stem positions the closed conformation
 should adapt. See <a class="reference internal" href="loop_closing.html#promod3.modelling.CCD.CCD" title="promod3.modelling.CCD.CCD"><code class="xref py py-meth docutils literal"><span class="pre">CCD()</span></code></a>.</li>
 <li><strong>sequence</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#str" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">str</span></code></a>) &#8211; Sequence of the conformation to be closed.</li>
 <li><strong>torsion_sampler</strong> (<a class="reference internal" href="../loop/torsion_sampler.html#promod3.loop.TorsionSampler" title="promod3.loop.TorsionSampler"><code class="xref py py-class docutils literal"><span class="pre">TorsionSampler</span></code></a> / <code class="xref py py-class docutils literal"><span class="pre">list</span></code>
@@ -459,9 +462,9 @@ the stems given by the closer.</p>
 <col class="field-body" />
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
-<li><strong>n_stem</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; Defining stem positions the closed conformation
+<li><strong>n_stem</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; Defining stem positions the closed conformation
 should adapt.</li>
-<li><strong>c_stem</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; Defining stem positions the closed conformation
+<li><strong>c_stem</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; Defining stem positions the closed conformation
 should adapt.</li>
 </ul>
 </td>
@@ -501,7 +504,7 @@ solutions. The KICCloser simply picks the first one.</p>
 <col class="field-body" />
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
-<li><strong>n_stem</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; Defining stem positions the closed conformation should
+<li><strong>n_stem</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; Defining stem positions the closed conformation should
 adapt.</li>
 <li><strong>c_stem</strong> &#8211; Defining stem positions the closed conformation should
 adapt.</li>
@@ -542,7 +545,7 @@ the c_stem with the desired positions.</p>
 <col class="field-name" />
 <col class="field-body" />
 <tbody valign="top">
-<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>c_stem</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; Defining stem positions the closed conformation should
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>c_stem</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; Defining stem positions the closed conformation should
 adapt.</td>
 </tr>
 <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">Whether closing was successful</td>
@@ -560,7 +563,7 @@ the n_stem with the desired positions.</p>
 <col class="field-name" />
 <col class="field-body" />
 <tbody valign="top">
-<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>n_stem</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; Defining stem positions the closed conformation should
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>n_stem</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; Defining stem positions the closed conformation should
 adapt.</td>
 </tr>
 <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">Whether closing was successful</td>
@@ -575,12 +578,22 @@ adapt.</td>
 <p>The scorer asses a proposed conformation and are intended to return a pseudo
 energy, the lower the better.</p>
 <dl class="class">
-<dt id="promod3.modelling.LinearScorer">
-<em class="property">class </em><code class="descclassname">promod3.modelling.</code><code class="descname">LinearScorer</code><span class="sig-paren">(</span><em>scorer</em>, <em>start_resnum</em>, <em>chain_idx</em>, <em>linear_weights</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.modelling.LinearScorer" title="Permalink to this definition">¶</a></dt>
+<dt>
+<code class="descname">LinearScorer(scorer, scorer_env, start_resnum, num_residues,</code></dt>
+<dt>
+<code class="descname">chain_idx, linear_weights)</code></dt>
 <dd><p>The LinearScorer allows to combine the scores available from
 <a class="reference internal" href="../scoring/backbone_scorers.html#promod3.scoring.BackboneOverallScorer" title="promod3.scoring.BackboneOverallScorer"><code class="xref py py-class docutils literal"><span class="pre">BackboneOverallScorer</span></code></a> in a linear manner. See
 <a class="reference internal" href="../scoring/backbone_scorers.html#promod3.scoring.BackboneOverallScorer.CalculateLinearCombination" title="promod3.scoring.BackboneOverallScorer.CalculateLinearCombination"><code class="xref py py-meth docutils literal"><span class="pre">CalculateLinearCombination()</span></code></a> for a
 detailed description of the arguments.</p>
+<div class="admonition warning">
+<p class="first admonition-title">Warning</p>
+<p class="last">The provided <em>scorer_env</em> will be altered in every
+<a class="reference internal" href="#promod3.modelling.GetScore" title="promod3.modelling.GetScore"><code class="xref py py-func docutils literal"><span class="pre">GetScore()</span></code></a> call.
+You might consider the Stash / Pop mechanism of the
+<a class="reference internal" href="../scoring/backbone_score_env.html#promod3.scoring.BackboneScoreEnv" title="promod3.scoring.BackboneScoreEnv"><code class="xref py py-class docutils literal"><span class="pre">BackboneScoreEnv</span></code></a> to restore to the
+original state once the sampling is done.</p>
+</div>
 <table class="docutils field-list" frame="void" rules="none">
 <col class="field-name" />
 <col class="field-body" />
@@ -588,7 +601,9 @@ detailed description of the arguments.</p>
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
 <li><strong>scorer</strong> (<a class="reference internal" href="../scoring/backbone_scorers.html#promod3.scoring.BackboneOverallScorer" title="promod3.scoring.BackboneOverallScorer"><code class="xref py py-class docutils literal"><span class="pre">BackboneOverallScorer</span></code></a>) &#8211; Scorer Object with set environment for the particular loop
 modelling problem.</li>
+<li><strong>scorer_env</strong> (<a class="reference internal" href="../scoring/backbone_score_env.html#promod3.scoring.BackboneScoreEnv" title="promod3.scoring.BackboneScoreEnv"><code class="xref py py-class docutils literal"><span class="pre">BackboneScoreEnv</span></code></a>) &#8211; The environment that is linked to the <em>scorer</em></li>
 <li><strong>start_resnum</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Res. number defining the position in the SEQRES.</li>
+<li><strong>num_residues</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Number of residues to score</li>
 <li><strong>chain_idx</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Index of chain the loop(s) belong to.</li>
 <li><strong>linear_weights</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/stdtypes.html#dict" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">dict</span></code></a> (keys: <a class="reference external" href="https://docs.python.org/2.7/library/functions.html#str" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">str</span></code></a>,
 values: <a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>)) &#8211; Weights for each desired scorer.</li>
@@ -602,8 +617,8 @@ which no scorer exists</p>
 </tbody>
 </table>
 <dl class="method">
-<dt id="promod3.modelling.LinearScorer.GetScore">
-<code class="descname">GetScore</code><span class="sig-paren">(</span><em>bb_list</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.modelling.LinearScorer.GetScore" title="Permalink to this definition">¶</a></dt>
+<dt id="promod3.modelling.GetScore">
+<code class="descclassname">promod3.modelling.</code><code class="descname">GetScore</code><span class="sig-paren">(</span><em>bb_list</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.modelling.GetScore" title="Permalink to this definition">¶</a></dt>
 <dd><table class="docutils field-list" frame="void" rules="none">
 <col class="field-name" />
 <col class="field-body" />
@@ -713,9 +728,6 @@ the returned temperature gets multiplied by the <em>cooling_factor</em>.</p>
       <input type="hidden" name="check_keywords" value="yes" />
       <input type="hidden" name="area" value="default" />
     </form>
-    <p class="searchtip" style="font-size: 90%">
-    Enter search terms or a module, class or function name.
-    </p>
 </div>
 <script type="text/javascript">$('#searchbox').show(0);</script>
         </div>
@@ -723,11 +735,11 @@ the returned temperature gets multiplied by the <em>cooling_factor</em>.</p>
       <div class="clearer"></div>
     </div>
     <div class="footer">
-      &copy;2017, ProMod3 authors.
+      &copy;2018, ProMod3 authors.
       
       |
-      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a>
-      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.6</a>
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.4.1</a>
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
       
       |
       <a href="../_sources/modelling/monte_carlo.txt"
diff --git a/doc/html/modelling/pipeline.html b/doc/html/modelling/pipeline.html
index fdf455dc507efbf870475eb13814ee084bf355c3..9973f610b7e21bd5badbd8e66be478d0bc0272bd 100644
--- a/doc/html/modelling/pipeline.html
+++ b/doc/html/modelling/pipeline.html
@@ -6,7 +6,7 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
-    <title>Modelling Pipeline &mdash; ProMod3 1.1.0 documentation</title>
+    <title>Modelling Pipeline &mdash; ProMod3 1.2.0 documentation</title>
     
     <link rel="stylesheet" href="../_static/alabaster.css" type="text/css" />
     <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
@@ -14,7 +14,7 @@
     <script type="text/javascript">
       var DOCUMENTATION_OPTIONS = {
         URL_ROOT:    '../',
-        VERSION:     '1.1.0',
+        VERSION:     '1.2.0',
         COLLAPSE_INDEX: false,
         FILE_SUFFIX: '.html',
         HAS_SOURCE:  true
@@ -23,16 +23,18 @@
     <script type="text/javascript" src="../_static/jquery.js"></script>
     <script type="text/javascript" src="../_static/underscore.js"></script>
     <script type="text/javascript" src="../_static/doctools.js"></script>
-    <link rel="top" title="ProMod3 1.1.0 documentation" href="../index.html" />
+    <link rel="top" title="ProMod3 1.2.0 documentation" href="../index.html" />
     <link rel="up" title="modelling - Protein Modelling" href="index.html" />
     <link rel="next" title="Model Checking" href="model_checking.html" />
     <link rel="prev" title="modelling - Protein Modelling" href="index.html" />
    
+  <link rel="stylesheet" href="../_static/custom.css" type="text/css" />
   
-  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
 
   </head>
-  <body role="document">  
+  <body role="document">
+  
 
     <div class="document">
       <div class="documentwrapper">
@@ -58,41 +60,41 @@ heuristics)</li>
 with the <a class="reference internal" href="#promod3.modelling.BuildFromRawModel" title="promod3.modelling.BuildFromRawModel"><code class="xref py py-func docutils literal"><span class="pre">BuildFromRawModel()</span></code></a> function. If you want to run and tweak the
 internal steps, you can start with the  following code and adapt it to your
 purposes:</p>
-<div class="highlight-python" id="modelling-steps-example"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">ost</span> <span class="kn">import</span> <span class="n">io</span>
-<span class="kn">from</span> <span class="nn">promod3</span> <span class="kn">import</span> <span class="n">modelling</span><span class="p">,</span> <span class="n">loop</span>
+<div class="highlight-default" id="modelling-steps-example"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">ost</span> <span class="k">import</span> <span class="n">io</span>
+<span class="kn">from</span> <span class="nn">promod3</span> <span class="k">import</span> <span class="n">modelling</span><span class="p">,</span> <span class="n">loop</span>
 
-<span class="c"># setup</span>
+<span class="c1"># setup</span>
 <span class="n">merge_distance</span> <span class="o">=</span> <span class="mi">4</span>
 <span class="n">fragment_db</span> <span class="o">=</span> <span class="n">loop</span><span class="o">.</span><span class="n">LoadFragDB</span><span class="p">()</span>
 <span class="n">structure_db</span> <span class="o">=</span> <span class="n">loop</span><span class="o">.</span><span class="n">LoadStructureDB</span><span class="p">()</span>
 <span class="n">torsion_sampler</span> <span class="o">=</span> <span class="n">loop</span><span class="o">.</span><span class="n">LoadTorsionSamplerCoil</span><span class="p">()</span>
 
-<span class="c"># get raw model</span>
-<span class="n">tpl</span> <span class="o">=</span> <span class="n">io</span><span class="o">.</span><span class="n">LoadPDB</span><span class="p">(</span><span class="s">&#39;data/1crn_cut.pdb&#39;</span><span class="p">)</span>
-<span class="n">aln</span> <span class="o">=</span> <span class="n">io</span><span class="o">.</span><span class="n">LoadAlignment</span><span class="p">(</span><span class="s">&#39;data/1crn.fasta&#39;</span><span class="p">)</span>
+<span class="c1"># get raw model</span>
+<span class="n">tpl</span> <span class="o">=</span> <span class="n">io</span><span class="o">.</span><span class="n">LoadPDB</span><span class="p">(</span><span class="s1">&#39;data/1crn_cut.pdb&#39;</span><span class="p">)</span>
+<span class="n">aln</span> <span class="o">=</span> <span class="n">io</span><span class="o">.</span><span class="n">LoadAlignment</span><span class="p">(</span><span class="s1">&#39;data/1crn.fasta&#39;</span><span class="p">)</span>
 <span class="n">aln</span><span class="o">.</span><span class="n">AttachView</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="n">tpl</span><span class="o">.</span><span class="n">CreateFullView</span><span class="p">())</span>
 <span class="n">mhandle</span> <span class="o">=</span> <span class="n">modelling</span><span class="o">.</span><span class="n">BuildRawModel</span><span class="p">(</span><span class="n">aln</span><span class="p">)</span>
 
-<span class="c"># we&#39;re not modelling termini</span>
+<span class="c1"># we&#39;re not modelling termini</span>
 <span class="n">modelling</span><span class="o">.</span><span class="n">RemoveTerminalGaps</span><span class="p">(</span><span class="n">mhandle</span><span class="p">)</span>
 
-<span class="c"># perform loop modelling to close all gaps</span>
+<span class="c1"># perform loop modelling to close all gaps</span>
 <span class="n">modelling</span><span class="o">.</span><span class="n">CloseGaps</span><span class="p">(</span><span class="n">mhandle</span><span class="p">,</span> <span class="n">merge_distance</span><span class="p">,</span> <span class="n">fragment_db</span><span class="p">,</span>
                     <span class="n">structure_db</span><span class="p">,</span> <span class="n">torsion_sampler</span><span class="p">)</span>
 
-<span class="c"># build sidechains</span>
+<span class="c1"># build sidechains</span>
 <span class="n">modelling</span><span class="o">.</span><span class="n">BuildSidechains</span><span class="p">(</span><span class="n">mhandle</span><span class="p">,</span> <span class="n">merge_distance</span><span class="p">,</span> <span class="n">fragment_db</span><span class="p">,</span>
                           <span class="n">structure_db</span><span class="p">,</span> <span class="n">torsion_sampler</span><span class="p">)</span>
 
-<span class="c"># minimize energy of final model using molecular mechanics</span>
+<span class="c1"># minimize energy of final model using molecular mechanics</span>
 <span class="n">modelling</span><span class="o">.</span><span class="n">MinimizeModelEnergy</span><span class="p">(</span><span class="n">mhandle</span><span class="p">)</span>
 
-<span class="c"># check final model and report issues</span>
+<span class="c1"># check final model and report issues</span>
 <span class="n">modelling</span><span class="o">.</span><span class="n">CheckFinalModel</span><span class="p">(</span><span class="n">mhandle</span><span class="p">)</span>
 
-<span class="c"># extract final model</span>
+<span class="c1"># extract final model</span>
 <span class="n">final_model</span> <span class="o">=</span> <span class="n">mhandle</span><span class="o">.</span><span class="n">model</span>
-<span class="n">io</span><span class="o">.</span><span class="n">SavePDB</span><span class="p">(</span><span class="n">final_model</span><span class="p">,</span> <span class="s">&#39;model.pdb&#39;</span><span class="p">)</span>
+<span class="n">io</span><span class="o">.</span><span class="n">SavePDB</span><span class="p">(</span><span class="n">final_model</span><span class="p">,</span> <span class="s1">&#39;model.pdb&#39;</span><span class="p">)</span>
 </pre></div>
 </div>
 <div class="section" id="build-raw-modelling-handle">
@@ -115,7 +117,7 @@ chain follows afterwards.</p>
 <col class="field-name" />
 <col class="field-body" />
 <tbody valign="top">
-<tr class="field-odd field"><th class="field-name">Type:</th><td class="field-body"><a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.EntityHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">EntityHandle</span></code></a></td>
+<tr class="field-odd field"><th class="field-name">Type:</th><td class="field-body"><a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.EntityHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">EntityHandle</span></code></a></td>
 </tr>
 </tbody>
 </table>
@@ -141,13 +143,13 @@ Gaps of different chains are appended one after another.</p>
 <dl class="attribute">
 <dt id="promod3.modelling.ModellingHandle.seqres">
 <code class="descname">seqres</code><a class="headerlink" href="#promod3.modelling.ModellingHandle.seqres" title="Permalink to this definition">¶</a></dt>
-<dd><p>List of sequences with one <a class="reference external" href="http://www.openstructure.org/docs/dev/seq/base/seq/#ost.seq.SequenceHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">SequenceHandle</span></code></a> for each chain
+<dd><p>List of sequences with one <a class="reference external" href="https://www.openstructure.org/docs/dev/seq/base/seq/#ost.seq.SequenceHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">SequenceHandle</span></code></a> for each chain
 of the target protein.</p>
 <table class="docutils field-list" frame="void" rules="none">
 <col class="field-name" />
 <col class="field-body" />
 <tbody valign="top">
-<tr class="field-odd field"><th class="field-name">Type:</th><td class="field-body"><a class="reference external" href="http://www.openstructure.org/docs/dev/seq/base/seq/#ost.seq.SequenceList" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">SequenceList</span></code></a></td>
+<tr class="field-odd field"><th class="field-name">Type:</th><td class="field-body"><a class="reference external" href="https://www.openstructure.org/docs/dev/seq/base/seq/#ost.seq.SequenceList" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">SequenceList</span></code></a></td>
 </tr>
 </tbody>
 </table>
@@ -156,7 +158,7 @@ of the target protein.</p>
 <dl class="attribute">
 <dt id="promod3.modelling.ModellingHandle.profiles">
 <code class="descname">profiles</code><a class="headerlink" href="#promod3.modelling.ModellingHandle.profiles" title="Permalink to this definition">¶</a></dt>
-<dd><p>List of profiles with one <a class="reference external" href="http://www.openstructure.org/docs/dev/seq/base/seq/#ost.seq.ProfileHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.seq.ProfileHandle</span></code></a> for each chain of
+<dd><p>List of profiles with one <a class="reference external" href="https://www.openstructure.org/docs/dev/seq/base/seq/#ost.seq.ProfileHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.seq.ProfileHandle</span></code></a> for each chain of
 the target protein (same order as in <a class="reference internal" href="#promod3.modelling.ModellingHandle.seqres" title="promod3.modelling.ModellingHandle.seqres"><code class="xref py py-attr docutils literal"><span class="pre">seqres</span></code></a>). Please note, that this
 attribute won&#8217;t be set by simply calling <a class="reference internal" href="#promod3.modelling.BuildFromRawModel" title="promod3.modelling.BuildFromRawModel"><code class="xref py py-func docutils literal"><span class="pre">BuildFromRawModel()</span></code></a>. You have
 to fill it manually or even better by the convenient function
@@ -165,7 +167,7 @@ to fill it manually or even better by the convenient function
 <col class="field-name" />
 <col class="field-body" />
 <tbody valign="top">
-<tr class="field-odd field"><th class="field-name">Type:</th><td class="field-body"><code class="xref py py-class docutils literal"><span class="pre">list</span></code> of <a class="reference external" href="http://www.openstructure.org/docs/dev/seq/base/seq/#ost.seq.ProfileHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.seq.ProfileHandle</span></code></a></td>
+<tr class="field-odd field"><th class="field-name">Type:</th><td class="field-body"><code class="xref py py-class docutils literal"><span class="pre">list</span></code> of <a class="reference external" href="https://www.openstructure.org/docs/dev/seq/base/seq/#ost.seq.ProfileHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.seq.ProfileHandle</span></code></a></td>
 </tr>
 </tbody>
 </table>
@@ -319,7 +321,7 @@ alignment handle or an alignment handle list. Every list item is treated as a
 single chain in the final raw model.</p>
 <p>Each alignment handle must contain exactly two sequences and the second
 sequence is considered the template sequence, which must have a
-<a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.EntityView" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">EntityView</span></code></a> attached.</p>
+<a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.EntityView" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">EntityView</span></code></a> attached.</p>
 <p>This is a basic protein core modelling algorithm that copies backbone
 coordinates based on the sequence alignment. For matching residues, the
 side chain coordinates are also copied. Gaps are ignored. Hydrogen an
@@ -347,7 +349,7 @@ as information about insertions and deletions in the gaps list.</p>
 <col class="field-body" />
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
-<li><strong>aln</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/seq/base/seq/#ost.seq.AlignmentHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">AlignmentHandle</span></code></a> / <code class="xref py py-class docutils literal"><span class="pre">AlignmentList</span></code>) &#8211; Single alignment handle for raw model with single chain or
+<li><strong>aln</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/seq/base/seq/#ost.seq.AlignmentHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">AlignmentHandle</span></code></a> / <code class="xref py py-class docutils literal"><span class="pre">AlignmentList</span></code>) &#8211; Single alignment handle for raw model with single chain or
 list of alignment handles for raw model with multiple chains.</li>
 <li><strong>include_ligands</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#bool" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">bool</span></code></a>) &#8211; True, if we wish to include ligands in the model. This
 searches for ligands in all OST handles of the views
@@ -373,7 +375,7 @@ in SMTL). All ligands are added to a new chain named
 <li>the second sequence does not have an attached structure</li>
 <li>the residues of the template structure do not match with the
 alignment sequence (note that you can set an &#8220;offset&#8221; (see
-<a class="reference external" href="http://www.openstructure.org/docs/dev/seq/base/seq/#ost.seq.AlignmentHandle.SetSequenceOffset" title="(in OpenStructure v1.6.0)"><code class="xref py py-meth docutils literal"><span class="pre">SetSequenceOffset()</span></code></a>) for the
+<a class="reference external" href="https://www.openstructure.org/docs/dev/seq/base/seq/#ost.seq.AlignmentHandle.SetSequenceOffset" title="(in OpenStructure v1.7.1)"><code class="xref py py-meth docutils literal"><span class="pre">SetSequenceOffset()</span></code></a>) for the
 template sequence (but not for the target))</li>
 <li>the target sequence has a non-zero offset (cannot be honored as
 the resulting model will always start its residue numbering at 1)</li>
@@ -393,7 +395,7 @@ the resulting model will always start its residue numbering at 1)</li>
 <dd><p>Build a model starting with a raw model (see <a class="reference internal" href="#promod3.modelling.BuildRawModel" title="promod3.modelling.BuildRawModel"><code class="xref py py-func docutils literal"><span class="pre">BuildRawModel()</span></code></a>).</p>
 <p>This function implements a recommended pipeline to generate complete models
 from a raw model. The steps are shown in detail in the code example
-<a class="reference internal" href="#modelling-steps-example"><span>above</span></a>. If you wish to use your own
+<a class="reference internal" href="#modelling-steps-example"><span class="std std-ref">above</span></a>. If you wish to use your own
 pipeline, you can use that code as a starting point for your own custom
 modelling pipeline. For reproducibility, we recommend that you keep copies
 of custom pipelines.</p>
@@ -411,12 +413,12 @@ return an incomplete model.</p>
 <li><strong>mhandle</strong> (<a class="reference internal" href="#promod3.modelling.ModellingHandle" title="promod3.modelling.ModellingHandle"><code class="xref py py-class docutils literal"><span class="pre">ModellingHandle</span></code></a>) &#8211; The prepared template coordinates loaded with the input
 alignment.</li>
 <li><strong>use_amber_ff</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#bool" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">bool</span></code></a>) &#8211; if True, use the AMBER force field instead of the def.
-CHARMM one (see <a class="reference external" href="http://www.openstructure.org/docs/dev/mol/mm/forcefield/#ost.mol.mm.LoadAMBERForcefield" title="(in OpenStructure v1.6.0)"><code class="xref py py-func docutils literal"><span class="pre">ost.mol.mm.LoadAMBERForcefield()</span></code></a>
-and <a class="reference external" href="http://www.openstructure.org/docs/dev/mol/mm/forcefield/#ost.mol.mm.LoadCHARMMForcefield" title="(in OpenStructure v1.6.0)"><code class="xref py py-func docutils literal"><span class="pre">ost.mol.mm.LoadCHARMMForcefield()</span></code></a>).
+CHARMM one (see <a class="reference external" href="https://www.openstructure.org/docs/dev/mol/mm/forcefield/#ost.mol.mm.LoadAMBERForcefield" title="(in OpenStructure v1.7.1)"><code class="xref py py-func docutils literal"><span class="pre">ost.mol.mm.LoadAMBERForcefield()</span></code></a>
+and <a class="reference external" href="https://www.openstructure.org/docs/dev/mol/mm/forcefield/#ost.mol.mm.LoadCHARMMForcefield" title="(in OpenStructure v1.7.1)"><code class="xref py py-func docutils literal"><span class="pre">ost.mol.mm.LoadCHARMMForcefield()</span></code></a>).
 Both do a similarly good job without ligands (CHARMM
 slightly better), but you will want to be consistent
 with the optional force fields in <cite>extra_force_fields</cite>.</li>
-<li><strong>extra_force_fields</strong> (<code class="xref py py-class docutils literal"><span class="pre">list</span></code> of <a class="reference external" href="http://www.openstructure.org/docs/dev/mol/mm/forcefield/#ost.mol.mm.Forcefield" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.mm.Forcefield</span></code></a>) &#8211; Additional list of force fields to use if a 
+<li><strong>extra_force_fields</strong> (<code class="xref py py-class docutils literal"><span class="pre">list</span></code> of <a class="reference external" href="https://www.openstructure.org/docs/dev/mol/mm/forcefield/#ost.mol.mm.Forcefield" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.mm.Forcefield</span></code></a>) &#8211; Additional list of force fields to use if a 
 (ligand) residue cannot be parametrized with the
 default force field. The force fields are tried
 in the order as given and ligands without an
@@ -427,7 +429,7 @@ existing parametrization are skipped.</li>
 <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Delivers the model as an OST entity.</p>
 </td>
 </tr>
-<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.EntityHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">Entity</span></code></a></p>
+<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.EntityHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">Entity</span></code></a></p>
 </td>
 </tr>
 </tbody>
@@ -449,10 +451,8 @@ The scorers added (with their respective keys) are:</p>
 <li>&#8220;reduced&#8221;: <a class="reference internal" href="../scoring/backbone_scorers.html#promod3.scoring.ReducedScorer" title="promod3.scoring.ReducedScorer"><code class="xref py py-class docutils literal"><span class="pre">ReducedScorer</span></code></a></li>
 <li>&#8220;clash&#8221;: <a class="reference internal" href="../scoring/backbone_scorers.html#promod3.scoring.ClashScorer" title="promod3.scoring.ClashScorer"><code class="xref py py-class docutils literal"><span class="pre">ClashScorer</span></code></a></li>
 <li>&#8220;hbond&#8221;: <a class="reference internal" href="../scoring/backbone_scorers.html#promod3.scoring.HBondScorer" title="promod3.scoring.HBondScorer"><code class="xref py py-class docutils literal"><span class="pre">HBondScorer</span></code></a></li>
-<li>&#8220;ss_agreement&#8221;: <a class="reference internal" href="../scoring/backbone_scorers.html#promod3.scoring.SSAgreementScorer" title="promod3.scoring.SSAgreementScorer"><code class="xref py py-class docutils literal"><span class="pre">SSAgreementScorer</span></code></a></li>
 <li>&#8220;torsion&#8221;: <a class="reference internal" href="../scoring/backbone_scorers.html#promod3.scoring.TorsionScorer" title="promod3.scoring.TorsionScorer"><code class="xref py py-class docutils literal"><span class="pre">TorsionScorer</span></code></a></li>
 <li>&#8220;pairwise&#8221;: <a class="reference internal" href="../scoring/backbone_scorers.html#promod3.scoring.PairwiseScorer" title="promod3.scoring.PairwiseScorer"><code class="xref py py-class docutils literal"><span class="pre">PairwiseScorer</span></code></a></li>
-<li>&#8220;density&#8221;: <a class="reference internal" href="../scoring/backbone_scorers.html#promod3.scoring.DensityScorer" title="promod3.scoring.DensityScorer"><code class="xref py py-class docutils literal"><span class="pre">DensityScorer</span></code></a></li>
 </ul>
 <table class="docutils field-list" frame="void" rules="none">
 <col class="field-name" />
@@ -604,7 +604,7 @@ environments get updated in <strong>target_mhandle</strong>.</p>
 <li><strong>target_chain_idx</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; This is the chain where the info goes to</li>
 <li><strong>start_resnum</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; First residue of the copied stretch</li>
 <li><strong>end_resnum</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Last residue of the copied stretch</li>
-<li><strong>transform</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/geom/mat/#ost.geom.Mat4" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.geom.Mat4</span></code></a>) &#8211; Transformation to be applied to all atom positions when
+<li><strong>transform</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/geom/mat/#ost.geom.Mat4" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.geom.Mat4</span></code></a>) &#8211; Transformation to be applied to all atom positions when
 they&#8217;re copied over</li>
 </ul>
 </td>
@@ -635,7 +635,7 @@ while ensuring consistency with the <a class="reference internal" href="#promod3
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
 <li><strong>mhandle</strong> (<a class="reference internal" href="#promod3.modelling.ModellingHandle" title="promod3.modelling.ModellingHandle"><code class="xref py py-class docutils literal"><span class="pre">ModellingHandle</span></code></a>) &#8211; Will have the profiles attached afterwards</li>
-<li><strong>profiles</strong> (<code class="xref py py-class docutils literal"><span class="pre">list</span></code> of <a class="reference external" href="http://www.openstructure.org/docs/dev/seq/base/seq/#ost.seq.ProfileHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.seq.ProfileHandle</span></code></a>) &#8211; The sequence profiles to attach</li>
+<li><strong>profiles</strong> (<code class="xref py py-class docutils literal"><span class="pre">list</span></code> of <a class="reference external" href="https://www.openstructure.org/docs/dev/seq/base/seq/#ost.seq.ProfileHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.seq.ProfileHandle</span></code></a>) &#8211; The sequence profiles to attach</li>
 </ul>
 </td>
 </tr>
@@ -673,7 +673,7 @@ with seqres in <strong>mhandle</strong></p>
 
 <dl class="function">
 <dt id="promod3.modelling.CloseGaps">
-<code class="descclassname">promod3.modelling.</code><code class="descname">CloseGaps</code><span class="sig-paren">(</span><em>mhandle</em>, <em>merge_distance=4</em>, <em>fragment_db=None</em>, <em>structure_db=None</em>, <em>torsion_sampler=None</em>, <em>fragger_handles=None</em>, <em>chain_idx=None</em>, <em>resnum_range=None</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/promod3/modelling/_closegaps.html#CloseGaps"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#promod3.modelling.CloseGaps" title="Permalink to this definition">¶</a></dt>
+<code class="descclassname">promod3.modelling.</code><code class="descname">CloseGaps</code><span class="sig-paren">(</span><em>mhandle</em>, <em>merge_distance=4</em>, <em>fragment_db=None</em>, <em>structure_db=None</em>, <em>torsion_sampler=None</em>, <em>fragger_handles=None</em>, <em>chain_idx=None</em>, <em>resnum_range=None</em>, <em>length_dep_weights=False</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/promod3/modelling/_closegaps.html#CloseGaps"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#promod3.modelling.CloseGaps" title="Permalink to this definition">¶</a></dt>
 <dd><p>Tries to close all gaps in a model, except termini. It will go through
 following steps:</p>
 <ul class="simple">
@@ -713,6 +713,11 @@ gets executed.</li>
 processed</li>
 <li><strong>resnum_range</strong> (<code class="xref py py-class docutils literal"><span class="pre">tuple</span></code> containing two <a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; If not None, only gaps within this resnum range get
 processed.</li>
+<li><strong>length_dep_weights</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#bool" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">bool</span></code></a>) &#8211; <a class="reference internal" href="loop_candidates.html#promod3.modelling.ScoringWeights" title="promod3.modelling.ScoringWeights"><code class="xref py py-class docutils literal"><span class="pre">ScoringWeights</span></code></a> provides different sets
+of weights that have been trained on different
+loop subsets. If this flag is true, the length
+dependent weights are used to close loops with
+database / Monte Carlo.</li>
 </ul>
 </td>
 </tr>
@@ -730,19 +735,19 @@ Before diving into the more demanding tasks in modeling, those may be closed
 already in the raw-model. After closure some checks are done to see if the
 solution is stereochemically sensible.</p>
 <p>Closed gaps are removed from <code class="xref py py-attr docutils literal"><span class="pre">mhandle.gaps</span></code>.</p>
-<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">ost</span> <span class="kn">import</span> <span class="n">io</span><span class="p">,</span> <span class="n">seq</span>
-<span class="kn">from</span> <span class="nn">promod3</span> <span class="kn">import</span> <span class="n">modelling</span>
+<div class="highlight-default"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">ost</span> <span class="k">import</span> <span class="n">io</span><span class="p">,</span> <span class="n">seq</span>
+<span class="kn">from</span> <span class="nn">promod3</span> <span class="k">import</span> <span class="n">modelling</span>
 
-<span class="c"># setup</span>
-<span class="n">tpl</span> <span class="o">=</span> <span class="n">io</span><span class="o">.</span><span class="n">LoadPDB</span><span class="p">(</span><span class="s">&#39;data/gly.pdb&#39;</span><span class="p">)</span>
-<span class="n">aln</span> <span class="o">=</span> <span class="n">seq</span><span class="o">.</span><span class="n">CreateAlignment</span><span class="p">(</span><span class="n">seq</span><span class="o">.</span><span class="n">CreateSequence</span><span class="p">(</span><span class="s">&#39;trg&#39;</span><span class="p">,</span> <span class="s">&#39;GGG-GGG&#39;</span><span class="p">),</span>
-                          <span class="n">seq</span><span class="o">.</span><span class="n">CreateSequence</span><span class="p">(</span><span class="s">&#39;tpl&#39;</span><span class="p">,</span> <span class="s">&#39;GGGAGGG&#39;</span><span class="p">))</span>
+<span class="c1"># setup</span>
+<span class="n">tpl</span> <span class="o">=</span> <span class="n">io</span><span class="o">.</span><span class="n">LoadPDB</span><span class="p">(</span><span class="s1">&#39;data/gly.pdb&#39;</span><span class="p">)</span>
+<span class="n">aln</span> <span class="o">=</span> <span class="n">seq</span><span class="o">.</span><span class="n">CreateAlignment</span><span class="p">(</span><span class="n">seq</span><span class="o">.</span><span class="n">CreateSequence</span><span class="p">(</span><span class="s1">&#39;trg&#39;</span><span class="p">,</span> <span class="s1">&#39;GGG-GGG&#39;</span><span class="p">),</span>
+                          <span class="n">seq</span><span class="o">.</span><span class="n">CreateSequence</span><span class="p">(</span><span class="s1">&#39;tpl&#39;</span><span class="p">,</span> <span class="s1">&#39;GGGAGGG&#39;</span><span class="p">))</span>
 <span class="n">aln</span><span class="o">.</span><span class="n">AttachView</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="n">tpl</span><span class="o">.</span><span class="n">CreateFullView</span><span class="p">())</span>
 <span class="n">mhandle</span> <span class="o">=</span> <span class="n">modelling</span><span class="o">.</span><span class="n">BuildRawModel</span><span class="p">(</span><span class="n">aln</span><span class="p">)</span>
-<span class="c"># close small deletion</span>
-<span class="k">print</span> <span class="s">&#39;Number of gaps before: </span><span class="si">%d</span><span class="s">&#39;</span> <span class="o">%</span> <span class="nb">len</span><span class="p">(</span><span class="n">mhandle</span><span class="o">.</span><span class="n">gaps</span><span class="p">)</span>
+<span class="c1"># close small deletion</span>
+<span class="nb">print</span> <span class="s1">&#39;Number of gaps before: </span><span class="si">%d</span><span class="s1">&#39;</span> <span class="o">%</span> <span class="nb">len</span><span class="p">(</span><span class="n">mhandle</span><span class="o">.</span><span class="n">gaps</span><span class="p">)</span>
 <span class="n">modelling</span><span class="o">.</span><span class="n">CloseSmallDeletions</span><span class="p">(</span><span class="n">mhandle</span><span class="p">)</span>
-<span class="k">print</span> <span class="s">&#39;Number of gaps after: </span><span class="si">%d</span><span class="s">&#39;</span> <span class="o">%</span> <span class="nb">len</span><span class="p">(</span><span class="n">mhandle</span><span class="o">.</span><span class="n">gaps</span><span class="p">)</span>
+<span class="nb">print</span> <span class="s1">&#39;Number of gaps after: </span><span class="si">%d</span><span class="s1">&#39;</span> <span class="o">%</span> <span class="nb">len</span><span class="p">(</span><span class="n">mhandle</span><span class="o">.</span><span class="n">gaps</span><span class="p">)</span>
 </pre></div>
 </div>
 <table class="docutils field-list" frame="void" rules="none">
@@ -763,7 +768,8 @@ The gap is penalized according as
 For the scondary-structure-penalty to work,
 the model-template must have the appropriate
 information before <a class="reference internal" href="#promod3.modelling.BuildRawModel" title="promod3.modelling.BuildRawModel"><code class="xref py py-func docutils literal"><span class="pre">BuildRawModel()</span></code></a> is
-called (e.g. with <a class="reference external" href="http://www.openstructure.org/docs/dev/bindings/dssp/#module-ost.bindings.dssp" title="(in OpenStructure v1.6.0)"><code class="xref py py-mod docutils literal"><span class="pre">ost.bindings.dssp</span></code></a>).</li>
+called (e.g. with 
+<a class="reference external" href="https://www.openstructure.org/docs/dev/mol/alg/molalg/#ost.mol.alg.AssignSecStruct" title="(in OpenStructure v1.7.1)"><code class="xref py py-meth docutils literal"><span class="pre">ost.mol.alg.AssignSecStruct()</span></code></a>).</li>
 <li><strong>use_full_extender</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#bool" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">bool</span></code></a>) &#8211; True = use <a class="reference internal" href="gap_handling.html#promod3.modelling.FullGapExtender" title="promod3.modelling.FullGapExtender"><code class="xref py py-class docutils literal"><span class="pre">FullGapExtender</span></code></a> instead of
 of <a class="reference internal" href="gap_handling.html#promod3.modelling.GapExtender" title="promod3.modelling.GapExtender"><code class="xref py py-class docutils literal"><span class="pre">GapExtender</span></code></a>. Also works in combination
 with <cite>use_scoring_extender</cite>. This allows the gap
@@ -796,21 +802,21 @@ stretch of original gaps and the deleted region. Original gaps will be
 removed. Stem residues count to the gap, so <strong>A-A-A</strong> has a distance of 0.</p>
 <p>IMPORTANT: we assume here that <em>mhandle</em> stores gaps sequentially.
 Non-sequential gaps are ignored!</p>
-<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">ost</span> <span class="kn">import</span> <span class="n">io</span><span class="p">,</span> <span class="n">seq</span>
-<span class="kn">from</span> <span class="nn">promod3</span> <span class="kn">import</span> <span class="n">modelling</span>
+<div class="highlight-default"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">ost</span> <span class="k">import</span> <span class="n">io</span><span class="p">,</span> <span class="n">seq</span>
+<span class="kn">from</span> <span class="nn">promod3</span> <span class="k">import</span> <span class="n">modelling</span>
 
-<span class="c"># setup</span>
-<span class="n">tpl</span> <span class="o">=</span> <span class="n">io</span><span class="o">.</span><span class="n">LoadPDB</span><span class="p">(</span><span class="s">&#39;data/1crn_cut.pdb&#39;</span><span class="p">)</span>
-<span class="n">seq_trg</span> <span class="o">=</span> <span class="s">&#39;TTCCPSIVARSNFNVCRLPGTPEAICATGYTCIIIPGATCPGDYAN&#39;</span>
-<span class="n">seq_tpl</span> <span class="o">=</span> <span class="s">&#39;TTCCPSIVARSNFNVCRLPGTPEA----G--CIIIPGATCPGDYAN&#39;</span>
-<span class="n">aln</span> <span class="o">=</span> <span class="n">seq</span><span class="o">.</span><span class="n">CreateAlignment</span><span class="p">(</span><span class="n">seq</span><span class="o">.</span><span class="n">CreateSequence</span><span class="p">(</span><span class="s">&#39;trg&#39;</span><span class="p">,</span> <span class="n">seq_trg</span><span class="p">),</span>
-                          <span class="n">seq</span><span class="o">.</span><span class="n">CreateSequence</span><span class="p">(</span><span class="s">&#39;tpl&#39;</span><span class="p">,</span> <span class="n">seq_tpl</span><span class="p">))</span>
+<span class="c1"># setup</span>
+<span class="n">tpl</span> <span class="o">=</span> <span class="n">io</span><span class="o">.</span><span class="n">LoadPDB</span><span class="p">(</span><span class="s1">&#39;data/1crn_cut.pdb&#39;</span><span class="p">)</span>
+<span class="n">seq_trg</span> <span class="o">=</span> <span class="s1">&#39;TTCCPSIVARSNFNVCRLPGTPEAICATGYTCIIIPGATCPGDYAN&#39;</span>
+<span class="n">seq_tpl</span> <span class="o">=</span> <span class="s1">&#39;TTCCPSIVARSNFNVCRLPGTPEA----G--CIIIPGATCPGDYAN&#39;</span>
+<span class="n">aln</span> <span class="o">=</span> <span class="n">seq</span><span class="o">.</span><span class="n">CreateAlignment</span><span class="p">(</span><span class="n">seq</span><span class="o">.</span><span class="n">CreateSequence</span><span class="p">(</span><span class="s1">&#39;trg&#39;</span><span class="p">,</span> <span class="n">seq_trg</span><span class="p">),</span>
+                          <span class="n">seq</span><span class="o">.</span><span class="n">CreateSequence</span><span class="p">(</span><span class="s1">&#39;tpl&#39;</span><span class="p">,</span> <span class="n">seq_tpl</span><span class="p">))</span>
 <span class="n">aln</span><span class="o">.</span><span class="n">AttachView</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="n">tpl</span><span class="o">.</span><span class="n">CreateFullView</span><span class="p">())</span>
 <span class="n">mhandle</span> <span class="o">=</span> <span class="n">modelling</span><span class="o">.</span><span class="n">BuildRawModel</span><span class="p">(</span><span class="n">aln</span><span class="p">)</span>
-<span class="c"># merge gaps</span>
-<span class="k">print</span> <span class="s">&#39;Number of gaps before: </span><span class="si">%d</span><span class="s">&#39;</span> <span class="o">%</span> <span class="nb">len</span><span class="p">(</span><span class="n">mhandle</span><span class="o">.</span><span class="n">gaps</span><span class="p">)</span>
+<span class="c1"># merge gaps</span>
+<span class="nb">print</span> <span class="s1">&#39;Number of gaps before: </span><span class="si">%d</span><span class="s1">&#39;</span> <span class="o">%</span> <span class="nb">len</span><span class="p">(</span><span class="n">mhandle</span><span class="o">.</span><span class="n">gaps</span><span class="p">)</span>
 <span class="n">modelling</span><span class="o">.</span><span class="n">MergeGapsByDistance</span><span class="p">(</span><span class="n">mhandle</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
-<span class="k">print</span> <span class="s">&#39;Number of gaps after: </span><span class="si">%d</span><span class="s">&#39;</span> <span class="o">%</span> <span class="nb">len</span><span class="p">(</span><span class="n">mhandle</span><span class="o">.</span><span class="n">gaps</span><span class="p">)</span>
+<span class="nb">print</span> <span class="s1">&#39;Number of gaps after: </span><span class="si">%d</span><span class="s1">&#39;</span> <span class="o">%</span> <span class="nb">len</span><span class="p">(</span><span class="n">mhandle</span><span class="o">.</span><span class="n">gaps</span><span class="p">)</span>
 </pre></div>
 </div>
 <table class="docutils field-list" frame="void" rules="none">
@@ -834,29 +840,29 @@ both in this resnum range.</li>
 
 <dl class="function">
 <dt id="promod3.modelling.FillLoopsByDatabase">
-<code class="descclassname">promod3.modelling.</code><code class="descname">FillLoopsByDatabase</code><span class="sig-paren">(</span><em>mhandle</em>, <em>fragment_db</em>, <em>structure_db</em>, <em>torsion_sampler</em>, <em>max_loops_to_search=40</em>, <em>min_loops_required=4</em>, <em>max_res_extension=-1</em>, <em>extended_search=True</em>, <em>use_scoring_extender=True</em>, <em>use_full_extender=True</em>, <em>score_variant=0</em>, <em>ring_punch_detection=1</em>, <em>chain_idx=None</em>, <em>resnum_range=None</em>, <em>max_num_all_atom=0</em>, <em>clash_thresh=-1</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/promod3/modelling/_closegaps.html#FillLoopsByDatabase"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#promod3.modelling.FillLoopsByDatabase" title="Permalink to this definition">¶</a></dt>
+<code class="descclassname">promod3.modelling.</code><code class="descname">FillLoopsByDatabase</code><span class="sig-paren">(</span><em>mhandle</em>, <em>fragment_db</em>, <em>structure_db</em>, <em>torsion_sampler</em>, <em>max_loops_to_search=40</em>, <em>min_loops_required=4</em>, <em>max_res_extension=-1</em>, <em>extended_search=True</em>, <em>use_scoring_extender=True</em>, <em>use_full_extender=True</em>, <em>score_variant=0</em>, <em>ring_punch_detection=1</em>, <em>chain_idx=None</em>, <em>resnum_range=None</em>, <em>max_num_all_atom=0</em>, <em>clash_thresh=-1</em>, <em>length_dep_weights=False</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/promod3/modelling/_closegaps.html#FillLoopsByDatabase"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#promod3.modelling.FillLoopsByDatabase" title="Permalink to this definition">¶</a></dt>
 <dd><p>Try to fill up loops from a structural database.</p>
 <p>Usually this will extend the gaps a bit to match candidates from the
 database. Do not expect a gap being filled in between its actual stem
 residues.
 This function cannot fill gaps at C- or N-terminal.</p>
-<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">ost</span> <span class="kn">import</span> <span class="n">io</span><span class="p">,</span> <span class="n">seq</span>
-<span class="kn">from</span> <span class="nn">promod3</span> <span class="kn">import</span> <span class="n">modelling</span><span class="p">,</span> <span class="n">loop</span>
+<div class="highlight-default"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">ost</span> <span class="k">import</span> <span class="n">io</span><span class="p">,</span> <span class="n">seq</span>
+<span class="kn">from</span> <span class="nn">promod3</span> <span class="k">import</span> <span class="n">modelling</span><span class="p">,</span> <span class="n">loop</span>
 
-<span class="c"># setup</span>
-<span class="n">tpl</span> <span class="o">=</span> <span class="n">io</span><span class="o">.</span><span class="n">LoadPDB</span><span class="p">(</span><span class="s">&#39;data/1crn_cut.pdb&#39;</span><span class="p">)</span>
-<span class="n">seq_trg</span> <span class="o">=</span> <span class="s">&#39;TTCCPSIVARSNFNVCRLPGTPEAICATYTGCIIIPGATCPGDYAN&#39;</span>
-<span class="n">seq_tpl</span> <span class="o">=</span> <span class="s">&#39;TTCCPSIVARSNFNVCRLPGTPEA------GCIIIPGATCPGDYAN&#39;</span>
-<span class="n">aln</span> <span class="o">=</span> <span class="n">seq</span><span class="o">.</span><span class="n">CreateAlignment</span><span class="p">(</span><span class="n">seq</span><span class="o">.</span><span class="n">CreateSequence</span><span class="p">(</span><span class="s">&#39;trg&#39;</span><span class="p">,</span> <span class="n">seq_trg</span><span class="p">),</span>
-                          <span class="n">seq</span><span class="o">.</span><span class="n">CreateSequence</span><span class="p">(</span><span class="s">&#39;tpl&#39;</span><span class="p">,</span> <span class="n">seq_tpl</span><span class="p">))</span>
+<span class="c1"># setup</span>
+<span class="n">tpl</span> <span class="o">=</span> <span class="n">io</span><span class="o">.</span><span class="n">LoadPDB</span><span class="p">(</span><span class="s1">&#39;data/1crn_cut.pdb&#39;</span><span class="p">)</span>
+<span class="n">seq_trg</span> <span class="o">=</span> <span class="s1">&#39;TTCCPSIVARSNFNVCRLPGTPEAICATYTGCIIIPGATCPGDYAN&#39;</span>
+<span class="n">seq_tpl</span> <span class="o">=</span> <span class="s1">&#39;TTCCPSIVARSNFNVCRLPGTPEA------GCIIIPGATCPGDYAN&#39;</span>
+<span class="n">aln</span> <span class="o">=</span> <span class="n">seq</span><span class="o">.</span><span class="n">CreateAlignment</span><span class="p">(</span><span class="n">seq</span><span class="o">.</span><span class="n">CreateSequence</span><span class="p">(</span><span class="s1">&#39;trg&#39;</span><span class="p">,</span> <span class="n">seq_trg</span><span class="p">),</span>
+                          <span class="n">seq</span><span class="o">.</span><span class="n">CreateSequence</span><span class="p">(</span><span class="s1">&#39;tpl&#39;</span><span class="p">,</span> <span class="n">seq_tpl</span><span class="p">))</span>
 <span class="n">aln</span><span class="o">.</span><span class="n">AttachView</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="n">tpl</span><span class="o">.</span><span class="n">CreateFullView</span><span class="p">())</span>
 <span class="n">mhandle</span> <span class="o">=</span> <span class="n">modelling</span><span class="o">.</span><span class="n">BuildRawModel</span><span class="p">(</span><span class="n">aln</span><span class="p">)</span>
-<span class="c"># close gaps</span>
-<span class="k">print</span> <span class="s">&#39;Number of gaps before: </span><span class="si">%d</span><span class="s">&#39;</span> <span class="o">%</span> <span class="nb">len</span><span class="p">(</span><span class="n">mhandle</span><span class="o">.</span><span class="n">gaps</span><span class="p">)</span>
+<span class="c1"># close gaps</span>
+<span class="nb">print</span> <span class="s1">&#39;Number of gaps before: </span><span class="si">%d</span><span class="s1">&#39;</span> <span class="o">%</span> <span class="nb">len</span><span class="p">(</span><span class="n">mhandle</span><span class="o">.</span><span class="n">gaps</span><span class="p">)</span>
 <span class="n">modelling</span><span class="o">.</span><span class="n">FillLoopsByDatabase</span><span class="p">(</span><span class="n">mhandle</span><span class="p">,</span> <span class="n">loop</span><span class="o">.</span><span class="n">LoadFragDB</span><span class="p">(),</span>
                               <span class="n">loop</span><span class="o">.</span><span class="n">LoadStructureDB</span><span class="p">(),</span>
                               <span class="n">loop</span><span class="o">.</span><span class="n">LoadTorsionSamplerCoil</span><span class="p">())</span>
-<span class="k">print</span> <span class="s">&#39;Number of gaps after: </span><span class="si">%d</span><span class="s">&#39;</span> <span class="o">%</span> <span class="nb">len</span><span class="p">(</span><span class="n">mhandle</span><span class="o">.</span><span class="n">gaps</span><span class="p">)</span>
+<span class="nb">print</span> <span class="s1">&#39;Number of gaps after: </span><span class="si">%d</span><span class="s1">&#39;</span> <span class="o">%</span> <span class="nb">len</span><span class="p">(</span><span class="n">mhandle</span><span class="o">.</span><span class="n">gaps</span><span class="p">)</span>
 </pre></div>
 </div>
 <table class="docutils field-list" frame="void" rules="none">
@@ -922,6 +928,11 @@ approx. 2x slower than without and will give a
 slight improvement in loop selection.</li>
 <li><strong>clash_thresh</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>) &#8211; If &gt; 0, we only keep loop candidates which have a
 backbone clash score lower than this.</li>
+<li><strong>length_dep_weights</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#bool" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">bool</span></code></a>) &#8211; <a class="reference internal" href="loop_candidates.html#promod3.modelling.ScoringWeights" title="promod3.modelling.ScoringWeights"><code class="xref py py-class docutils literal"><span class="pre">ScoringWeights</span></code></a> provides different sets
+of weights that have been trained on different
+loop subsets. If this flag is true, the length
+dependent weights are used to select the final 
+loops.</li>
 </ul>
 </td>
 </tr>
@@ -931,7 +942,7 @@ backbone clash score lower than this.</li>
 
 <dl class="function">
 <dt id="promod3.modelling.FillLoopsByMonteCarlo">
-<code class="descclassname">promod3.modelling.</code><code class="descname">FillLoopsByMonteCarlo</code><span class="sig-paren">(</span><em>mhandle</em>, <em>torsion_sampler</em>, <em>max_loops_to_search=6</em>, <em>max_extension=30</em>, <em>mc_num_loops=2</em>, <em>mc_steps=5000</em>, <em>use_scoring_extender=True</em>, <em>use_full_extender=True</em>, <em>score_variant=0</em>, <em>ring_punch_detection=1</em>, <em>fragger_handles=None</em>, <em>chain_idx=None</em>, <em>resnum_range=None</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/promod3/modelling/_closegaps.html#FillLoopsByMonteCarlo"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#promod3.modelling.FillLoopsByMonteCarlo" title="Permalink to this definition">¶</a></dt>
+<code class="descclassname">promod3.modelling.</code><code class="descname">FillLoopsByMonteCarlo</code><span class="sig-paren">(</span><em>mhandle</em>, <em>torsion_sampler</em>, <em>max_loops_to_search=6</em>, <em>max_extension=30</em>, <em>mc_num_loops=2</em>, <em>mc_steps=5000</em>, <em>use_scoring_extender=True</em>, <em>use_full_extender=True</em>, <em>score_variant=0</em>, <em>ring_punch_detection=1</em>, <em>fragger_handles=None</em>, <em>chain_idx=None</em>, <em>resnum_range=None</em>, <em>length_dep_weights=False</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/promod3/modelling/_closegaps.html#FillLoopsByMonteCarlo"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#promod3.modelling.FillLoopsByMonteCarlo" title="Permalink to this definition">¶</a></dt>
 <dd><p>Try to fill up loops with Monte Carlo sampling.</p>
 <p>This is meant as a &#8220;last-resort&#8221; approach when it is not possible to fill
 the loops from the database with <a class="reference internal" href="#promod3.modelling.FillLoopsByDatabase" title="promod3.modelling.FillLoopsByDatabase"><code class="xref py py-func docutils literal"><span class="pre">FillLoopsByDatabase()</span></code></a>.
@@ -941,22 +952,22 @@ more loop candidates to be found.</p>
 <em>fragger_handles</em> is given) <a class="reference internal" href="../loop/structure_db.html#promod3.loop.Fragger" title="promod3.loop.Fragger"><code class="xref py py-class docutils literal"><span class="pre">Fragger</span></code></a> lists. The latter
 is only used if the gap length is &gt;= the length of fragments stored.</p>
 <p>This function cannot fill gaps at C- or N-terminal.</p>
-<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">ost</span> <span class="kn">import</span> <span class="n">io</span><span class="p">,</span> <span class="n">seq</span>
-<span class="kn">from</span> <span class="nn">promod3</span> <span class="kn">import</span> <span class="n">modelling</span><span class="p">,</span> <span class="n">loop</span>
+<div class="highlight-default"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">ost</span> <span class="k">import</span> <span class="n">io</span><span class="p">,</span> <span class="n">seq</span>
+<span class="kn">from</span> <span class="nn">promod3</span> <span class="k">import</span> <span class="n">modelling</span><span class="p">,</span> <span class="n">loop</span>
 
-<span class="c"># setup</span>
-<span class="n">tpl</span> <span class="o">=</span> <span class="n">io</span><span class="o">.</span><span class="n">LoadPDB</span><span class="p">(</span><span class="s">&#39;data/1crn_cut.pdb&#39;</span><span class="p">)</span>
-<span class="n">seq_trg</span> <span class="o">=</span> <span class="s">&#39;TTCCPSIVARSNFNVCRLPGTPEAICATYTGCIIIPGATCPGDYAN&#39;</span>
-<span class="n">seq_tpl</span> <span class="o">=</span> <span class="s">&#39;TTCCPSIVARSNFNVCRLPGTPEA------GCIIIPGATCPGDYAN&#39;</span>
-<span class="n">aln</span> <span class="o">=</span> <span class="n">seq</span><span class="o">.</span><span class="n">CreateAlignment</span><span class="p">(</span><span class="n">seq</span><span class="o">.</span><span class="n">CreateSequence</span><span class="p">(</span><span class="s">&#39;trg&#39;</span><span class="p">,</span> <span class="n">seq_trg</span><span class="p">),</span>
-                          <span class="n">seq</span><span class="o">.</span><span class="n">CreateSequence</span><span class="p">(</span><span class="s">&#39;tpl&#39;</span><span class="p">,</span> <span class="n">seq_tpl</span><span class="p">))</span>
+<span class="c1"># setup</span>
+<span class="n">tpl</span> <span class="o">=</span> <span class="n">io</span><span class="o">.</span><span class="n">LoadPDB</span><span class="p">(</span><span class="s1">&#39;data/1crn_cut.pdb&#39;</span><span class="p">)</span>
+<span class="n">seq_trg</span> <span class="o">=</span> <span class="s1">&#39;TTCCPSIVARSNFNVCRLPGTPEAICATYTGCIIIPGATCPGDYAN&#39;</span>
+<span class="n">seq_tpl</span> <span class="o">=</span> <span class="s1">&#39;TTCCPSIVARSNFNVCRLPGTPEA------GCIIIPGATCPGDYAN&#39;</span>
+<span class="n">aln</span> <span class="o">=</span> <span class="n">seq</span><span class="o">.</span><span class="n">CreateAlignment</span><span class="p">(</span><span class="n">seq</span><span class="o">.</span><span class="n">CreateSequence</span><span class="p">(</span><span class="s1">&#39;trg&#39;</span><span class="p">,</span> <span class="n">seq_trg</span><span class="p">),</span>
+                          <span class="n">seq</span><span class="o">.</span><span class="n">CreateSequence</span><span class="p">(</span><span class="s1">&#39;tpl&#39;</span><span class="p">,</span> <span class="n">seq_tpl</span><span class="p">))</span>
 <span class="n">aln</span><span class="o">.</span><span class="n">AttachView</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="n">tpl</span><span class="o">.</span><span class="n">CreateFullView</span><span class="p">())</span>
 <span class="n">mhandle</span> <span class="o">=</span> <span class="n">modelling</span><span class="o">.</span><span class="n">BuildRawModel</span><span class="p">(</span><span class="n">aln</span><span class="p">)</span>
-<span class="c"># close gaps</span>
-<span class="k">print</span> <span class="s">&#39;Number of gaps before: </span><span class="si">%d</span><span class="s">&#39;</span> <span class="o">%</span> <span class="nb">len</span><span class="p">(</span><span class="n">mhandle</span><span class="o">.</span><span class="n">gaps</span><span class="p">)</span>
+<span class="c1"># close gaps</span>
+<span class="nb">print</span> <span class="s1">&#39;Number of gaps before: </span><span class="si">%d</span><span class="s1">&#39;</span> <span class="o">%</span> <span class="nb">len</span><span class="p">(</span><span class="n">mhandle</span><span class="o">.</span><span class="n">gaps</span><span class="p">)</span>
 <span class="n">modelling</span><span class="o">.</span><span class="n">FillLoopsByMonteCarlo</span><span class="p">(</span><span class="n">mhandle</span><span class="p">,</span>
                               	<span class="n">loop</span><span class="o">.</span><span class="n">LoadTorsionSamplerCoil</span><span class="p">())</span>
-<span class="k">print</span> <span class="s">&#39;Number of gaps after: </span><span class="si">%d</span><span class="s">&#39;</span> <span class="o">%</span> <span class="nb">len</span><span class="p">(</span><span class="n">mhandle</span><span class="o">.</span><span class="n">gaps</span><span class="p">)</span>
+<span class="nb">print</span> <span class="s1">&#39;Number of gaps after: </span><span class="si">%d</span><span class="s1">&#39;</span> <span class="o">%</span> <span class="nb">len</span><span class="p">(</span><span class="n">mhandle</span><span class="o">.</span><span class="n">gaps</span><span class="p">)</span>
 </pre></div>
 </div>
 <table class="docutils field-list" frame="void" rules="none">
@@ -990,6 +1001,11 @@ fragger handle for each chain in <em>mhandle</em>.</li>
 processed</li>
 <li><strong>resnum_range</strong> (<code class="xref py py-class docutils literal"><span class="pre">tuple</span></code> containing two <a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; If not None, only gaps within this resnum range get
 processed</li>
+<li><strong>length_dep_weights</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#bool" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">bool</span></code></a>) &#8211; <a class="reference internal" href="loop_candidates.html#promod3.modelling.ScoringWeights" title="promod3.modelling.ScoringWeights"><code class="xref py py-class docutils literal"><span class="pre">ScoringWeights</span></code></a> provides different sets
+of weights that have been trained on different
+loop subsets. If this flag is true, the length
+dependent weights are used to select the final 
+loops.</li>
 </ul>
 </td>
 </tr>
@@ -1044,22 +1060,22 @@ but we do not assume that the resulting termini are of high quality!</p>
 <em>fragger_handles</em> is given) <a class="reference internal" href="../loop/structure_db.html#promod3.loop.Fragger" title="promod3.loop.Fragger"><code class="xref py py-class docutils literal"><span class="pre">Fragger</span></code></a> lists. The latter
 is only used if the gap length is &gt;= the length of fragments stored.</p>
 <p>Terminal gaps of length 1 are ignored by this function!</p>
-<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">ost</span> <span class="kn">import</span> <span class="n">io</span><span class="p">,</span> <span class="n">seq</span>
-<span class="kn">from</span> <span class="nn">promod3</span> <span class="kn">import</span> <span class="n">modelling</span><span class="p">,</span> <span class="n">loop</span>
+<div class="highlight-default"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">ost</span> <span class="k">import</span> <span class="n">io</span><span class="p">,</span> <span class="n">seq</span>
+<span class="kn">from</span> <span class="nn">promod3</span> <span class="k">import</span> <span class="n">modelling</span><span class="p">,</span> <span class="n">loop</span>
 
-<span class="c"># setup</span>
-<span class="n">tpl</span> <span class="o">=</span> <span class="n">io</span><span class="o">.</span><span class="n">LoadPDB</span><span class="p">(</span><span class="s">&#39;data/gly.pdb&#39;</span><span class="p">)</span>
-<span class="n">seq_trg</span> <span class="o">=</span> <span class="s">&#39;AAAAGGGGGGGGGGGGGGGGGGGGAAAAAA&#39;</span>
-<span class="n">seq_tpl</span> <span class="o">=</span> <span class="s">&#39;----GGGGGGGGGGGGGGGGGGGG------&#39;</span>
-<span class="n">aln</span> <span class="o">=</span> <span class="n">seq</span><span class="o">.</span><span class="n">CreateAlignment</span><span class="p">(</span><span class="n">seq</span><span class="o">.</span><span class="n">CreateSequence</span><span class="p">(</span><span class="s">&#39;trg&#39;</span><span class="p">,</span> <span class="n">seq_trg</span><span class="p">),</span>
-                          <span class="n">seq</span><span class="o">.</span><span class="n">CreateSequence</span><span class="p">(</span><span class="s">&#39;tpl&#39;</span><span class="p">,</span> <span class="n">seq_tpl</span><span class="p">))</span>
+<span class="c1"># setup</span>
+<span class="n">tpl</span> <span class="o">=</span> <span class="n">io</span><span class="o">.</span><span class="n">LoadPDB</span><span class="p">(</span><span class="s1">&#39;data/gly.pdb&#39;</span><span class="p">)</span>
+<span class="n">seq_trg</span> <span class="o">=</span> <span class="s1">&#39;AAAAGGGGGGGGGGGGGGGGGGGGAAAAAA&#39;</span>
+<span class="n">seq_tpl</span> <span class="o">=</span> <span class="s1">&#39;----GGGGGGGGGGGGGGGGGGGG------&#39;</span>
+<span class="n">aln</span> <span class="o">=</span> <span class="n">seq</span><span class="o">.</span><span class="n">CreateAlignment</span><span class="p">(</span><span class="n">seq</span><span class="o">.</span><span class="n">CreateSequence</span><span class="p">(</span><span class="s1">&#39;trg&#39;</span><span class="p">,</span> <span class="n">seq_trg</span><span class="p">),</span>
+                          <span class="n">seq</span><span class="o">.</span><span class="n">CreateSequence</span><span class="p">(</span><span class="s1">&#39;tpl&#39;</span><span class="p">,</span> <span class="n">seq_tpl</span><span class="p">))</span>
 <span class="n">aln</span><span class="o">.</span><span class="n">AttachView</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="n">tpl</span><span class="o">.</span><span class="n">CreateFullView</span><span class="p">())</span>
 <span class="n">mhandle</span> <span class="o">=</span> <span class="n">modelling</span><span class="o">.</span><span class="n">BuildRawModel</span><span class="p">(</span><span class="n">aln</span><span class="p">)</span>
-<span class="c"># close gaps</span>
-<span class="k">print</span> <span class="s">&#39;Number of gaps before: </span><span class="si">%d</span><span class="s">&#39;</span> <span class="o">%</span> <span class="nb">len</span><span class="p">(</span><span class="n">mhandle</span><span class="o">.</span><span class="n">gaps</span><span class="p">)</span>
+<span class="c1"># close gaps</span>
+<span class="nb">print</span> <span class="s1">&#39;Number of gaps before: </span><span class="si">%d</span><span class="s1">&#39;</span> <span class="o">%</span> <span class="nb">len</span><span class="p">(</span><span class="n">mhandle</span><span class="o">.</span><span class="n">gaps</span><span class="p">)</span>
 <span class="n">modelling</span><span class="o">.</span><span class="n">ModelTermini</span><span class="p">(</span><span class="n">mhandle</span><span class="p">,</span>
                        <span class="n">loop</span><span class="o">.</span><span class="n">LoadTorsionSamplerCoil</span><span class="p">())</span>
-<span class="k">print</span> <span class="s">&#39;Number of gaps after: </span><span class="si">%d</span><span class="s">&#39;</span> <span class="o">%</span> <span class="nb">len</span><span class="p">(</span><span class="n">mhandle</span><span class="o">.</span><span class="n">gaps</span><span class="p">)</span>
+<span class="nb">print</span> <span class="s1">&#39;Number of gaps after: </span><span class="si">%d</span><span class="s1">&#39;</span> <span class="o">%</span> <span class="nb">len</span><span class="p">(</span><span class="n">mhandle</span><span class="o">.</span><span class="n">gaps</span><span class="p">)</span>
 </pre></div>
 </div>
 <table class="docutils field-list" frame="void" rules="none">
@@ -1118,7 +1134,7 @@ if None.</li>
 <dt id="promod3.modelling.MinimizeModelEnergy">
 <code class="descclassname">promod3.modelling.</code><code class="descname">MinimizeModelEnergy</code><span class="sig-paren">(</span><em>mhandle</em>, <em>max_iterations=12</em>, <em>max_iter_sd=20</em>, <em>max_iter_lbfgs=10</em>, <em>use_amber_ff=False</em>, <em>extra_force_fields=[]</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/promod3/modelling/_pipeline.html#MinimizeModelEnergy"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#promod3.modelling.MinimizeModelEnergy" title="Permalink to this definition">¶</a></dt>
 <dd><p>Minimize energy of final model using molecular mechanics.</p>
-<p>Uses <code class="xref py py-mod docutils literal"><span class="pre">ost.mol.mm</span></code> to perform energy minimization.
+<p>Uses <a class="reference external" href="https://www.openstructure.org/docs/dev/mol/mm/molmm/#module-ost.mol.mm" title="(in OpenStructure v1.7.1)"><code class="xref py py-mod docutils literal"><span class="pre">ost.mol.mm</span></code></a> to perform energy minimization.
 It will iteratively (at most <em>max_iterations</em> times):</p>
 <ul class="simple">
 <li>run up to <em>max_iter_sd</em> minimization iter. of a steepest descend method</li>
@@ -1142,7 +1158,7 @@ If the variable is not set, 1 thread will be used by default.</p>
 <li><strong>max_iter_lbfgs</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Max. number of iterations within LBFGS method</li>
 <li><strong>use_amber_ff</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#bool" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">bool</span></code></a>) &#8211; if True, use the AMBER force field instead of the def.
 CHARMM one (see <a class="reference internal" href="#promod3.modelling.BuildFromRawModel" title="promod3.modelling.BuildFromRawModel"><code class="xref py py-meth docutils literal"><span class="pre">BuildFromRawModel()</span></code></a>).</li>
-<li><strong>extra_force_fields</strong> (<code class="xref py py-class docutils literal"><span class="pre">list</span></code> of <a class="reference external" href="http://www.openstructure.org/docs/dev/mol/mm/forcefield/#ost.mol.mm.Forcefield" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.mm.Forcefield</span></code></a>) &#8211; Additional list of force fields to use (see
+<li><strong>extra_force_fields</strong> (<code class="xref py py-class docutils literal"><span class="pre">list</span></code> of <a class="reference external" href="https://www.openstructure.org/docs/dev/mol/mm/forcefield/#ost.mol.mm.Forcefield" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.mm.Forcefield</span></code></a>) &#8211; Additional list of force fields to use (see
 <a class="reference internal" href="#promod3.modelling.BuildFromRawModel" title="promod3.modelling.BuildFromRawModel"><code class="xref py py-meth docutils literal"><span class="pre">BuildFromRawModel()</span></code></a>).</li>
 </ul>
 </td>
@@ -1150,7 +1166,7 @@ CHARMM one (see <a class="reference internal" href="#promod3.modelling.BuildFrom
 <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The model including all oxygens as used in the minimizer.</p>
 </td>
 </tr>
-<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.EntityHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">Entity</span></code></a></p>
+<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.EntityHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">Entity</span></code></a></p>
 </td>
 </tr>
 </tbody>
@@ -1217,9 +1233,6 @@ CHARMM one (see <a class="reference internal" href="#promod3.modelling.BuildFrom
       <input type="hidden" name="check_keywords" value="yes" />
       <input type="hidden" name="area" value="default" />
     </form>
-    <p class="searchtip" style="font-size: 90%">
-    Enter search terms or a module, class or function name.
-    </p>
 </div>
 <script type="text/javascript">$('#searchbox').show(0);</script>
         </div>
@@ -1227,11 +1240,11 @@ CHARMM one (see <a class="reference internal" href="#promod3.modelling.BuildFrom
       <div class="clearer"></div>
     </div>
     <div class="footer">
-      &copy;2017, ProMod3 authors.
+      &copy;2018, ProMod3 authors.
       
       |
-      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a>
-      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.6</a>
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.4.1</a>
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
       
       |
       <a href="../_sources/modelling/pipeline.txt"
diff --git a/doc/html/modelling/sidechain_reconstruction.html b/doc/html/modelling/sidechain_reconstruction.html
index e5940d829e08a43dfb35a33ca4a8b2867f4ca481..85e5fae720597dac6cad027ccab4fa3d2bf0d636 100644
--- a/doc/html/modelling/sidechain_reconstruction.html
+++ b/doc/html/modelling/sidechain_reconstruction.html
@@ -6,7 +6,7 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
-    <title>Sidechain Reconstruction &mdash; ProMod3 1.1.0 documentation</title>
+    <title>Sidechain Reconstruction &mdash; ProMod3 1.2.0 documentation</title>
     
     <link rel="stylesheet" href="../_static/alabaster.css" type="text/css" />
     <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
@@ -14,7 +14,7 @@
     <script type="text/javascript">
       var DOCUMENTATION_OPTIONS = {
         URL_ROOT:    '../',
-        VERSION:     '1.1.0',
+        VERSION:     '1.2.0',
         COLLAPSE_INDEX: false,
         FILE_SUFFIX: '.html',
         HAS_SOURCE:  true
@@ -23,16 +23,18 @@
     <script type="text/javascript" src="../_static/jquery.js"></script>
     <script type="text/javascript" src="../_static/underscore.js"></script>
     <script type="text/javascript" src="../_static/doctools.js"></script>
-    <link rel="top" title="ProMod3 1.1.0 documentation" href="../index.html" />
+    <link rel="top" title="ProMod3 1.2.0 documentation" href="../index.html" />
     <link rel="up" title="modelling - Protein Modelling" href="index.html" />
     <link rel="next" title="Modelling Algorithms" href="algorithms.html" />
     <link rel="prev" title="Generating Loops De Novo" href="monte_carlo.html" />
    
+  <link rel="stylesheet" href="../_static/custom.css" type="text/css" />
   
-  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
 
   </head>
-  <body role="document">  
+  <body role="document">
+  
 
     <div class="document">
       <div class="documentwrapper">
@@ -44,48 +46,48 @@
 <p>Two methods are provided to fully reconstruct sidechains of residues:</p>
 <ul class="simple">
 <li>the <a class="reference internal" href="#promod3.modelling.ReconstructSidechains" title="promod3.modelling.ReconstructSidechains"><code class="xref py py-func docutils literal"><span class="pre">ReconstructSidechains()</span></code></a> function handles a full OST
-<a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.EntityHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">EntityHandle</span></code></a></li>
+<a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.EntityHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">EntityHandle</span></code></a></li>
 <li>the <a class="reference internal" href="#promod3.modelling.SidechainReconstructor" title="promod3.modelling.SidechainReconstructor"><code class="xref py py-class docutils literal"><span class="pre">SidechainReconstructor</span></code></a> is linked to an all atom environment
 and used to reconstruct sidechains of single loops</li>
 </ul>
 <p>Example usage:</p>
-<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">ost</span> <span class="kn">import</span> <span class="n">io</span><span class="p">,</span> <span class="n">mol</span>
-<span class="kn">from</span> <span class="nn">promod3</span> <span class="kn">import</span> <span class="n">modelling</span>
+<div class="highlight-default"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">ost</span> <span class="k">import</span> <span class="n">io</span><span class="p">,</span> <span class="n">mol</span>
+<span class="kn">from</span> <span class="nn">promod3</span> <span class="k">import</span> <span class="n">modelling</span>
 
-<span class="c"># load a protein </span>
-<span class="n">prot</span> <span class="o">=</span> <span class="n">io</span><span class="o">.</span><span class="n">LoadPDB</span><span class="p">(</span><span class="s">&#39;data/1CRN.pdb&#39;</span><span class="p">)</span>
-<span class="c"># get only amino acids</span>
-<span class="n">prot</span> <span class="o">=</span> <span class="n">mol</span><span class="o">.</span><span class="n">CreateEntityFromView</span><span class="p">(</span><span class="n">prot</span><span class="o">.</span><span class="n">Select</span><span class="p">(</span><span class="s">&quot;peptide=true&quot;</span><span class="p">),</span> <span class="bp">True</span><span class="p">)</span>
-<span class="n">io</span><span class="o">.</span><span class="n">SavePDB</span><span class="p">(</span><span class="n">prot</span><span class="p">,</span> <span class="s">&#39;sidechain_test_orig.pdb&#39;</span><span class="p">)</span>
-<span class="c"># reconstruct sidechains</span>
-<span class="n">modelling</span><span class="o">.</span><span class="n">ReconstructSidechains</span><span class="p">(</span><span class="n">prot</span><span class="p">,</span> <span class="n">keep_sidechains</span><span class="o">=</span><span class="bp">False</span><span class="p">)</span>
-<span class="n">io</span><span class="o">.</span><span class="n">SavePDB</span><span class="p">(</span><span class="n">prot</span><span class="p">,</span> <span class="s">&#39;sidechain_test_rec.pdb&#39;</span><span class="p">)</span>
+<span class="c1"># load a protein </span>
+<span class="n">prot</span> <span class="o">=</span> <span class="n">io</span><span class="o">.</span><span class="n">LoadPDB</span><span class="p">(</span><span class="s1">&#39;data/1CRN.pdb&#39;</span><span class="p">)</span>
+<span class="c1"># get only amino acids</span>
+<span class="n">prot</span> <span class="o">=</span> <span class="n">mol</span><span class="o">.</span><span class="n">CreateEntityFromView</span><span class="p">(</span><span class="n">prot</span><span class="o">.</span><span class="n">Select</span><span class="p">(</span><span class="s2">&quot;peptide=true&quot;</span><span class="p">),</span> <span class="kc">True</span><span class="p">)</span>
+<span class="n">io</span><span class="o">.</span><span class="n">SavePDB</span><span class="p">(</span><span class="n">prot</span><span class="p">,</span> <span class="s1">&#39;sidechain_test_orig.pdb&#39;</span><span class="p">)</span>
+<span class="c1"># reconstruct sidechains</span>
+<span class="n">modelling</span><span class="o">.</span><span class="n">ReconstructSidechains</span><span class="p">(</span><span class="n">prot</span><span class="p">,</span> <span class="n">keep_sidechains</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
+<span class="n">io</span><span class="o">.</span><span class="n">SavePDB</span><span class="p">(</span><span class="n">prot</span><span class="p">,</span> <span class="s1">&#39;sidechain_test_rec.pdb&#39;</span><span class="p">)</span>
 </pre></div>
 </div>
-<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">ost</span> <span class="kn">import</span> <span class="n">io</span>
-<span class="kn">from</span> <span class="nn">promod3</span> <span class="kn">import</span> <span class="n">loop</span><span class="p">,</span> <span class="n">modelling</span>
+<div class="highlight-default"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">ost</span> <span class="k">import</span> <span class="n">io</span>
+<span class="kn">from</span> <span class="nn">promod3</span> <span class="k">import</span> <span class="n">loop</span><span class="p">,</span> <span class="n">modelling</span>
 
-<span class="c"># load example (has res. numbering starting at 1)</span>
-<span class="n">prot</span> <span class="o">=</span> <span class="n">io</span><span class="o">.</span><span class="n">LoadPDB</span><span class="p">(</span><span class="s">&#39;data/1CRN.pdb&#39;</span><span class="p">)</span>
+<span class="c1"># load example (has res. numbering starting at 1)</span>
+<span class="n">prot</span> <span class="o">=</span> <span class="n">io</span><span class="o">.</span><span class="n">LoadPDB</span><span class="p">(</span><span class="s1">&#39;data/1CRN.pdb&#39;</span><span class="p">)</span>
 <span class="n">res_list</span> <span class="o">=</span> <span class="n">prot</span><span class="o">.</span><span class="n">residues</span>
-<span class="n">seqres_str</span> <span class="o">=</span> <span class="s">&#39;&#39;</span><span class="o">.</span><span class="n">join</span><span class="p">([</span><span class="n">r</span><span class="o">.</span><span class="n">one_letter_code</span> <span class="k">for</span> <span class="n">r</span> <span class="ow">in</span> <span class="n">res_list</span><span class="p">])</span>
+<span class="n">seqres_str</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="o">.</span><span class="n">join</span><span class="p">([</span><span class="n">r</span><span class="o">.</span><span class="n">one_letter_code</span> <span class="k">for</span> <span class="n">r</span> <span class="ow">in</span> <span class="n">res_list</span><span class="p">])</span>
 
-<span class="c"># initialize AllAtom environment and sidechain reconstructor</span>
+<span class="c1"># initialize AllAtom environment and sidechain reconstructor</span>
 <span class="n">env</span> <span class="o">=</span> <span class="n">loop</span><span class="o">.</span><span class="n">AllAtomEnv</span><span class="p">(</span><span class="n">seqres_str</span><span class="p">)</span>
 <span class="n">env</span><span class="o">.</span><span class="n">SetInitialEnvironment</span><span class="p">(</span><span class="n">prot</span><span class="p">)</span>
-<span class="n">sc_rec</span> <span class="o">=</span> <span class="n">modelling</span><span class="o">.</span><span class="n">SidechainReconstructor</span><span class="p">(</span><span class="n">keep_sidechains</span><span class="o">=</span><span class="bp">False</span><span class="p">)</span>
+<span class="n">sc_rec</span> <span class="o">=</span> <span class="n">modelling</span><span class="o">.</span><span class="n">SidechainReconstructor</span><span class="p">(</span><span class="n">keep_sidechains</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
 <span class="n">sc_rec</span><span class="o">.</span><span class="n">AttachEnvironment</span><span class="p">(</span><span class="n">env</span><span class="p">)</span>
 
-<span class="c"># reconstruct subset (res. num. 6..10)</span>
+<span class="c1"># reconstruct subset (res. num. 6..10)</span>
 <span class="n">res</span> <span class="o">=</span> <span class="n">sc_rec</span><span class="o">.</span><span class="n">Reconstruct</span><span class="p">(</span><span class="mi">6</span><span class="p">,</span> <span class="mi">5</span><span class="p">)</span>
-<span class="c"># reconstruct two loops (6..10 and 20..25)</span>
+<span class="c1"># reconstruct two loops (6..10 and 20..25)</span>
 <span class="n">res</span> <span class="o">=</span> <span class="n">sc_rec</span><span class="o">.</span><span class="n">Reconstruct</span><span class="p">(</span><span class="n">start_resnum_list</span><span class="o">=</span><span class="p">[</span><span class="mi">6</span><span class="p">,</span> <span class="mi">20</span><span class="p">],</span>
                          <span class="n">num_residues_list</span><span class="o">=</span><span class="p">[</span><span class="mi">5</span><span class="p">,</span> <span class="mi">6</span><span class="p">],</span>
                          <span class="n">chain_idx_list</span><span class="o">=</span><span class="p">[</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">])</span>
-<span class="c"># update environment with solution</span>
+<span class="c1"># update environment with solution</span>
 <span class="n">env</span><span class="o">.</span><span class="n">SetEnvironment</span><span class="p">(</span><span class="n">res</span><span class="o">.</span><span class="n">env_pos</span><span class="p">)</span>
-<span class="c"># store all positions of environment</span>
-<span class="n">io</span><span class="o">.</span><span class="n">SavePDB</span><span class="p">(</span><span class="n">env</span><span class="o">.</span><span class="n">GetAllAtomPositions</span><span class="p">()</span><span class="o">.</span><span class="n">ToEntity</span><span class="p">(),</span> <span class="s">&#39;sc_rec_test.pdb&#39;</span><span class="p">)</span>
+<span class="c1"># store all positions of environment</span>
+<span class="n">io</span><span class="o">.</span><span class="n">SavePDB</span><span class="p">(</span><span class="n">env</span><span class="o">.</span><span class="n">GetAllAtomPositions</span><span class="p">()</span><span class="o">.</span><span class="n">ToEntity</span><span class="p">(),</span> <span class="s1">&#39;sc_rec_test.pdb&#39;</span><span class="p">)</span>
 </pre></div>
 </div>
 <div class="section" id="reconstruct-function">
@@ -99,7 +101,7 @@ and used to reconstruct sidechains of single loops</li>
 <col class="field-body" />
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
-<li><strong>ent</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.EntityHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.EntityHandle</span></code></a>) &#8211; Structure for sidechain reconstruction. Note, that the sidechain
+<li><strong>ent</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.EntityHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.EntityHandle</span></code></a>) &#8211; Structure for sidechain reconstruction. Note, that the sidechain
 reconstruction gets directly applied on the structure itself.</li>
 <li><strong>keep_sidechains</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#bool" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">bool</span></code></a>) &#8211; Flag, whether complete sidechains in <em>ent</em> (i.e. 
 containing all required atoms) should be kept rigid
@@ -180,9 +182,9 @@ residues within <em>remodel_cutoff</em> already have a
 sidechain, the <em>rigid_frame_cutoff</em> won&#8217;t have any
 effect.</li>
 <li><strong>graph_max_complexity</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Max. complexity for
-<a class="reference internal" href="../sidechain/graph.html#promod3.sidechain.RotamerGraph.TreeSolve" title="promod3.sidechain.RotamerGraph.TreeSolve"><code class="xref py py-meth docutils literal"><span class="pre">promod3.sidechain.RotamerGraph.TreeSolve()</span></code></a>.</li>
+<code class="xref py py-meth docutils literal"><span class="pre">promod3.sidechain.RotamerGraph.TreeSolve()</span></code>.</li>
 <li><strong>graph_intial_epsilon</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>) &#8211; Initial epsilon for
-<a class="reference internal" href="../sidechain/graph.html#promod3.sidechain.RotamerGraph.TreeSolve" title="promod3.sidechain.RotamerGraph.TreeSolve"><code class="xref py py-meth docutils literal"><span class="pre">promod3.sidechain.RotamerGraph.TreeSolve()</span></code></a>.</li>
+<code class="xref py py-meth docutils literal"><span class="pre">promod3.sidechain.RotamerGraph.TreeSolve()</span></code>.</li>
 <li><strong>disulfid_score_thresh</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>) &#8211; If <code class="xref py py-meth docutils literal"><span class="pre">DisulfidScore()</span></code> between two CYS is
 below this threshold, we consider them to be
 disulfid-bonded.</li>
@@ -210,7 +212,7 @@ environment before calling this!</p>
 <col class="field-body" />
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
-<li><strong>start_resnum</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a> / <a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResNum" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResNum</span></code></a>) &#8211; Start of loop.</li>
+<li><strong>start_resnum</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a> / <a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResNum" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResNum</span></code></a>) &#8211; Start of loop.</li>
 <li><strong>num_residues</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Length of loop.</li>
 <li><strong>chain_idx</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Chain the loop belongs to.</li>
 <li><strong>start_resnum_list</strong> (<code class="xref py py-class docutils literal"><span class="pre">list</span></code> of <a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Starts of loops.</li>
@@ -430,9 +432,6 @@ in the environment (same length as <em>env_pos.res_indices</em>)</p>
       <input type="hidden" name="check_keywords" value="yes" />
       <input type="hidden" name="area" value="default" />
     </form>
-    <p class="searchtip" style="font-size: 90%">
-    Enter search terms or a module, class or function name.
-    </p>
 </div>
 <script type="text/javascript">$('#searchbox').show(0);</script>
         </div>
@@ -440,11 +439,11 @@ in the environment (same length as <em>env_pos.res_indices</em>)</p>
       <div class="clearer"></div>
     </div>
     <div class="footer">
-      &copy;2017, ProMod3 authors.
+      &copy;2018, ProMod3 authors.
       
       |
-      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a>
-      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.6</a>
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.4.1</a>
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
       
       |
       <a href="../_sources/modelling/sidechain_reconstruction.txt"
diff --git a/doc/html/objects.inv b/doc/html/objects.inv
index 81a8d72de97fcc038be6300b37887a25fa9ac54c..c7226c83d6d29c07ee6392a031ad29887d8c9f0f 100644
Binary files a/doc/html/objects.inv and b/doc/html/objects.inv differ
diff --git a/doc/html/portableIO.html b/doc/html/portableIO.html
index 74404d4b6a833266bab8ea6dc38f97bf5f7be463..ce9c3bed25946e90ca661dc414a86805a914c840 100644
--- a/doc/html/portableIO.html
+++ b/doc/html/portableIO.html
@@ -6,7 +6,7 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
-    <title>Using Binary Files In ProMod3 &mdash; ProMod3 1.1.0 documentation</title>
+    <title>Using Binary Files In ProMod3 &mdash; ProMod3 1.2.0 documentation</title>
     
     <link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
     <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
@@ -14,7 +14,7 @@
     <script type="text/javascript">
       var DOCUMENTATION_OPTIONS = {
         URL_ROOT:    './',
-        VERSION:     '1.1.0',
+        VERSION:     '1.2.0',
         COLLAPSE_INDEX: false,
         FILE_SUFFIX: '.html',
         HAS_SOURCE:  true
@@ -23,16 +23,18 @@
     <script type="text/javascript" src="_static/jquery.js"></script>
     <script type="text/javascript" src="_static/underscore.js"></script>
     <script type="text/javascript" src="_static/doctools.js"></script>
-    <link rel="top" title="ProMod3 1.1.0 documentation" href="index.html" />
+    <link rel="top" title="ProMod3 1.2.0 documentation" href="index.html" />
     <link rel="up" title="Documentation For Developers" href="developers.html" />
     <link rel="next" title="Changelog" href="changelog.html" />
     <link rel="prev" title="ProMod3‘s Share Of CMake" href="cmake/index.html" />
    
+  <link rel="stylesheet" href="_static/custom.css" type="text/css" />
   
-  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
 
   </head>
-  <body role="document">  
+  <body role="document">
+  
 
     <div class="document">
       <div class="documentwrapper">
@@ -108,7 +110,7 @@ Generally, we store any data-structure value-by-value as fixed-width types!</p>
 </ul>
 <p>Each serializable class must define a <code class="docutils literal"><span class="pre">Serialize</span></code> function that accepts sinks
 and sources, such as:</p>
-<div class="highlight-cpp"><div class="highlight"><pre><span class="k">template</span> <span class="o">&lt;</span><span class="k">typename</span> <span class="n">DS</span><span class="o">&gt;</span>
+<div class="highlight-cpp"><div class="highlight"><pre><span></span><span class="k">template</span> <span class="o">&lt;</span><span class="k">typename</span> <span class="n">DS</span><span class="o">&gt;</span>
 <span class="kt">void</span> <span class="n">Serialize</span><span class="p">(</span><span class="n">DS</span><span class="o">&amp;</span> <span class="n">ds</span><span class="p">)</span> <span class="p">{</span>
   <span class="c1">// serialize element-by-element</span>
 <span class="p">}</span>
@@ -116,7 +118,7 @@ and sources, such as:</p>
 </div>
 <p>Or if this is not possible for an object of type <code class="docutils literal"><span class="pre">T</span></code>, we need to define
 global functions such as:</p>
-<div class="highlight-cpp"><div class="highlight"><pre><span class="kr">inline</span> <span class="kt">void</span> <span class="nf">Serialize</span><span class="p">(</span><span class="n">core</span><span class="o">::</span><span class="n">PortableBinaryDataSource</span><span class="o">&amp;</span> <span class="n">ds</span><span class="p">,</span> <span class="n">T</span><span class="o">&amp;</span> <span class="n">t</span><span class="p">)</span> <span class="p">{</span> <span class="p">}</span>
+<div class="highlight-cpp"><div class="highlight"><pre><span></span><span class="kr">inline</span> <span class="kt">void</span> <span class="nf">Serialize</span><span class="p">(</span><span class="n">core</span><span class="o">::</span><span class="n">PortableBinaryDataSource</span><span class="o">&amp;</span> <span class="n">ds</span><span class="p">,</span> <span class="n">T</span><span class="o">&amp;</span> <span class="n">t</span><span class="p">)</span> <span class="p">{</span> <span class="p">}</span>
 <span class="kr">inline</span> <span class="kt">void</span> <span class="nf">Serialize</span><span class="p">(</span><span class="n">core</span><span class="o">::</span><span class="n">PortableBinaryDataSink</span><span class="o">&amp;</span> <span class="n">ds</span><span class="p">,</span> <span class="n">T</span> <span class="n">t</span><span class="p">)</span> <span class="p">{</span> <span class="p">}</span>
 </pre></div>
 </div>
@@ -143,17 +145,17 @@ serialize the values manually and convert each element appropriately.</li>
 <h2>Code Example<a class="headerlink" href="#code-example" title="Permalink to this headline">¶</a></h2>
 <p>Here is an example of a class which provides functionality for portable
 and non-portable I/O:</p>
-<div class="highlight-cpp"><div class="highlight"><pre><span class="c1">// includes for this class</span>
-<span class="cp">#include &lt;boost/shared_ptr.hpp&gt;</span>
-<span class="cp">#include &lt;iostream&gt;</span>
-<span class="cp">#include &lt;fstream&gt;</span>
-<span class="cp">#include &lt;sstream&gt;</span>
-<span class="cp">#include &lt;vector&gt;</span>
+<div class="highlight-cpp"><div class="highlight"><pre><span></span><span class="c1">// includes for this class</span>
+<span class="cp">#include</span> <span class="cpf">&lt;boost/shared_ptr.hpp&gt;</span><span class="cp"></span>
+<span class="cp">#include</span> <span class="cpf">&lt;iostream&gt;</span><span class="cp"></span>
+<span class="cp">#include</span> <span class="cpf">&lt;fstream&gt;</span><span class="cp"></span>
+<span class="cp">#include</span> <span class="cpf">&lt;sstream&gt;</span><span class="cp"></span>
+<span class="cp">#include</span> <span class="cpf">&lt;vector&gt;</span><span class="cp"></span>
 
 <span class="c1">// includes for I/O</span>
-<span class="cp">#include &lt;promod3/core/message.hh&gt;</span>
-<span class="cp">#include &lt;promod3/core/portable_binary_serializer.hh&gt;</span>
-<span class="cp">#include &lt;promod3/core/check_io.hh&gt;</span>
+<span class="cp">#include</span> <span class="cpf">&lt;promod3/core/message.hh&gt;</span><span class="cp"></span>
+<span class="cp">#include</span> <span class="cpf">&lt;promod3/core/portable_binary_serializer.hh&gt;</span><span class="cp"></span>
+<span class="cp">#include</span> <span class="cpf">&lt;promod3/core/check_io.hh&gt;</span><span class="cp"></span>
 
 <span class="k">using</span> <span class="k">namespace</span> <span class="n">promod3</span><span class="p">;</span>
 
@@ -468,9 +470,6 @@ in the <code class="file docutils literal"><span class="pre">extras/data_generat
       <input type="hidden" name="check_keywords" value="yes" />
       <input type="hidden" name="area" value="default" />
     </form>
-    <p class="searchtip" style="font-size: 90%">
-    Enter search terms or a module, class or function name.
-    </p>
 </div>
 <script type="text/javascript">$('#searchbox').show(0);</script>
         </div>
@@ -478,11 +477,11 @@ in the <code class="file docutils literal"><span class="pre">extras/data_generat
       <div class="clearer"></div>
     </div>
     <div class="footer">
-      &copy;2017, ProMod3 authors.
+      &copy;2018, ProMod3 authors.
       
       |
-      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a>
-      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.6</a>
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.4.1</a>
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
       
       |
       <a href="_sources/portableIO.txt"
diff --git a/doc/html/py-modindex.html b/doc/html/py-modindex.html
index 71f4bc4ddf7474eec8f663839da66c0d80c4b9f4..94cc934014dc70ed49d89fbccbc9117b373ad337 100644
--- a/doc/html/py-modindex.html
+++ b/doc/html/py-modindex.html
@@ -6,7 +6,7 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
-    <title>Python Module Index &mdash; ProMod3 1.1.0 documentation</title>
+    <title>Python Module Index &mdash; ProMod3 1.2.0 documentation</title>
     
     <link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
     <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
@@ -14,7 +14,7 @@
     <script type="text/javascript">
       var DOCUMENTATION_OPTIONS = {
         URL_ROOT:    './',
-        VERSION:     '1.1.0',
+        VERSION:     '1.2.0',
         COLLAPSE_INDEX: false,
         FILE_SUFFIX: '.html',
         HAS_SOURCE:  true
@@ -23,16 +23,18 @@
     <script type="text/javascript" src="_static/jquery.js"></script>
     <script type="text/javascript" src="_static/underscore.js"></script>
     <script type="text/javascript" src="_static/doctools.js"></script>
-    <link rel="top" title="ProMod3 1.1.0 documentation" href="index.html" />
+    <link rel="top" title="ProMod3 1.2.0 documentation" href="index.html" />
 
    
+  <link rel="stylesheet" href="_static/custom.css" type="text/css" />
   
-  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
 
 
 
   </head>
-  <body role="document">  
+  <body role="document">
+  
 
     <div class="document">
       <div class="documentwrapper">
@@ -122,9 +124,6 @@
       <input type="hidden" name="check_keywords" value="yes" />
       <input type="hidden" name="area" value="default" />
     </form>
-    <p class="searchtip" style="font-size: 90%">
-    Enter search terms or a module, class or function name.
-    </p>
 </div>
 <script type="text/javascript">$('#searchbox').show(0);</script>
         </div>
@@ -132,11 +131,11 @@
       <div class="clearer"></div>
     </div>
     <div class="footer">
-      &copy;2017, ProMod3 authors.
+      &copy;2018, ProMod3 authors.
       
       |
-      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a>
-      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.6</a>
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.4.1</a>
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
       
     </div>
 
diff --git a/doc/html/scoring/all_atom_scorers.html b/doc/html/scoring/all_atom_scorers.html
index 8927ea93c0fbfb5b887ce479eeb401617d21b90f..983fd1a43688c709ba13f6608a27e1cbd61780b1 100644
--- a/doc/html/scoring/all_atom_scorers.html
+++ b/doc/html/scoring/all_atom_scorers.html
@@ -6,7 +6,7 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
-    <title>All Atom Scorers &mdash; ProMod3 1.1.0 documentation</title>
+    <title>All Atom Scorers &mdash; ProMod3 1.2.0 documentation</title>
     
     <link rel="stylesheet" href="../_static/alabaster.css" type="text/css" />
     <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
@@ -14,7 +14,7 @@
     <script type="text/javascript">
       var DOCUMENTATION_OPTIONS = {
         URL_ROOT:    '../',
-        VERSION:     '1.1.0',
+        VERSION:     '1.2.0',
         COLLAPSE_INDEX: false,
         FILE_SUFFIX: '.html',
         HAS_SOURCE:  true
@@ -23,16 +23,18 @@
     <script type="text/javascript" src="../_static/jquery.js"></script>
     <script type="text/javascript" src="../_static/underscore.js"></script>
     <script type="text/javascript" src="../_static/doctools.js"></script>
-    <link rel="top" title="ProMod3 1.1.0 documentation" href="../index.html" />
+    <link rel="top" title="ProMod3 1.2.0 documentation" href="../index.html" />
     <link rel="up" title="scoring - Loop Scoring" href="index.html" />
-    <link rel="next" title="loop - Loop Handling" href="../loop/index.html" />
+    <link rel="next" title="Other Scoring Functions" href="other_scoring_functions.html" />
     <link rel="prev" title="Backbone Scorers" href="backbone_scorers.html" />
    
+  <link rel="stylesheet" href="../_static/custom.css" type="text/css" />
   
-  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
 
   </head>
-  <body role="document">  
+  <body role="document">
+  
 
     <div class="document">
       <div class="documentwrapper">
@@ -102,9 +104,9 @@
 
 <dl class="method">
 <dt id="promod3.scoring.AllAtomOverallScorer.CalculateLinearCombination">
-<code class="descname">CalculateLinearCombination</code><span class="sig-paren">(</span><em>linear_weights</em>, <em>start_resnum</em>, <em>num_residues</em>, <em>chain_idx=0</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.scoring.AllAtomOverallScorer.CalculateLinearCombination" title="Permalink to this definition">¶</a></dt>
-<dd><p>Calculate linear combination of scores for the desired loop (extracted from
-environment) against the set environment (see
+<code class="descname">CalculateLinearCombination</code><span class="sig-paren">(</span><em>linear_weights</em>, <em>start_resnum</em>, <em>num_residues</em>, <em>chain_idx</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.scoring.AllAtomOverallScorer.CalculateLinearCombination" title="Permalink to this definition">¶</a></dt>
+<dd><p>Calculate linear combination of scores for the desired loop(s) (extracted
+from environment) against the set environment (see
 <a class="reference internal" href="#promod3.scoring.AllAtomScorer.CalculateScore" title="promod3.scoring.AllAtomScorer.CalculateScore"><code class="xref py py-meth docutils literal"><span class="pre">AllAtomScorer.CalculateScore()</span></code></a>).</p>
 <table class="docutils field-list" frame="void" rules="none">
 <col class="field-name" />
@@ -115,10 +117,10 @@ environment) against the set environment (see
 values: <a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>)) &#8211; Weights for each desired scorer. You can add a
 constant value to each score by defining a weight
 with key &#8220;intercept&#8221;.</li>
-<li><strong>start_resnum</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a> / <a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResNum" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResNum</span></code></a>) &#8211; Res. number defining the position in the SEQRES
+<li><strong>start_resnum</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a> / <code class="xref py py-class docutils literal"><span class="pre">list</span></code> of <a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Res. number(s) defining the position(s) in the SEQRES
 (see <a class="reference internal" href="../loop/all_atom.html#promod3.loop.AllAtomEnv" title="promod3.loop.AllAtomEnv"><code class="xref py py-class docutils literal"><span class="pre">AllAtomEnv</span></code></a> for indexing)</li>
-<li><strong>num_residues</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Length of loop.</li>
-<li><strong>chain_idx</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Index of chain the loop belongs to
+<li><strong>num_residues</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a> / <code class="xref py py-class docutils literal"><span class="pre">list</span></code> of <a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Length of loop(s).</li>
+<li><strong>chain_idx</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a> / <code class="xref py py-class docutils literal"><span class="pre">list</span></code> of <a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Index of chain the loop(s) belongs to
 (see <a class="reference internal" href="../loop/all_atom.html#promod3.loop.AllAtomEnv" title="promod3.loop.AllAtomEnv"><code class="xref py py-class docutils literal"><span class="pre">AllAtomEnv</span></code></a> for indexing)</li>
 </ul>
 </td>
@@ -195,23 +197,19 @@ following keys:
 
 <dl class="method">
 <dt id="promod3.scoring.AllAtomScorer.CalculateScore">
-<code class="descname">CalculateScore</code><span class="sig-paren">(</span><em>start_resnum</em>, <em>num_residues</em>, <em>chain_idx=0</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.scoring.AllAtomScorer.CalculateScore" title="Permalink to this definition">¶</a></dt>
-<dd><p>Calculates score for the desired loop (extracted from environment) against
+<code class="descname">CalculateScore</code><span class="sig-paren">(</span><em>start_resnum</em>, <em>num_residues</em>, <em>chain_idx</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.scoring.AllAtomScorer.CalculateScore" title="Permalink to this definition">¶</a></dt>
+<dd><p>Calculates score for the desired loop(s) (extracted from environment) against
 the set environment. Unless otherwise noted in the scorer, a lower &#8220;score&#8221;
 is better!</p>
-<p>Note that the structural data of the loop is expected to be in the linked
-environment before calling this! This behavior is different from the
-corresponding function in <a class="reference internal" href="backbone_scorers.html#promod3.scoring.BackboneScorer" title="promod3.scoring.BackboneScorer"><code class="xref py py-class docutils literal"><span class="pre">BackboneScorer</span></code></a> as, for performance
-reasons, we require all the comparisons to be done against the environment.</p>
 <table class="docutils field-list" frame="void" rules="none">
 <col class="field-name" />
 <col class="field-body" />
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
-<li><strong>start_resnum</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a> / <a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResNum" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResNum</span></code></a>) &#8211; Res. number defining the position in the SEQRES
+<li><strong>start_resnum</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a> / <code class="xref py py-class docutils literal"><span class="pre">list</span></code> of <a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Res. number(s) defining the position(s) in the SEQRES
 (see <a class="reference internal" href="../loop/all_atom.html#promod3.loop.AllAtomEnv" title="promod3.loop.AllAtomEnv"><code class="xref py py-class docutils literal"><span class="pre">AllAtomEnv</span></code></a> for indexing)</li>
-<li><strong>num_residues</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Length of loop.</li>
-<li><strong>chain_idx</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Index of chain the loop belongs to
+<li><strong>num_residues</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a> / <code class="xref py py-class docutils literal"><span class="pre">list</span></code> of <a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Length of loop(s).</li>
+<li><strong>chain_idx</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a> / <code class="xref py py-class docutils literal"><span class="pre">list</span></code> of <a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Index of chain the loop(s) belongs to
 (see <a class="reference internal" href="../loop/all_atom.html#promod3.loop.AllAtomEnv" title="promod3.loop.AllAtomEnv"><code class="xref py py-class docutils literal"><span class="pre">AllAtomEnv</span></code></a> for indexing)</li>
 </ul>
 </td>
@@ -235,29 +233,26 @@ invalid positions.</p>
 <dl class="method">
 <dt id="promod3.scoring.AllAtomScorer.CalculateScoreProfile">
 <code class="descname">CalculateScoreProfile</code><span class="sig-paren">(</span><em>start_resnum</em>, <em>num_residues</em>, <em>chain_idx=0</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.scoring.AllAtomScorer.CalculateScoreProfile" title="Permalink to this definition">¶</a></dt>
-<dd><p>Calculates per residue scores for the desired loop (extracted from
+<dd><p>Calculates per residue scores for the desired loop(s) (extracted from
 environment) against the set environment.</p>
-<p>Note that the structural data of the loop is expected to be in the linked
-environment before calling this! This behavior is different from the
-corresponding function in <a class="reference internal" href="backbone_scorers.html#promod3.scoring.BackboneScorer" title="promod3.scoring.BackboneScorer"><code class="xref py py-class docutils literal"><span class="pre">BackboneScorer</span></code></a> as, for performance
-reasons, we require all the comparisons to be done against the environment.</p>
 <table class="docutils field-list" frame="void" rules="none">
 <col class="field-name" />
 <col class="field-body" />
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
-<li><strong>start_resnum</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a> / <a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResNum" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResNum</span></code></a>) &#8211; Res. number defining the position in the SEQRES
+<li><strong>start_resnum</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a> / <code class="xref py py-class docutils literal"><span class="pre">list</span></code> of <a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Res. number(s) defining the position(s) in the SEQRES
 (see <a class="reference internal" href="../loop/all_atom.html#promod3.loop.AllAtomEnv" title="promod3.loop.AllAtomEnv"><code class="xref py py-class docutils literal"><span class="pre">AllAtomEnv</span></code></a> for indexing)</li>
-<li><strong>num_residues</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Length of loop.</li>
-<li><strong>chain_idx</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Index of chain the loop belongs to
+<li><strong>num_residues</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Length of loop(s).</li>
+<li><strong>chain_idx</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a> / <code class="xref py py-class docutils literal"><span class="pre">list</span></code> of <a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Index of chain the loop(s) belongs to
 (see <a class="reference internal" href="../loop/all_atom.html#promod3.loop.AllAtomEnv" title="promod3.loop.AllAtomEnv"><code class="xref py py-class docutils literal"><span class="pre">AllAtomEnv</span></code></a> for indexing)</li>
 </ul>
 </td>
 </tr>
-<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Scores for the given loop, one for each residue.</p>
+<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Scores for the given loop(s), one for each residue.</p>
 </td>
 </tr>
-<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first"><code class="xref py py-class docutils literal"><span class="pre">list</span></code> of <a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a></p>
+<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first"><code class="xref py py-class docutils literal"><span class="pre">list</span></code> of <a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a> / <code class="xref py py-class docutils literal"><span class="pre">list</span></code> of <code class="xref py py-class docutils literal"><span class="pre">list</span></code>
+of <a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a></p>
 </td>
 </tr>
 <tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last">same <a class="reference external" href="https://docs.python.org/2.7/library/exceptions.html#exceptions.RuntimeError" title="(in Python v2.7)"><code class="xref py py-exc docutils literal"><span class="pre">RuntimeError</span></code></a> as <a class="reference internal" href="#promod3.scoring.AllAtomScorer.CalculateScore" title="promod3.scoring.AllAtomScorer.CalculateScore"><code class="xref py py-meth docutils literal"><span class="pre">CalculateScore()</span></code></a>.</p>
@@ -280,8 +275,11 @@ pseudo interaction energy between all atoms which are located within a
 <em>cutoff</em> and which are at least <em>seq_sep</em> residues apart. An energy is
 assigned to each distance using equally sized bins and distinguishing all
 possible pairs of atoms (usually the energy only differs for chemically
-distinguishable heavy atoms). The calculated score is normalized by the number
-of interacting atom pairs.</p>
+distinguishable heavy atoms).
+By default, the scorer calculates the scores by
+including everything, the stuff set in the environment and the coordinates
+in the input loops. You can change this behaviour with the according
+functions.</p>
 <p>The scorer needs to be initialized either by loading a predefined scorer (e.g.
 <a class="reference internal" href="#promod3.scoring.LoadAllAtomInteractionScorer" title="promod3.scoring.LoadAllAtomInteractionScorer"><code class="xref py py-func docutils literal"><span class="pre">LoadAllAtomInteractionScorer()</span></code></a>) or by setting all energies (see <a class="reference internal" href="#promod3.scoring.AllAtomInteractionScorer.SetEnergy" title="promod3.scoring.AllAtomInteractionScorer.SetEnergy"><code class="xref py py-meth docutils literal"><span class="pre">SetEnergy()</span></code></a>).</p>
 <table class="docutils field-list" frame="void" rules="none">
@@ -322,7 +320,7 @@ less machine-dependent).</p>
 <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference internal" href="#promod3.scoring.AllAtomInteractionScorer" title="promod3.scoring.AllAtomInteractionScorer"><code class="xref py py-class docutils literal"><span class="pre">AllAtomInteractionScorer</span></code></a></td>
 </tr>
 <tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/2.7/library/exceptions.html#exceptions.RuntimeError" title="(in Python v2.7)"><code class="xref py py-exc docutils literal"><span class="pre">RuntimeError</span></code></a> if file cannot be opened or if
-file cannot be parsed (see <a class="reference internal" href="../portableIO.html#portableio"><span>here</span></a> for details).</td>
+file cannot be parsed (see <a class="reference internal" href="../portableIO.html#portableio"><span class="std std-ref">here</span></a> for details).</td>
 </tr>
 </tbody>
 </table>
@@ -334,7 +332,7 @@ file cannot be parsed (see <a class="reference internal" href="../portableIO.htm
 <dt id="promod3.scoring.AllAtomInteractionScorer.SavePortable">
 <code class="descname">SavePortable</code><span class="sig-paren">(</span><em>filename</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.scoring.AllAtomInteractionScorer.SavePortable" title="Permalink to this definition">¶</a></dt>
 <dd><p>Saves a raw / portable binary representation. Use portable files for
-distribution and convert locally to raw files. See <a class="reference internal" href="../portableIO.html#portableio"><span>here</span></a>
+distribution and convert locally to raw files. See <a class="reference internal" href="../portableIO.html#portableio"><span class="std std-ref">here</span></a>
 for details.</p>
 <table class="docutils field-list" frame="void" rules="none">
 <col class="field-name" />
@@ -352,7 +350,10 @@ for details.</p>
 <dt id="promod3.scoring.AllAtomInteractionScorer.SetEnergy">
 <code class="descname">SetEnergy</code><span class="sig-paren">(</span><em>aaa1</em>, <em>aaa2</em>, <em>bin</em>, <em>energy</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.scoring.AllAtomInteractionScorer.SetEnergy" title="Permalink to this definition">¶</a></dt>
 <dd><p>Setup one energy value. Unless a predefined scorer is loaded, this must be
-called for every pair of heavy atom types and for every <em>bin</em> &lt; <em>bins</em>.</p>
+called for every pair of heavy atom types and for every <em>bin</em> &lt; <em>bins</em>.
+Internal symmetry is enforced =&gt; Calling SetEnergy(aaa1, aaa2, bin, energy) is
+equivalent to calling SetEnergy(aaa1, aaa2, bin, energy) AND
+SetEnergy(aaa2, aaa1, bin, energy).</p>
 <table class="docutils field-list" frame="void" rules="none">
 <col class="field-name" />
 <col class="field-body" />
@@ -372,6 +373,48 @@ called for every pair of heavy atom types and for every <em>bin</em> &lt; <em>bi
 </table>
 </dd></dl>
 
+<dl class="method">
+<dt id="promod3.scoring.AllAtomInteractionScorer.DoInternalScores">
+<code class="descname">DoInternalScores</code><span class="sig-paren">(</span><em>do_it</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.scoring.AllAtomInteractionScorer.DoInternalScores" title="Permalink to this definition">¶</a></dt>
+<dd><table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>do_it</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#bool" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">bool</span></code></a>) &#8211; Whether to include pairwise interactions within the
+loop. True by default.</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="method">
+<dt id="promod3.scoring.AllAtomInteractionScorer.DoExternalScores">
+<code class="descname">DoExternalScores</code><span class="sig-paren">(</span><em>do_it</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.scoring.AllAtomInteractionScorer.DoExternalScores" title="Permalink to this definition">¶</a></dt>
+<dd><table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>do_it</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#bool" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">bool</span></code></a>) &#8211; Whether to include pairwise interactions towards the
+environment. True by default.</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="method">
+<dt id="promod3.scoring.AllAtomInteractionScorer.DoNormalize">
+<code class="descname">DoNormalize</code><span class="sig-paren">(</span><em>do_it</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.scoring.AllAtomInteractionScorer.DoNormalize" title="Permalink to this definition">¶</a></dt>
+<dd><table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>do_it</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#bool" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">bool</span></code></a>) &#8211; Whether to normalize the calculated scores by the number
+of residues in the input loop. True by default.</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
 </dd></dl>
 
 <dl class="function">
@@ -397,8 +440,7 @@ called for every pair of heavy atom types and for every <em>bin</em> &lt; <em>bi
 <em class="property">class </em><code class="descclassname">promod3.scoring.</code><code class="descname">AllAtomPackingScorer</code><span class="sig-paren">(</span><em>cutoff</em>, <em>max_count</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.scoring.AllAtomPackingScorer" title="Permalink to this definition">¶</a></dt>
 <dd><p>Inherits all functionality of <a class="reference internal" href="#promod3.scoring.AllAtomScorer" title="promod3.scoring.AllAtomScorer"><code class="xref py py-class docutils literal"><span class="pre">AllAtomScorer</span></code></a>. Evaluates pseudo
 energies by counting surrounding atoms within a certain <em>cutoff</em> radius around
-all heavy atoms not belonging to the assessed residue itself. The calculated
-score is normalized by the number of atoms being assessed.</p>
+all heavy atoms not belonging to the assessed residue itself.</p>
 <p>The scorer needs to be initialized either by loading a predefined scorer (e.g.
 <a class="reference internal" href="#promod3.scoring.LoadAllAtomPackingScorer" title="promod3.scoring.LoadAllAtomPackingScorer"><code class="xref py py-func docutils literal"><span class="pre">LoadAllAtomPackingScorer()</span></code></a>) or by setting all energies (see
 <a class="reference internal" href="#promod3.scoring.AllAtomPackingScorer.SetEnergy" title="promod3.scoring.AllAtomPackingScorer.SetEnergy"><code class="xref py py-meth docutils literal"><span class="pre">SetEnergy()</span></code></a>).</p>
@@ -437,7 +479,7 @@ less machine-dependent).</p>
 <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference internal" href="#promod3.scoring.AllAtomPackingScorer" title="promod3.scoring.AllAtomPackingScorer"><code class="xref py py-class docutils literal"><span class="pre">AllAtomPackingScorer</span></code></a></td>
 </tr>
 <tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/2.7/library/exceptions.html#exceptions.RuntimeError" title="(in Python v2.7)"><code class="xref py py-exc docutils literal"><span class="pre">RuntimeError</span></code></a> if file cannot be opened or if
-file cannot be parsed (see <a class="reference internal" href="../portableIO.html#portableio"><span>here</span></a> for details).</td>
+file cannot be parsed (see <a class="reference internal" href="../portableIO.html#portableio"><span class="std std-ref">here</span></a> for details).</td>
 </tr>
 </tbody>
 </table>
@@ -449,7 +491,7 @@ file cannot be parsed (see <a class="reference internal" href="../portableIO.htm
 <dt id="promod3.scoring.AllAtomPackingScorer.SavePortable">
 <code class="descname">SavePortable</code><span class="sig-paren">(</span><em>filename</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.scoring.AllAtomPackingScorer.SavePortable" title="Permalink to this definition">¶</a></dt>
 <dd><p>Saves a raw / portable binary representation. Use portable files for
-distribution and convert locally to raw files. See <a class="reference internal" href="../portableIO.html#portableio"><span>here</span></a>
+distribution and convert locally to raw files. See <a class="reference internal" href="../portableIO.html#portableio"><span class="std std-ref">here</span></a>
 for details.</p>
 <table class="docutils field-list" frame="void" rules="none">
 <col class="field-name" />
@@ -486,6 +528,20 @@ called for every heavy atom type and for every <em>count</em> &lt;= <em>max_coun
 </table>
 </dd></dl>
 
+<dl class="method">
+<dt id="promod3.scoring.AllAtomPackingScorer.DoNormalize">
+<code class="descname">DoNormalize</code><span class="sig-paren">(</span><em>do_it</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.scoring.AllAtomPackingScorer.DoNormalize" title="Permalink to this definition">¶</a></dt>
+<dd><table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>do_it</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#bool" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">bool</span></code></a>) &#8211; Whether to normalize the calculated scores by the number
+of residues in the input loop. True by default.</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
 </dd></dl>
 
 <dl class="function">
@@ -512,8 +568,52 @@ called for every heavy atom type and for every <em>count</em> &lt;= <em>max_coun
 <dd><p>Inherits all functionality of <a class="reference internal" href="#promod3.scoring.AllAtomScorer" title="promod3.scoring.AllAtomScorer"><code class="xref py py-class docutils literal"><span class="pre">AllAtomScorer</span></code></a>. Calculates a simple
 clash score of all atoms against the environment. There is no need to define
 any parameters here as all interaction energies are fixed (see Eq. (11) in
-<a class="reference internal" href="../sidechain/disulfid.html#canutescu2003b" id="id1">[canutescu2003b]</a>). The calculated score is normalized by the number of atoms
-being assessed.</p>
+<a class="reference internal" href="other_scoring_functions.html#canutescu2003b" id="id1">[canutescu2003b]</a>). By default, the scorer calculates the scores by
+including everything, the stuff set in the environment and the coordinates
+in the input loops. You can change this behaviour with the according
+functions.</p>
+<dl class="method">
+<dt id="promod3.scoring.AllAtomClashScorer.DoInternalScores">
+<code class="descname">DoInternalScores</code><span class="sig-paren">(</span><em>do_it</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.scoring.AllAtomClashScorer.DoInternalScores" title="Permalink to this definition">¶</a></dt>
+<dd><table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>do_it</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#bool" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">bool</span></code></a>) &#8211; Whether to include pairwise interactions within the
+loop. True by default.</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="method">
+<dt id="promod3.scoring.AllAtomClashScorer.DoExternalScores">
+<code class="descname">DoExternalScores</code><span class="sig-paren">(</span><em>do_it</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.scoring.AllAtomClashScorer.DoExternalScores" title="Permalink to this definition">¶</a></dt>
+<dd><table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>do_it</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#bool" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">bool</span></code></a>) &#8211; Whether to include pairwise interactions towards the
+environment. True by default.</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="method">
+<dt id="promod3.scoring.AllAtomClashScorer.DoNormalize">
+<code class="descname">DoNormalize</code><span class="sig-paren">(</span><em>do_it</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.scoring.AllAtomClashScorer.DoNormalize" title="Permalink to this definition">¶</a></dt>
+<dd><table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>do_it</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#bool" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">bool</span></code></a>) &#8211; Whether to normalize the calculated scores by the number
+of residues in the input loop. True by default.</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
 </dd></dl>
 
 </div>
@@ -543,7 +643,7 @@ being assessed.</p>
   <li><a href="../users.html">Documentation For Users</a><ul>
   <li><a href="index.html"><code class="docutils literal"><span class="pre">scoring</span></code> - Loop Scoring</a><ul>
       <li>Previous: <a href="backbone_scorers.html" title="previous chapter">Backbone Scorers</a></li>
-      <li>Next: <a href="../loop/index.html" title="next chapter"><code class="docutils literal"><span class="pre">loop</span></code> - Loop Handling</a></li>
+      <li>Next: <a href="other_scoring_functions.html" title="next chapter">Other Scoring Functions</a></li>
   </ul></li>
   </ul></li>
   </ul></li>
@@ -564,9 +664,6 @@ being assessed.</p>
       <input type="hidden" name="check_keywords" value="yes" />
       <input type="hidden" name="area" value="default" />
     </form>
-    <p class="searchtip" style="font-size: 90%">
-    Enter search terms or a module, class or function name.
-    </p>
 </div>
 <script type="text/javascript">$('#searchbox').show(0);</script>
         </div>
@@ -574,11 +671,11 @@ being assessed.</p>
       <div class="clearer"></div>
     </div>
     <div class="footer">
-      &copy;2017, ProMod3 authors.
+      &copy;2018, ProMod3 authors.
       
       |
-      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a>
-      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.6</a>
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.4.1</a>
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
       
       |
       <a href="../_sources/scoring/all_atom_scorers.txt"
diff --git a/doc/html/scoring/backbone_score_env.html b/doc/html/scoring/backbone_score_env.html
index 68882801ba831d30ef8131e11bf36ff921a7e56f..e1b57c32a98e58a6133441cde6027450387db6b9 100644
--- a/doc/html/scoring/backbone_score_env.html
+++ b/doc/html/scoring/backbone_score_env.html
@@ -6,7 +6,7 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
-    <title>Backbone Score Environment &mdash; ProMod3 1.1.0 documentation</title>
+    <title>Backbone Score Environment &mdash; ProMod3 1.2.0 documentation</title>
     
     <link rel="stylesheet" href="../_static/alabaster.css" type="text/css" />
     <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
@@ -14,7 +14,7 @@
     <script type="text/javascript">
       var DOCUMENTATION_OPTIONS = {
         URL_ROOT:    '../',
-        VERSION:     '1.1.0',
+        VERSION:     '1.2.0',
         COLLAPSE_INDEX: false,
         FILE_SUFFIX: '.html',
         HAS_SOURCE:  true
@@ -23,16 +23,18 @@
     <script type="text/javascript" src="../_static/jquery.js"></script>
     <script type="text/javascript" src="../_static/underscore.js"></script>
     <script type="text/javascript" src="../_static/doctools.js"></script>
-    <link rel="top" title="ProMod3 1.1.0 documentation" href="../index.html" />
+    <link rel="top" title="ProMod3 1.2.0 documentation" href="../index.html" />
     <link rel="up" title="scoring - Loop Scoring" href="index.html" />
     <link rel="next" title="Backbone Scorers" href="backbone_scorers.html" />
     <link rel="prev" title="scoring - Loop Scoring" href="index.html" />
    
+  <link rel="stylesheet" href="../_static/custom.css" type="text/css" />
   
-  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
 
   </head>
-  <body role="document">  
+  <body role="document">
+  
 
     <div class="document">
       <div class="documentwrapper">
@@ -50,16 +52,24 @@
 used by the scorers. It is linked to a (list of) seqres (one per chain) at
 construction. The idea is to initialize it at the beginning of the modelling
 process with all known data (positions extracted from template, psipred
-prediction, density map, etc) and then update the environment whenever a new
-loop is being added. Note that, depending on the used scorers, some
-information must be provided for the score to make sense and any env. data can
-be set at any time before actually calculating a score.</p>
+prediction, etc). All scorers attached to that environment will see that data
+and can calculate scores accordingly.
+Scoring with this setup is a two step process:</p>
+<ul class="simple">
+<li>Set the positions you want to score in the environment to make it available
+to all attached scorers</li>
+<li>Call the scorers to get the desired scores</li>
+</ul>
+<p>One problem that might occur is that you mess around with the environment and
+at some point you want to restore the original state. The
+<a class="reference internal" href="#promod3.scoring.BackboneScoreEnv" title="promod3.scoring.BackboneScoreEnv"><code class="xref py py-class docutils literal"><span class="pre">BackboneScoreEnv</span></code></a> provides a Stash / Pop mechanism to perform this
+task.</p>
 <table class="docutils field-list" frame="void" rules="none">
 <col class="field-name" />
 <col class="field-body" />
 <tbody valign="top">
-<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>seqres</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#str" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">str</span></code></a> / <a class="reference external" href="http://www.openstructure.org/docs/dev/seq/base/seq/#ost.seq.SequenceHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.seq.SequenceHandle</span></code></a> /
-<code class="xref py py-class docutils literal"><span class="pre">list</span></code> of <a class="reference external" href="https://docs.python.org/2.7/library/functions.html#str" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">str</span></code></a> / <a class="reference external" href="http://www.openstructure.org/docs/dev/seq/base/seq/#ost.seq.SequenceList" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.seq.SequenceList</span></code></a>) &#8211; Internal SEQRES to be set (single chain or list with one per
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>seqres</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#str" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">str</span></code></a> / <a class="reference external" href="https://www.openstructure.org/docs/dev/seq/base/seq/#ost.seq.SequenceHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.seq.SequenceHandle</span></code></a> /
+<code class="xref py py-class docutils literal"><span class="pre">list</span></code> of <a class="reference external" href="https://docs.python.org/2.7/library/functions.html#str" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">str</span></code></a> / <a class="reference external" href="https://www.openstructure.org/docs/dev/seq/base/seq/#ost.seq.SequenceList" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.seq.SequenceList</span></code></a>) &#8211; Internal SEQRES to be set (single chain or list with one per
 chain). Whenever setting structural data, consistency with this SEQRES is enforced.</td>
 </tr>
 </tbody>
@@ -96,7 +106,7 @@ structural data was already set, all the existing data gets cleared first.</p>
 <col class="field-name" />
 <col class="field-body" />
 <tbody valign="top">
-<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>env_structure</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.EntityHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.EntityHandle</span></code></a>) &#8211; Structral data to be set as environment. The chains
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>env_structure</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.EntityHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.EntityHandle</span></code></a>) &#8211; Structral data to be set as environment. The chains
 in <em>env_structure</em> are expected to be in the same
 order as the SEQRES items provided in constructor.</td>
 </tr>
@@ -120,7 +130,7 @@ positions.</p>
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
 <li><strong>bb_list</strong> (<a class="reference internal" href="../loop/backbone.html#promod3.loop.BackboneList" title="promod3.loop.BackboneList"><code class="xref py py-class docutils literal"><span class="pre">BackboneList</span></code></a>) &#8211; Structural data to be set as environment.</li>
-<li><strong>start_resnum</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a> / <a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResNum" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResNum</span></code></a>) &#8211; Res. number defining the position in the SEQRES.</li>
+<li><strong>start_resnum</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a> / <a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResNum" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResNum</span></code></a>) &#8211; Res. number defining the position in the SEQRES.</li>
 <li><strong>chain_idx</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Index of chain the structural data belongs to.</li>
 </ul>
 </td>
@@ -178,25 +188,6 @@ predictions&#8217; sizes is inconsistent with the internal SEQRES size.</td>
 </table>
 </dd></dl>
 
-<dl class="method">
-<dt id="promod3.scoring.BackboneScoreEnv.SetMap">
-<code class="descname">SetMap</code><span class="sig-paren">(</span><em>map</em>, <em>resolution</em>, <em>all_atom=False</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.scoring.BackboneScoreEnv.SetMap" title="Permalink to this definition">¶</a></dt>
-<dd><p>Sets an internal density map, which is necessary to calculate some scores.</p>
-<table class="docutils field-list" frame="void" rules="none">
-<col class="field-name" />
-<col class="field-body" />
-<tbody valign="top">
-<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
-<li><strong>map</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/img/base/img/#ost.img.ImageHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.img.ImageHandle</span></code></a>) &#8211; The density map</li>
-<li><strong>resolution</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>) &#8211; Expected resolution of the density map.</li>
-<li><strong>all_atom</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#bool" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">bool</span></code></a>) &#8211; Whether the map is accurate enough to resolve all atoms.</li>
-</ul>
-</td>
-</tr>
-</tbody>
-</table>
-</dd></dl>
-
 <dl class="method">
 <dt id="promod3.scoring.BackboneScoreEnv.AddPairwiseFunction">
 <code class="descname">AddPairwiseFunction</code><span class="sig-paren">(</span><em>function</em>, <em>function_type</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.scoring.BackboneScoreEnv.AddPairwiseFunction" title="Permalink to this definition">¶</a></dt>
@@ -250,6 +241,35 @@ residue or when <em>f_idx</em> is an invalid index.</p>
 </table>
 </dd></dl>
 
+<dl class="method">
+<dt id="promod3.scoring.BackboneScoreEnv.Stash">
+<code class="descname">Stash</code><span class="sig-paren">(</span><em>start_rnum</em>, <em>num_residues</em>, <em>chain_idx</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.scoring.BackboneScoreEnv.Stash" title="Permalink to this definition">¶</a></dt>
+<dd><p>FILO style stashing. You can perform up to 100 stash operations to save
+the current state of certain stretches in the environment. This state can
+be restored by calling <a class="reference internal" href="#promod3.scoring.BackboneScoreEnv.Pop" title="promod3.scoring.BackboneScoreEnv.Pop"><code class="xref py py-func docutils literal"><span class="pre">Pop()</span></code></a>. In one stash operation you can either
+stash one stretch by providing integers as input or several stretches by
+providing lists of integers.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
+<li><strong>start_rnum</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a> / <code class="xref py py-class docutils literal"><span class="pre">list</span></code> of <a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; start rnum of stretch to stash</li>
+<li><strong>num_residues</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a> / <code class="xref py py-class docutils literal"><span class="pre">list</span></code> of <a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; length of stretch to stash</li>
+<li><strong>chain_idx</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a> / <code class="xref py py-class docutils literal"><span class="pre">list</span></code> of <a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; chain idx of stretch to stash</li>
+</ul>
+</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="method">
+<dt id="promod3.scoring.BackboneScoreEnv.Pop">
+<code class="descname">Pop</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#promod3.scoring.BackboneScoreEnv.Pop" title="Permalink to this definition">¶</a></dt>
+<dd><p>Remove and apply the the last stash operation.</p>
+</dd></dl>
+
 <dl class="method">
 <dt id="promod3.scoring.BackboneScoreEnv.GetSeqres">
 <code class="descname">GetSeqres</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#promod3.scoring.BackboneScoreEnv.GetSeqres" title="Permalink to this definition">¶</a></dt>
@@ -259,7 +279,7 @@ residue or when <em>f_idx</em> is an invalid index.</p>
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">SEQRES that was set in constructor (one sequence per chain).</td>
 </tr>
-<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="http://www.openstructure.org/docs/dev/seq/base/seq/#ost.seq.SequenceList" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.seq.SequenceList</span></code></a></td>
+<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="https://www.openstructure.org/docs/dev/seq/base/seq/#ost.seq.SequenceList" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.seq.SequenceList</span></code></a></td>
 </tr>
 </tbody>
 </table>
@@ -369,7 +389,7 @@ The constraint functions are built after the principle of QMEANDisCo.</p>
 <col class="field-body" />
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
-<li><strong>seqres</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/seq/base/seq/#ost.seq.SequenceHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.seq.SequenceHandle</span></code></a>) &#8211; The sequence with which all added structures must match</li>
+<li><strong>seqres</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/seq/base/seq/#ost.seq.SequenceHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.seq.SequenceHandle</span></code></a>) &#8211; The sequence with which all added structures must match</li>
 <li><strong>function_type</strong> (<a class="reference internal" href="#promod3.scoring.PairwiseFunctionType" title="promod3.scoring.PairwiseFunctionType"><code class="xref py py-class docutils literal"><span class="pre">PairwiseFunctionType</span></code></a>) &#8211; Whether you want to assess pairwise distances between CA
 or CB atoms</li>
 </ul>
@@ -384,7 +404,7 @@ or CB atoms</li>
 <col class="field-name" />
 <col class="field-body" />
 <tbody valign="top">
-<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>aln</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/seq/base/seq/#ost.seq.AlignmentHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.seq.AlignmentHandle</span></code></a>) &#8211; Alignment, where first sequence represent the initial
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>aln</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/seq/base/seq/#ost.seq.AlignmentHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.seq.AlignmentHandle</span></code></a>) &#8211; Alignment, where first sequence represent the initial
 SEQRES and the second sequence the actual structural
 info. The second sequence must have a view attached.</td>
 </tr>
@@ -483,9 +503,6 @@ inconsistent with SEQRES you initialized the DiscoContainer with</p>
       <input type="hidden" name="check_keywords" value="yes" />
       <input type="hidden" name="area" value="default" />
     </form>
-    <p class="searchtip" style="font-size: 90%">
-    Enter search terms or a module, class or function name.
-    </p>
 </div>
 <script type="text/javascript">$('#searchbox').show(0);</script>
         </div>
@@ -493,11 +510,11 @@ inconsistent with SEQRES you initialized the DiscoContainer with</p>
       <div class="clearer"></div>
     </div>
     <div class="footer">
-      &copy;2017, ProMod3 authors.
+      &copy;2018, ProMod3 authors.
       
       |
-      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a>
-      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.6</a>
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.4.1</a>
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
       
       |
       <a href="../_sources/scoring/backbone_score_env.txt"
diff --git a/doc/html/scoring/backbone_scorers.html b/doc/html/scoring/backbone_scorers.html
index dec79f579c701f4453884c1ed2f4be565d356be5..71276424ad8d5762fa2f4f87b16a5e46d6c22fa1 100644
--- a/doc/html/scoring/backbone_scorers.html
+++ b/doc/html/scoring/backbone_scorers.html
@@ -6,7 +6,7 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
-    <title>Backbone Scorers &mdash; ProMod3 1.1.0 documentation</title>
+    <title>Backbone Scorers &mdash; ProMod3 1.2.0 documentation</title>
     
     <link rel="stylesheet" href="../_static/alabaster.css" type="text/css" />
     <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
@@ -14,7 +14,7 @@
     <script type="text/javascript">
       var DOCUMENTATION_OPTIONS = {
         URL_ROOT:    '../',
-        VERSION:     '1.1.0',
+        VERSION:     '1.2.0',
         COLLAPSE_INDEX: false,
         FILE_SUFFIX: '.html',
         HAS_SOURCE:  true
@@ -23,16 +23,18 @@
     <script type="text/javascript" src="../_static/jquery.js"></script>
     <script type="text/javascript" src="../_static/underscore.js"></script>
     <script type="text/javascript" src="../_static/doctools.js"></script>
-    <link rel="top" title="ProMod3 1.1.0 documentation" href="../index.html" />
+    <link rel="top" title="ProMod3 1.2.0 documentation" href="../index.html" />
     <link rel="up" title="scoring - Loop Scoring" href="index.html" />
     <link rel="next" title="All Atom Scorers" href="all_atom_scorers.html" />
     <link rel="prev" title="Backbone Score Environment" href="backbone_score_env.html" />
    
+  <link rel="stylesheet" href="../_static/custom.css" type="text/css" />
   
-  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
 
   </head>
-  <body role="document">  
+  <body role="document">
+  
 
     <div class="document">
       <div class="documentwrapper">
@@ -102,30 +104,27 @@
 
 <dl class="method">
 <dt id="promod3.scoring.BackboneOverallScorer.Calculate">
-<code class="descname">Calculate</code><span class="sig-paren">(</span><em>key</em>, <em>bb_list</em>, <em>start_resnum</em>, <em>chain_idx=0</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.scoring.BackboneOverallScorer.Calculate" title="Permalink to this definition">¶</a></dt>
-<dd><p>Calculate score(s) for one or many loop(s) with
-<a class="reference internal" href="#promod3.scoring.BackboneScorer.CalculateScore" title="promod3.scoring.BackboneScorer.CalculateScore"><code class="xref py py-meth docutils literal"><span class="pre">BackboneScorer.CalculateScore()</span></code></a>.</p>
+<code class="descname">Calculate</code><span class="sig-paren">(</span><em>key</em>, <em>start_resnum</em>, <em>num_residues</em>, <em>chain_idx=0</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.scoring.BackboneOverallScorer.Calculate" title="Permalink to this definition">¶</a></dt>
+<dd><p>Calculate score for one or several stretches of amino acids given the
+current scoring environment.</p>
 <table class="docutils field-list" frame="void" rules="none">
 <col class="field-name" />
 <col class="field-body" />
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
 <li><strong>key</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#str" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">str</span></code></a>) &#8211; Key for desired scorer.</li>
-<li><strong>bb_list</strong> (<a class="reference internal" href="../loop/backbone.html#promod3.loop.BackboneList" title="promod3.loop.BackboneList"><code class="xref py py-class docutils literal"><span class="pre">BackboneList</span></code></a> / <code class="xref py py-class docutils literal"><span class="pre">list</span></code> of
-<a class="reference internal" href="../loop/backbone.html#promod3.loop.BackboneList" title="promod3.loop.BackboneList"><code class="xref py py-class docutils literal"><span class="pre">BackboneList</span></code></a>) &#8211; Loop(s) for which to calculate the given score</li>
-<li><strong>start_resnum</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Res. number defining the position in the SEQRES
+<li><strong>start_resnum</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a> / <code class="xref py py-class docutils literal"><span class="pre">list</span></code> of <a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Res. number defining the position in the SEQRES
 (see <a class="reference internal" href="backbone_score_env.html#promod3.scoring.BackboneScoreEnv" title="promod3.scoring.BackboneScoreEnv"><code class="xref py py-class docutils literal"><span class="pre">BackboneScoreEnv</span></code></a> for indexing)</li>
-<li><strong>chain_idx</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Index of chain the loop(s) belong to
+<li><strong>num_residues</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a> / <code class="xref py py-class docutils literal"><span class="pre">list</span></code> of <a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Number of residues in the stretch(es) to score</li>
+<li><strong>chain_idx</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a> / <code class="xref py py-class docutils literal"><span class="pre">list</span></code> of <a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Index of chain the stretch(es) belongs to
 (see <a class="reference internal" href="backbone_score_env.html#promod3.scoring.BackboneScoreEnv" title="promod3.scoring.BackboneScoreEnv"><code class="xref py py-class docutils literal"><span class="pre">BackboneScoreEnv</span></code></a> for indexing)</li>
 </ul>
 </td>
 </tr>
-<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Score(s) calculated with the desired scorer for the given loop(s).
-In the case of multiple loops, the returned list has the same
-order as the input.</p>
+<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Score calculated with the desired scorer for the given stretch(es).</p>
 </td>
 </tr>
-<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first"><a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a> / <code class="xref py py-class docutils literal"><span class="pre">list</span></code> of <a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a></p>
+<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first"><a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a></p>
 </td>
 </tr>
 <tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last"><a class="reference external" href="https://docs.python.org/2.7/library/exceptions.html#exceptions.RuntimeError" title="(in Python v2.7)"><code class="xref py py-exc docutils literal"><span class="pre">RuntimeError</span></code></a> if there is no scorer with that
@@ -138,8 +137,9 @@ order as the input.</p>
 
 <dl class="method">
 <dt id="promod3.scoring.BackboneOverallScorer.CalculateLinearCombination">
-<code class="descname">CalculateLinearCombination</code><span class="sig-paren">(</span><em>linear_weights</em>, <em>bb_list</em>, <em>start_resnum</em>, <em>chain_idx=0</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.scoring.BackboneOverallScorer.CalculateLinearCombination" title="Permalink to this definition">¶</a></dt>
-<dd><p>Calculate linear combination(s) of scores for one or many loop(s).</p>
+<code class="descname">CalculateLinearCombination</code><span class="sig-paren">(</span><em>linear_weights</em>, <em>start_resnum</em>, <em>num_residues</em>, <em>chain_idx=0</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.scoring.BackboneOverallScorer.CalculateLinearCombination" title="Permalink to this definition">¶</a></dt>
+<dd><p>Calculate linear combination of scores for one or several stretches of
+amino acids given the current scoring environment.</p>
 <table class="docutils field-list" frame="void" rules="none">
 <col class="field-name" />
 <col class="field-body" />
@@ -149,21 +149,19 @@ order as the input.</p>
 values: <a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>)) &#8211; Weights for each desired scorer. You can add a
 constant value to each score by defining a weight
 with key &#8220;intercept&#8221;.</li>
-<li><strong>bb_list</strong> (<a class="reference internal" href="../loop/backbone.html#promod3.loop.BackboneList" title="promod3.loop.BackboneList"><code class="xref py py-class docutils literal"><span class="pre">BackboneList</span></code></a> / <code class="xref py py-class docutils literal"><span class="pre">list</span></code> of
-<a class="reference internal" href="../loop/backbone.html#promod3.loop.BackboneList" title="promod3.loop.BackboneList"><code class="xref py py-class docutils literal"><span class="pre">BackboneList</span></code></a>) &#8211; Loop(s) for which to calculate the given score</li>
-<li><strong>start_resnum</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Res. number defining the position in the SEQRES
+<li><strong>start_resnum</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a> / <code class="xref py py-class docutils literal"><span class="pre">list</span></code> of <a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Res. number defining the position in the SEQRES
 (see <a class="reference internal" href="backbone_score_env.html#promod3.scoring.BackboneScoreEnv" title="promod3.scoring.BackboneScoreEnv"><code class="xref py py-class docutils literal"><span class="pre">BackboneScoreEnv</span></code></a> for indexing)</li>
-<li><strong>chain_idx</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Index of chain the loop(s) belong to
+<li><strong>num_residues</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a> / <code class="xref py py-class docutils literal"><span class="pre">list</span></code> of <a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Number of residues in the stretch(es) to score</li>
+<li><strong>chain_idx</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a> / <code class="xref py py-class docutils literal"><span class="pre">list</span></code> of <a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Index of chain the stretch(es) belongs to
 (see <a class="reference internal" href="backbone_score_env.html#promod3.scoring.BackboneScoreEnv" title="promod3.scoring.BackboneScoreEnv"><code class="xref py py-class docutils literal"><span class="pre">BackboneScoreEnv</span></code></a> for indexing)</li>
 </ul>
 </td>
 </tr>
-<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Linear combination(s) of the scores calculated with the desired
-scorers for the given loop(s). In the case of multiple loops, the
-returned list has the same order as the input.</p>
+<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Linear combination of the scores calculated with the desired
+scorers for the given stretch(es)</p>
 </td>
 </tr>
-<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first"><a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a> / <code class="xref py py-class docutils literal"><span class="pre">list</span></code> of <a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a></p>
+<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first"><a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a></p>
 </td>
 </tr>
 <tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last"><a class="reference external" href="https://docs.python.org/2.7/library/exceptions.html#exceptions.RuntimeError" title="(in Python v2.7)"><code class="xref py py-exc docutils literal"><span class="pre">RuntimeError</span></code></a> if <em>linear_weights</em> has a <em>key</em> for
@@ -202,7 +200,7 @@ which no scorer exists or anything raised in
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">Loads or creates the default scorers accessible through
 following keys:
-&#8220;cb_packing&#8221;, &#8220;cbeta&#8221;, &#8220;reduced&#8221;, &#8220;clash&#8221;, &#8220;hbond&#8221;, &#8220;ss_agreement&#8221;,&#8221;torsion&#8221;, &#8220;pairwise&#8221;, &#8220;density&#8221;</td>
+&#8220;cb_packing&#8221;, &#8220;cbeta&#8221;, &#8220;reduced&#8221;, &#8220;clash&#8221;, &#8220;hbond&#8221;, &#8220;ss_agreement&#8221;,&#8221;torsion&#8221;, &#8220;pairwise&#8221;</td>
 </tr>
 <tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference internal" href="#promod3.scoring.BackboneOverallScorer" title="promod3.scoring.BackboneOverallScorer"><code class="xref py py-class docutils literal"><span class="pre">BackboneOverallScorer</span></code></a></td>
 </tr>
@@ -232,25 +230,24 @@ following keys:
 
 <dl class="method">
 <dt id="promod3.scoring.BackboneScorer.CalculateScore">
-<code class="descname">CalculateScore</code><span class="sig-paren">(</span><em>bb_list</em>, <em>start_resnum</em>, <em>chain_idx=0</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.scoring.BackboneScorer.CalculateScore" title="Permalink to this definition">¶</a></dt>
-<dd><p>Calculates score for the given loop internally and against the set
-environment. Data in the environment, which overlaps with the given
-<em>bb_list</em> is ignored. Unless otherwise noted in the scorer, a lower &#8220;score&#8221;
-is better!</p>
+<code class="descname">CalculateScore</code><span class="sig-paren">(</span><em>start_resnum</em>, <em>num_residues</em>, <em>chain_idx=0</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.scoring.BackboneScorer.CalculateScore" title="Permalink to this definition">¶</a></dt>
+<dd><p>Calculates score for one or several stretches given the structural
+information in the attached environment. Unless otherwise noted in the
+scorer, a lower &#8220;score&#8221; is better!</p>
 <table class="docutils field-list" frame="void" rules="none">
 <col class="field-name" />
 <col class="field-body" />
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
-<li><strong>bb_list</strong> (<a class="reference internal" href="../loop/backbone.html#promod3.loop.BackboneList" title="promod3.loop.BackboneList"><code class="xref py py-class docutils literal"><span class="pre">BackboneList</span></code></a>) &#8211; Loop for which to calculate the given score</li>
-<li><strong>start_resnum</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Res. number defining the position in the SEQRES
+<li><strong>start_resnum</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a> / <code class="xref py py-class docutils literal"><span class="pre">list</span></code> of <a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Res. number defining the position in the SEQRES
 (see <a class="reference internal" href="backbone_score_env.html#promod3.scoring.BackboneScoreEnv" title="promod3.scoring.BackboneScoreEnv"><code class="xref py py-class docutils literal"><span class="pre">BackboneScoreEnv</span></code></a> for indexing)</li>
-<li><strong>chain_idx</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Index of chain the loop belongs to
+<li><strong>num_residues</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a> / <code class="xref py py-class docutils literal"><span class="pre">list</span></code> of <a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Number of residues in the stretch(es) to score</li>
+<li><strong>chain_idx</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a> / <code class="xref py py-class docutils literal"><span class="pre">list</span></code> of <a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Index of chain the stretch(es) belongs to
 (see <a class="reference internal" href="backbone_score_env.html#promod3.scoring.BackboneScoreEnv" title="promod3.scoring.BackboneScoreEnv"><code class="xref py py-class docutils literal"><span class="pre">BackboneScoreEnv</span></code></a> for indexing)</li>
 </ul>
 </td>
 </tr>
-<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Score for the given loop.</p>
+<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Score for the given stretch(es).</p>
 </td>
 </tr>
 <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first"><a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a></p>
@@ -258,8 +255,8 @@ is better!</p>
 </tr>
 <tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last">(for most scorers) <a class="reference external" href="https://docs.python.org/2.7/library/exceptions.html#exceptions.RuntimeError" title="(in Python v2.7)"><code class="xref py py-exc docutils literal"><span class="pre">RuntimeError</span></code></a> if scorer was
 never attached to a score environment, if scorer has never been
-properly initialized or if <em>chain_index</em> / <em>start_resnum</em> lead to
-invalid positions.</p>
+properly initialized or if <em>start_resnum</em> / <em>num_residues</em> /
+<em>chain_idx</em> lead to invalid positions.</p>
 </td>
 </tr>
 </tbody>
@@ -268,27 +265,27 @@ invalid positions.</p>
 
 <dl class="method">
 <dt id="promod3.scoring.BackboneScorer.CalculateScoreProfile">
-<code class="descname">CalculateScoreProfile</code><span class="sig-paren">(</span><em>bb_list</em>, <em>start_resnum</em>, <em>chain_idx=0</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.scoring.BackboneScorer.CalculateScoreProfile" title="Permalink to this definition">¶</a></dt>
-<dd><p>Calculates per residue scores for the given loop internally and against the
-set environment. Data in the environment, which overlaps with the given
-<em>bb_list</em> is ignored.</p>
+<code class="descname">CalculateScoreProfile</code><span class="sig-paren">(</span><em>start_resnum</em>, <em>num_residues</em>, <em>chain_idx=0</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.scoring.BackboneScorer.CalculateScoreProfile" title="Permalink to this definition">¶</a></dt>
+<dd><p>Calculates per residue scores for one or several stretches given the
+structural information in the attached environment.</p>
 <table class="docutils field-list" frame="void" rules="none">
 <col class="field-name" />
 <col class="field-body" />
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
-<li><strong>bb_list</strong> (<a class="reference internal" href="../loop/backbone.html#promod3.loop.BackboneList" title="promod3.loop.BackboneList"><code class="xref py py-class docutils literal"><span class="pre">BackboneList</span></code></a>) &#8211; Loop for which to calculate the given scores</li>
-<li><strong>start_resnum</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Res. number defining the position in the SEQRES
+<li><strong>start_resnum</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a> / <code class="xref py py-class docutils literal"><span class="pre">list</span></code> of <a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Res. number defining the position in the SEQRES
 (see <a class="reference internal" href="backbone_score_env.html#promod3.scoring.BackboneScoreEnv" title="promod3.scoring.BackboneScoreEnv"><code class="xref py py-class docutils literal"><span class="pre">BackboneScoreEnv</span></code></a> for indexing)</li>
-<li><strong>chain_idx</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Index of chain the loop belongs to
+<li><strong>num_residues</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a> / <code class="xref py py-class docutils literal"><span class="pre">list</span></code> of <a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Number of residues in the stretch(es) to score</li>
+<li><strong>chain_idx</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a> / <code class="xref py py-class docutils literal"><span class="pre">list</span></code> of <a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Index of chain the stretch(es) belongs to
 (see <a class="reference internal" href="backbone_score_env.html#promod3.scoring.BackboneScoreEnv" title="promod3.scoring.BackboneScoreEnv"><code class="xref py py-class docutils literal"><span class="pre">BackboneScoreEnv</span></code></a> for indexing)</li>
 </ul>
 </td>
 </tr>
-<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Scores for the given loop, one for each residue.</p>
+<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Scores for the given stretch(es), one for each residue.</p>
 </td>
 </tr>
-<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first"><code class="xref py py-class docutils literal"><span class="pre">list</span></code> of <a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a></p>
+<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first"><code class="xref py py-class docutils literal"><span class="pre">list</span></code> of <a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a> or <code class="xref py py-class docutils literal"><span class="pre">list</span></code> of <code class="xref py py-class docutils literal"><span class="pre">list</span></code>
+of <a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a></p>
 </td>
 </tr>
 <tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last">same <a class="reference external" href="https://docs.python.org/2.7/library/exceptions.html#exceptions.RuntimeError" title="(in Python v2.7)"><code class="xref py py-exc docutils literal"><span class="pre">RuntimeError</span></code></a> as <a class="reference internal" href="#promod3.scoring.BackboneScorer.CalculateScore" title="promod3.scoring.BackboneScorer.CalculateScore"><code class="xref py py-meth docutils literal"><span class="pre">CalculateScore()</span></code></a>.</p>
@@ -308,25 +305,7 @@ set environment. Data in the environment, which overlaps with the given
 <em class="property">class </em><code class="descclassname">promod3.scoring.</code><code class="descname">CBPackingScorer</code><span class="sig-paren">(</span><em>cutoff</em>, <em>max_count</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.scoring.CBPackingScorer" title="Permalink to this definition">¶</a></dt>
 <dd><p>Inherits all functionality of <a class="reference internal" href="#promod3.scoring.BackboneScorer" title="promod3.scoring.BackboneScorer"><code class="xref py py-class docutils literal"><span class="pre">BackboneScorer</span></code></a>. Evaluates pseudo
 energies by counting the number of other CB positions within a certain
-<em>cutoff</em> radius of the CB position of the residue to be evaluated. The
-calculated score is normalized by the number of residues in the loop.
-In the default mode, the scorer scores a <a class="reference internal" href="../loop/backbone.html#promod3.loop.BackboneList" title="promod3.loop.BackboneList"><code class="xref py py-class docutils literal"><span class="pre">promod3.loop.BackboneList</span></code></a>
-given the defined environment. By placing this
-<a class="reference internal" href="../loop/backbone.html#promod3.loop.BackboneList" title="promod3.loop.BackboneList"><code class="xref py py-class docutils literal"><span class="pre">promod3.loop.BackboneList</span></code></a>, the score of the residues in the
-environment also change. It is possible to honour this effect by using the
-&#8220;IncludeEnv&#8221; mode. In this alternative mode, every environment residue close
-to the input <a class="reference internal" href="../loop/backbone.html#promod3.loop.BackboneList" title="promod3.loop.BackboneList"><code class="xref py py-class docutils literal"><span class="pre">promod3.loop.BackboneList</span></code></a> also contributes
-to the final score by adding the difference in score when the environment
-residue sees the original environment and the score when the environment would
-be modified by the <a class="reference internal" href="../loop/backbone.html#promod3.loop.BackboneList" title="promod3.loop.BackboneList"><code class="xref py py-class docutils literal"><span class="pre">promod3.loop.BackboneList</span></code></a>. You choose the mode
-by specifically calling the according CalculateEnergy functions.
-If you call the CalculateScore function from the parent class
-(e.g. when the scorer is part of the <a class="reference internal" href="#promod3.scoring.BackboneOverallScorer" title="promod3.scoring.BackboneOverallScorer"><code class="xref py py-class docutils literal"><span class="pre">BackboneOverallScorer</span></code></a>), it
-gets checked what mode is currently active. You can toggle the mode by calling
-the appropriate functions in this class. By default (when you load a scorer or
-when you create a new scorer) the classic version gets called. If you want to
-get per residue scores, the &#8220;IncludeEnv&#8221; mode makes not much sense and the
-scorer throws an error if a profile is requeset in this mode.</p>
+<em>cutoff</em> radius of the CB position of the residue to be evaluated.</p>
 <p>The scorer needs to be initialized either by loading a predefined scorer (e.g.
 <a class="reference internal" href="#promod3.scoring.LoadCBPackingScorer" title="promod3.scoring.LoadCBPackingScorer"><code class="xref py py-func docutils literal"><span class="pre">LoadCBPackingScorer()</span></code></a>) or by setting all energies (see
 <a class="reference internal" href="#promod3.scoring.CBPackingScorer.SetEnergy" title="promod3.scoring.CBPackingScorer.SetEnergy"><code class="xref py py-meth docutils literal"><span class="pre">SetEnergy()</span></code></a>).</p>
@@ -365,7 +344,7 @@ less machine-dependent).</p>
 <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference internal" href="#promod3.scoring.CBPackingScorer" title="promod3.scoring.CBPackingScorer"><code class="xref py py-class docutils literal"><span class="pre">CBPackingScorer</span></code></a></td>
 </tr>
 <tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/2.7/library/exceptions.html#exceptions.RuntimeError" title="(in Python v2.7)"><code class="xref py py-exc docutils literal"><span class="pre">RuntimeError</span></code></a> if file cannot be opened or if
-file cannot be parsed (see <a class="reference internal" href="../portableIO.html#portableio"><span>here</span></a> for details).</td>
+file cannot be parsed (see <a class="reference internal" href="../portableIO.html#portableio"><span class="std std-ref">here</span></a> for details).</td>
 </tr>
 </tbody>
 </table>
@@ -377,7 +356,7 @@ file cannot be parsed (see <a class="reference internal" href="../portableIO.htm
 <dt id="promod3.scoring.CBPackingScorer.SavePortable">
 <code class="descname">SavePortable</code><span class="sig-paren">(</span><em>filename</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.scoring.CBPackingScorer.SavePortable" title="Permalink to this definition">¶</a></dt>
 <dd><p>Saves a raw / portable binary representation. Use portable files for
-distribution and convert locally to raw files. See <a class="reference internal" href="../portableIO.html#portableio"><span>here</span></a>
+distribution and convert locally to raw files. See <a class="reference internal" href="../portableIO.html#portableio"><span class="std std-ref">here</span></a>
 for details.</p>
 <table class="docutils field-list" frame="void" rules="none">
 <col class="field-name" />
@@ -401,7 +380,7 @@ called for every type of amino acids and for every <em>count</em> &lt;= <em>max_
 <col class="field-body" />
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
-<li><strong>aa</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.AminoAcid</span></code></a>) &#8211; Amino acid for which to set energy.</li>
+<li><strong>aa</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.AminoAcid</span></code></a>) &#8211; Amino acid for which to set energy.</li>
 <li><strong>count</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Number of surrounding CB positions for which to set energy.</li>
 <li><strong>energy</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>) &#8211; Energy to set for those parameters.</li>
 </ul>
@@ -415,18 +394,17 @@ called for every type of amino acids and for every <em>count</em> &lt;= <em>max_
 </dd></dl>
 
 <dl class="method">
-<dt id="promod3.scoring.CBPackingScorer.UseClassicMode">
-<code class="descname">UseClassicMode</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#promod3.scoring.CBPackingScorer.UseClassicMode" title="Permalink to this definition">¶</a></dt>
-<dd><p>If you call this function, the default mode is set to classic if the
-CalculateScore function from the parent class gets called.</p>
-</dd></dl>
-
-<dl class="method">
-<dt id="promod3.scoring.CBPackingScorer.UseIncludeEnvMode">
-<code class="descname">UseIncludeEnvMode</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#promod3.scoring.CBPackingScorer.UseIncludeEnvMode" title="Permalink to this definition">¶</a></dt>
-<dd><p>If you call this function, the default mode is set to the
-described alternative mode if the CalculateScore function from the parent
-class gets called.</p>
+<dt id="promod3.scoring.CBPackingScorer.DoNormalize">
+<code class="descname">DoNormalize</code><span class="sig-paren">(</span><em>do_it</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.scoring.CBPackingScorer.DoNormalize" title="Permalink to this definition">¶</a></dt>
+<dd><table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>do_it</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#bool" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">bool</span></code></a>) &#8211; Whether to normalize the calculated scores by the number
+of residues to be scored. True by default.</td>
+</tr>
+</tbody>
+</table>
 </dd></dl>
 
 </dd></dl>
@@ -455,9 +433,8 @@ class gets called.</p>
 <dd><p>Inherits all functionality of <a class="reference internal" href="#promod3.scoring.BackboneScorer" title="promod3.scoring.BackboneScorer"><code class="xref py py-class docutils literal"><span class="pre">BackboneScorer</span></code></a>. Evaluates a pairwise
 pseudo interaction energy between CB atoms which are located within a <em>cutoff</em>
 and which are at least <em>seq_sep</em> residues apart. An energy is assigned to each
-distance using <em>bins</em> equally sized bins and distinguishing all possible pairs
-of amino acids. The calculated score is normalized by the number of
-interacting CB pairs.</p>
+distance using equally sized bins and distinguishing all possible pairs
+of amino acids.</p>
 <p>The scorer needs to be initialized either by loading a predefined scorer (e.g.
 <a class="reference internal" href="#promod3.scoring.LoadCBetaScorer" title="promod3.scoring.LoadCBetaScorer"><code class="xref py py-func docutils literal"><span class="pre">LoadCBetaScorer()</span></code></a>) or by setting all energies (see <a class="reference internal" href="#promod3.scoring.CBetaScorer.SetEnergy" title="promod3.scoring.CBetaScorer.SetEnergy"><code class="xref py py-meth docutils literal"><span class="pre">SetEnergy()</span></code></a>).</p>
 <table class="docutils field-list" frame="void" rules="none">
@@ -498,7 +475,7 @@ less machine-dependent).</p>
 <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference internal" href="#promod3.scoring.CBetaScorer" title="promod3.scoring.CBetaScorer"><code class="xref py py-class docutils literal"><span class="pre">CBetaScorer</span></code></a></td>
 </tr>
 <tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/2.7/library/exceptions.html#exceptions.RuntimeError" title="(in Python v2.7)"><code class="xref py py-exc docutils literal"><span class="pre">RuntimeError</span></code></a> if file cannot be opened or if
-file cannot be parsed (see <a class="reference internal" href="../portableIO.html#portableio"><span>here</span></a> for details).</td>
+file cannot be parsed (see <a class="reference internal" href="../portableIO.html#portableio"><span class="std std-ref">here</span></a> for details).</td>
 </tr>
 </tbody>
 </table>
@@ -510,7 +487,7 @@ file cannot be parsed (see <a class="reference internal" href="../portableIO.htm
 <dt id="promod3.scoring.CBetaScorer.SavePortable">
 <code class="descname">SavePortable</code><span class="sig-paren">(</span><em>filename</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.scoring.CBetaScorer.SavePortable" title="Permalink to this definition">¶</a></dt>
 <dd><p>Saves a raw / portable binary representation. Use portable files for
-distribution and convert locally to raw files. See <a class="reference internal" href="../portableIO.html#portableio"><span>here</span></a>
+distribution and convert locally to raw files. See <a class="reference internal" href="../portableIO.html#portableio"><span class="std std-ref">here</span></a>
 for details.</p>
 <table class="docutils field-list" frame="void" rules="none">
 <col class="field-name" />
@@ -528,14 +505,17 @@ for details.</p>
 <dt id="promod3.scoring.CBetaScorer.SetEnergy">
 <code class="descname">SetEnergy</code><span class="sig-paren">(</span><em>aa1</em>, <em>aa2</em>, <em>bin</em>, <em>energy</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.scoring.CBetaScorer.SetEnergy" title="Permalink to this definition">¶</a></dt>
 <dd><p>Setup one energy value. Unless a predefined scorer is loaded, this must be
-called for every pair of amino acids and for every <em>bin</em> &lt; <em>bins</em>.</p>
+called for every pair of amino acids and for every <em>bin</em> &lt; <em>bins</em>.
+Internal symmetry is enforced =&gt; Calling SetEnergy(aa1, aa2, bin, energy) is
+equivalent to calling SetEnergy(aa1, aa2, bin, energy) AND
+SetEnergy(aa2, aa1, bin, energy).</p>
 <table class="docutils field-list" frame="void" rules="none">
 <col class="field-name" />
 <col class="field-body" />
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
-<li><strong>aa1</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.AminoAcid</span></code></a>) &#8211; Amino acid for first interaction partner.</li>
-<li><strong>aa2</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.AminoAcid</span></code></a>) &#8211; Amino acid for second interaction partner.</li>
+<li><strong>aa1</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.AminoAcid</span></code></a>) &#8211; Amino acid for first interaction partner.</li>
+<li><strong>aa2</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.AminoAcid</span></code></a>) &#8211; Amino acid for second interaction partner.</li>
 <li><strong>bin</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Discrete bin describing the interaction distance.</li>
 <li><strong>energy</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>) &#8211; Energy to set for those parameters.</li>
 </ul>
@@ -548,6 +528,49 @@ called for every pair of amino acids and for every <em>bin</em> &lt; <em>bins</e
 </table>
 </dd></dl>
 
+<dl class="method">
+<dt id="promod3.scoring.CBetaScorer.DoInternalScores">
+<code class="descname">DoInternalScores</code><span class="sig-paren">(</span><em>do_it</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.scoring.CBetaScorer.DoInternalScores" title="Permalink to this definition">¶</a></dt>
+<dd><table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>do_it</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#bool" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">bool</span></code></a>) &#8211; Whether to include pairwise interactions between
+the scored residues. True by default.</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="method">
+<dt id="promod3.scoring.CBetaScorer.DoExternalScores">
+<code class="descname">DoExternalScores</code><span class="sig-paren">(</span><em>do_it</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.scoring.CBetaScorer.DoExternalScores" title="Permalink to this definition">¶</a></dt>
+<dd><table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>do_it</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#bool" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">bool</span></code></a>) &#8211; Whether to include pairwise interactions of the scored
+residues towards the surrounding environment.
+True by default.</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="method">
+<dt id="promod3.scoring.CBetaScorer.DoNormalize">
+<code class="descname">DoNormalize</code><span class="sig-paren">(</span><em>do_it</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.scoring.CBetaScorer.DoNormalize" title="Permalink to this definition">¶</a></dt>
+<dd><table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>do_it</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#bool" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">bool</span></code></a>) &#8211; Whether to normalize the calculated scores by the number
+of residues to be scored. True by default.</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
 </dd></dl>
 
 <dl class="function">
@@ -574,7 +597,7 @@ called for every pair of amino acids and for every <em>bin</em> &lt; <em>bins</e
 <dd><p>Inherits all functionality of <a class="reference internal" href="#promod3.scoring.BackboneScorer" title="promod3.scoring.BackboneScorer"><code class="xref py py-class docutils literal"><span class="pre">BackboneScorer</span></code></a>. Evaluates a pairwise
 pseudo interaction energy between the reduced representation of residues.
 Every residue gets represented by its CA position p and a directional
-component <code class="docutils literal"><span class="pre">v</span> <span class="pre">=</span> <span class="pre">norm(ca_pos-n_pos)</span> <span class="pre">+</span> <span class="pre">norm</span> <span class="pre">(ca_pos-c_pos)</span></code>. Residues with CA
+component <code class="docutils literal"><span class="pre">v</span> <span class="pre">=</span> <span class="pre">norm(p-n_pos)</span> <span class="pre">+</span> <span class="pre">norm(p-c_pos)</span></code>. Residues with CA
 distance &lt; <em>cutoff</em> and which are at least <em>seq_sep</em> residues apart are
 considered to be interacting. For interacting residues r1 and r2, we can
 define a line l between p1 and p2. The potential then considers:</p>
@@ -584,9 +607,6 @@ define a line l between p1 and p2. The potential then considers:</p>
 <li>beta =&gt; angle between v2 and l</li>
 <li>gamma =&gt; dihedral between (p1+v1,p1,p2,p2+v2)</li>
 </ul>
-<p>Every pairwise interaction within the loop and to the environment gets
-evaluated according to the given parametrization, summed up and finally
-normalized by the number of total interactions.</p>
 <p>The scorer needs to be initialized either by loading a predefined scorer (e.g.
 <a class="reference internal" href="#promod3.scoring.LoadReducedScorer" title="promod3.scoring.LoadReducedScorer"><code class="xref py py-func docutils literal"><span class="pre">LoadReducedScorer()</span></code></a>) or by setting all energies (see <a class="reference internal" href="#promod3.scoring.ReducedScorer.SetEnergy" title="promod3.scoring.ReducedScorer.SetEnergy"><code class="xref py py-meth docutils literal"><span class="pre">SetEnergy()</span></code></a>).</p>
 <table class="docutils field-list" frame="void" rules="none">
@@ -631,7 +651,7 @@ less machine-dependent).</p>
 <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference internal" href="#promod3.scoring.ReducedScorer" title="promod3.scoring.ReducedScorer"><code class="xref py py-class docutils literal"><span class="pre">ReducedScorer</span></code></a></td>
 </tr>
 <tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/2.7/library/exceptions.html#exceptions.RuntimeError" title="(in Python v2.7)"><code class="xref py py-exc docutils literal"><span class="pre">RuntimeError</span></code></a> if file cannot be opened or if
-file cannot be parsed (see <a class="reference internal" href="../portableIO.html#portableio"><span>here</span></a> for details).</td>
+file cannot be parsed (see <a class="reference internal" href="../portableIO.html#portableio"><span class="std std-ref">here</span></a> for details).</td>
 </tr>
 </tbody>
 </table>
@@ -643,7 +663,7 @@ file cannot be parsed (see <a class="reference internal" href="../portableIO.htm
 <dt id="promod3.scoring.ReducedScorer.SavePortable">
 <code class="descname">SavePortable</code><span class="sig-paren">(</span><em>filename</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.scoring.ReducedScorer.SavePortable" title="Permalink to this definition">¶</a></dt>
 <dd><p>Saves a raw / portable binary representation. Use portable files for
-distribution and convert locally to raw files. See <a class="reference internal" href="../portableIO.html#portableio"><span>here</span></a>
+distribution and convert locally to raw files. See <a class="reference internal" href="../portableIO.html#portableio"><span class="std std-ref">here</span></a>
 for details.</p>
 <table class="docutils field-list" frame="void" rules="none">
 <col class="field-name" />
@@ -663,14 +683,19 @@ for details.</p>
 <dd><p>Setup one energy value. Unless a predefined scorer is loaded, this must be
 called for every pair of amino acids, every <em>dist_bin</em> &lt; <em>dist_bins</em>, every
 <em>alpha_bin</em> &lt; <em>angle_bins</em>, every <em>beta_bin</em> &lt; <em>angle_bins</em> and every
-<em>gamma_bin</em> &lt; <em>dihedral_bins</em>.</p>
+<em>gamma_bin</em> &lt; <em>dihedral_bins</em>.
+Internal symmetry is enforced =&gt; Calling
+SetEnergy(aa1, aa2, dist_bin, alpha_bin, beta_bin, energy) is
+equivalent to calling
+SetEnergy(aa1, aa2, dist_bin, alpha_bin, beta_bin, energy) AND
+SetEnergy(aa2, aa1, dist_bin, beta_bin, alpha_bin, energy).</p>
 <table class="docutils field-list" frame="void" rules="none">
 <col class="field-name" />
 <col class="field-body" />
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
-<li><strong>aa1</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.AminoAcid</span></code></a>) &#8211; Amino acid for first interaction partner.</li>
-<li><strong>aa2</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.AminoAcid</span></code></a>) &#8211; Amino acid for second interaction partner.</li>
+<li><strong>aa1</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.AminoAcid</span></code></a>) &#8211; Amino acid for first interaction partner.</li>
+<li><strong>aa2</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.AminoAcid</span></code></a>) &#8211; Amino acid for second interaction partner.</li>
 <li><strong>dist_bin</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Discrete bin describing the interaction distance.</li>
 <li><strong>alpha_bin</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Discrete bin describing the alpha angle.</li>
 <li><strong>beta_bin</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Discrete bin describing the beta angle.</li>
@@ -686,6 +711,49 @@ called for every pair of amino acids, every <em>dist_bin</em> &lt; <em>dist_bins
 </table>
 </dd></dl>
 
+<dl class="method">
+<dt id="promod3.scoring.ReducedScorer.DoInternalScores">
+<code class="descname">DoInternalScores</code><span class="sig-paren">(</span><em>do_it</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.scoring.ReducedScorer.DoInternalScores" title="Permalink to this definition">¶</a></dt>
+<dd><table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>do_it</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#bool" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">bool</span></code></a>) &#8211; Whether to include pairwise interactions between
+the scored residues. True by default.</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="method">
+<dt id="promod3.scoring.ReducedScorer.DoExternalScores">
+<code class="descname">DoExternalScores</code><span class="sig-paren">(</span><em>do_it</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.scoring.ReducedScorer.DoExternalScores" title="Permalink to this definition">¶</a></dt>
+<dd><table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>do_it</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#bool" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">bool</span></code></a>) &#8211; Whether to include pairwise interactions of the scored
+residues towards the surrounding environment.
+True by default.</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="method">
+<dt id="promod3.scoring.ReducedScorer.DoNormalize">
+<code class="descname">DoNormalize</code><span class="sig-paren">(</span><em>do_it</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.scoring.ReducedScorer.DoNormalize" title="Permalink to this definition">¶</a></dt>
+<dd><table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>do_it</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#bool" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">bool</span></code></a>) &#8211; Whether to normalize the calculated scores by the number
+of residues to be scored. True by default.</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
 </dd></dl>
 
 <dl class="function">
@@ -711,28 +779,51 @@ called for every pair of amino acids, every <em>dist_bin</em> &lt; <em>dist_bins
 <em class="property">class </em><code class="descclassname">promod3.scoring.</code><code class="descname">ClashScorer</code><a class="headerlink" href="#promod3.scoring.ClashScorer" title="Permalink to this definition">¶</a></dt>
 <dd><p>Inherits all functionality of <a class="reference internal" href="#promod3.scoring.BackboneScorer" title="promod3.scoring.BackboneScorer"><code class="xref py py-class docutils literal"><span class="pre">BackboneScorer</span></code></a>. Calculates a simple
 clash score of a loop itself and with the set environment. There is no need to
-define any parameters here as all interaction energies are fixed. The
-calculated score is normalized by the number of residues in the loop.</p>
+define any parameters here as all interaction energies are fixed (see Eq. (11)
+in <a class="reference internal" href="other_scoring_functions.html#canutescu2003b" id="id1">[canutescu2003b]</a>).</p>
+<dl class="method">
+<dt id="promod3.scoring.ClashScorer.DoInternalScores">
+<code class="descname">DoInternalScores</code><span class="sig-paren">(</span><em>do_it</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.scoring.ClashScorer.DoInternalScores" title="Permalink to this definition">¶</a></dt>
+<dd><table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>do_it</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#bool" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">bool</span></code></a>) &#8211; Whether to include pairwise interactions between
+the scored residues. True by default.</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="method">
+<dt id="promod3.scoring.ClashScorer.DoExternalScores">
+<code class="descname">DoExternalScores</code><span class="sig-paren">(</span><em>do_it</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.scoring.ClashScorer.DoExternalScores" title="Permalink to this definition">¶</a></dt>
+<dd><table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>do_it</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#bool" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">bool</span></code></a>) &#8211; Whether to include pairwise interactions of the scored
+residues towards the surrounding environment.
+True by default.</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="method">
+<dt id="promod3.scoring.ClashScorer.DoNormalize">
+<code class="descname">DoNormalize</code><span class="sig-paren">(</span><em>do_it</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.scoring.ClashScorer.DoNormalize" title="Permalink to this definition">¶</a></dt>
+<dd><table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>do_it</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#bool" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">bool</span></code></a>) &#8211; Whether to normalize the calculated scores by the number
+of residues to be scored. True by default.</td>
+</tr>
+</tbody>
+</table>
 </dd></dl>
 
-</div>
-<div class="section" id="densityscorer-class">
-<h2>DensityScorer class<a class="headerlink" href="#densityscorer-class" title="Permalink to this headline">¶</a></h2>
-<dl class="class">
-<dt id="promod3.scoring.DensityScorer">
-<em class="property">class </em><code class="descclassname">promod3.scoring.</code><code class="descname">DensityScorer</code><a class="headerlink" href="#promod3.scoring.DensityScorer" title="Permalink to this definition">¶</a></dt>
-<dd><p>Inherits all functionality of <a class="reference internal" href="#promod3.scoring.BackboneScorer" title="promod3.scoring.BackboneScorer"><code class="xref py py-class docutils literal"><span class="pre">BackboneScorer</span></code></a>. Calculates the
-normalized cross correlation between a density generated from the input
-<a class="reference internal" href="../loop/backbone.html#promod3.loop.BackboneList" title="promod3.loop.BackboneList"><code class="xref py py-class docutils literal"><span class="pre">BackboneList</span></code></a> and a set map.</p>
-<p>This scorer requires that the attached environment has a density map defined
-(see <a class="reference internal" href="backbone_score_env.html#promod3.scoring.BackboneScoreEnv.SetMap" title="promod3.scoring.BackboneScoreEnv.SetMap"><code class="xref py py-meth docutils literal"><span class="pre">BackboneScoreEnv.SetMap()</span></code></a>) as soon as a score is to be calculated.
-The <em>resolution</em> and <em>all_atom</em> flags that were specified in SetMap determine
-how the backbone list is translated into an artificial density map. If
-<em>all_atom</em> is set to False (which is recommended for low resolution maps), the
-artificial map gets constructed by only using CA positions instead of all
-atoms.</p>
-<p>Note that for this scorer a higher &#8220;score&#8221; is better! So take care when
-combining this to other scores, where it is commonly the other way around.</p>
 </dd></dl>
 
 </div>
@@ -757,9 +848,6 @@ states. State 1 for helical residues, state 2 for extended residues and state
 0 for other residues. If the state of two interacting particles is the same,
 thats the one from which the energy is extracted. In all other cases, the
 energy is extracted from the 0 state.</p>
-<p>Every pairwise interaction within the loop and to the environment gets
-evaluated according to the given parametrization, summed up and finally
-normalized by the number of residues in the loop.</p>
 <p>The scorer needs to be initialized either by loading a predefined scorer (e.g.
 <a class="reference internal" href="#promod3.scoring.LoadHBondScorer" title="promod3.scoring.LoadHBondScorer"><code class="xref py py-func docutils literal"><span class="pre">LoadHBondScorer()</span></code></a>) or by setting all energies (see <a class="reference internal" href="#promod3.scoring.HBondScorer.SetEnergy" title="promod3.scoring.HBondScorer.SetEnergy"><code class="xref py py-meth docutils literal"><span class="pre">SetEnergy()</span></code></a>).</p>
 <table class="docutils field-list" frame="void" rules="none">
@@ -811,7 +899,7 @@ less machine-dependent).</p>
 <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference internal" href="#promod3.scoring.HBondScorer" title="promod3.scoring.HBondScorer"><code class="xref py py-class docutils literal"><span class="pre">HBondScorer</span></code></a></td>
 </tr>
 <tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/2.7/library/exceptions.html#exceptions.RuntimeError" title="(in Python v2.7)"><code class="xref py py-exc docutils literal"><span class="pre">RuntimeError</span></code></a> if file cannot be opened or if
-file cannot be parsed (see <a class="reference internal" href="../portableIO.html#portableio"><span>here</span></a> for details).</td>
+file cannot be parsed (see <a class="reference internal" href="../portableIO.html#portableio"><span class="std std-ref">here</span></a> for details).</td>
 </tr>
 </tbody>
 </table>
@@ -823,7 +911,7 @@ file cannot be parsed (see <a class="reference internal" href="../portableIO.htm
 <dt id="promod3.scoring.HBondScorer.SavePortable">
 <code class="descname">SavePortable</code><span class="sig-paren">(</span><em>filename</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.scoring.HBondScorer.SavePortable" title="Permalink to this definition">¶</a></dt>
 <dd><p>Saves a raw / portable binary representation. Use portable files for
-distribution and convert locally to raw files. See <a class="reference internal" href="../portableIO.html#portableio"><span>here</span></a>
+distribution and convert locally to raw files. See <a class="reference internal" href="../portableIO.html#portableio"><span class="std std-ref">here</span></a>
 for details.</p>
 <table class="docutils field-list" frame="void" rules="none">
 <col class="field-name" />
@@ -866,6 +954,49 @@ called for every state ([0, 1, 2]), every <em>d_bin</em> &lt; <em>d_bins</em>, e
 </table>
 </dd></dl>
 
+<dl class="method">
+<dt id="promod3.scoring.HBondScorer.DoInternalScores">
+<code class="descname">DoInternalScores</code><span class="sig-paren">(</span><em>do_it</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.scoring.HBondScorer.DoInternalScores" title="Permalink to this definition">¶</a></dt>
+<dd><table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>do_it</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#bool" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">bool</span></code></a>) &#8211; Whether to include pairwise interactions between
+the scored residues. True by default.</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="method">
+<dt id="promod3.scoring.HBondScorer.DoExternalScores">
+<code class="descname">DoExternalScores</code><span class="sig-paren">(</span><em>do_it</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.scoring.HBondScorer.DoExternalScores" title="Permalink to this definition">¶</a></dt>
+<dd><table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>do_it</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#bool" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">bool</span></code></a>) &#8211; Whether to include pairwise interactions of the scored
+residues towards the surrounding environment.
+True by default.</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="method">
+<dt id="promod3.scoring.HBondScorer.DoNormalize">
+<code class="descname">DoNormalize</code><span class="sig-paren">(</span><em>do_it</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.scoring.HBondScorer.DoNormalize" title="Permalink to this definition">¶</a></dt>
+<dd><table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>do_it</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#bool" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">bool</span></code></a>) &#8211; Whether to normalize the calculated scores by the number
+of residues to be scored. True by default.</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
 </dd></dl>
 
 <dl class="function">
@@ -895,8 +1026,7 @@ psipred prediction, its confidence and the actually occurring secondary
 structure in the model. In every score evaluation, the secondary structure of
 the loop is estimated by searching for hydrogen bonds leading to a secondary
 structure as defined by dssp. The hbonds are searched internally in the loop
-as well as in the environment. The final score gets summed up over all
-residues in the loop and normalized by the number of residues.</p>
+as well as in the environment.</p>
 <p>The scorer needs to be initialized either by loading a predefined scorer (e.g.
 <a class="reference internal" href="#promod3.scoring.LoadSSAgreementScorer" title="promod3.scoring.LoadSSAgreementScorer"><code class="xref py py-func docutils literal"><span class="pre">LoadSSAgreementScorer()</span></code></a>) or by setting scores for all possible states
 (see <a class="reference internal" href="#promod3.scoring.SSAgreementScorer.SetScore" title="promod3.scoring.SSAgreementScorer.SetScore"><code class="xref py py-meth docutils literal"><span class="pre">SetScore()</span></code></a>).</p>
@@ -924,7 +1054,7 @@ less machine-dependent).</p>
 <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference internal" href="#promod3.scoring.SSAgreementScorer" title="promod3.scoring.SSAgreementScorer"><code class="xref py py-class docutils literal"><span class="pre">SSAgreementScorer</span></code></a></td>
 </tr>
 <tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/2.7/library/exceptions.html#exceptions.RuntimeError" title="(in Python v2.7)"><code class="xref py py-exc docutils literal"><span class="pre">RuntimeError</span></code></a> if file cannot be opened or if
-file cannot be parsed (see <a class="reference internal" href="../portableIO.html#portableio"><span>here</span></a> for details).</td>
+file cannot be parsed (see <a class="reference internal" href="../portableIO.html#portableio"><span class="std std-ref">here</span></a> for details).</td>
 </tr>
 </tbody>
 </table>
@@ -936,7 +1066,7 @@ file cannot be parsed (see <a class="reference internal" href="../portableIO.htm
 <dt id="promod3.scoring.SSAgreementScorer.SavePortable">
 <code class="descname">SavePortable</code><span class="sig-paren">(</span><em>filename</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.scoring.SSAgreementScorer.SavePortable" title="Permalink to this definition">¶</a></dt>
 <dd><p>Saves a raw / portable binary representation. Use portable files for
-distribution and convert locally to raw files. See <a class="reference internal" href="../portableIO.html#portableio"><span>here</span></a>
+distribution and convert locally to raw files. See <a class="reference internal" href="../portableIO.html#portableio"><span class="std std-ref">here</span></a>
 for details.</p>
 <table class="docutils field-list" frame="void" rules="none">
 <col class="field-name" />
@@ -974,6 +1104,20 @@ is loaded, this must be called for every combination of states.</p>
 </table>
 </dd></dl>
 
+<dl class="method">
+<dt id="promod3.scoring.SSAgreementScorer.DoNormalize">
+<code class="descname">DoNormalize</code><span class="sig-paren">(</span><em>do_it</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.scoring.SSAgreementScorer.DoNormalize" title="Permalink to this definition">¶</a></dt>
+<dd><table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>do_it</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#bool" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">bool</span></code></a>) &#8211; Whether to normalize the calculated scores by the number
+of residues to be scored. True by default.</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
 </dd></dl>
 
 <dl class="function">
@@ -999,9 +1143,7 @@ is loaded, this must be called for every combination of states.</p>
 <em class="property">class </em><code class="descclassname">promod3.scoring.</code><code class="descname">TorsionScorer</code><span class="sig-paren">(</span><em>group_definitions</em>, <em>torsion_bins</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.scoring.TorsionScorer" title="Permalink to this definition">¶</a></dt>
 <dd><p>Inherits all functionality of <a class="reference internal" href="#promod3.scoring.BackboneScorer" title="promod3.scoring.BackboneScorer"><code class="xref py py-class docutils literal"><span class="pre">BackboneScorer</span></code></a>. Evaluates pseudo
 energies based on the identity of three consecutive residues and the phi/psi
-dihedral angles of the central residue. Every residue gets evaluated according
-to the set parametrization and the final score gets normalized by the total
-number of summed pseudo energies. The first phi and last psi angle get
+dihedral angles of the central residue. The first phi and last psi angle get
 determined with the help of the environment if set.</p>
 <p>The scorer needs to be initialized either by loading a predefined scorer (e.g.
 <a class="reference internal" href="#promod3.scoring.LoadTorsionScorer" title="promod3.scoring.LoadTorsionScorer"><code class="xref py py-func docutils literal"><span class="pre">LoadTorsionScorer()</span></code></a>) or by setting all energies (see <a class="reference internal" href="#promod3.scoring.TorsionScorer.SetEnergy" title="promod3.scoring.TorsionScorer.SetEnergy"><code class="xref py py-meth docutils literal"><span class="pre">SetEnergy()</span></code></a>)
@@ -1045,7 +1187,7 @@ less machine-dependent).</p>
 <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference internal" href="#promod3.scoring.TorsionScorer" title="promod3.scoring.TorsionScorer"><code class="xref py py-class docutils literal"><span class="pre">TorsionScorer</span></code></a></td>
 </tr>
 <tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/2.7/library/exceptions.html#exceptions.RuntimeError" title="(in Python v2.7)"><code class="xref py py-exc docutils literal"><span class="pre">RuntimeError</span></code></a> if file cannot be opened or if
-file cannot be parsed (see <a class="reference internal" href="../portableIO.html#portableio"><span>here</span></a> for details).</td>
+file cannot be parsed (see <a class="reference internal" href="../portableIO.html#portableio"><span class="std std-ref">here</span></a> for details).</td>
 </tr>
 </tbody>
 </table>
@@ -1057,7 +1199,7 @@ file cannot be parsed (see <a class="reference internal" href="../portableIO.htm
 <dt id="promod3.scoring.TorsionScorer.SavePortable">
 <code class="descname">SavePortable</code><span class="sig-paren">(</span><em>filename</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.scoring.TorsionScorer.SavePortable" title="Permalink to this definition">¶</a></dt>
 <dd><p>Saves a raw / portable binary representation. Use portable files for
-distribution and convert locally to raw files. See <a class="reference internal" href="../portableIO.html#portableio"><span>here</span></a>
+distribution and convert locally to raw files. See <a class="reference internal" href="../portableIO.html#portableio"><span class="std std-ref">here</span></a>
 for details.</p>
 <table class="docutils field-list" frame="void" rules="none">
 <col class="field-name" />
@@ -1097,6 +1239,20 @@ numbering starting at 0.</li>
 </table>
 </dd></dl>
 
+<dl class="method">
+<dt id="promod3.scoring.TorsionScorer.DoNormalize">
+<code class="descname">DoNormalize</code><span class="sig-paren">(</span><em>do_it</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.scoring.TorsionScorer.DoNormalize" title="Permalink to this definition">¶</a></dt>
+<dd><table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>do_it</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#bool" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">bool</span></code></a>) &#8211; Whether to normalize the calculated scores by the number
+of residues to be scored. True by default.</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
 </dd></dl>
 
 <dl class="function">
@@ -1121,15 +1277,54 @@ numbering starting at 0.</li>
 <dt id="promod3.scoring.PairwiseScorer">
 <em class="property">class </em><code class="descclassname">promod3.scoring.</code><code class="descname">PairwiseScorer</code><a class="headerlink" href="#promod3.scoring.PairwiseScorer" title="Permalink to this definition">¶</a></dt>
 <dd><p>Inherits all functionality of <a class="reference internal" href="#promod3.scoring.BackboneScorer" title="promod3.scoring.BackboneScorer"><code class="xref py py-class docutils literal"><span class="pre">BackboneScorer</span></code></a>. Evaluates a list of
-generic pairwise functions (see <a class="reference internal" href="backbone_score_env.html#promod3.scoring.PairwiseFunction" title="promod3.scoring.PairwiseFunction"><code class="xref py py-class docutils literal"><span class="pre">PairwiseFunction</span></code></a>). When evaluating a
-loop, the scores of all pairwise functions which involve a residue in the loop
-are summed up (the other residue can be either in the loop or in the env.) and
-normalized by the number of residues in the loop.</p>
-<p>This scorer assumes that the attached environment has pairwise functions
-defined (see <a class="reference internal" href="backbone_score_env.html#promod3.scoring.BackboneScoreEnv.ApplyPairwiseFunction" title="promod3.scoring.BackboneScoreEnv.ApplyPairwiseFunction"><code class="xref py py-meth docutils literal"><span class="pre">BackboneScoreEnv.ApplyPairwiseFunction()</span></code></a>) as soon as a
-score is to be calculated.</p>
+generic pairwise functions (see <a class="reference internal" href="backbone_score_env.html#promod3.scoring.PairwiseFunction" title="promod3.scoring.PairwiseFunction"><code class="xref py py-class docutils literal"><span class="pre">PairwiseFunction</span></code></a>).
+That are set in the attached scoring environment
+(see <a class="reference internal" href="backbone_score_env.html#promod3.scoring.BackboneScoreEnv.ApplyPairwiseFunction" title="promod3.scoring.BackboneScoreEnv.ApplyPairwiseFunction"><code class="xref py py-meth docutils literal"><span class="pre">BackboneScoreEnv.ApplyPairwiseFunction()</span></code></a>).</p>
 <p>Note that for this scorer a higher &#8220;score&#8221; is better! So take care when
 combining this to other scores, where it is commonly the other way around.</p>
+<dl class="method">
+<dt id="promod3.scoring.PairwiseScorer.DoInternalScores">
+<code class="descname">DoInternalScores</code><span class="sig-paren">(</span><em>do_it</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.scoring.PairwiseScorer.DoInternalScores" title="Permalink to this definition">¶</a></dt>
+<dd><table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>do_it</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#bool" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">bool</span></code></a>) &#8211; Whether to include pairwise interactions between
+the scored residues. True by default.</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="method">
+<dt id="promod3.scoring.PairwiseScorer.DoExternalScores">
+<code class="descname">DoExternalScores</code><span class="sig-paren">(</span><em>do_it</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.scoring.PairwiseScorer.DoExternalScores" title="Permalink to this definition">¶</a></dt>
+<dd><table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>do_it</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#bool" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">bool</span></code></a>, true by default.) &#8211; Whether to include pairwise interactions of the scored
+residues towards the surrounding environment.
+True by default.</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="method">
+<dt id="promod3.scoring.PairwiseScorer.DoNormalize">
+<code class="descname">DoNormalize</code><span class="sig-paren">(</span><em>do_it</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.scoring.PairwiseScorer.DoNormalize" title="Permalink to this definition">¶</a></dt>
+<dd><table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>do_it</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#bool" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">bool</span></code></a>) &#8211; Whether to normalize the calculated scores by the number
+of residues to be scored. True by default.</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
 </dd></dl>
 
 </div>
@@ -1150,7 +1345,6 @@ combining this to other scores, where it is commonly the other way around.</p>
 <li><a class="reference internal" href="#cbetascorer-class">CBetaScorer class</a></li>
 <li><a class="reference internal" href="#reducedscorer-class">ReducedScorer class</a></li>
 <li><a class="reference internal" href="#clashscorer-class">ClashScorer class</a></li>
-<li><a class="reference internal" href="#densityscorer-class">DensityScorer class</a></li>
 <li><a class="reference internal" href="#hbondscorer-class">HBondScorer class</a></li>
 <li><a class="reference internal" href="#ssagreementscorer-class">SSAgreementScorer class</a></li>
 <li><a class="reference internal" href="#torsionscorer-class">TorsionScorer class</a></li>
@@ -1186,9 +1380,6 @@ combining this to other scores, where it is commonly the other way around.</p>
       <input type="hidden" name="check_keywords" value="yes" />
       <input type="hidden" name="area" value="default" />
     </form>
-    <p class="searchtip" style="font-size: 90%">
-    Enter search terms or a module, class or function name.
-    </p>
 </div>
 <script type="text/javascript">$('#searchbox').show(0);</script>
         </div>
@@ -1196,11 +1387,11 @@ combining this to other scores, where it is commonly the other way around.</p>
       <div class="clearer"></div>
     </div>
     <div class="footer">
-      &copy;2017, ProMod3 authors.
+      &copy;2018, ProMod3 authors.
       
       |
-      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a>
-      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.6</a>
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.4.1</a>
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
       
       |
       <a href="../_sources/scoring/backbone_scorers.txt"
diff --git a/doc/html/scoring/index.html b/doc/html/scoring/index.html
index eeee00139663ac1378844f314705e982f862f19b..e733603063ec5484bad703f5de8006b1f24d4029 100644
--- a/doc/html/scoring/index.html
+++ b/doc/html/scoring/index.html
@@ -6,7 +6,7 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
-    <title>scoring - Loop Scoring &mdash; ProMod3 1.1.0 documentation</title>
+    <title>scoring - Loop Scoring &mdash; ProMod3 1.2.0 documentation</title>
     
     <link rel="stylesheet" href="../_static/alabaster.css" type="text/css" />
     <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
@@ -14,7 +14,7 @@
     <script type="text/javascript">
       var DOCUMENTATION_OPTIONS = {
         URL_ROOT:    '../',
-        VERSION:     '1.1.0',
+        VERSION:     '1.2.0',
         COLLAPSE_INDEX: false,
         FILE_SUFFIX: '.html',
         HAS_SOURCE:  true
@@ -23,16 +23,18 @@
     <script type="text/javascript" src="../_static/jquery.js"></script>
     <script type="text/javascript" src="../_static/underscore.js"></script>
     <script type="text/javascript" src="../_static/doctools.js"></script>
-    <link rel="top" title="ProMod3 1.1.0 documentation" href="../index.html" />
+    <link rel="top" title="ProMod3 1.2.0 documentation" href="../index.html" />
     <link rel="up" title="Documentation For Users" href="../users.html" />
     <link rel="next" title="Backbone Score Environment" href="backbone_score_env.html" />
     <link rel="prev" title="Subrotamer Optimization" href="../sidechain/subrotamer_optimizer.html" />
    
+  <link rel="stylesheet" href="../_static/custom.css" type="text/css" />
   
-  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
 
   </head>
-  <body role="document">  
+  <body role="document">
+  
 
     <div class="document">
       <div class="documentwrapper">
@@ -43,35 +45,30 @@
 <span id="scoring-loop-scoring"></span><h1><a class="reference internal" href="#module-promod3.scoring" title="promod3.scoring: Loop Scoring"><code class="xref py py-mod docutils literal"><span class="pre">scoring</span></code></a> - Loop Scoring<a class="headerlink" href="#module-promod3.scoring" title="Permalink to this headline">¶</a></h1>
 <p>Tools and algorithms to score loops. The scoring system is split between an
 environment which contains model-specific data and scorers which evaluate loops.</p>
-<p>In this example, we load a structure, setup a score environment and a few
-scorers and finally score some loops:</p>
-<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">ost</span> <span class="kn">import</span> <span class="n">io</span><span class="p">,</span> <span class="n">seq</span>
-<span class="kn">from</span> <span class="nn">promod3</span> <span class="kn">import</span> <span class="n">loop</span><span class="p">,</span> <span class="n">scoring</span>
+<p>In this example, we load a structure, setup a score environment, link a few
+scorers to it and finally score some loops:</p>
+<div class="highlight-default"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">ost</span> <span class="k">import</span> <span class="n">io</span><span class="p">,</span> <span class="n">seq</span>
+<span class="kn">from</span> <span class="nn">promod3</span> <span class="k">import</span> <span class="n">loop</span><span class="p">,</span> <span class="n">scoring</span>
 
-<span class="c"># load data</span>
-<span class="n">ent</span> <span class="o">=</span> <span class="n">io</span><span class="o">.</span><span class="n">LoadPDB</span><span class="p">(</span><span class="s">&quot;data/1CRN.pdb&quot;</span><span class="p">)</span>
-<span class="n">ent_seq</span> <span class="o">=</span> <span class="n">seq</span><span class="o">.</span><span class="n">SequenceFromChain</span><span class="p">(</span><span class="s">&#39;A&#39;</span><span class="p">,</span> <span class="n">ent</span><span class="o">.</span><span class="n">FindChain</span><span class="p">(</span><span class="s">&#39;A&#39;</span><span class="p">))</span>
+<span class="c1"># load data</span>
+<span class="n">ent</span> <span class="o">=</span> <span class="n">io</span><span class="o">.</span><span class="n">LoadPDB</span><span class="p">(</span><span class="s2">&quot;data/1CRN.pdb&quot;</span><span class="p">)</span>
+<span class="n">ent_seq</span> <span class="o">=</span> <span class="n">seq</span><span class="o">.</span><span class="n">SequenceFromChain</span><span class="p">(</span><span class="s1">&#39;A&#39;</span><span class="p">,</span> <span class="n">ent</span><span class="o">.</span><span class="n">FindChain</span><span class="p">(</span><span class="s1">&#39;A&#39;</span><span class="p">))</span>
 
-<span class="c"># setup score environment linked to entity</span>
+<span class="c1"># setup score environment linked to entity</span>
 <span class="n">score_env</span> <span class="o">=</span> <span class="n">scoring</span><span class="o">.</span><span class="n">BackboneScoreEnv</span><span class="p">(</span><span class="n">ent_seq</span><span class="p">)</span>
 <span class="n">score_env</span><span class="o">.</span><span class="n">SetInitialEnvironment</span><span class="p">(</span><span class="n">ent</span><span class="p">)</span>
 
-<span class="c"># setup scorers attached to that env.</span>
+<span class="c1"># setup scorers attached to that env.</span>
 <span class="n">clash_scorer</span> <span class="o">=</span> <span class="n">scoring</span><span class="o">.</span><span class="n">ClashScorer</span><span class="p">()</span>
 <span class="n">clash_scorer</span><span class="o">.</span><span class="n">AttachEnvironment</span><span class="p">(</span><span class="n">score_env</span><span class="p">)</span>
 <span class="n">cbeta_scorer</span> <span class="o">=</span> <span class="n">scoring</span><span class="o">.</span><span class="n">LoadCBetaScorer</span><span class="p">()</span>
 <span class="n">cbeta_scorer</span><span class="o">.</span><span class="n">AttachEnvironment</span><span class="p">(</span><span class="n">score_env</span><span class="p">)</span>
 
-<span class="c"># get backbone list to be scored</span>
-<span class="c"># (here extracted from the structure, but it could be anything)</span>
-<span class="n">ev</span> <span class="o">=</span> <span class="n">ent</span><span class="o">.</span><span class="n">Select</span><span class="p">(</span><span class="s">&quot;rnum &gt;= 23 and rnum &lt;= 30&quot;</span><span class="p">)</span>
-<span class="n">bb_seq</span> <span class="o">=</span> <span class="s">&#39;&#39;</span><span class="o">.</span><span class="n">join</span><span class="p">([</span><span class="n">r</span><span class="o">.</span><span class="n">one_letter_code</span> <span class="k">for</span> <span class="n">r</span> <span class="ow">in</span> <span class="n">ev</span><span class="o">.</span><span class="n">residues</span><span class="p">])</span>
-<span class="n">bb_res</span> <span class="o">=</span> <span class="p">[</span><span class="n">r</span><span class="o">.</span><span class="n">handle</span> <span class="k">for</span> <span class="n">r</span> <span class="ow">in</span> <span class="n">ev</span><span class="o">.</span><span class="n">residues</span><span class="p">]</span>
-<span class="n">bb_list</span> <span class="o">=</span> <span class="n">loop</span><span class="o">.</span><span class="n">BackboneList</span><span class="p">(</span><span class="n">bb_seq</span><span class="p">,</span> <span class="n">bb_res</span><span class="p">)</span>
-
-<span class="c"># score it (note that 23 is the starting res. num.)</span>
-<span class="k">print</span> <span class="s">&quot;Clash-Score&quot;</span><span class="p">,</span> <span class="n">clash_scorer</span><span class="o">.</span><span class="n">CalculateScore</span><span class="p">(</span><span class="n">bb_list</span><span class="p">,</span> <span class="mi">23</span><span class="p">)</span>
-<span class="k">print</span> <span class="s">&quot;CBeta-Score&quot;</span><span class="p">,</span> <span class="n">cbeta_scorer</span><span class="o">.</span><span class="n">CalculateScore</span><span class="p">(</span><span class="n">bb_list</span><span class="p">,</span> <span class="mi">23</span><span class="p">)</span>
+<span class="c1"># calculate scores for 10 residues starting at residue number 23.</span>
+<span class="c1"># all required structural information comes from the environment</span>
+<span class="c1"># that can evolve as the modelling proceeds.</span>
+<span class="nb">print</span> <span class="s2">&quot;Clash-Score&quot;</span><span class="p">,</span> <span class="n">clash_scorer</span><span class="o">.</span><span class="n">CalculateScore</span><span class="p">(</span><span class="mi">23</span><span class="p">,</span> <span class="mi">10</span><span class="p">)</span>
+<span class="nb">print</span> <span class="s2">&quot;CBeta-Score&quot;</span><span class="p">,</span> <span class="n">cbeta_scorer</span><span class="o">.</span><span class="n">CalculateScore</span><span class="p">(</span><span class="mi">23</span><span class="p">,</span> <span class="mi">10</span><span class="p">)</span>
 </pre></div>
 </div>
 <p>Contents:</p>
@@ -90,7 +87,6 @@ scorers and finally score some loops:</p>
 <li class="toctree-l2"><a class="reference internal" href="backbone_scorers.html#cbetascorer-class">CBetaScorer class</a></li>
 <li class="toctree-l2"><a class="reference internal" href="backbone_scorers.html#reducedscorer-class">ReducedScorer class</a></li>
 <li class="toctree-l2"><a class="reference internal" href="backbone_scorers.html#clashscorer-class">ClashScorer class</a></li>
-<li class="toctree-l2"><a class="reference internal" href="backbone_scorers.html#densityscorer-class">DensityScorer class</a></li>
 <li class="toctree-l2"><a class="reference internal" href="backbone_scorers.html#hbondscorer-class">HBondScorer class</a></li>
 <li class="toctree-l2"><a class="reference internal" href="backbone_scorers.html#ssagreementscorer-class">SSAgreementScorer class</a></li>
 <li class="toctree-l2"><a class="reference internal" href="backbone_scorers.html#torsionscorer-class">TorsionScorer class</a></li>
@@ -105,6 +101,10 @@ scorers and finally score some loops:</p>
 <li class="toctree-l2"><a class="reference internal" href="all_atom_scorers.html#allatomclashscorer-class">AllAtomClashScorer class</a></li>
 </ul>
 </li>
+<li class="toctree-l1"><a class="reference internal" href="other_scoring_functions.html">Other Scoring Functions</a><ul>
+<li class="toctree-l2"><a class="reference internal" href="other_scoring_functions.html#scoring-functions-from-scwrl3">Scoring Functions from SCWRL3</a></li>
+</ul>
+</li>
 </ul>
 </div>
 </div>
@@ -140,9 +140,6 @@ scorers and finally score some loops:</p>
       <input type="hidden" name="check_keywords" value="yes" />
       <input type="hidden" name="area" value="default" />
     </form>
-    <p class="searchtip" style="font-size: 90%">
-    Enter search terms or a module, class or function name.
-    </p>
 </div>
 <script type="text/javascript">$('#searchbox').show(0);</script>
         </div>
@@ -150,11 +147,11 @@ scorers and finally score some loops:</p>
       <div class="clearer"></div>
     </div>
     <div class="footer">
-      &copy;2017, ProMod3 authors.
+      &copy;2018, ProMod3 authors.
       
       |
-      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a>
-      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.6</a>
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.4.1</a>
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
       
       |
       <a href="../_sources/scoring/index.txt"
diff --git a/doc/html/scoring/other_scoring_functions.html b/doc/html/scoring/other_scoring_functions.html
new file mode 100644
index 0000000000000000000000000000000000000000..998c0c6c19f3cec55ad955d5c844295d786d62b2
--- /dev/null
+++ b/doc/html/scoring/other_scoring_functions.html
@@ -0,0 +1,182 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>Other Scoring Functions &mdash; ProMod3 1.2.0 documentation</title>
+    
+    <link rel="stylesheet" href="../_static/alabaster.css" type="text/css" />
+    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '../',
+        VERSION:     '1.2.0',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="../_static/jquery.js"></script>
+    <script type="text/javascript" src="../_static/underscore.js"></script>
+    <script type="text/javascript" src="../_static/doctools.js"></script>
+    <link rel="top" title="ProMod3 1.2.0 documentation" href="../index.html" />
+    <link rel="up" title="scoring - Loop Scoring" href="index.html" />
+    <link rel="next" title="loop - Loop Handling" href="../loop/index.html" />
+    <link rel="prev" title="All Atom Scorers" href="all_atom_scorers.html" />
+   
+  <link rel="stylesheet" href="../_static/custom.css" type="text/css" />
+  
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
+
+  </head>
+  <body role="document">
+  
+
+    <div class="document">
+      <div class="documentwrapper">
+        <div class="bodywrapper">
+          <div class="body" role="main">
+            
+  <div class="section" id="other-scoring-functions">
+<h1>Other Scoring Functions<a class="headerlink" href="#other-scoring-functions" title="Permalink to this headline">¶</a></h1>
+<div class="section" id="scoring-functions-from-scwrl3">
+<h2>Scoring Functions from SCWRL3<a class="headerlink" href="#scoring-functions-from-scwrl3" title="Permalink to this headline">¶</a></h2>
+<dl class="method">
+<dt id="promod3.scoring.SCWRL3PairwiseScore">
+<code class="descclassname">promod3.scoring.</code><code class="descname">SCWRL3PairwiseScore</code><span class="sig-paren">(</span><em>d</em>, <em>Rij</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.scoring.SCWRL3PairwiseScore" title="Permalink to this definition">¶</a></dt>
+<dd><p>Pairwise score from the SCWRL3 sidechain construction algorithm
+<a class="reference internal" href="#canutescu2003b" id="id1">[canutescu2003b]</a>.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
+<li><strong>d</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>) &#8211; Distance between the two interacting particles</li>
+<li><strong>Rij</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>) &#8211; <p>Summed hard-sphere radii of the interacting particles.
+Suggestions from the paper:</p>
+<ul>
+<li>carbon: 1.6</li>
+<li>oxygen: 1.3</li>
+<li>nitrogen: 1.3</li>
+<li>sulfur: 1.7</li>
+</ul>
+</li>
+</ul>
+</td>
+</tr>
+<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The score</p>
+</td>
+</tr>
+<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a></p>
+</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="method">
+<dt id="promod3.scoring.SCWRL3DisulfidScore">
+<code class="descclassname">promod3.scoring.</code><code class="descname">SCWRL3DisulfidScore</code><span class="sig-paren">(</span><em>ca_pos_one</em>, <em>cb_pos_one</em>, <em>sg_pos_one                              ca_pos_two</em>, <em>cb_pos_two</em>, <em>sg_pos_two</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.scoring.SCWRL3DisulfidScore" title="Permalink to this definition">¶</a></dt>
+<dd><p>Implements the empirically derived disulfid score from the SCWRL3 sidechain
+construction algorithm <a class="reference internal" href="#canutescu2003b" id="id2">[canutescu2003b]</a>.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
+<li><strong>ca_pos_one</strong> (<code class="xref py py-class docutils literal"><span class="pre">ost.geoom.Vec3</span></code>) &#8211; CA carbon position of first amino acid</li>
+<li><strong>cb_pos_one</strong> (<code class="xref py py-class docutils literal"><span class="pre">ost.geoom.Vec3</span></code>) &#8211; CB carbon position of first amino acid</li>
+<li><strong>sg_pos_one</strong> (<code class="xref py py-class docutils literal"><span class="pre">ost.geoom.Vec3</span></code>) &#8211; SG sulfur position of first amino acid</li>
+<li><strong>ca_pos_two</strong> (<code class="xref py py-class docutils literal"><span class="pre">ost.geoom.Vec3</span></code>) &#8211; CA carbon position of second amino acid</li>
+<li><strong>cb_pos_two</strong> (<code class="xref py py-class docutils literal"><span class="pre">ost.geoom.Vec3</span></code>) &#8211; CB carbon position of second amino acid</li>
+<li><strong>sg_pos_two</strong> (<code class="xref py py-class docutils literal"><span class="pre">ost.geoom.Vec3</span></code>) &#8211; SG sulfur position of second amino acid</li>
+</ul>
+</td>
+</tr>
+<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The score</p>
+</td>
+</tr>
+<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a></p>
+</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<table class="docutils citation" frame="void" id="canutescu2003b" rules="none">
+<colgroup><col class="label" /><col /></colgroup>
+<tbody valign="top">
+<tr><td class="label">[canutescu2003b]</td><td><em>(<a class="fn-backref" href="#id1">1</a>, <a class="fn-backref" href="#id2">2</a>)</em> Canutescu AA, Shelenkov AA, Dunbrack RL Jr. (2003). A graph-theory algorithm for rapid protein side-chain prediction. Protein Sci (2003).</td></tr>
+</tbody>
+</table>
+</div>
+</div>
+
+
+          </div>
+        </div>
+      </div>
+      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
+        <div class="sphinxsidebarwrapper">
+  <h3><a href="../index.html">Table Of Contents</a></h3>
+  <ul>
+<li><a class="reference internal" href="#">Other Scoring Functions</a><ul>
+<li><a class="reference internal" href="#scoring-functions-from-scwrl3">Scoring Functions from SCWRL3</a></li>
+</ul>
+</li>
+</ul>
+<div class="relations">
+<h3>Related Topics</h3>
+<ul>
+  <li><a href="../index.html">Documentation overview</a><ul>
+  <li><a href="../users.html">Documentation For Users</a><ul>
+  <li><a href="index.html"><code class="docutils literal"><span class="pre">scoring</span></code> - Loop Scoring</a><ul>
+      <li>Previous: <a href="all_atom_scorers.html" title="previous chapter">All Atom Scorers</a></li>
+      <li>Next: <a href="../loop/index.html" title="next chapter"><code class="docutils literal"><span class="pre">loop</span></code> - Loop Handling</a></li>
+  </ul></li>
+  </ul></li>
+  </ul></li>
+</ul>
+</div>
+  <div role="note" aria-label="source link">
+    <h3>This Page</h3>
+    <ul class="this-page-menu">
+      <li><a href="../_sources/scoring/other_scoring_functions.txt"
+            rel="nofollow">Show Source</a></li>
+    </ul>
+   </div>
+<div id="searchbox" style="display: none" role="search">
+  <h3>Quick search</h3>
+    <form class="search" action="../search.html" method="get">
+      <input type="text" name="q" />
+      <input type="submit" value="Go" />
+      <input type="hidden" name="check_keywords" value="yes" />
+      <input type="hidden" name="area" value="default" />
+    </form>
+</div>
+<script type="text/javascript">$('#searchbox').show(0);</script>
+        </div>
+      </div>
+      <div class="clearer"></div>
+    </div>
+    <div class="footer">
+      &copy;2018, ProMod3 authors.
+      
+      |
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.4.1</a>
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
+      
+      |
+      <a href="../_sources/scoring/other_scoring_functions.txt"
+          rel="nofollow">Page source</a>
+    </div>
+
+    
+
+    
+  </body>
+</html>
\ No newline at end of file
diff --git a/doc/html/search.html b/doc/html/search.html
index 98d9a3d5ad7153ae993b4f5982f6a12181cde6d8..175b5dbecda4fd05bc276408aaeabcf79e257d85 100644
--- a/doc/html/search.html
+++ b/doc/html/search.html
@@ -6,7 +6,7 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
-    <title>Search &mdash; ProMod3 1.1.0 documentation</title>
+    <title>Search &mdash; ProMod3 1.2.0 documentation</title>
     
     <link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
     <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
@@ -14,7 +14,7 @@
     <script type="text/javascript">
       var DOCUMENTATION_OPTIONS = {
         URL_ROOT:    './',
-        VERSION:     '1.1.0',
+        VERSION:     '1.2.0',
         COLLAPSE_INDEX: false,
         FILE_SUFFIX: '.html',
         HAS_SOURCE:  true
@@ -24,7 +24,7 @@
     <script type="text/javascript" src="_static/underscore.js"></script>
     <script type="text/javascript" src="_static/doctools.js"></script>
     <script type="text/javascript" src="_static/searchtools.js"></script>
-    <link rel="top" title="ProMod3 1.1.0 documentation" href="index.html" />
+    <link rel="top" title="ProMod3 1.2.0 documentation" href="index.html" />
   <script type="text/javascript">
     jQuery(function() { Search.loadIndex("searchindex.js"); });
   </script>
@@ -32,12 +32,14 @@
   <script type="text/javascript" id="searchindexloader"></script>
   
    
+  <link rel="stylesheet" href="_static/custom.css" type="text/css" />
   
-  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
 
 
   </head>
-  <body role="document">  
+  <body role="document">
+  
 
     <div class="document">
       <div class="documentwrapper">
@@ -84,11 +86,11 @@
       <div class="clearer"></div>
     </div>
     <div class="footer">
-      &copy;2017, ProMod3 authors.
+      &copy;2018, ProMod3 authors.
       
       |
-      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a>
-      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.6</a>
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.4.1</a>
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
       
     </div>
 
diff --git a/doc/html/searchindex.js b/doc/html/searchindex.js
index da50d0e0a294c6e24a3095b14bcb0d8117909f0d..0c62df2650b19609ccc5d2fdf8536279e9693cc2 100644
--- a/doc/html/searchindex.js
+++ b/doc/html/searchindex.js
@@ -1 +1 @@
-Search.setIndex({envversion:46,filenames:["actions/index","actions/index_dev","buildsystem","changelog","cmake/index","contributing","core/geometry","core/helper","core/index","core/pm3argparse","core/runtime_profiling","core/setcompoundschemlib","dev_setup","developers","gettingstarted","index","loop/all_atom","loop/backbone","loop/index","loop/load_loop_objects","loop/mm_system_creation","loop/structure_db","loop/torsion_sampler","modelling/algorithms","modelling/gap_handling","modelling/index","modelling/loop_candidates","modelling/loop_closing","modelling/model_checking","modelling/monte_carlo","modelling/pipeline","modelling/sidechain_reconstruction","portableIO","scoring/all_atom_scorers","scoring/backbone_score_env","scoring/backbone_scorers","scoring/index","sidechain/disulfid","sidechain/frame","sidechain/graph","sidechain/index","sidechain/loading","sidechain/rotamer","sidechain/rotamer_constructor","sidechain/rotamer_id","sidechain/rotamer_lib","sidechain/subrotamer_optimizer","users"],objects:{"":{"command:add_doc_dependency":[4,0,1,""],"command:add_doc_source":[4,0,1,""],"command:convert_module_data":[4,0,1,""],"command:module":[4,0,1,""],"command:pm_action":[4,0,1,""],"command:promod3_unittest":[4,0,1,""],"command:pymod":[4,0,1,""],test_actions:[1,1,0,"-"]},"promod3.core":{ConstructAtomPos:[6,6,1,""],ConstructCBetaPos:[6,6,1,""],ConstructCTerminalOxygens:[6,6,1,""],EvaluateGromacsPosRule:[6,6,1,""],RotationAroundLine:[6,6,1,""],StaticRuntimeProfiler:[10,2,1,""],StemCoords:[6,2,1,""],StemPairOrientation:[6,2,1,""],helper:[7,1,0,"-"],pm3argparse:[9,1,0,"-"]},"promod3.core.StaticRuntimeProfiler":{Clear:[10,4,1,""],IsEnabled:[10,4,1,""],PrintSummary:[10,4,1,""],Start:[10,4,1,""],StartScoped:[10,4,1,""],Stop:[10,4,1,""]},"promod3.core.StemCoords":{c_coord:[6,5,1,""],ca_coord:[6,5,1,""],n_coord:[6,5,1,""]},"promod3.core.StemPairOrientation":{angle_four:[6,5,1,""],angle_one:[6,5,1,""],angle_three:[6,5,1,""],angle_two:[6,5,1,""],distance:[6,5,1,""]},"promod3.core.helper":{FileExists:[7,6,1,""],FileExtension:[7,6,1,""],FileGzip:[7,6,1,""],MsgErrorAndExit:[7,6,1,""]},"promod3.core.pm3argparse":{PM3ArgumentParser:[9,2,1,""]},"promod3.core.pm3argparse.PM3ArgumentParser":{"__init__":[9,3,1,""],AddAlignment:[9,3,1,""],AddStructure:[9,3,1,""],AssembleParser:[9,3,1,""],Parse:[9,3,1,""],action:[9,5,1,""]},"promod3.loop":{AllAtomEnv:[16,2,1,""],AllAtomEnvPositions:[16,2,1,""],AllAtomPositions:[16,2,1,""],AminoAcidAtom:[16,2,1,""],AminoAcidHydrogen:[16,2,1,""],AminoAcidLookup:[16,2,1,""],BackboneList:[17,2,1,""],CoordInfo:[21,2,1,""],ForcefieldAminoAcid:[20,2,1,""],ForcefieldBondInfo:[20,2,1,""],ForcefieldConnectivity:[20,2,1,""],ForcefieldHarmonicAngleInfo:[20,2,1,""],ForcefieldHarmonicImproperInfo:[20,2,1,""],ForcefieldLJPairInfo:[20,2,1,""],ForcefieldLookup:[20,2,1,""],ForcefieldPeriodicDihedralInfo:[20,2,1,""],ForcefieldUreyBradleyAngleInfo:[20,2,1,""],FragDB:[21,2,1,""],Fragger:[21,2,1,""],FraggerMap:[21,2,1,""],FragmentInfo:[21,2,1,""],LoadFragDB:[19,3,1,""],LoadStructureDB:[19,3,1,""],LoadTorsionSampler:[19,3,1,""],LoadTorsionSamplerCoil:[19,3,1,""],LoadTorsionSamplerExtended:[19,3,1,""],LoadTorsionSamplerHelical:[19,3,1,""],MmSystemCreator:[20,2,1,""],PsipredPrediction:[21,2,1,""],StructureDB:[21,2,1,""],TorsionSampler:[22,2,1,""]},"promod3.loop.AllAtomEnv":{ClearEnvironment:[16,3,1,""],GetAllAtomPositions:[16,3,1,""],GetEnvironment:[16,3,1,""],GetSeqres:[16,3,1,""],SetEnvironment:[16,3,1,""],SetInitialEnvironment:[16,3,1,""]},"promod3.loop.AllAtomEnvPositions":{all_pos:[16,5,1,""],res_indices:[16,5,1,""]},"promod3.loop.AllAtomPositions":{AllAtomPositions:[16,3,1,""],ClearPos:[16,3,1,""],ClearResidue:[16,3,1,""],Copy:[16,3,1,""],Extract:[16,3,1,""],ExtractBackbone:[16,3,1,""],GetAA:[16,3,1,""],GetFirstIndex:[16,3,1,""],GetIndex:[16,3,1,""],GetLastIndex:[16,3,1,""],GetNumAtoms:[16,3,1,""],GetNumResidues:[16,3,1,""],GetOmegaTorsion:[16,3,1,""],GetPhiTorsion:[16,3,1,""],GetPos:[16,3,1,""],GetPsiTorsion:[16,3,1,""],GetSequence:[16,3,1,""],InsertInto:[16,3,1,""],IsAllSet:[16,3,1,""],IsAnySet:[16,3,1,""],IsSet:[16,3,1,""],SetPos:[16,3,1,""],SetResidue:[16,3,1,""],ToEntity:[16,3,1,""]},"promod3.loop.AminoAcidLookup":{GetAA:[16,4,1,""],GetAAA:[16,4,1,""],GetAAH:[16,4,1,""],GetAnchorAtomIndex:[16,4,1,""],GetAtomName:[16,4,1,""],GetAtomNameAmber:[16,4,1,""],GetAtomNameCharmm:[16,4,1,""],GetElement:[16,4,1,""],GetH1Index:[16,4,1,""],GetH2Index:[16,4,1,""],GetH3Index:[16,4,1,""],GetHNIndex:[16,4,1,""],GetHydrogenIndex:[16,4,1,""],GetIndex:[16,4,1,""],GetMaxNumAtoms:[16,4,1,""],GetMaxNumHydrogens:[16,4,1,""],GetNumAtoms:[16,4,1,""],GetNumHydrogens:[16,4,1,""],GetOLC:[16,4,1,""]},"promod3.loop.BackboneList":{"__len__":[17,3,1,""],ApplyTransform:[17,3,1,""],BackboneList:[17,3,1,""],CARMSD:[17,3,1,""],Copy:[17,3,1,""],Extract:[17,3,1,""],GetAA:[17,3,1,""],GetBounds:[17,3,1,""],GetC:[17,3,1,""],GetCA:[17,3,1,""],GetCB:[17,3,1,""],GetN:[17,3,1,""],GetO:[17,3,1,""],GetOLC:[17,3,1,""],GetOmegaTorsion:[17,3,1,""],GetPhiTorsion:[17,3,1,""],GetPsiTorsion:[17,3,1,""],GetSequence:[17,3,1,""],GetTransform:[17,3,1,""],InsertInto:[17,3,1,""],MinCADistance:[17,3,1,""],RMSD:[17,3,1,""],ReconstructCBetaPositions:[17,3,1,""],ReconstructCStemOxygen:[17,3,1,""],ReconstructOxygenPositions:[17,3,1,""],ReplaceFragment:[17,3,1,""],RotateAroundOmegaTorsion:[17,3,1,""],RotateAroundPhiPsiTorsion:[17,3,1,""],RotateAroundPhiTorsion:[17,3,1,""],RotateAroundPsiTorsion:[17,3,1,""],Set:[17,3,1,""],SetAA:[17,3,1,""],SetAroundOmegaTorsion:[17,3,1,""],SetAroundPhiPsiTorsion:[17,3,1,""],SetAroundPhiTorsion:[17,3,1,""],SetAroundPsiTorsion:[17,3,1,""],SetBackrub:[17,3,1,""],SetC:[17,3,1,""],SetCA:[17,3,1,""],SetCB:[17,3,1,""],SetN:[17,3,1,""],SetO:[17,3,1,""],SetOLC:[17,3,1,""],SetSequence:[17,3,1,""],SuperposeOnto:[17,3,1,""],ToDensity:[17,3,1,""],ToEntity:[17,3,1,""],TransOmegaTorsions:[17,3,1,""],append:[17,3,1,""],clear:[17,3,1,""],empty:[17,3,1,""],resize:[17,3,1,""]},"promod3.loop.CoordInfo":{offset:[21,5,1,""],pdb_id:[21,5,1,""],size:[21,5,1,""]},"promod3.loop.ForcefieldBondInfo":{bond_length:[20,5,1,""],force_constant:[20,5,1,""],index_one:[20,5,1,""],index_two:[20,5,1,""]},"promod3.loop.ForcefieldConnectivity":{harmonic_angles:[20,5,1,""],harmonic_bonds:[20,5,1,""],harmonic_impropers:[20,5,1,""],lj_pairs:[20,5,1,""],periodic_dihedrals:[20,5,1,""],periodic_impropers:[20,5,1,""],urey_bradley_angles:[20,5,1,""]},"promod3.loop.ForcefieldHarmonicAngleInfo":{angle:[20,5,1,""],force_constant:[20,5,1,""],index_one:[20,5,1,""],index_three:[20,5,1,""],index_two:[20,5,1,""]},"promod3.loop.ForcefieldHarmonicImproperInfo":{angle:[20,5,1,""],force_constant:[20,5,1,""],index_four:[20,5,1,""],index_one:[20,5,1,""],index_three:[20,5,1,""],index_two:[20,5,1,""]},"promod3.loop.ForcefieldLJPairInfo":{epsilon:[20,5,1,""],index_one:[20,5,1,""],index_two:[20,5,1,""],sigma:[20,5,1,""]},"promod3.loop.ForcefieldLookup":{GetAA:[20,3,1,""],GetCharges:[20,3,1,""],GetDefault:[20,4,1,""],GetDisulfidConnectivity:[20,3,1,""],GetEpsilons:[20,3,1,""],GetFudgeLJ:[20,3,1,""],GetFudgeQQ:[20,3,1,""],GetHeavyIndex:[20,3,1,""],GetHydrogenIndex:[20,3,1,""],GetInternalConnectivity:[20,3,1,""],GetMasses:[20,3,1,""],GetNumAtoms:[20,3,1,""],GetOXTIndex:[20,3,1,""],GetPeptideBoundConnectivity:[20,3,1,""],GetSigmas:[20,3,1,""],Load:[20,4,1,""],LoadCHARMM:[20,4,1,""],LoadPortable:[20,4,1,""],Save:[20,3,1,""],SavePortable:[20,3,1,""],SetCharges:[20,3,1,""],SetDefault:[20,4,1,""],SetDisulfidConnectivity:[20,3,1,""],SetEpsilons:[20,3,1,""],SetFudgeLJ:[20,3,1,""],SetFudgeQQ:[20,3,1,""],SetInternalConnectivity:[20,3,1,""],SetMasses:[20,3,1,""],SetPeptideBoundConnectivity:[20,3,1,""],SetSigmas:[20,3,1,""]},"promod3.loop.ForcefieldPeriodicDihedralInfo":{force_constant:[20,5,1,""],index_four:[20,5,1,""],index_one:[20,5,1,""],index_three:[20,5,1,""],index_two:[20,5,1,""],multiplicity:[20,5,1,""],phase:[20,5,1,""]},"promod3.loop.ForcefieldUreyBradleyAngleInfo":{angle:[20,5,1,""],angle_force_constant:[20,5,1,""],bond_force_constant:[20,5,1,""],bond_length:[20,5,1,""],index_one:[20,5,1,""],index_three:[20,5,1,""],index_two:[20,5,1,""]},"promod3.loop.FragDB":{AddFragments:[21,3,1,""],GetAngularBinSize:[21,3,1,""],GetDistBinSize:[21,3,1,""],GetNumFragments:[21,3,1,""],GetNumStemPairs:[21,3,1,""],HasFragLength:[21,3,1,""],Load:[21,4,1,""],LoadPortable:[21,4,1,""],MaxFragLength:[21,3,1,""],PrintStatistics:[21,3,1,""],Save:[21,3,1,""],SavePortable:[21,3,1,""],SearchDB:[21,3,1,""]},"promod3.loop.Fragger":{"__getitem__":[21,3,1,""],"__len__":[21,3,1,""],AddSSAgreeParameters:[21,3,1,""],AddSeqIDParameters:[21,3,1,""],AddSeqSimParameters:[21,3,1,""],AddSequenceProfileParameters:[21,3,1,""],AddStructureProfileParameters:[21,3,1,""],AddTorsionProbabilityParameters:[21,3,1,""],Fill:[21,3,1,""],GetFragmentInfo:[21,3,1,""],GetScore:[21,3,1,""]},"promod3.loop.FraggerMap":{"__getitem__":[21,3,1,""],"__setitem__":[21,3,1,""],Contains:[21,3,1,""],Load:[21,3,1,""],LoadBB:[21,3,1,""],Save:[21,3,1,""],SaveBB:[21,3,1,""]},"promod3.loop.FragmentInfo":{chain_index:[21,5,1,""],length:[21,5,1,""],offset:[21,5,1,""]},"promod3.loop.MmSystemCreator":{ExtractLoopPositions:[20,3,1,""],GetCpuPlatformSupport:[20,3,1,""],GetDisulfidBridges:[20,3,1,""],GetForcefieldAminoAcids:[20,3,1,""],GetIndexing:[20,3,1,""],GetLoopLengths:[20,3,1,""],GetLoopStartIndices:[20,3,1,""],GetNumLoopResidues:[20,3,1,""],GetNumResidues:[20,3,1,""],GetSimulation:[20,3,1,""],SetCpuPlatformSupport:[20,3,1,""],SetupSystem:[20,3,1,""],UpdatePositions:[20,3,1,""]},"promod3.loop.PsipredPrediction":{"__len__":[21,3,1,""],Add:[21,3,1,""],Extract:[21,3,1,""],FromHHM:[21,3,1,""],FromHoriz:[21,3,1,""],GetConfidence:[21,3,1,""],GetConfidences:[21,3,1,""],GetPrediction:[21,3,1,""],GetPredictions:[21,3,1,""],PsipredPrediction:[21,3,1,""]},"promod3.loop.StructureDB":{AddCoordinates:[21,3,1,""],GenerateStructureProfile:[21,3,1,""],GetBackboneList:[21,3,1,""],GetCoordIndex:[21,3,1,""],GetCoordInfo:[21,3,1,""],GetDSSPStates:[21,3,1,""],GetDihedralAngles:[21,3,1,""],GetNumCoords:[21,3,1,""],GetResidueDepths:[21,3,1,""],GetSequence:[21,3,1,""],GetSequenceProfile:[21,3,1,""],GetSolventAccessibilitites:[21,3,1,""],GetStructureProfile:[21,3,1,""],GetSubDB:[21,3,1,""],Load:[21,4,1,""],LoadPortable:[21,4,1,""],PrintStatistics:[21,3,1,""],Save:[21,3,1,""],SavePortable:[21,3,1,""],SetStructureProfile:[21,3,1,""]},"promod3.loop.TorsionSampler":{Draw:[22,3,1,""],DrawPhiGivenPsi:[22,3,1,""],DrawPsiGivenPhi:[22,3,1,""],ExtractStatistics:[22,3,1,""],GetBinSize:[22,3,1,""],GetBinsPerDimension:[22,3,1,""],GetHistogramIndex:[22,3,1,""],GetHistogramIndices:[22,3,1,""],GetPhiProbabilityGivenPsi:[22,3,1,""],GetProbability:[22,3,1,""],GetPsiProbabilityGivenPhi:[22,3,1,""],Load:[22,4,1,""],LoadPortable:[22,4,1,""],Save:[22,3,1,""],SavePortable:[22,3,1,""],UpdateDistributions:[22,3,1,""]},"promod3.modelling":{AllAtomRelaxer:[27,2,1,""],BackboneRelaxer:[27,2,1,""],BuildFromRawModel:[30,6,1,""],BuildRawModel:[30,6,1,""],BuildSidechains:[30,6,1,""],CCD:[27,2,1,""],CCDCloser:[29,2,1,""],CTerminalCloser:[29,2,1,""],CheckFinalModel:[30,6,1,""],ClearGaps:[24,6,1,""],CloseGaps:[30,6,1,""],CloseLargeDeletions:[30,6,1,""],CloseSmallDeletions:[30,6,1,""],CountEnclosedGaps:[24,6,1,""],CountEnclosedInsertions:[24,6,1,""],DirtyCCDCloser:[29,2,1,""],ExponentialCooler:[29,2,1,""],FillLoopsByDatabase:[30,6,1,""],FillLoopsByMonteCarlo:[30,6,1,""],FilterCandidates:[28,6,1,""],FilterCandidatesWithSC:[28,6,1,""],FraggerHandle:[23,2,1,""],FragmentSampler:[29,2,1,""],FullGapExtender:[24,2,1,""],GapExtender:[24,2,1,""],GenerateDeNovoTrajectories:[23,6,1,""],GetRingPunches:[28,6,1,""],GetRings:[28,6,1,""],HasRingPunches:[28,6,1,""],InsertLoop:[30,6,1,""],InsertLoopClearGaps:[24,6,1,""],IsAllAtomScoringSetUp:[30,6,1,""],IsBackboneScoringSetUp:[30,6,1,""],KIC:[27,2,1,""],KICCloser:[29,2,1,""],LinearScorer:[29,2,1,""],LoopCandidates:[26,2,1,""],MergeGaps:[24,6,1,""],MergeGapsByDistance:[30,6,1,""],MergeMHandle:[30,6,1,""],MinimizeModelEnergy:[30,6,1,""],ModelTermini:[30,6,1,""],ModellingHandle:[30,2,1,""],NTerminalCloser:[29,2,1,""],PhiPsiSampler:[29,2,1,""],ReconstructSidechains:[31,6,1,""],RemoveTerminalGaps:[30,6,1,""],ReorderGaps:[30,6,1,""],ReportMolProbityScores:[28,6,1,""],RigidBlocks:[23,3,1,""],RunMolProbity:[28,6,1,""],RunMolProbityEntity:[28,6,1,""],SampleMonteCarlo:[29,3,1,""],ScoreContainer:[26,2,1,""],ScoringGapExtender:[24,2,1,""],ScoringWeights:[26,2,1,""],SetPsipredPredictions:[30,6,1,""],SetSequenceProfiles:[30,6,1,""],SetupDefaultAllAtomScoring:[30,6,1,""],SetupDefaultBackboneScoring:[30,6,1,""],ShiftExtension:[24,2,1,""],SidechainReconstructionData:[31,2,1,""],SidechainReconstructor:[31,2,1,""],SoftSampler:[29,2,1,""],StructuralGap:[24,2,1,""],StructuralGapList:[24,2,1,""]},"promod3.modelling.AllAtomRelaxer":{GetSystemCreator:[27,3,1,""],Run:[27,3,1,""],UpdatePositions:[27,3,1,""]},"promod3.modelling.BackboneRelaxer":{AddCARestraint:[27,3,1,""],AddCBRestraint:[27,3,1,""],AddCRestraint:[27,3,1,""],AddNRestraint:[27,3,1,""],AddORestraint:[27,3,1,""],GetNonBondedCutoff:[27,3,1,""],Run:[27,3,1,""],SetNonBondedCutoff:[27,3,1,""]},"promod3.modelling.CCD":{CCD:[27,3,1,""],Close:[27,3,1,""]},"promod3.modelling.CCDCloser":{Close:[29,3,1,""]},"promod3.modelling.DirtyCCDCloser":{Close:[29,3,1,""]},"promod3.modelling.ExponentialCooler":{GetTemperature:[29,3,1,""],Reset:[29,3,1,""]},"promod3.modelling.FraggerHandle":{Get:[23,3,1,""],GetList:[23,3,1,""],LoadCached:[23,3,1,""],SaveCached:[23,3,1,""]},"promod3.modelling.FragmentSampler":{Initialize:[29,3,1,""],ProposeStep:[29,3,1,""]},"promod3.modelling.FullGapExtender":{Extend:[24,3,1,""]},"promod3.modelling.GapExtender":{Extend:[24,3,1,""]},"promod3.modelling.KIC":{Close:[27,3,1,""],KIC:[27,3,1,""]},"promod3.modelling.KICCloser":{Close:[29,3,1,""]},"promod3.modelling.LinearScorer":{GetScore:[29,3,1,""]},"promod3.modelling.LoopCandidates":{Add:[26,3,1,""],AddFragmentInfo:[26,3,1,""],ApplyCCD:[26,3,1,""],ApplyKIC:[26,3,1,""],CalculateAllAtomScores:[26,3,1,""],CalculateBackboneScores:[26,3,1,""],CalculateSequenceProfileScores:[26,3,1,""],CalculateStemRMSDs:[26,3,1,""],CalculateStructureProfileScores:[26,3,1,""],Extract:[26,3,1,""],FillFromDatabase:[26,4,1,""],FillFromMonteCarloSampler:[26,4,1,""],GetClusteredCandidates:[26,3,1,""],GetClusters:[26,3,1,""],GetFragmentInfo:[26,3,1,""],GetLargestCluster:[26,3,1,""],GetSequence:[26,3,1,""],HasFragmentInfos:[26,3,1,""],Remove:[26,3,1,""]},"promod3.modelling.ModellingHandle":{Copy:[30,3,1,""],all_atom_scorer:[30,5,1,""],all_atom_scorer_env:[30,5,1,""],all_atom_sidechain_env:[30,5,1,""],backbone_scorer:[30,5,1,""],backbone_scorer_env:[30,5,1,""],gaps:[30,5,1,""],model:[30,5,1,""],profiles:[30,5,1,""],psipred_predictions:[30,5,1,""],seqres:[30,5,1,""],sidechain_reconstructor:[30,5,1,""]},"promod3.modelling.PhiPsiSampler":{Initialize:[29,3,1,""],ProposeStep:[29,3,1,""]},"promod3.modelling.ScoreContainer":{Contains:[26,3,1,""],Copy:[26,3,1,""],Extend:[26,3,1,""],Extract:[26,3,1,""],Get:[26,3,1,""],GetNumCandidates:[26,3,1,""],IsEmpty:[26,3,1,""],LinearCombine:[26,3,1,""],Set:[26,3,1,""]},"promod3.modelling.ScoringGapExtender":{Extend:[24,3,1,""]},"promod3.modelling.ScoringWeights":{GetAllAtomScoringKeys:[26,4,1,""],GetAllAtomWeights:[26,4,1,""],GetBackboneScoringKeys:[26,4,1,""],GetBackboneWeights:[26,4,1,""],GetSequenceProfileScoresKey:[26,4,1,""],GetStemRMSDsKey:[26,4,1,""],GetStructureProfileScoresKey:[26,4,1,""],GetWeights:[26,4,1,""],SetAllAtomScoringKeys:[26,4,1,""],SetBackboneScoringKeys:[26,4,1,""],SetSequenceProfileScoresKey:[26,4,1,""],SetStemRMSDsKey:[26,4,1,""],SetStructureProfileScoresKey:[26,4,1,""],SetWeights:[26,4,1,""]},"promod3.modelling.ShiftExtension":{Extend:[24,3,1,""]},"promod3.modelling.SidechainReconstructionData":{disulfid_bridges:[31,5,1,""],env_pos:[31,5,1,""],is_c_ter:[31,5,1,""],is_n_ter:[31,5,1,""],loop_lengths:[31,5,1,""],loop_start_indices:[31,5,1,""],rotamer_res_indices:[31,5,1,""]},"promod3.modelling.SidechainReconstructor":{AttachEnvironment:[31,3,1,""],Reconstruct:[31,3,1,""]},"promod3.modelling.SoftSampler":{Initialize:[29,3,1,""],ProposeStep:[29,3,1,""]},"promod3.modelling.StructuralGap":{Copy:[24,3,1,""],ExtendAtCTerm:[24,3,1,""],ExtendAtNTerm:[24,3,1,""],GetChain:[24,3,1,""],GetChainIndex:[24,3,1,""],GetChainName:[24,3,1,""],GetLength:[24,3,1,""],IsCTerminal:[24,3,1,""],IsNTerminal:[24,3,1,""],IsTerminal:[24,3,1,""],ShiftCTerminal:[24,3,1,""],after:[24,5,1,""],before:[24,5,1,""],full_seq:[24,5,1,""],length:[24,5,1,""],seq:[24,5,1,""]},"promod3.scoring":{AllAtomClashScorer:[33,2,1,""],AllAtomInteractionScorer:[33,2,1,""],AllAtomOverallScorer:[33,2,1,""],AllAtomPackingScorer:[33,2,1,""],AllAtomScorer:[33,2,1,""],BackboneOverallScorer:[35,2,1,""],BackboneScoreEnv:[34,2,1,""],BackboneScorer:[35,2,1,""],CBPackingScorer:[35,2,1,""],CBetaScorer:[35,2,1,""],ClashScorer:[35,2,1,""],ConstraintFunction:[34,2,1,""],ContactFunction:[34,2,1,""],DensityScorer:[35,2,1,""],DiscoContainer:[34,2,1,""],HBondScorer:[35,2,1,""],LoadAllAtomInteractionScorer:[33,6,1,""],LoadAllAtomPackingScorer:[33,6,1,""],LoadCBPackingScorer:[35,6,1,""],LoadCBetaScorer:[35,6,1,""],LoadDefaultAllAtomOverallScorer:[33,6,1,""],LoadDefaultBackboneOverallScorer:[35,6,1,""],LoadHBondScorer:[35,6,1,""],LoadReducedScorer:[35,6,1,""],LoadSSAgreementScorer:[35,6,1,""],LoadTorsionScorer:[35,6,1,""],PairwiseFunction:[34,2,1,""],PairwiseFunctionType:[34,2,1,""],PairwiseScorer:[35,2,1,""],ReducedScorer:[35,2,1,""],SSAgreementScorer:[35,2,1,""],TorsionScorer:[35,2,1,""]},"promod3.scoring.AllAtomInteractionScorer":{Load:[33,4,1,""],LoadPortable:[33,4,1,""],Save:[33,3,1,""],SavePortable:[33,3,1,""],SetEnergy:[33,3,1,""]},"promod3.scoring.AllAtomOverallScorer":{"__getitem__":[33,3,1,""],"__setitem__":[33,3,1,""],AttachEnvironment:[33,3,1,""],CalculateLinearCombination:[33,3,1,""],Contains:[33,3,1,""],Get:[33,3,1,""]},"promod3.scoring.AllAtomPackingScorer":{Load:[33,4,1,""],LoadPortable:[33,4,1,""],Save:[33,3,1,""],SavePortable:[33,3,1,""],SetEnergy:[33,3,1,""]},"promod3.scoring.AllAtomScorer":{AttachEnvironment:[33,3,1,""],CalculateScore:[33,3,1,""],CalculateScoreProfile:[33,3,1,""]},"promod3.scoring.BackboneOverallScorer":{"__getitem__":[35,3,1,""],"__setitem__":[35,3,1,""],AttachEnvironment:[35,3,1,""],Calculate:[35,3,1,""],CalculateLinearCombination:[35,3,1,""],Contains:[35,3,1,""],Get:[35,3,1,""]},"promod3.scoring.BackboneScoreEnv":{AddPairwiseFunction:[34,3,1,""],ApplyPairwiseFunction:[34,3,1,""],ClearEnvironment:[34,3,1,""],Copy:[34,3,1,""],GetSeqres:[34,3,1,""],SetEnvironment:[34,3,1,""],SetInitialEnvironment:[34,3,1,""],SetMap:[34,3,1,""],SetPsipredPrediction:[34,3,1,""]},"promod3.scoring.BackboneScorer":{AttachEnvironment:[35,3,1,""],CalculateScore:[35,3,1,""],CalculateScoreProfile:[35,3,1,""]},"promod3.scoring.CBPackingScorer":{Load:[35,4,1,""],LoadPortable:[35,4,1,""],Save:[35,3,1,""],SavePortable:[35,3,1,""],SetEnergy:[35,3,1,""],UseClassicMode:[35,3,1,""],UseIncludeEnvMode:[35,3,1,""]},"promod3.scoring.CBetaScorer":{Load:[35,4,1,""],LoadPortable:[35,4,1,""],Save:[35,3,1,""],SavePortable:[35,3,1,""],SetEnergy:[35,3,1,""]},"promod3.scoring.DiscoContainer":{AddStructuralInfo:[34,6,1,""],AttachConstraints:[34,6,1,""]},"promod3.scoring.HBondScorer":{Load:[35,4,1,""],LoadPortable:[35,4,1,""],Save:[35,3,1,""],SavePortable:[35,3,1,""],SetEnergy:[35,3,1,""]},"promod3.scoring.PairwiseFunction":{Score:[34,3,1,""]},"promod3.scoring.ReducedScorer":{Load:[35,4,1,""],LoadPortable:[35,4,1,""],Save:[35,3,1,""],SavePortable:[35,3,1,""],SetEnergy:[35,3,1,""]},"promod3.scoring.SSAgreementScorer":{Load:[35,4,1,""],LoadPortable:[35,4,1,""],Save:[35,3,1,""],SavePortable:[35,3,1,""],SetScore:[35,3,1,""]},"promod3.scoring.TorsionScorer":{Load:[35,4,1,""],LoadPortable:[35,4,1,""],Save:[35,3,1,""],SavePortable:[35,3,1,""],SetEnergy:[35,3,1,""]},"promod3.sidechain":{AAToRotID:[44,3,1,""],BBDepRotamerLib:[45,2,1,""],DisulfidRawScore:[37,3,1,""],DisulfidScore:[37,3,1,""],FRMRotamer:[42,2,1,""],FRMRotamerGroup:[42,2,1,""],Frame:[38,2,1,""],FrameResidue:[38,2,1,""],LoadDunbrackLib:[41,3,1,""],LoadPenultimateLib:[41,3,1,""],Particle:[42,2,1,""],RRMRotamer:[42,2,1,""],RRMRotamerGroup:[42,2,1,""],ReadDunbrackFile:[41,3,1,""],ResolveCysteins:[37,3,1,""],RotamerGraph:[39,2,1,""],RotamerID:[44,2,1,""],RotamerLib:[45,2,1,""],RotamerLibEntry:[45,2,1,""],SCWRLRotamerConstructor:[43,2,1,""],SidechainParticle:[42,2,1,""],SubrotamerOptimizer:[46,3,1,""],TLCToRotID:[44,3,1,""]},"promod3.sidechain.BBDepRotamerLib":{AddRotamer:[45,3,1,""],Load:[45,4,1,""],LoadPortable:[45,4,1,""],MakeStatic:[45,3,1,""],QueryLib:[45,3,1,""],Save:[45,3,1,""],SavePortable:[45,3,1,""],SetInterpolate:[45,3,1,""]},"promod3.sidechain.FRMRotamer":{"__getitem__":[42,3,1,""],"__len__":[42,3,1,""],AddFrameEnergy:[42,3,1,""],AddSubrotamerDefinition:[42,3,1,""],ApplyOnResidue:[42,3,1,""],GetActiveSubrotamer:[42,3,1,""],GetFrameEnergy:[42,3,1,""],GetInternalEnergy:[42,3,1,""],GetInternalEnergyPrefactor:[42,3,1,""],GetNumSubrotamers:[42,3,1,""],GetProbability:[42,3,1,""],GetSelfEnergy:[42,3,1,""],GetSubrotamerDefinition:[42,3,1,""],GetTemperature:[42,3,1,""],SetActiveSubrotamer:[42,3,1,""],SetFrameEnergy:[42,3,1,""],SetInternalEnergy:[42,3,1,""],SetInternalEnergyPrefactor:[42,3,1,""],SetProbability:[42,3,1,""],SetTemperature:[42,3,1,""],ToFrameResidue:[42,3,1,""],ToRRMRotamer:[42,3,1,""]},"promod3.sidechain.FRMRotamerGroup":{"__getitem__":[42,3,1,""],"__len__":[42,3,1,""],AddFrameEnergy:[42,3,1,""],ApplyOnResidue:[42,3,1,""],ApplySelfEnergyThresh:[42,3,1,""],Merge:[42,3,1,""],SetFrameEnergy:[42,3,1,""]},"promod3.sidechain.FrameResidue":{"__getitem__":[38,3,1,""],"__len__":[38,3,1,""]},"promod3.sidechain.Particle":{AddLonePair:[42,3,1,""],GetCharge:[42,3,1,""],GetName:[42,3,1,""],GetParticleType:[42,3,1,""],GetPos:[42,3,1,""],IsHBondAcceptor:[42,3,1,""],IsHBondDonor:[42,3,1,""],PairwiseEnergy:[42,3,1,""],SetPolarDirection:[42,3,1,""]},"promod3.sidechain.RRMRotamer":{"__getitem__":[42,3,1,""],"__len__":[42,3,1,""],AddFrameEnergy:[42,3,1,""],ApplyOnResidue:[42,3,1,""],GetFrameEnergy:[42,3,1,""],GetInternalEnergy:[42,3,1,""],GetInternalEnergyPrefactor:[42,3,1,""],GetProbability:[42,3,1,""],GetSelfEnergy:[42,3,1,""],SetFrameEnergy:[42,3,1,""],SetInternalEnergy:[42,3,1,""],SetInternalEnergyPrefactor:[42,3,1,""],SetProbability:[42,3,1,""],ToFrameResidue:[42,3,1,""]},"promod3.sidechain.RRMRotamerGroup":{"__getitem__":[42,3,1,""],"__len__":[42,3,1,""],AddFrameEnergy:[42,3,1,""],ApplyOnResidue:[42,3,1,""],ApplySelfEnergyThresh:[42,3,1,""],Merge:[42,3,1,""],SetFrameEnergy:[42,3,1,""]},"promod3.sidechain.RotamerGraph":{AStarSolve:[39,3,1,""],ApplyDEE:[39,3,1,""],ApplyEdgeDecomposition:[39,3,1,""],CreateFromFRMList:[39,4,1,""],CreateFromRRMList:[39,4,1,""],GetActiveEdges:[39,3,1,""],GetActiveRotamers:[39,3,1,""],GetEdges:[39,3,1,""],GetNumActiveEdges:[39,3,1,""],GetNumActiveNodes:[39,3,1,""],GetNumActiveRotamers:[39,3,1,""],GetNumEdges:[39,3,1,""],GetNumNodes:[39,3,1,""],GetNumRotamers:[39,3,1,""],GetPairwiseEnergies:[39,3,1,""],GetSelfEnergies:[39,3,1,""],MCSolve:[39,3,1,""],Prune:[39,3,1,""],Reset:[39,3,1,""],TreeSolve:[39,3,1,""]},"promod3.sidechain.RotamerLib":{AddRotamer:[45,3,1,""],Load:[45,4,1,""],LoadPortable:[45,4,1,""],MakeStatic:[45,3,1,""],QueryLib:[45,3,1,""],Save:[45,3,1,""],SavePortable:[45,3,1,""]},"promod3.sidechain.RotamerLibEntry":{FromResidue:[45,4,1,""],IsSimilar:[45,3,1,""],SimilarDihedral:[45,3,1,""],chi1:[45,5,1,""],chi2:[45,5,1,""],chi3:[45,5,1,""],chi4:[45,5,1,""],probability:[45,5,1,""],sig1:[45,5,1,""],sig2:[45,5,1,""],sig3:[45,5,1,""],sig4:[45,5,1,""]},"promod3.sidechain.SCWRLRotamerConstructor":{AssignInternalEnergies:[43,3,1,""],ConstructBackboneFrameResidue:[43,3,1,""],ConstructFrameResidue:[43,3,1,""],ConstructFrameResidueHeuristic:[43,3,1,""],ConstructRRMRotamerGroup:[43,3,1,""],ConstructSidechainFrameResidue:[43,3,1,""]},"test_actions.ActionTestCase":{RunAction:[1,3,1,""],RunExitStatusTest:[1,3,1,""],pm_action:[1,5,1,""],pm_bin:[1,5,1,""],testPMExists:[1,3,1,""]},promod3:{SetCompoundsChemlib:[11,6,1,""],core:[8,1,0,"-"],loop:[18,1,0,"-"],modelling:[25,1,0,"-"],scoring:[36,1,0,"-"],sidechain:[40,1,0,"-"]},test_actions:{ActionTestCase:[1,2,1,""]}},objnames:{"0":["cmake","command","CMake command"],"1":["py","module","Python module"],"2":["py","class","Python class"],"3":["py","method","Python method"],"4":["py","staticmethod","Python static method"],"5":["py","attribute","Python attribute"],"6":["py","function","Python function"]},objtypes:{"0":"cmake:command","1":"py:module","2":"py:class","3":"py:method","4":"py:staticmethod","5":"py:attribute","6":"py:function"},terms:{"10a":31,"1akia":21,"1crn":[16,18,20,21,25,26,27,29,30,31,36,40],"1crn_cut":[25,26,30],"1crna":[21,26],"1ey":5,"1eye_rec":5,"2010dunbracklib":32,"20a":31,"2b1":2,"2jlp":0,"30a":31,"3x3":6,"__doc__":[7,9],"__getitem__":[21,33,35,38,42],"__init__":[1,5,9,12],"__len__":[17,21,38,42],"__main__":[1,5],"__name__":[1,5],"__setitem__":[21,33,35],"_data":32,"_name":4,"_run":[1,4],"_xml":4,"boolean":7,"break":[4,5,12],"byte":[32,39],"case":[0,1,5,12,17,21,22,24,27,29,30,31,32,35,37,40,42,43,45],"char":[17,32],"class":[],"const":32,"default":[],"enum":44,"export":[5,16,39],"final":[5,14,21,23,25,26,30,34,35,36,37,39,40,42],"float":[6,16,17,20,21,22,23,24,26,27,28,29,30,31,32,33,34,35,37,39,42,43,45,46],"function":[],"import":[0,1,5,7,9,12,14,16,17,18,20,21,22,25,26,27,29,30,31,36,40,42,43],"int":[1,6,7,10,16,17,19,20,21,22,23,24,26,27,28,29,30,31,32,33,34,35,38,39,42,43,45,46],"long":30,"new":[1,3,5,9,12,13,16,17,20,21,24,26,27,29,30,31,32,34,35,40,42],"null":21,"public":[5,32,41],"return":[1,5,6,7,9,10,11,16,17,19,20,21,22,23,24,26,27,28,29,30,31,32,33,34,35,37,38,39,41,42,43,44,45],"s\u00f6ding":21,"short":[5,12,32],"static":[5,10,16,20,21,22,26,31,32,33,35,39,41,45],"super":40,"switch":[5,12,34],"throw":[1,32,35,40,41],"true":[1,7,9,10,16,17,18,19,20,21,24,26,27,28,29,30,31,32,33,35,37,40,43],"try":[1,5,14,24,30,32,45],"void":32,"while":[1,4,5,10,16,20,30,32],aa1:35,aa2:35,aa_aft:21,aa_befor:21,aa_clash:[30,33],aa_interact:[30,33],aa_pack:[30,33],aa_packing_scor:32,aa_relax_test:27,aa_res_idx:43,aa_scor:32,aa_with_rotam:40,aaa1:33,aaa2:33,aaa:[16,33],aaaaaaaa:17,aaaaggggggggggggggggggggaaaaaa:30,aah:16,aatorotid:44,abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz:30,abil:12,abl:[2,5],abort:[5,27,30,39],about:[1,4,5,21,30,39],abov:[0,1,5,9,12,17,23,24,26,30,32,44,45],absolut:4,academ:5,accept:[9,26,27,29,30,31,32,39],acceptor:[35,43],access:[4,5,16,17,21,22,26,30,33,34,35,42,44],accessibili:21,accessibl:21,accord:[12,16,17,20,21,22,23,24,26,29,30,31,35,37,39,40,42,43,45],accur:[23,34],accuraci:[23,27],achiev:[12,39],acknowledg:5,across:[1,45],act:27,action_nam:12,action_unit_test:1,actiontest:1,activ:[9,10,12,35,37,39,42,46],active_internal_energi:46,actual:[5,9,12,17,21,29,30,31,34,35,42,45],actual_posit:29,actual_step:29,adapt:[5,20,27,29,30,41],add:[1,2,4,5,9,14,16,21,22,26,27,30,31,33,34,35,37,40,42,43],add_argu:7,add_custom_target:5,add_doc_depend:4,add_doc_sourc:[4,5],add_subdirectori:5,addalign:9,addcarestraint:27,addcbrestraint:27,addcoordin:21,addcrestraint:27,addfrag:21,addfragmentinfo:26,addframeenergi:42,addharmonicangl:20,addharmonicbond:20,addharmonicimprop:20,addit:[4,7,9,10,12,17,18,20,21,28,30,32,43],addition:[1,4,12,16,20,43],addljpair:20,addlonepair:42,addnrestraint:27,addorestraint:27,addpairwisefunct:34,addperiodicdihedr:20,addperiodicimprop:20,address:32,addrotam:45,addseqidparamet:21,addseqsimparamet:[18,21],addsequenceprofileparamet:21,addssagreeparamet:21,addstructur:9,addstructuralinfo:34,addstructureprofileparamet:21,addsubrotamerdefinit:42,addtorsionprobabilityparamet:21,addureybradleyangl:20,admir:5,advanc:23,advantag:20,advic:[5,12],advis:21,affect:[5,17,44],after:[1,2,4,5,9,12,16,17,20,21,22,24,26,27,29,30,32,34,39,41,43,45],after_c_stem:17,afterward:[5,30],again:[2,5,23],against:[33,35],agg:22,agglom:26,ago:1,agreement:[21,23,35],agress:[2,39],ala:[17,22,27,40,44],ala_cb:16,ala_h1:16,ala_h:16,alanin:44,alg:[18,21],algorithm:[],alia:24,align:[0,9,14,21,23,25,30,34],alignedcuboid:17,alignmenthandl:[23,30,34],alignmentlist:[0,9,30],all:[],all_atom:[16,17,20,34,35,42,43],all_atom_env:16,all_atom_po:[16,43],all_atom_scor:30,all_atom_scorer_env:30,all_atom_sidechain_env:30,all_po:[16,20,27],all_scor:26,allatom:[27,30,31],allatomclashscor:[],allatominteractionscor:[],allatomoverallscor:[],allatompackingscor:[],allatomrelax:[20,27],alloc:21,allow:[0,2,3,5,7,12,17,21,22,23,26,29,30,32,33,35],allow_multitempl:9,allow_prepro_ci:17,almost:4,aln:[0,23,25,26,30,34],aln_sourc:9,alon:7,along:[1,5,21],alot:5,alpha:[6,17,35,40],alpha_bin:35,alreadi:[1,4,5,12,17,20,21,23,26,30,31,33,34,35,39,42,43,45,46],also:[1,2,4,5,7,12,21,22,23,26,27,28,29,30,31,35,37,38,39,41,43,45],alter:29,altern:[4,5,29,30,35,41,43],alwai:[0,1,5,12,24,29,30,32],amber:[16,30],ambig:45,ambigu:45,aminoacid:[16,17,20,22,35,44,45],aminoacidatom:[16,33],aminoacidhydrogen:16,aminoacidlookup:[16,20],among:26,amount:[14,23,45],analysi:[21,27,28],analyt:[26,45],anchor:[6,16,43],ancient:11,ang:34,angl:[],angle_bin:35,angle_bin_s:21,angle_force_const:20,angle_four:6,angle_on:6,angle_thre:6,angle_two:6,angstrom:[21,27],ani:[0,1,4,5,9,10,11,14,16,17,20,21,22,24,26,28,29,30,31,32,33,34,35,38,39,40,42,43],anneal:[26,29,39],announc:[1,5],anoth:[4,10,17,24,27,30,31,37],anymor:39,anyon:[5,12],anyth:[0,2,5,9,10,11,26,27,31,33,35,36],anywai:5,anywher:12,apart:[1,26,30,31,33,35],append:[0,9,17,21,22,30,40],appli:[7,11,12,17,24,26,27,29,30,31,37,39,40,42],applic:[1,27],applyccd:26,applyde:39,applyedgedecomposit:39,applyk:26,applyonresidu:[40,42],applypairwisefunct:[34,35],applysd:20,applyselfenergythresh:[40,42],applytransform:17,approach:[2,21,23,30,32,37,39,40,43],appropri:[21,22,30,32,35,43],approx:30,approxim:[20,39,42],arbitrari:[16,21,37],arbitrarili:29,arg:[1,4,9,44],arg_ca:16,arg_hd3:16,arg_sorted_scor:26,arginin:44,argpars:9,argument:[],argumentpars:9,argv:9,around:[1,4,5,6,12,17,26,27,30,33,35],arrai:[0,5,32],artifici:35,ascend:24,ask:5,asn:44,asn_c:16,asn_hb2:16,asp:[16,42,44,45],asp_ha:16,asp_o:16,asparagin:44,aspart:[44,45],ass:29,assembl:9,assemblepars:9,assertequ:5,assess:[33,34],assign:[17,21,26,29,33,35,41,43,46],assigndssp:21,assigninternalenergi:43,assignsecstruct:21,associ:[24,38],assum:[1,4,5,20,21,27,30,32,34,35,37,39],assur:37,astar:[3,39],astarsolv:39,atom:[],atom_idx:[16,20],atom_nam:[16,20],atomhandl:42,atomseq:21,attach:[0,4,5,9,16,20,23,24,30,31,33,34,35,36],attach_view:9,attachconstraint:34,attachenviron:[26,27,29,31,33,35,36],attachview:[25,26,30],attent:[1,12],attribut:[5,9,30,31,45],autom:[2,4],automat:[1,5,7,10,12,21,25,26,32,39,45],automatis:5,avaibl:43,avail:[1,2,5,11,12,14,20,29,40],availabl:5,averag:[21,26,34,37],avg:21,avg_sampling_per_posit:23,avoid:[7,11,27,29],awai:[12,31,42],awar:5,awesom:[1,5],axi:[6,17,21],back:[1,12,20,29,39],backbon:[],backbone_scor:[26,30],backbone_scorer_env:30,backbonelist:[],backboneoverallscor:[],backbonerelax:[27,30],backbonescor:[],backbonescoreenv:[],backbonescoreenvlisten:5,background:[2,31],backrub:17,backward:32,bad:20,base:[],base_target:4,bashrc:5,basi:[4,5,12,21,27,29,42],basic:[1,2,5,7,12,22,29,30,40,42,45],bb_list:[14,16,17,18,21,24,26,27,29,30,34,35,36],bb_list_on:23,bb_list_two:23,bb_re:36,bb_score:26,bb_seq:36,bbdeprotamerlib:[31,32,41,43,45],becaus:[5,12,16,30,34,39],becom:45,been:[2,12,19,21,26,27,33,35,37,39,41,45],befor:[1,4,5,9,12,17,20,21,22,24,26,27,29,30,31,32,33,34],begin:[1,5,16,17,29,34],behav:1,behavior:33,behaviour:[9,34,45],behind:5,bell:5,belong:[4,12,16,17,21,24,26,29,30,31,33,34,35,38,42,43],belov:21,below:[0,5,16,20,21,23,26,27,31,32,33,35,37],below_thre:21,besid:[2,4,9,39],best:[4,26,30,37],best_candid:26,beta:[6,17,28,35],beta_bin:35,better:[20,26,29,30,33,35],between:[1,9,17,20,21,23,24,26,27,29,30,31,32,33,34,35,36,37,38,39,42,43,45],beyond:9,big:[20,32],bilinearli:45,bin:[1,5,12,14,21,22,33,35,45],bin_siz:45,binari:[],bind:[21,30],bins_per_dimens:22,bioinformat:21,biol:21,biopolym:21,bit:[1,2,5,12,26,30],blank:5,blosum62:[18,21,23,34],bond:[],bond_force_const:20,bond_length:[6,20],bool:[1,5,7,9,10,16,17,19,20,21,24,26,27,28,29,30,31,32,33,34,35,37,39,42,43,45],boost:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47],boost_librari:4,boost_root:2,both:[16,24,30,37,40,45],bound:[16,20,23,26,42],bradlei:20,branch:[],branchnam:12,brew:4,bridg:[19,20,27,30,31],briefli:12,bring:5,broken:1,broyden:30,bug:[3,5,12],build_disulfid:31,builder:2,buildfromrawmodel:[25,30],buildrawmodel:[0,25,26,30],buildsidechain:30,buildup:[40,42],built:[4,20,21,34,38,43],bunch:[1,9,12],bytecod:1,c_coord:6,c_num:24,c_po:[6,17,35,43],c_stem:[6,18,21,24,26,27,29],c_stem_idx:[],c_stem_psi:29,c_str:32,c_ter:[27,43],ca_coord:6,ca_pairwise_funct:34,ca_po:[6,17,35,43],ca_pos_on:37,ca_pos_two:37,ca_posit:37,ca_rmsd:[18,21],cach:[2,21,23],calcul:[5,17,21,22,23,26,27,29,33,34,35,37,38,39,42,43],calculateallatomscor:26,calculatebackbonescor:26,calculateenergi:35,calculatelinearcombin:[26,29,33,35],calculatescor:[33,35,36],calculatescoreprofil:[33,35],calculatesequenceprofilescor:26,calculatestemrmsd:26,calculatestructureprofilescor:26,calculatesurfac:21,call:[1,2,4,5,7,9,10,11,12,16,20,21,22,24,26,29,30,31,32,33,35,39,42,43,45],callabl:[9,12],calpha:30,calul:22,came:5,can:[],cand:30,candid:[],cannot:[0,5,9,20,21,22,24,30,32,33,35,41,44,45],canutescu2003:27,canutescu2003b:[33,37],canutescu:[27,37],cap:39,capabl:[19,25,29],captur:1,carbon:[6,17,42,43],carbonyl:[42,43],care:[0,5,21,26,27,30,32,35,39],carlo:[3,23,26,29,30,39],carmsd:[17,18,21],carri:[5,7],cast:32,categori:4,caus:[12,28],caution:16,cb_pack:[23,30,35],cb_packing_scor:32,cb_pairwise_funct:34,cb_po:[17,43],cb_pos_on:37,cb_pos_two:37,cb_posit:37,cbeta:[23,26,29,30,35,36],cbeta_scor:[32,36],cbetaenvlisten:5,cbetascor:[],cbpackingscor:[],ccd:[],ccdcloser:29,center:28,central:[17,22,35],centroid:26,certain:[1,2,4,5,12,21,22,23,24,30,32,33,35,39],certainli:1,ch1particl:42,ch2particl:42,ch3particl:42,chain:[],chain_id:21,chain_idx:[5,16,21,26,29,30,31,33,34,35],chain_idx_list:31,chain_idx_on:34,chain_idx_two:34,chain_index:[21,29,33,35],chain_indic:34,chain_nam:[21,30],chainhandl:[16,17,24],chainid:0,chainview:21,chakravarti:21,chakravarty1999:21,chanact:30,chanc:[5,30,39],chang:[1,3,4,5,12,16,22,24,27,29,30,31,35,39],change_frequ:[29,39],chapter:[24,28],charact:[9,21],charg:[5,16,20,27,42,43],charmm:[16,20,30],check:[],check_io:32,check_xml:5,checkbasetyp:32,checkfinalmodel:30,checkmagicnumb:32,checkout:[5,12],checktypes:32,chemic:[11,16,33],chi1:45,chi2:45,chi3:45,chi4:45,chi:45,child:9,childclass:1,chmod:5,choos:[26,29,35],chosen:[0,9,29,30],cif:[0,9],ciiipgatcpgdyan:30,circumv:43,citat:27,clash:[3,23,26,27,29,30,33,35,36,37,40],clash_scor:36,clash_thresh:30,clashscor:[],classic:[35,41],clean:[2,5,12],cleanli:32,clear:[10,16,17,26,30,34],clearenviron:[16,34],cleargap:24,clearli:[],clearpo:16,clearresidu:16,clever:[],clip:9,clone:5,close:[12,14,17,21,26,27,29,30,31,35,37],closed_posit:29,closegap:30,closelargedelet:30,closer:[],closesmalldelet:[27,30],closest:21,closur:[27,30],clustal:[0,9],cluster:[3,23,26,32,34],cluster_thresh:[23,34],clutter:[1,5],cmake:[],cmake_support:[4,5,12],cmakecach:2,cmakelist:[1,2,4,5,12],cname:21,coars:5,code:[],codetest:[4,5],coil:[19,23],collect:[7,10,16,23,34],column:[21,23],combin:[20,21,22,23,26,29,30,33,35,37,45],come:[1,4,5,7,9,30,31,39],command:[],commandlin:9,comment:12,commerci:5,commit:[5,12],common:[5,9,23],commonli:[5,14,25,26,35],comp_lib:43,compar:[3,5,17,18,21,26,27,45],comparison:[21,30,33,45],compat:[12,20,32],compensatori:17,compil:[1,2,4,5,10,12,14,32,47],complain:1,complaint:12,complement:21,complet:[10,12,17,20,21,27,29,30,31,45],complex:[5,12,31,37,42,46],compon:[11,21,28,35,39],compound:[11,43],compoundlib:43,compress:7,comput:[3,5,21,26,28,33,35],concaten:16,concept:5,concern:5,condit:[5,22],conf:[2,5],confid:[21,35],config:[4,5],config_head:4,configur:[2,5,12,26,39,45],conflict:12,conform:[21,27,29,39,40,45],connect:[4,12,16,20,21,26,39],conop:[16,17,20,22,35,43,44],conquer:5,consecut:[22,35],conserv:[14,24],consid:[4,5,10,12,16,17,21,22,23,26,27,29,30,31,33,34,35,37,39,41,43,45],consider_all_nod:39,consider_hydrogen:42,consider_ligand:31,consist:[3,5,16,20,21,23,24,26,27,29,30,31,32,34,37,42,45],constant:[20,27,33,35,46],constraint:[9,21,27,34],constraintfunct:34,construct:[],constructatompo:6,constructbackboneframeresidu:[40,43],constructcbetapo:6,constructcterminaloxygen:6,constructetd:39,constructframeresidu:43,constructframeresidueheurist:43,constructfrmrotamergroup:[40,43],constructor:[],constructrrmrotamergroup:43,constructsidechainframeresidu:43,contact:34,contactfunct:34,contain:[0,1,2,4,5,6,7,9,12,16,17,19,20,21,22,23,26,29,30,31,33,34,35,36,37,38,40,41,42,43,45],content:[5,8,13,15,18,21,36,40,47],contigu:[20,31,32],continu:[1,16,24,27,40],contrast:38,contribut:[],control:[0,5,26,29,31,34,39,42,45,46],conveni:[],convent:[1,44],converg:[23,26,27,29],convers:32,convert:[4,17,20,21,22,30,32,33,35,45,46],convert_module_data:4,convertbasetyp:32,cool:[],cooler:[],cooling_factor:[29,39],coord:26,coord_info:21,coordin:[6,21,26,27,30,40],coordinfo:21,cope:12,copi:[2,4,5,12,14,16,17,24,26,30,34],core:[],correct:20,correctli:30,correl:35,correspond:[12,16,17,20,21,22,26,32,33,45],corrupt:[16,34],could:[1,4,5,9,12,20,21,30,36],count:[10,24,29,30,33,35],countenclosedgap:24,countenclosedinsert:24,counterpart:[35,43],coupl:[1,5,12,30],cours:5,coutsia:27,cover:[1,5,8,10,16,20,21,23,25,29],coverag:30,cparticl:42,cpp:4,cpr:[44,45],cpu:[14,20,30],cpu_platform_support:20,crambin:[21,26,29],crash:40,createalign:[26,30],createentityfromview:[31,40],createfromfrmlist:[39,40],createfromrrmlist:39,createfullview:[25,26,30],createsequ:[26,30],creation:[20,27],creator:[20,27],criteria:31,criterion:[29,39],criterium:26,croak:12,cross:35,crucial:5,cterminalclos:29,cumul:43,current:[2,4,5,10,12,16,17,20,21,26,29,30,32,34,35,39,42,43,46],custom:[5,21,29,30,31,32,44],cutoff:[19,20,26,27,31,33,35],cycl:24,cyclic:[26,27],cyd:[44,45],cyh:[44,45],cys_hb3:16,cys_sg:16,cystein:[20,31,37,40,44],d_bin:35,dai:7,dampen:20,dare:4,dat:[21,32],data1:4,data2:4,data:[],data_:32,data_gener:32,databas:[],databs:21,date:12,dbg:5,dcmake_install_prefix:2,deactiv:39,dead:39,deal:[30,31],debug:[5,16],decent:11,decid:[5,27],decis:22,declar:[4,5,12],decod:9,decompos:39,decomposit:[23,39],decreas:29,dedic:[4,5,12],dee:39,deep:[17,30],def:[1,5,16,30],def_angl:16,defin:[],definem:5,degre:[17,21,22,41],delet:[0,2,5,17,30,42],deliv:[1,21,29,30],delta_scor:29,demand:30,demonstr:21,densiti:[17,27,30,34,35,41],densityscor:[],dep1:4,dep2:4,dep:4,dependency1:4,dependency2:4,depends_on:4,depth:21,deriv:[1,21,41],descend:30,descent:[26,27],describ:[4,7,13,16,17,21,24,25,27,28,32,33,35,37,39,40,42,45,47],descript:[0,9,12,29,37,45],design:[1,41],desir:[6,14,20,26,27,29,30,33,35],despit:[],detail:[0,6,9,12,20,21,22,26,28,29,30,33,35,45],detect:[],determin:[5,7,20,26,29,34,35],determinist:23,deuterium:30,develop:[],deviat:[17,28,29,41,45],devot:8,dict:[4,23,26,28,29,33,35],dictionari:[4,9,11,21,28],did:[5,26,30],differ:[1,2,4,5,11,12,16,21,23,24,26,30,33,35,39,40,44,45],dihedr:[],dihedral_angl:17,dihedral_bin:35,dihedral_idx:45,dihedral_pair:22,dimens:22,dir:[4,5],direct:[5,17,19,35,42,43],directli:[5,21,26,30,31,34,37,41,42,43,44,45],directori:[],dirti:1,dirtyccdclos:29,disabl:[1,12],disable_doctest:2,disable_document:2,disable_linkcheck:2,discocontain:34,discret:[33,35],discuss:21,disk:[5,20,23,33,35,45],displai:[7,9,10],dissimilar:23,dist:35,dist_bin:35,dist_bin_s:21,distanc:[6,17,21,23,26,30,31,33,34,35],distance_thresh:23,distant:34,distinct:[16,31],distribut:[1,5,20,21,22,29,32,33,35,41,45],disulfid:[],disulfid_bridg:[20,31],disulfid_score_thresh:31,disulfidrawscor:37,disulfidscor:[31,37],dive:[12,30],diverg:5,divers:[21,23],divid:23,dng:14,doc:[2,4,5,12],docstr:9,doctest:[2,5,12],document:[],doe:[1,4,5,6,7,9,11,12,17,21,25,26,30,32,34,39,41,43],doesn:[5,12,24,27,29,45],domain:23,domin:39,don:[2,26,30,43],done:[1,5,7,9,12,18,20,22,26,30,32,33],donor:35,dont_write_bytecod:1,dost_root:2,doubt:9,down:[9,17,21,29],dpm3_runtime_profiling_level:10,draw:[17,22,29],drawback:5,drawn:[22,29],drawphigivenpsi:22,drawpsigivenphi:22,drop:5,dssp:[21,30,35],dssp_state:35,due:[21,26,27,30,37,41],dump:45,dunbrack:[27,31,37,40,41],dure:[1,16,27,30,32,38,45],dynam:45,e_cut:39,e_thresh:[30,39],e_tresh:39,each:[0,5,9,10,16,17,20,21,22,23,24,26,28,29,30,31,32,33,35,39],earli:3,earlier:2,easi:5,easier:[1,5],easili:[4,12,30],echo:5,edg:39,edge_idx:39,ediff:39,editor:1,educ:5,effect:[4,5,20,31,35,37,39],effici:[16,21,23,29],egg:21,eigen3_include_dir:2,eigen:[2,3],either:[0,5,9,12,16,17,22,24,26,27,29,30,31,32,33,34,35,38,42,44,45],elabor:5,electrostat:[20,27],element:[1,16,17,21,23,26,28,32,34,37,39],elenumerador:[],elimin:39,els:[5,12,31,32],emerg:1,emploi:12,empti:[5,7,9,17,21,23,26,30,42],enabl:[1,2,7,9,11,20],enable_mm:2,enable_ss:2,enclos:[24,30],encod:0,encount:[24,29],end:[0,1,2,4,5,7,9,12,16,17,21,23,24,26,30,39],end_resnum:30,end_transl:4,endian:32,energi:[3,5,14,20,27,29,30,33,35,37,38,39,42,43,46],enforc:[16,21,26,29,30,31,34],enough:[5,12,20,21,30,32,34],ensur:[2,5,14,26,30,32],ent:[0,9,16,20,28,31,36],ent_seq:36,enter:38,entiti:[5,9,10,16,17,28,30,36,40],entityhandl:[9,16,17,28,30,31,34],entityview:[21,22,23,28,30],entri:[],enumer:[5,16,20,21,26,34,39,40,42,43,44],env:[5,14,16,20,27,28,30,31,33,34,35,36],env_po:[27,31],env_structur:[16,34],environ:[],epsilon:[20,31,39,46],equal:[29,33,35,37,43],equidist:45,equival:30,error:[0,7,9,10,30,32,35],especi:23,estim:[21,28,29,35,37,39,41],etc:[1,5,12,17,26,34],evalu:[],evaluategromacsposrul:6,even:[2,5,17,20,24,30,39],event:23,eventu:9,ever:[12,29],everi:[0,1,5,16,17,21,22,23,26,27,29,30,31,33,34,35,37,39,42,43,45,46],everyth:[],evolut:21,exact:32,exactli:[2,21,23,26,30,34,37,43,44],exampl:[],example_reconstruct:40,exce:[21,33,35],exceed:24,except:[0,9,24,30,43],exclud:5,exclus:[1,5,20],execut:[],exisit:[],exist:[1,2,4,5,7,9,10,12,16,17,21,26,27,28,29,30,32,33,34,35,41,42,44,45],exit:[0,1,7,9],exit_cod:1,exit_statu:7,exot:5,exp:[29,39],expect:[1,16,20,21,30,31,33,34,37,46],expens:21,experiment:30,explain:[1,5],explan:5,explicit:2,exponenti:29,exponentialcool:29,express:37,ext:7,extend:[],extendatcterm:24,extendatnterm:24,extended_search:[26,30],extens:[0,3,7,9,24,30],extension_penalti:24,extent:21,extern:[4,5,21],extra:[2,5,12,17,32],extra_bin:21,extra_force_field:30,extract:[5,6,16,17,18,20,21,22,23,25,26,27,29,30,31,33,34,35,36,37,39,41,43],extract_burial_statu:21,extractbackbon:16,extractloopposit:20,extractstatist:22,extrem:17,f_i:21,f_idx:34,facilit:23,factor:[20,29,39,41,42],fail:[0,1,5,7,10,17,26,30],failur:[0,5,7,9,45],fall:27,fallback:45,fals:[1,5,7,9,17,20,21,24,26,29,30,31,34,35,37,39,42,43],far:[26,30],fast:[6,14,16,20,21,22,32,33,34,35,45],fasta:[0,9,25,30],faster:[20,21,27,28,34,39],fastest:[27,30],favor:28,favourit:1,feasibl:[],fed:[4,12,39],fedora:5,feed:[4,16,26,43],feel:[5,12],fellow:5,fetch:12,few:[2,5,12,20,32,36],ff_aa:20,ff_aa_on:20,ff_aa_two:20,ff_ala:20,ff_arg:20,ff_asn:20,ff_asp:20,ff_cy:20,ff_cys2:20,ff_gln:20,ff_glu:20,ff_gly:20,ff_hisd:20,ff_hise:20,ff_ile:20,ff_leu:20,ff_lookup:[20,27,30],ff_lookup_charmm:32,ff_ly:20,ff_met:20,ff_phe:20,ff_pro:20,ff_ser:20,ff_thr:20,ff_trp:20,ff_tyr:20,ff_val:20,ff_xxx:20,field:[30,32,45],figur:12,file:[],filecheck:12,fileexist:7,fileextens:7,filegzip:7,filenam:[0,5,7,9,20,21,22,23,32,33,35,41,45],filenotfound:28,fill:[4,5,9,12,18,21,24,25,26,28,30],fillfromdatabas:[26,30],fillfrommontecarlosampl:[26,30],fillloopsbydatabas:30,fillloopsbymontecarlo:30,filtercandid:28,filtercandidateswithsc:28,final_model:[25,30],find:[],findchain:36,findwithin:5,fine:5,finish:46,fire:1,first:[0,1,5,9,12,14,16,17,20,21,22,23,24,26,27,29,30,31,33,34,35,37,39,40,42,45],fit:[],fix:[3,5,7,12,20,27,31,32,33,35],fix_cterm:27,fix_nterm:27,fix_surrounding_hydrogen:20,flag1:4,flag2:4,flag:[0,2,4,5,7,17,31,35,39,42],flanking_rot_angle_on:17,flanking_rot_angle_two:17,fletch:[21,40],fletcher:30,flexibl:[31,37,40,41,42,43,46],flip:45,flush:[1,12],fold:21,folder:[2,4,5,12,14,32],follow:[0,1,2,4,5,7,12,14,17,18,20,21,23,24,25,30,31,32,33,35,39,40,42,43,44,45],fontsiz:22,forbidden:5,forc:[20,27,30],force_const:[20,27],forcefield:[],forcefieldaminoacid:20,forcefieldbondinfo:20,forcefieldconnect:20,forcefieldharmonicangleinfo:20,forcefieldharmonicimproperinfo:20,forcefieldljpairinfo:20,forcefieldlookup:[20,27,30,32],forcefieldperiodicdihedralinfo:20,forcefieldureybradleyangleinfo:20,forg:12,forget:[1,5],form:[10,19,20,21,25,30,34,45],formal:[26,27,42,45],format:[0,5,9,21,41],formatt:5,formula:28,forward:12,found:[1,4,5,7,9,12,16,18,21,23,26,27,28,29,30,31,39,45],foundat:1,four:[6,29],fraction:[21,27,29],frag_db:[18,21,26,32],frag_info:21,frag_length:[18,21,23],frag_map:21,frag_po:[18,21,23],frag_residu:[18,21],frag_seq:[18,21],frag_siz:21,fragdb:[18,19,21,26,30,32],fragger:[18,21,23,29,30],fragger_handl:30,fragger_map:21,fraggerhandl:[21,23,30],fraggermap:[21,23],fragment:[],fragment_db:30,fragment_handl:23,fragment_info:21,fragment_length:[21,23],fragmentinfo:[21,26],fragments_per_posit:23,fragmentsampl:29,frame:[],frame_energi:42,frame_residu:[38,40],frameresidu:[38,42,43],framework:5,free:[5,44,45],frequenc:[21,29],frm:31,frmrotam:[37,42,46],frmrotamergroup:[37,39,42,43],from:[0,1,2,4,5,6,7,9,12,14,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,39,40,41,42,43,44,45],fromhhm:21,fromhoriz:21,fromresidu:45,front:[1,7,12],fstream:32,fudg:20,fulfil:[21,45],full:[0,1,5,16,19,20,21,24,25,26,29,31,40,42],full_seq:[24,26],fullgapextend:[24,30],fulli:[5,12,16,17,21,24,25,31],function_typ:34,functions_specific_to_your_act:5,fundament:32,funni:[2,5],further:[23,24,30,31,32],furthermor:32,futur:[20,21],gamma:[34,35,37],gamma_bin:35,gap:[],gapextend:[24,30],gapfre:21,gather:[4,8,12,21,23,40,42,45],gciiipgatcpgdyan:[26,30],gener:[],generatedenovotrajectori:23,generatestructureprofil:21,geom:[16,17,20,23,27,30,37,42,43],geometr:[],get:[],getaa:[16,17,20],getaaa:16,getaah:16,getactiveedg:39,getactiverotam:39,getactivesubrotam:42,getallatomposit:[16,27,31],getallatomscoringkei:26,getallatomweight:26,getanchoratomindex:16,getangl:40,getangularbins:21,getatomcount:5,getatomnam:16,getatomnameamb:16,getatomnamecharmm:16,getaveragescor:26,getbackbonelist:[18,21],getbackbonescoringkei:26,getbackboneweight:26,getbins:22,getbinsperdimens:22,getbound:17,getc:17,getca:17,getcb:17,getchain:24,getchainindex:24,getchainnam:24,getchains:5,getcharg:[20,42],getclust:26,getclusteredcandid:26,getconfid:21,getcoordindex:21,getcoordinfo:21,getcpuplatformsupport:20,getdefault:[20,27,30],getdihedralangl:21,getdistbins:21,getdisulfidbridg:20,getdisulfidconnect:20,getdsspstat:21,getedg:39,getel:16,getenviron:16,getenvsetdata:5,getepsilon:20,getfirstindex:16,getforcefieldaminoacid:20,getfragmentinfo:[21,26],getframeenergi:42,getfudgelj:20,getfudgeqq:20,geth1index:16,geth2index:16,geth3index:16,getheavyindex:20,gethistogramindex:[17,22],gethistogramindic:22,gethnindex:16,gethydrogenindex:[16,20],getindex:[16,20],getinternalconnect:20,getinternalenergi:42,getinternalenergyprefactor:42,getlargestclust:26,getlastindex:16,getlength:24,getlist:23,getlooplength:20,getloopstartindic:20,getmass:20,getmaxnumatom:16,getmaxnumhydrogen:16,getn:17,getnam:[40,42],getnonbondedcutoff:27,getnum:26,getnumactiveedg:39,getnumactivenod:39,getnumactiverotam:39,getnumatom:[16,20],getnumb:26,getnumcandid:26,getnumchain:5,getnumcoord:21,getnumedg:39,getnumfrag:21,getnumhydrogen:16,getnumloopresidu:20,getnumnod:39,getnumresidu:[5,16,20],getnumrotam:39,getnumstempair:21,getnumsubrotam:42,geto:17,getolc:[16,17],getomegators:[16,17],getoxtindex:20,getpairwiseenergi:39,getparticletyp:42,getpeptideboundconnect:20,getphiprobabilitygivenpsi:22,getphitors:[16,17,40],getpo:[16,42],getpotentialenergi:20,getpredict:21,getprob:[22,42],getpsiprobabilitygivenphi:22,getpsitors:[16,17,40],getr:28,getresiduedepth:21,getringpunch:28,getscor:[21,29],getselfenergi:[39,42],getseqr:[16,34],getsequ:[16,17,21,26],getsequenceprofil:21,getsequenceprofilescoreskei:26,getsigma:20,getsimul:20,getsolventaccessibilitit:21,getstemrmsdskei:26,getstructureprofil:21,getstructureprofilescoreskei:26,getsubdb:21,getsubrotamerdefinit:42,getsystemcr:27,gettemperatur:[29,42],gettransform:17,getversionnumb:32,getweight:[23,26],ggg:30,gggaggg:30,gggggggggggggggggggg:30,git:[],gitignor:5,give:[4,5,12,18,26,29,30,42],given:[0,1,4,5,6,7,9,10,16,17,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,37,39,40,42,43,45],gln:44,gln_ne2:16,global:[11,26,32],glu:[16,42,44,45],glu_oe1:16,glutam:44,glutamin:44,gly:[30,31,40,44],gly_n:16,glycin:[17,27,31,44],goal:[1,25],goe:[2,5,10,12,30,45],goldfarb:30,goldstein:39,good:[4,5,14,20,21,30],got:2,grain:5,graph:[],graph_initial_epsilon:31,graph_intial_epsilon:31,graph_max_complex:31,grep:2,gromac:6,group:[],group_definit:[22,35],group_idx:35,guarante:[21,23,26,31,32],gui:[5,22],guid:27,guidelin:[5,32],gzip:[0,7,9],hand:[2,4,9,42],handl:[],handler:23,happen:[1,5,20,21,23,24,29,30,42],hardwar:14,harmon:[20,27],harmonic_angl:20,harmonic_bond:20,harmonic_improp:20,hasfraglength:21,hasfragmentinfo:26,hash:21,hasringpunch:28,have:[],hbond:[23,30,35,42,43,44],hbond_scor:32,hbondscor:[],headach:5,header1:4,header2:4,header3:4,header4:4,header:[],header_output_dir:4,headlin:5,heavi:[16,20,31,33,43],heavili:[21,40],helic:[17,19,20,23,30,35,41],helix:[14,17,29,40],hello:32,hello_world:5,hellyeah:14,help:[0,1,2,4,5,9,12,14,20,35],helpactiontest:1,helper:[],hen:21,henc:[5,10,16,21,32],here:[0,1,2,4,5,7,9,10,12,14,16,17,20,21,22,23,25,26,27,29,30,32,33,35,36,37,45],het:30,heurist:[30,43],heuristicprocessor:16,hgfhvhefgdntngcmssgphfnpygkehgapvdenrhlg:0,hhm:[21,26],hhsearch:21,hhsuit:21,hidden:42,hide:[5,12],hierarch:[26,34],hierarchi:11,high:[3,5,12,25,30],high_resolut:17,higher:[2,26,34,35],highest:11,highli:[2,5,21],hint:9,histidin:[20,44],histogram:[22,29],histori:12,hit:[1,12,22,27,39],hmm:21,holi:[],home:4,homolog:[0,8,14,21,30],homologu:21,honor:30,honour:[30,35],hook:[],horiz:21,host:[4,12],hotfix:12,hous:[],how:[],hparticl:42,hpp:32,hsd:[44,45],hse:[44,45],html:[2,5,12],http:5,hydrogen:[3,16,17,20,21,30,35,42,43],hyphen:1,i_loop:[20,31],id_:32,idea:[1,5,16,18,20,21,30,34,42,46],ideal:[17,27,46],idenfifi:43,ident:[21,22,35,45],identifi:[0,9,10,21,26,30,31,33,35,43,45],idx:[16,17,20,21,23,27,34,39,42],idx_ca_res_37:16,idxhandl:5,iff:[21,24,28],ifstream:32,ignor:[0,20,27,30,35],illustr:21,imagehandl:[17,34],imagin:5,imaginari:1,img:[17,34],immedi:[1,5,11,12],impact:20,implement:[12,21,23,24,27,30,32,37,39,40,44],implicit:2,improp:20,improv:[3,19,20,30,37,40],in_dir:4,in_fil:5,in_path:4,in_stream:32,in_stream_:32,inaccur:20,inaccurate_pot_energi:20,inact:46,inactive_internal_energi:46,incl:[20,21,30],includ:[2,5,7,12,14,16,19,20,21,24,26,28,30,32,40],include_ligand:30,includeenv:35,inclus:30,incompat:[26,27],incomplet:[30,41],inconsist:[9,16,17,20,21,24,26,27,31,34],inconveni:12,increas:[23,26,27,30,39],independ:[20,31,41],index:[5,15,16,17,20,21,22,23,24,26,27,28,29,30,33,34,35,38,42,43,45],index_four:20,index_on:20,index_thre:20,index_two:20,indic:[],individu:[33,35],inf:39,influenc:[9,23,34],info:[21,26,30,34],inform:[5,9,12,17,18,19,21,23,24,26,30,34],inherit:[1,33,34,35],init:12,init_bb_list:29,init_frag:29,initi:[3,16,17,21,23,26,27,29,30,31,33,34,35,39,42,45],initial_bb:26,initial_epsilon:[39,46],initialis:1,inlin:[5,32],inner:10,input:[0,1,3,9,12,14,20,21,22,23,27,29,30,31,33,35,37,39,41,43,46],insert:[16,17,24,26,29,30,46],insertinto:[16,17,26],insertloop:[24,30],insertloopcleargap:[24,26,30],insid:[1,4],insight:12,inspir:27,instanc:[3,5,9,19,20,32],instead:[1,2,4,5,7,21,23,24,26,29,30,35,43],instruct:2,int16_t:32,int32_t:32,int_32_t:32,integ:[5,9,16],intend:[1,5,29],interact:[5,20,27,33,34,35,37,38,39,42],intercept:[33,35],interest:[1,20,21,29,32,39,42,45],interfac:[0,4,5],intermedi:5,intern:[0,1,4,5,12,16,19,20,21,22,23,26,27,29,30,31,32,34,35,39,42,43,46],internal_e_prefac:43,internal_e_prefactor:42,internal_energi:42,internet:5,interpol:[34,45],interpret:[5,7],intervent:5,intrins:2,introduc:[1,4,5,12,27,30,39],invalid:[5,16,20,21,24,27,30,31,33,34,35,38,42,44,45],invok:[2,4,5,11,12],involv:[12,25,35,37],iostream:32,is_c_ter:[20,31],is_cter:20,is_n_ter:[20,31],is_nter:20,isallatomscoringsetup:[26,30],isallset:16,isanyset:16,isbackbonescoringsetup:30,isctermin:24,isempti:26,isen:10,ishbondacceptor:42,ishbonddonor:42,isntermin:24,isoleucin:44,isset:16,issimilar:45,issourc:32,istermin:24,isvalid:40,item:[1,5,12,16,17,20,21,30,34],iter:[21,22,23,26,27,29,30,39,42],itself:[4,5,12,21,29,31,32,33,35,42],job:[5,21,30],join:[5,16,18,21,26,27,29,31,36],jone:[21,42],jones1999:21,json:[0,9],just:[1,2,5,9,11,12,18,20,21,24,26,30],kabsch1983:21,kabsch:21,keep:[],keep_non_converg:26,keep_sidechain:[5,31],kei:[0,9,21,23,26,29,30,33,34,35],kept:[5,12,20,26,27,31,38],kernel:41,keyword:22,kic:[],kicclos:29,kick:9,kill_electrostat:20,kind:[1,5],kinemat:27,know:[2,45],known:[4,7,16,34,43],kortemm:27,krivov2009:[40,41],krivov:40,kwarg:1,l_e:42,lab:41,label:[12,20],lack:30,languag:4,larg:[21,22,27,30],larger:[10,17,21,30,39,43],largest:[23,26,37],last:[1,4,16,17,20,21,24,26,27,29,30,34,35,41],last_psi:17,later:[1,5,16,39],latest:[2,5],latter:[0,12,30],launcher:[4,5],layer:37,layout:[21,32],lazi:42,lbfg:30,lead:[0,5,6,7,17,20,26,27,31,33,35,41],least:[0,2,4,5,12,17,20,30,33,35,37,39],leav:1,left:[7,27],legal:5,len:[17,18,20,21,23,26,30,31,35,40],length:[6,16,19,20,21,22,23,24,26,27,30,31,32,33,34,37],lennard:42,less:[0,12,17,20,21,22,26,30,33,35,39,45],let:[1,5,17,21,26,40],letter:[16,17,21,22,29,44],leu:44,leu_h:16,leucin:44,level:[2,3,5,10,11,12,21,25,30,42],lexicograph:30,lib64:5,libari:41,libexec:[4,5],libpromod3_nam:4,librari:[],library1:4,library2:4,licenc:41,life:12,ligand:[3,30,31,43],like:[1,4,5,12,30,32,41,42],limit:[21,27,30],line:[],linear:[21,23,26,29,33,35],linear_weight:[26,29,33,35],linearcombin:26,linearscor:29,liner:34,link:[2,4,5,12,16,20,21,23,31,33,34,35,36],link_cmd:4,linkcheck:[2,5,12],linker:[4,30],linker_length:30,list:[0,1,2,3,4,5,6,7,9,16,17,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,42,43,45,46],listen:5,literalinclud:5,littl:[4,5,12,32],live:[4,5],lj_pair:20,load:[],load_frequ:[19,21],loadalign:[25,30],loadallatominteractionscor:33,loadallatompackingscor:33,loadamberforcefield:30,loadbb:21,loadcach:23,loadcbetascor:[26,29,35,36],loadcbpackingscor:35,loadcharmm:20,loadcharmmforcefield:30,loaddefaultallatomoverallscor:33,loaddefaultbackboneoverallscor:35,loaddunbracklib:[40,41],loadent:[0,9],loadfragdb:[18,19,26,30],loadhbondscor:35,loadpdb:[5,16,18,20,21,25,26,27,29,30,31,36,40],loadpenultimatelib:41,loadport:[20,21,22,32,33,35,45],loadreducedscor:35,loadsequenceprofil:[21,26],loadssagreementscor:35,loadstructuredb:[18,19,21,26,30],loadtorsionsampl:[17,19,22,29],loadtorsionsamplercoil:[19,26,30],loadtorsionsamplerextend:19,loadtorsionsamplerhel:19,loadtorsionscor:35,local:[2,20,21,22,33,35,45],locat:[2,4,17,24,32,33,35,39,42],log:[7,12,28,42,43],logic:0,loginfo:28,lone:42,lone_pair:42,longer:[],longest:21,look:[5,7,12,17,31,34],lookup:[],looooooong:39,loop:[],loop_candid:26,loop_length:[20,21,31],loop_main:5,loop_po:20,loop_seq:26,loop_start:[],loop_start_indic:[20,31],loopcandid:[],loss:12,lost:[1,12],lot:[1,5,9,12],lovel:41,lovell2000:41,low:[1,5,35,39,43],lower:[26,29,30,33,35],lowest:[26,29,42],lowest_energy_conform:29,lysin:44,machin:[20,21,22,32,33,35,45],macro:[4,5],made:[4,45],magic:[5,32],mai:[0,1,2,4,5,7,9,12,16,20,24,27,30],main:[30,32,45],mainli:[16,29,41,42],maintain:[5,12],major:12,makefil:[2,5],makestat:45,malici:12,man:[2,5],manag:[4,5],mandel:27,mandell2009:27,mani:[7,9,27,28,30,35,43],manipul:17,manner:[5,29,39],manual:[1,2,5,6,12,21,26,29,30,32,42],map:[16,17,21,23,28,31,34,35],mar:19,mark:[4,43],markup:5,mass:20,massiv:23,master:[5,12],mat3:6,mat4:[6,17,23,30],match:[0,4,20,21,22,23,26,27,29,30,34,35],materi:[1,5],math:28,mathemat:[26,27],matplotlib:22,matric:21,matrix:[6,21],matter:4,max:[6,16,24,28,30,31,35,39,45,46],max_alpha:35,max_beta:35,max_complex:[39,46],max_count:[33,35],max_d:35,max_dev:29,max_dist:[26,34],max_extens:30,max_gamma:35,max_iter:[23,26,30],max_iter_lbfg:30,max_iter_sd:30,max_length:24,max_loops_to_search:30,max_n:39,max_num_all_atom:30,max_p:43,max_prob:42,max_res_extens:30,max_step:27,max_to_show:10,max_visited_nod:39,maxfraglength:21,maxim:[19,21,23,26,27,29,30,34,35,39],maximum:[23,26,27,29,39,42,43],mc_closer:29,mc_cooler:29,mc_num_loop:30,mc_sampler:29,mc_scorer:29,mc_step:[30,39],mcsolv:39,mean:[4,5,9,12,16,20,27,30,31],meaning:[21,26,41],meant:[14,16,21,28,30,39,43],measur:23,mechan:[14,27,30],meddl:30,member:[5,9,26,30],memori:[21,30,32,39],mention:[1,2],merg:[12,20,23,24,26,30,31,34,42],merge_dist:30,mergegap:24,mergegapsbydist:30,mergemhandl:30,mess:[5,12],messi:12,met:44,methionin:[30,44],method:[0,1,9,16,20,21,22,27,30,31,32,39,43],metric:34,metropoli:[26,29,39],mhandl:[24,25,26,30],middl:12,might:[20,21,27,39,42,43,46],min:[26,35],min_alpha:35,min_beta:35,min_candid:26,min_d:35,min_dist:34,min_gamma:35,min_loops_requir:30,min_scor:26,mincadist:17,mind:[1,5],minim:[3,14,17,20,21,26,27,30,33,34,35,39,40],minimizemodelenergi:30,minimum:[17,23,37],minor:[3,20],minu:39,mirror:32,miser:10,mismatch:[16,34],miss:[0,7,9,20,30],mix:[0,4],mkdir:[2,5],mm_sy:[20,27],mm_sys_output:20,mm_system_cr:27,mmcif:7,mmsystemcr:[20,27],mod:5,mode:[1,35,45],modellinghandl:[24,26,30],modeltermini:30,modif:30,modifi:[5,12,17,26,30,35],modified_crambin:26,modul:[],module_data:4,mol:[],molecular:[14,21,27,30],moli:[],molprob:[],molprobity_bin:28,molprobity_execut:28,moment:5,monitor:1,monolith:5,mont:[3,23,26,29,30,39],mood:5,more:[1,2,4,5,9,10,12,23,30,37,39,42],most:[0,4,5,17,20,22,23,26,27,30,33,35,41],mostli:[4,12,42],motion:17,movabl:20,move:[2,3,5,12,20,26,27,29,30,32],movement:23,mpscore:28,msg:7,msgerrorandexit:7,msm:21,msse4:2,much:[5,21,30,35,39],multi:14,multipl:[0,2,3,4,5,9,10,14,20,23,26,30,31,33,35],multipli:[29,39],multitempl:9,must:[],mutlipl:9,my_db:21,myclass:32,myclassptr:32,mytrg:0,n_coord:6,n_num:24,n_po:[6,17,35,43],n_stem:[6,18,21,24,26,27,29],n_stem_idx:[],n_stem_phi:29,n_ter:[27,43],naiv:[],name:[0,1,4,5,7,9,10,16,20,21,22,24,26,28,30,37,41,42,44,45],name_pymod:4,namespac:[9,32],nan:45,nat:27,nativ:32,necessari:[5,17,21,29,34],necessarili:46,need:[1,2,3,4,5,7,9,11,12,17,20,21,22,23,26,27,30,31,32,33,34,35,40],need_config_head:4,neg:[1,20,27,34,39],neglect:[23,27,38,42],neglect_size_on:26,neighbor:[5,16,30],neighbour:[30,45],network:[17,37],never:[9,12,26,31,32,33,35],nevertheless:[5,42],new_default:20,new_env_po:16,new_po:16,new_res_nam:42,new_siz:17,newli:[16,29],next:[1,5,12,17,22,23,24,32],next_aa:29,nice:5,nitrogen:[6,17,27,42,43],nobodi:1,node:39,node_idx:39,non:[],nonbonded_cutoff:[20,27],none:[9,23,28,30,31],nonredund:21,nonrotamer:41,nonzero:[39,45],norm:35,normal:[33,35],normalis:34,notabl:21,note:[0,2,5,9,10,16,17,20,21,23,26,27,29,30,31,32,33,34,35,36,39,40,43,44],noth:[4,5,10,29,42],notic:[1,4,12],novel:21,now:[5,10,12,14,17,21],nparticl:42,nterminalclos:29,null_model:26,num:[18,23,26,27,31,36],num_frag:[21,30],num_gap_extens:24,num_loop:26,num_residu:[16,20,31,33,34],num_residues_list:31,num_trajectori:23,number:[0,1,5,6,9,10,14,16,17,19,20,21,22,23,24,26,27,29,30,31,32,33,34,35,37,38,39,42,45],numer:30,numpi:[22,29],o_po:[17,43],object:[],observ:[21,27,39,46],obtain:[14,18,30],obviou:12,occupi:[38,43],occur:[16,23,34,35],ocparticl:42,odd:21,off:[1,5,10,30],offend:28,offer:[19,25,42],offset:[0,3,9,21,26,30],ofstream:32,often:[5,7,9,27],olc:17,old:[28,30],oligom:25,oligomer:3,olson:21,omega:[16,17],onc:[1,5,12,20,23,26,27,39,45,46],one_letter_cod:[16,18,21,26,27,29,31,36],onli:[0,1,2,4,5,7,9,10,11,12,16,17,20,21,23,24,26,28,29,30,31,32,33,35,37,39,40,41,43],onto:[1,17,21,23],oparticl:42,open:[9,20,21,22,32,33,35,45],openmm:[2,14,20],openstructur:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47],oper:[3,12,14,16,21,39],opt:[7,9,12],optim:[],optimis:5,optimize_subrotam:[31,37],optimum:[],option:[0,2,9,27,30,45],order:[0,9,16,20,21,24,26,30,32,34,35],org:5,organ:[5,21,45],orient:[6,27,35],orig_indic:[26,28],origin:[6,9,12,17,26,29,30,35,39,46],ost:[],ost_double_precis:2,ost_ent:28,ost_librari:4,ost_root:[2,5],other:[0,1,2,4,5,10,12,16,17,26,30,31,33,35,39,42,45,46],other_db:21,other_index:17,other_res_index:16,otherwis:[1,4,5,10,12,16,17,20,21,23,24,26,27,29,33,34,35,39,42],our:[4,5,12,21,26],out:[1,2,4,5,10,12,16,20,21,22,23,24,26,40,45],out_path:4,out_po:20,out_stream:32,out_stream_:32,outer:10,outlier:28,output:[],output_dir:4,outsid:[5,34],over:[2,4,9,12,21,27,30,35,42],overal:[29,34,39],overhead:20,overlap:[20,29,30,31,35],overli:12,overload:32,overrid:[2,20],overridden:4,overview:[5,12],overwrit:26,overwritten:20,own:[],oxt:[6,16,20],oxygen:[17,30,42,43],pack:16,packag:[4,5,12],pad:[17,32],page:[2,5,15],pai:1,pair:[6,20,21,22,23,27,29,31,32,33,34,35,37,42,45],pairwis:[],pairwise_energi:39,pairwiseenergi:42,pairwisefunct:[34,35],pairwisefunctiontyp:34,pairwisescor:[],paper:[37,40,42],paragraph:[1,5],parallel:21,paramet:[1,4,5,6,7,9,10,11,16,17,19,20,21,22,23,24,26,27,28,29,30,31,33,34,35,37,38,39,41,42,43,44,45,46],parameter_index:21,parametr:[27,30,31,35,43],parent:[30,35],pars:[],parser:[],part:[1,5,12,14,16,29,30,34,35,37,39,40,42],partial:24,particip:[31,37],particl:[],particular:[5,21,26,27,29,39,42,45],partner:[33,34,35,42],pass:[9,12,16,20,21,23,24,27,29,38,42,43],past:[5,12,17,24],path:[1,2,4,5,7,12,14,20,21,22,28,33,35,45],path_to_chemlib:11,pattern:21,paus:10,pdb:[0,5,7,9,14,16,17,18,19,20,21,25,26,27,28,29,30,31,36,40],pdb_id:21,penal:[24,30],penalti:[24,30],penultim:[31,41],penultimatelib:32,peopl:12,pep:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47],peptid:[16,18,20,21,30,31,40],per:[4,5,8,12,16,21,22,26,29,30,33,34,35,37,39],percentag:28,perfect:5,perfectli:5,perform:[0,12,14,20,23,26,27,28,29,30,32,33,37,39],period:20,periodic_dihedr:20,periodic_improp:20,permiss:5,permut:39,phase:20,phe:[44,45],phenix:28,phenylalanin:44,phi:[16,17,21,22,27,29,35,40,43,45],phi_bin:[35,45],phi_handl:40,phipsisampl:29,phosphoserin:30,phrase:5,pick:[26,29],pictur:5,piec:[5,23],pipelin:[],pivot:[26,27,29],pivot_on:[26,27],pivot_thre:[26,27],pivot_two:[26,27],place:[1,2,4,5,7,9,12,35],plain:[0,9],plan:12,plane:28,platform:[14,20],pleas:[2,5,12,21,23,26,27,30],plot:22,plt:22,plu:[5,9,11,37,42],pm3_csc:12,pm3_openmm_cpu_thread:[14,20,30],pm3_runtime_profiling_level:10,pm3argpars:[],pm3argumentpars:[0,7,9],pm_action:[1,4,5],pm_action_init:5,pm_bin:1,png:22,point:[2,5,9,11,16,21,23,29,30,34,45],pointer:[2,5,32],polar:[42,43],polar_direct:42,polici:5,pop:12,popul:[2,12],port_str_db:21,portabl:[],portable_binary_seri:32,portable_fil:4,portablebinarydatasink:32,portablebinarydatasourc:32,pos_end:23,pos_on:23,pos_start:23,pos_two:23,posit:[],possibl:[0,3,5,9,12,17,20,21,22,24,26,27,29,30,31,32,33,34,35,37,39,42,44],post:9,postprocess:31,pot:20,pot_:27,potenti:[18,19,20,21,26,27,30,31,32,35,39],pqhpg:0,practic:[4,5,20,21],pre:[5,12],pre_commit:[5,12],preceed:31,precis:[2,26,30],precomput:[],pred:34,predefin:[4,14,20,30,33,35],predict:[21,23,30,34,35,37,40],prefactor:42,prefer:[2,4,45,46],prefilt:30,prefix:[1,4,5,7],prepar:[5,30],present:[17,27,31,42,43,45],prev_aa:29,prevent:[1,5],previous:[20,21,26,31,34],primary_rot_angl:17,principl:[29,34],print:[1,2,17,18,20,21,26,27,28,30,36],printstatist:21,printsummari:10,prior:30,privat:[1,32],pro:[16,22,44,45],probabilist:[21,43],probability_cutoff:43,probabl:[4,5,12,21,22,23,26,27,29,39,41,42,43,45],problem:[9,12,21,26,27,29,30,37,39,41,46],problemat:23,procedur:[23,31],process:[1,9,12,16,20,23,27,29,30,32,34,38,45],produc:[0,1,2,4,5,21,23,24,28,30,39,41,43],product:[1,3,12],prof:[21,26],prof_dir:21,prof_path:21,profil:[],profiledb:21,profilehandl:[21,23,26,30],profilehandlelist:[],prog:9,program:[4,5,8],project:[4,5,12],prolin:[17,28,43,44],promin:0,promod3_mod:4,promod3_nam:4,promod3_name_head:4,promod3_path:5,promod3_root:5,promod3_shared_data_path:[5,32],promod3_unittest:[1,4,5],promot:5,propag:[5,17],proper:[12,43],properli:[1,30,33,35,39,43],properti:[16,17,21,30,45],propos:[24,26,27,29,37],proposed_posit:29,proposestep:29,prot:[5,18,21,27,29,31,40],prot_rec:5,protein:[],proton:[16,20,44,45],provid:[0,1,2,4,5,9,12,16,17,18,20,21,23,24,26,27,28,29,30,31,32,34,41,42,43,45],prune:[39,46],pseudo:[29,30,33,35],psi:[16,17,21,22,27,29,35,40,43,45],psi_bin:[35,45],psi_handl:40,psipr:[21,23,34,35],psipred_confid:35,psipred_pr:23,psipred_predict:[21,23,30],psipred_st:35,psipredpredict:[],psipredpredictionlist:[],pull:[5,12],punch:[],pure:0,purpos:[5,30,45],push:12,pushverbositylevel:9,put:[1,4,5,7,9,30],py_run:[1,4,5],pyc:1,pylint:12,pylintrc:12,pymod:[4,5,12],pyplot:22,pytest:5,python2:5,python:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47],python_root:2,pythonpath:5,qmean:2,qmeandisco:34,qualiti:30,queri:[21,45],querylib:45,question:22,quickli:[5,27],quit:[5,9],rachovski:19,rackovski:19,radian:[6,17,20,22],radii:28,radiu:[5,28,33,35],raihvhqfgdlsqgcestgphynplavph:0,rais:[0,6,9,16,17,20,21,22,23,24,26,27,28,29,30,31,33,34,35,37,38,42,43,45],rama_iffi:28,ramachandran:28,random:[17,19,22,26,27,29,39],random_se:26,randomized_frag:17,randomli:[22,29],rang:[5,6,16,17,18,20,21,22,23,24,27,29,30,33,34,35,45],rank:26,rapid:37,rare:5,rather:[5,7,12,45],raw:[],rawmodel:5,reach:[0,24,27],read:[0,5,7,9,12,20,21,22,24,31,32,33,35,41,45],readabl:[0,5,9,45],readdunbrackfil:41,reader:[12,14],readi:[2,45],readm:2,real:[5,9,32,43],realli:[1,2,5,7,12],reappear:12,reason:[5,12,21,27,29,33,46],rebas:12,rebuild:[2,5],recalcul:22,recent:12,recoginz:44,recogn:[0,9],recognis:[1,5,12],recognit:21,recommend:[2,5,20,30,35],reconstruct:[],reconstructcbetaposit:17,reconstructcstemoxygen:17,reconstructor:[27,30,31],reconstructoxygenposit:17,reconstructsidechain:[5,30,31],reconstructtest:5,record:[1,30],recreat:12,reduc:[3,20,21,23,30,35],reduced_scor:32,reducedscor:[],redund:19,ref_backbon:[18,21],ref_fil:5,refactor:3,refer:[1,4,5,14,16,17,18,20],referenc:5,refresh:26,regard:[27,37],region:[20,23,24,27,29,30,38,43],regist:[4,5],regress:41,reinterpret_cast:32,reject:[26,27,29],rel:[4,6,23,27,35,39],relat:[4,5,9,21,32,39,42],relax:[],relev:[2,3,4,20,31],remain:[25,29,30],rememb:[1,5,29],remodel:[26,31],remodel_cutoff:31,remov:[2,3,17,20,24,26,28,30,31,39,40],removeterminalgap:30,renumb:30,reorder:30,reordergap:30,replac:[16,17,29,30],replacefrag:17,report:[1,5,30],reportmolprobityscor:28,repositori:[1,4,5,12],repres:[],represent:[17,18,20,21,22,32,33,35,42,45],reproduc:30,requeset:35,request:[23,41,45],requir:[0,2,5,9,12,16,17,21,22,23,26,27,30,31,32,33,35,42,43,44,45],reread:21,res_idx:42,res_index:16,res_indic:[16,20,31],res_list:[16,20,27,31],res_num:16,resembl:12,reserv:7,reset:[16,20,27,29,34,39,42],residu:[],residue_depth:21,residue_index:[38,42,43],residuehandl:[6,16,17,21,24,26,27,28,29,42,43,45],residuehandlelist:16,resiz:[17,32],resnum:[16,17,24,26,30,31,33,34],resnum_on:34,resnum_rang:30,resnum_two:34,resolut:[17,27,34,35],resolv:[12,16,27,34],resolvecystein:37,resort:30,respect:[6,20,30],respons:[5,12],rest:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47],restor:17,restraint:27,restrict:[5,12,24],restructuredtext:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47],result:[0,2,5,20,22,23,26,27,28,29,30,31,37,39,41,45],resum:10,reus:[30,31],review:12,reviv:12,rewrit:1,richardson:41,ridig:31,right:[1,2,5,9],rigid_frame_cutoff:31,rigidblock:23,ring:[],ring_punch_detect:30,rmsd:[17,18,21,23,26,27],rmsd_cutoff:[21,26,27],rmsd_thresh:[21,23],rmsd_threshold:21,rnum:36,robot:27,role:9,root:[2,4,5,12],rosetta:35,rot:31,rot_constructor:40,rot_group:[40,43],rot_lib:43,rot_lib_entri:43,rota_out:28,rotam:[],rotamer_group:[37,39,40],rotamer_id:40,rotamer_librari:31,rotamer_model:31,rotamer_on:37,rotamer_res_indic:31,rotamer_two:37,rotamergraph:[31,39,40,42,46],rotamergroup:[39,42],rotamerid:[],rotamerlib:[31,32,41,43,45],rotamerlibentri:[43,45],rotat:[6,17],rotatearoundomegators:17,rotatearoundphipsitors:17,rotatearoundphitors:17,rotatearoundpsitors:17,rotationaroundlin:6,roughli:19,round:45,routin:[1,14,26],rrm:31,rrmrotam:[37,42],rrmrotamergroup:[37,39,42,43],rst1:4,rst2:4,rst:[4,5,12],rsync:5,rule:[5,6,12],run:[],runact:1,runexitstatustest:1,runmolprob:28,runmolprobityent:28,runnabl:5,runner:1,runtest:[1,5],runtim:[],runtimeerror:[6,16,17,20,21,22,24,26,27,29,30,31,33,34,35,37,38,41,42,43,45],runtimeexcept:22,safe:2,said:4,same:[0,1,2,4,5,9,10,16,20,21,23,26,27,29,30,31,32,33,34,35,38,39,42,43,45],samiti:30,sampl:[],sampled_frag:29,samplemontecarlo:29,sampler:[],sampling_start_index:29,sander:21,saniti:2,sanity_check:2,sanner1996:21,sanner:21,satisfi:44,save:[5,12,17,20,21,22,23,26,29,32,33,35,45],savebb:21,savecach:23,savefig:22,savepdb:[14,16,17,20,21,25,26,27,29,30,31,40],saveport:[20,21,22,32,33,35,45],sc_data:27,sc_rec:[27,31],sc_rec_test:31,sc_result:27,scale:17,scatter:22,scheme:[1,5,9,16,24,29],sci:[27,37],scondari:30,scope:10,score:[],score_contain:26,score_env:[26,29,36],score_threshold:37,score_vari:30,scorecontain:26,scoring_weight:23,scoringgapextend:[24,30],scoringweight:[23,26],scratch:21,scriptnam:7,scriptpath:5,scwrl4:[37,40,42,43],scwrlrotamerconstructor:[40,42,43],seamlessli:12,search:[2,5,15,16,21,23,26,28,30,31,35,37,42,43],searchdb:[18,21],second:[5,17,20,23,26,27,30,33,34,35,37,39],secondari:[21,23,35],secondli:5,section:[1,4,13,47],see:[0,1,5,6,7,9,12,14,16,19,20,21,22,24,26,28,29,30,32,33,35,39,45],seed:[19,22,26,27,29,39],seem:12,segment:17,select:[3,21,23,29,30,31,36,39,40],selenium:30,self:[1,5,37,39,42],self_energi:42,send:7,sens:[34,35],sensibl:30,separ:[1,5,20,22,30,33,35,37,39],seq:[9,16,18,21,23,24,26,30,34,36],seq_idx_on:23,seq_idx_two:23,seq_one_idx:23,seq_sep:[33,35],seq_tpl:[26,30],seq_trg:[26,30],seq_two_idx:23,seqid:21,seqr:[0,16,18,21,23,24,26,29,30,31,33,34,35],seqres_str:[16,27,31],seqsim:21,sequenc:[],sequencefromchain:36,sequencehandl:[16,23,24,30,34],sequencelist:[16,30,34],sequenceprofil:21,sequenti:[17,30],ser:44,serial:[21,32],serializ:32,serin:44,serv:[1,9,21,23,26,29],servic:12,set:[1,2,4,5,7,9,11,12,14,16,17,20,21,23,26,27,28,29,30,31,32,33,34,35,37,39,40,42,43,45,46],setaa:17,setactivesubrotam:42,setallatomscoringkei:26,setaroundomegators:17,setaroundphipsitors:17,setaroundphitors:17,setaroundpsitors:17,setbackbonescoringkei:26,setbackrub:17,setc:17,setca:17,setcb:17,setcharg:20,setcpuplatformsupport:20,setdefault:20,setdisulfidconnect:20,setenergi:[33,35],setenviron:[16,27,31,34],setepsilon:20,setframeenergi:[40,42],setfudgelj:20,setfudgeqq:20,setinitialenviron:[16,26,27,29,31,34,36],setinternalconnect:20,setinternalenergi:42,setinternalenergyprefactor:42,setinterpol:45,setmap:[34,35],setmass:20,setn:17,setnonbondedcutoff:27,seto:17,setolc:17,setpeptideboundconnect:20,setphitors:17,setpo:16,setpolardirect:42,setprob:42,setpsipredpredict:[30,34,35],setpsitors:17,setresidu:16,setscor:35,setsequ:17,setsequenceoffset:30,setsequenceprofil:30,setsequenceprofilescoreskei:26,setsigma:20,setstemrmsdskei:26,setstructureprofil:21,setstructureprofilescoreskei:26,settemperatur:42,setup:[],setupdefaultallatomscor:[26,30],setupdefaultbackbonescor:[26,30],setupsystem:20,setweight:26,sever:[2,3,5,9,19,21,22,23,26,27,31,37,42,45,46],sg_pos_on:37,sg_pos_two:37,shake:29,shanno:30,shapovalov2011:41,shapovalov:[40,41],shared_ptr:32,shebang:5,sheet:[30,41],shelenkov:37,shell:[1,2,5,7],shift:[17,24],shiftctermin:24,shiftextens:24,shorten:30,shorter:30,shortest:26,shortli:5,should:[1,2,4,5,7,9,12,14,17,18,21,22,23,26,27,29,30,31,32,34,38,39,40,42],show:[1,5,9,10,26,29,40],showcas:[1,16,20,22],shown:[5,10,30],shrink:17,side:[5,30,37,40],sidechain:[],sidechain_pymod:5,sidechain_reconstructor:30,sidechain_rst:5,sidechain_test_data:5,sidechain_test_orig:31,sidechain_test_rec:31,sidechain_unit_test:5,sidechainparticl:[42,43],sidechainreconstructiondata:[],sidechainreconstructor:[],sidenot:31,sig1:45,sig2:45,sig3:45,sig4:45,sigma:20,silent:1,sim:20,similar:[1,2,12,18,21,23,34,35,45],similardihedr:45,similarli:[2,20,30],simpl:[0,6,17,21,29,33,34,35,37,45],simpler:[20,30],simplest:[5,25],simpli:[16,17,26,27,29,30,43,44,45],simplic:18,simplif:9,simplifi:[3,17,20,21],simul:[20,26,27,29,39],sinc:[1,2,4,5,7,12,14,17,20,21,22,23,39,41,44],singl:[2,4,5,16,17,20,21,23,26,27,29,30,31,34,35,38,39,41,42,43,46],single_chain_structur:21,singleton:20,singular:23,sink:32,sit:5,site:5,size:[5,16,17,21,22,27,29,32,33,34,35],sizeof:32,skip:[0,1,5,12,21,30,43],slide:23,slight:30,slightli:[30,39],slow:32,slower:[14,20,21,22,30,33,35,45],small:[5,21,27,30,31],smaller:[17,21,23,27,35],smallest:[],smallish:[2,5],smart:12,smng:3,smooth:41,smtl:30,soding2005:21,softsampl:29,softwar:5,sol:40,sole:[1,12],soli:19,solut:[5,23,26,27,29,30,31,39,40],solv:[12,39,46],solvent:21,solvent_access:21,solvent_accessibility_str:21,solver:3,some:[1,2,4,5,9,12,16,18,21,25,28,29,30,31,32,34,36,40,43,45],somedata:32,someth:[1,5,7,12,21],sometim:12,somewher:[4,21],soon:[27,35,39,40,45],sort:[1,4,10,26,39,45],sound:12,sourc:[1,2,4,5,7,9,11,12,21,23,26,27,28,30,31,32,45],source1:[4,12],source2:[4,12],source3:4,source4:4,source_chain_idx:30,source_mhandl:30,span:30,sparticl:42,spatial:5,spawn:[1,5],spdbv:30,spdbv_style:30,special:[1,2,4,5,20,43,44,45],specif:[1,5,20,21,22,23,26,29,34,35,36,41,43,45],specifi:[2,4,6,17,21,22,27,30,31,34,35,39,42,45],specimen:7,speed:[3,20,30],spehner:21,spend:5,spent:[10,14],sphinx:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47],spit:24,split:36,sport:5,squar:21,src:[5,12],src_db:21,ss_agreement:[30,35],ss_agreement_scor:32,ssagre:21,ssagreementscor:[],sse:2,sstream:32,stabil:21,stabl:12,stack:12,stage:[],stai:[1,5,12,39],standard:[2,5,8,9,12,16,22,32,35,41,45],start:[],start_idx:26,start_resnum:[16,17,26,29,30,31,33,34,35],start_resnum_list:31,start_temperatur:[29,39],starter:1,startscop:10,stash:12,state:[1,2,5,16,21,35,37,44,45],staticruntimeprofil:10,statist:[10,19,21],statu:[1,5],std:32,stderr:1,stdout:1,steadili:[29,39],steepest:[27,30],stem:[6,17,20,21,24,26,27,29,30,31],stemcoord:6,stempairorient:6,step:[],stereochem:30,steric:45,still:[5,10,20,30,32],stop:[1,5,10,24,27],stop_criterion:27,storabl:21,storag:[5,16,20,33,35],store:[0,1,5,6,12,14,16,17,20,21,22,23,24,26,27,29,30,31,32],stori:5,str:[1,7,9,10,11,16,17,20,21,22,23,24,26,27,28,29,30,31,32,33,34,35,42,44,45],str_len:32,straight:12,strategi:45,stream:32,stretch:[16,21,30,34],strict:12,string:[0,7,9,21,22,24,32],stringstream:32,strip:30,struct:32,struct_db:18,structral:[16,34],structur:[],structural_db:26,structuralgap:[24,28],structuralgaplist:[24,30],structure_db:[21,23,26,30,32],structure_dir:21,structure_path:21,structure_sourc:9,structuredb:[19,21,23,26,30,32],structureprofil:21,stuff:21,style:[30,35],sub:[5,21,27],sub_frag:17,sub_res_list:21,subdir:5,subfold:5,subject:5,submodul:5,submodule1:12,subpart:23,subproblem:[],subrotam:[],subrotameroptim:[31,46],subsequ:[17,30,39],subset:[20,23,26,27,31],subst:21,subst_matrix:21,substitut:21,substweightmatrix:21,subtre:[4,5],succeed:24,success:[7,29,39],suffix:7,suggest:5,suit:[1,5,21],sulfur:[37,42,43],sum:[10,23,24,30,31,35,37],summari:10,superpos:[17,21,23,26,27,29],superpose_stem:17,superposed_rmsd:[17,26],superposeonto:17,superposit:[3,23,26,29],superpost:23,supervis:1,supos:21,support:[1,5,7,9,14,20,27,30],suppos:12,sure:[2,5,9,12,21],surf:21,surfac:21,surfacehandl:21,surotam:42,surround:[20,21,27,31,33,35],symmetr:[21,34,45],sync:5,system:[],t_sampler:22,tackl:[],tail:17,tailor:[16,30],take:[5,16,21,22,23,26,27,29,30,32,35,37,39,43,46],taken:[0,16,20,27,30,43],talk:1,target:[0,1,2,4,5,9,14,21,23,25,26,27,29,30,34],target_chain_idx:30,target_mhandl:30,target_pdb:28,target_sequ:21,task:[5,12,27,30,32],technic:21,tell:[1,5,7,9,12,21],temperatur:[26,29,39,42],templat:[0,1,9,14,25,30,32,34],temporari:[21,30],temporarili:12,term:[5,21,42,44,45,46],termin:[1,6,7,14,16,17,20,24,26,27,29,30,31],terminal_len:29,terminal_seqr:29,termini:[24,29,30],terminu:[21,29,30,43],test_:5,test_action_:1,test_action_do_awesom:1,test_action_help:1,test_awesome_featur:5,test_check_io:32,test_cod:5,test_doctest:5,test_foo:4,test_portable_binari:32,test_reconstruct_sidechain:5,test_sidechain_reconstruct:5,test_submodule1:12,test_suite_:4,test_suite_your_module_run:5,test_your_modul:12,testcas:[1,5],testcasenam:5,testexit0:1,testpmexist:1,testreconstruct:5,testutil:[1,5],text:[1,9],than:[4,5,9,10,12,16,17,21,23,26,27,28,30,31,35,37,39],thei:[2,5,12,16,17,20,21,22,26,27,28,29,30,37,39,42,43,44,45],them:[4,5,12,17,20,21,22,23,24,26,30,31,34,38],themselv:20,theoret:29,theori:37,therefor:[5,17,19,21,23,27,29,30,45],thereof:20,thi:[0,1,2,4,5,7,8,9,10,11,12,13,14,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,39,40,42,43,44,45,46,47],thing:[1,2,5,12,21,23,30,45],think:5,thoroughli:12,those:[0,1,2,4,5,9,12,20,26,30,31,32,33,35,39,40],though:[20,30,32],thr:44,thread:[14,19,20,30],three:[1,4,12,16,17,22,26,28,29,35,44],threonin:44,thresh:[17,23,42,45],threshold:[21,23,27,30,31,34,39,45],through:[1,5,6,17,21,24,30,33,35],throughout:[9,12,19,20],thu:7,tidi:12,tightli:12,time:[1,5,9,10,12,14,23,30,34],timer:10,tini:[12,30],titl:22,tlc:[16,44],tlc_an:16,tlctorotid:[40,44],tmp_buf:32,todens:17,toentiti:[14,16,17,20,21,27,29,31],toframeresidu:42,togeth:[5,12,21,37],toggl:35,too:[9,12,21,26,27,30,32,42],tool:[4,18,21,32,36,40],toolbox:12,top:[2,5,10,11,12],topic:[1,5,12],topolog:[20,27],torrmrotam:42,torsion:[],torsion_angl:40,torsion_bin:35,torsion_plot:22,torsion_sampl:[17,21,26,27,29,30,32],torsion_sampler_coil:[23,32],torsion_sampler_extend:[23,32],torsion_sampler_hel:32,torsion_sampler_helix:23,torsion_sampler_list:21,torsion_scor:32,torsionprob:21,torsionsampl:[17,19,21,22,23,26,27,29,30,32,35],torsionscor:[],total:[10,21,23,35,39],touch:[1,5,20],toward:[5,24,27,30,42,43,46],tpl:[0,25,26,30],tpr:[44,45],trace:30,track:[],tradition:7,trail:0,train:19,trajectori:[23,29],tran:[17,44,45],transform:[6,17,23,30,45],translat:[4,5,35,44,45],transomegators:17,treat:[5,20,30,31,32,45],treatment:43,tree:[1,4,5,12,39,40],treesolv:[31,39,40],trg:[0,9,26,30],tri:[23,24,30,37,39,45],trick:[1,12],trigger:[1,4,5,41],tripeptid:22,tripl:7,triplet:[],trp:44,trustworthi:12,tryptophan:44,ttccpsivarsnfnvcrlpgtpea:[26,30],ttccpsivarsnfnvcrlpgtpeaicatgytciiipgatcpgdyan:30,ttccpsivarsnfnvcrlpgtpeaicatytgciiipgatcpgdyan:[26,30],tupl:[6,7,17,20,21,23,24,28,30,31,37,39],turn:[0,1,7,10,12,30],tutori:5,tweak:30,twice:[10,34],two:[1,5,12,16,17,20,21,23,24,26,27,30,31,32,33,34,35,37,40,42,44,45],txt:[1,2,4,5,12],type:[],typedef:32,typenam:32,typic:[17,23,29,40,43],tyr:[44,45],tyrosin:44,uint32_t:32,uint:32,ultra:21,uncertain:5,uncharg:43,undefin:20,under:[4,5],undergo:[23,27,29,31],underli:[24,26],underscor:1,understand:12,undo:39,unexpect:2,unfavor:[17,27],unfavour:[27,29,37],unfortun:12,unhandl:[0,9],uniform:27,uniqu:[23,26,29,45],unittest:[1,5,12],unix:12,unknown:20,unless:[9,16,17,20,26,33,35],unlik:40,unrecognis:7,unset:[16,20,31],unsupport:[9,32],until:[5,27,30,34,39,43],untouch:17,untrack:1,unus:12,updat:[3,5,12,16,20,24,26,27,30,31,34],updatedistribut:22,updateposit:[20,27],upon:[27,29],upper:[],urei:20,urey_bradley_angl:20,usabl:12,usag:[0,9,19,21,26,27,31,39],use_amber_ff:30,use_bbdep_lib:31,use_frm:31,use_full_extend:30,use_scoring_extend:30,useclassicmod:35,useincludeenvmod:35,user:[],userlevel:1,usr:[2,5],usual:[1,2,4,5,9,10,12,17,26,30,33],utilis:[5,12],v_size:32,val:[22,44],valid:[0,12,17,24,29,30,31,39,41],valin:44,valu:[2,7,9,16,17,20,23,26,29,30,32,33,34,35,37,39,40,41,42,44,45,46],valueerror:[23,30],vanish:34,varadarajan:21,vari:[4,32],variabl:[1,2,5,10,14,20,28,30,32],variant:[20,26],variou:[1,2,4,12,25],vec3:[6,16,17,27,28,37,42,43],vec3list:23,vector:[20,22,26,32],verbos:1,veri:[1,5,7,12,20,23,30,32],verif:9,verifi:[1,7,12],version:[2,5,12,21,30,32,35,41,44],vertex:21,via:[1,5,9,11,20],view:[9,12,22,30,34],virtual:5,visibl:31,visual:14,wai:[1,2,4,5,12,17,18,20,21,26,35,40,41,44],wait:5,walk:[1,5],want:[1,2,5,11,12,17,21,23,26,27,30,34,35,42,43,45,46],warn:[5,12,30],watch:5,web:[2,5],weight:[3,21,23,26,29,33,35],weird:[23,27,40],well:[0,2,4,12,16,21,22,23,24,26,30,32,35,40,45],went:[0,5],were:[12,21,26,30,35],wether:39,what:[1,5,7,9,12,18,34,35],when:[1,4,5,9,10,16,17,20,21,22,23,24,26,29,30,31,32,34,35,37,39,41,42,43,45],whenev:[5,16,26,34],where:[0,1,4,5,7,9,10,12,16,17,20,21,22,26,30,32,33,34,35,39,41,42,43,45],wherea:21,whether:[5,7,17,20,21,26,27,29,31,34,39,42,43,45],which:[0,1,4,5,6,7,8,9,12,14,16,17,20,21,22,23,24,26,27,28,29,30,31,32,33,34,35,36,39,42,43,45],whistl:5,whitespac:0,who:[39,40],whole:[1,2,5,12,17,21,30,42],why:[1,12,43],width:[32,39,40],wild:4,window:23,window_length:23,wise:4,wish:[2,13,22,30],with_aa:26,with_db:26,within:[2,4,5,10,12,16,20,23,24,28,30,31,33,35,45],without:[1,4,5,7,9,20,21,24,27,30,34,41],won:[30,31,41,43],word:[4,41],work:[1,2,4,5,10,12,14,20,24,30,32,41],worst:12,would:[1,2,5,7,17,22,35,37,42],wrap:21,wrapper:[1,4,5,11,30],write:[],writebasetyp:32,writemagicnumb:32,writetypes:32,writeversionnumb:32,written:[5,32],wrong:[2,9],xlabel:22,xlim:22,xml:5,xxx:[17,44],xxx_num_atom:16,xxx_num_hydrogen:16,year:1,yet:[21,26],ylabel:22,ylim:22,you:[0,1,2,4,5,7,9,10,11,12,14,16,17,18,20,21,22,23,25,26,27,29,30,31,32,33,34,35,39,40,41,42,43,45,46],your:[],your_modul:[5,12],yourself:[2,5,12,30,39,43],zero:[0,21,30,45],zhou2005:21,zhou:21,zip:40},titles:["ProMod3 Actions","<code class=\"docutils literal\"><span class=\"pre\">test_actions</span></code> - Testing Actions","Building ProMod3","Changelog","ProMod3&#8216;s Share Of CMake","Contributing","Geometry functions","<code class=\"docutils literal\"><span class=\"pre\">helper</span></code> - Shared Functionality For the Everything","<code class=\"docutils literal\"><span class=\"pre\">core</span></code> - ProMod3 Core Functionality","<code class=\"docutils literal\"><span class=\"pre\">pm3argparse</span></code> - Parsing Command Lines","Runtime profiling","<code class=\"docutils literal\"><span class=\"pre\">SetCompoundsChemlib()</span></code>","ProMod3 Setup","Documentation For Developers","Getting Started","Welcome To ProMod3&#8217;s Documentation!","Handling All Atom Positions","Representing Loops","<code class=\"docutils literal\"><span class=\"pre\">loop</span></code> - Loop Handling","Loading Precomputed Objects","Generate <code class=\"docutils literal\"><span class=\"pre\">ost.mol.mm</span></code> systems","Structural Data","Sampling Dihedral Angles","Modelling Algorithms","Handling Gaps","<code class=\"docutils literal\"><span class=\"pre\">modelling</span></code> - Protein Modelling","Handling Loop Candidates","Fitting Loops Into Gaps","Model Checking","Generating Loops De Novo","Modelling Pipeline","Sidechain Reconstruction","Using Binary Files In ProMod3","All Atom Scorers","Backbone Score Environment","Backbone Scorers","<code class=\"docutils literal\"><span class=\"pre\">scoring</span></code> - Loop Scoring","Disulfid Bond Evaluation","Frame","Rotamer Graph","<code class=\"docutils literal\"><span class=\"pre\">sidechain</span></code> - Sidechain Modelling","Loading Rotamer Libraries","Rotamers","Rotamer Constructor","RotamerID","Rotamer Library","Subrotamer Optimization","Documentation For Users"],titleterms:{"class":[16,17,21,22,24,26,31,33,34,35],"default":30,"function":[4,6,7,8,24,31,34],acid:[16,20,22],action:[0,1,4,5],actiontestcas:1,algorithm:23,all:[16,27,33],allatomclashscor:33,allatomenv:16,allatomenvposit:16,allatominteractionscor:33,allatomoverallscor:33,allatompackingscor:33,allatomposit:16,allatomscor:33,amino:[16,20,22],angl:22,api:1,argument:9,atom:[16,27,33],backbon:[27,34,35,45],backbonelist:17,backboneoverallscor:35,backbonescor:35,backbonescoreenv:34,base:[21,33,35],binari:32,block:[23,42],bond:37,branch:12,build:[0,2,30,42],can:44,candid:26,cbetascor:35,cbpackingscor:35,ccd:27,chain:21,changelog:3,check:28,clashscor:35,closer:29,cmake:[1,2,4,12],code:32,command:9,construct:[34,43],constructor:43,contribut:5,conveni:34,cooler:29,core:8,creat:[1,20],data:[21,32],databas:21,defin:[21,22],definit:4,densityscor:35,depend:[2,45],detect:28,develop:13,dihedr:22,directori:12,distinguish:16,disulfid:37,document:[4,5,13,15,47],entri:45,enumerador:[],environ:34,evalu:37,everyth:7,exampl:[26,32],execut:1,exisit:32,extend:24,featur:[5,21],file:[7,32],find:21,fit:27,forcefield:20,fragment:21,frame:[38,43],gap:[24,27],gener:[20,29],geometr:21,geometri:6,get:[14,44],git:12,graph:39,group:42,handl:[16,18,24,26,30],have:1,hbondscor:35,header:32,helper:7,hook:12,how:[5,44],indic:15,instal:2,integr:1,introduct:[4,7,9],issu:5,keep:26,kic:27,librari:[41,45],licens:5,line:9,load:[19,41],lookup:20,loop:[17,18,20,26,27,29,36],loopcandid:26,mainten:4,make:[1,2],messag:7,model:[0,14,23,25,26,28,30,40],modul:[4,5],mol:20,molprob:28,must:1,non:45,novo:[23,29],object:[19,29,38],optim:46,ost:20,output:1,own:5,pairwis:34,pairwisescor:35,pars:9,parser:9,parti:5,particl:42,pipelin:[14,30],pm3argpars:9,portabl:32,posit:16,precomput:19,profil:10,promod3:[0,2,4,5,8,12,14,15,32],protein:25,psipredpredict:21,punch:28,quick:5,raw:30,reconstruct:31,reducedscor:35,relax:27,releas:3,repres:17,residu:43,rigid:23,ring:28,rotam:[39,41,42,43,45],rotamerid:44,run:[1,2,14],runtim:10,sampl:22,sampler:[22,29],score:[26,34,36],scorer:[5,29,33,35],script:1,sequenc:21,setcompoundschemlib:11,setup:12,share:[4,7],sidechain:[31,40],sidechainreconstructiondata:31,sidechainreconstructor:31,smallest:42,ssagreementscor:35,stage:12,start:[5,14],step:30,structur:[12,21],subclass:1,subrotam:46,system:20,tabl:15,test:[1,4,5,7],test_act:1,third:5,torsion:22,torsionscor:35,track:26,triplet:22,type:45,unit:[1,4,5],user:47,welcom:15,write:5,your:5}})
\ No newline at end of file
+Search.setIndex({envversion:47,filenames:["actions/index","actions/index_dev","buildsystem","changelog","cmake/index","contributing","core/geometry","core/graph_minimizer","core/helper","core/index","core/pm3argparse","core/runtime_profiling","core/setcompoundschemlib","dev_setup","developers","gettingstarted","index","loop/all_atom","loop/backbone","loop/index","loop/load_loop_objects","loop/mm_system_creation","loop/structure_db","loop/torsion_sampler","modelling/algorithms","modelling/gap_handling","modelling/index","modelling/loop_candidates","modelling/loop_closing","modelling/model_checking","modelling/monte_carlo","modelling/pipeline","modelling/sidechain_reconstruction","portableIO","scoring/all_atom_scorers","scoring/backbone_score_env","scoring/backbone_scorers","scoring/index","scoring/other_scoring_functions","sidechain/disulfid","sidechain/frame","sidechain/graph","sidechain/index","sidechain/loading","sidechain/rotamer","sidechain/rotamer_constructor","sidechain/rotamer_id","sidechain/rotamer_lib","sidechain/subrotamer_optimizer","users"],objects:{"":{"command:add_doc_dependency":[4,0,1,""],"command:add_doc_source":[4,0,1,""],"command:convert_module_data":[4,0,1,""],"command:module":[4,0,1,""],"command:pm_action":[4,0,1,""],"command:promod3_unittest":[4,0,1,""],"command:pymod":[4,0,1,""],test_actions:[1,2,0,"-"]},"promod3.core":{ConstructAtomPos:[6,1,1,""],ConstructCBetaPos:[6,1,1,""],ConstructCTerminalOxygens:[6,1,1,""],EvaluateGromacsPosRule:[6,1,1,""],GraphMinimizer:[7,3,1,""],RotationAroundLine:[6,1,1,""],StaticRuntimeProfiler:[11,3,1,""],StemCoords:[6,3,1,""],StemPairOrientation:[6,3,1,""],helper:[8,2,0,"-"],pm3argparse:[10,2,0,"-"]},"promod3.core.GraphMinimizer":{AStarSolve:[7,4,1,""],AddEdge:[7,4,1,""],AddNode:[7,4,1,""],ApplyDEE:[7,4,1,""],ApplyEdgeDecomposition:[7,4,1,""],MCSolve:[7,4,1,""],NaiveSolve:[7,4,1,""],Prune:[7,4,1,""],Reset:[7,4,1,""],TreeSolve:[7,4,1,""]},"promod3.core.StaticRuntimeProfiler":{Clear:[11,5,1,""],IsEnabled:[11,5,1,""],PrintSummary:[11,5,1,""],Start:[11,5,1,""],StartScoped:[11,5,1,""],Stop:[11,5,1,""]},"promod3.core.StemCoords":{c_coord:[6,6,1,""],ca_coord:[6,6,1,""],n_coord:[6,6,1,""]},"promod3.core.StemPairOrientation":{angle_four:[6,6,1,""],angle_one:[6,6,1,""],angle_three:[6,6,1,""],angle_two:[6,6,1,""],distance:[6,6,1,""]},"promod3.core.helper":{FileExists:[8,1,1,""],FileExtension:[8,1,1,""],FileGzip:[8,1,1,""],MsgErrorAndExit:[8,1,1,""]},"promod3.core.pm3argparse":{PM3ArgumentParser:[10,3,1,""]},"promod3.core.pm3argparse.PM3ArgumentParser":{"__init__":[10,4,1,""],AddAlignment:[10,4,1,""],AddStructure:[10,4,1,""],AssembleParser:[10,4,1,""],Parse:[10,4,1,""],action:[10,6,1,""]},"promod3.loop":{AllAtomEnv:[17,3,1,""],AllAtomEnvPositions:[17,3,1,""],AllAtomPositions:[17,3,1,""],AminoAcidAtom:[17,3,1,""],AminoAcidHydrogen:[17,3,1,""],AminoAcidLookup:[17,3,1,""],BackboneList:[18,3,1,""],CoordInfo:[22,3,1,""],ForcefieldAminoAcid:[21,3,1,""],ForcefieldBondInfo:[21,3,1,""],ForcefieldConnectivity:[21,3,1,""],ForcefieldHarmonicAngleInfo:[21,3,1,""],ForcefieldHarmonicImproperInfo:[21,3,1,""],ForcefieldLJPairInfo:[21,3,1,""],ForcefieldLookup:[21,3,1,""],ForcefieldPeriodicDihedralInfo:[21,3,1,""],ForcefieldUreyBradleyAngleInfo:[21,3,1,""],FragDB:[22,3,1,""],Fragger:[22,3,1,""],FraggerMap:[22,3,1,""],FragmentInfo:[22,3,1,""],LoadFragDB:[20,4,1,""],LoadStructureDB:[20,4,1,""],LoadTorsionSampler:[20,4,1,""],LoadTorsionSamplerCoil:[20,4,1,""],LoadTorsionSamplerExtended:[20,4,1,""],LoadTorsionSamplerHelical:[20,4,1,""],MmSystemCreator:[21,3,1,""],PsipredPrediction:[22,3,1,""],StructureDB:[22,3,1,""],StructureDBDataType:[22,3,1,""],TorsionSampler:[23,3,1,""]},"promod3.loop.AllAtomEnv":{ClearEnvironment:[17,4,1,""],GetAllAtomPositions:[17,4,1,""],GetEnvironment:[17,4,1,""],GetSeqres:[17,4,1,""],SetEnvironment:[17,4,1,""],SetInitialEnvironment:[17,4,1,""]},"promod3.loop.AllAtomEnvPositions":{all_pos:[17,6,1,""],res_indices:[17,6,1,""]},"promod3.loop.AllAtomPositions":{AllAtomPositions:[17,4,1,""],ClearPos:[17,4,1,""],ClearResidue:[17,4,1,""],Copy:[17,4,1,""],Extract:[17,4,1,""],ExtractBackbone:[17,4,1,""],GetAA:[17,4,1,""],GetFirstIndex:[17,4,1,""],GetIndex:[17,4,1,""],GetLastIndex:[17,4,1,""],GetNumAtoms:[17,4,1,""],GetNumResidues:[17,4,1,""],GetOmegaTorsion:[17,4,1,""],GetPhiTorsion:[17,4,1,""],GetPos:[17,4,1,""],GetPsiTorsion:[17,4,1,""],GetSequence:[17,4,1,""],InsertInto:[17,4,1,""],IsAllSet:[17,4,1,""],IsAnySet:[17,4,1,""],IsSet:[17,4,1,""],SetPos:[17,4,1,""],SetResidue:[17,4,1,""],ToEntity:[17,4,1,""]},"promod3.loop.AminoAcidLookup":{GetAA:[17,5,1,""],GetAAA:[17,5,1,""],GetAAH:[17,5,1,""],GetAnchorAtomIndex:[17,5,1,""],GetAtomName:[17,5,1,""],GetAtomNameAmber:[17,5,1,""],GetAtomNameCharmm:[17,5,1,""],GetElement:[17,5,1,""],GetH1Index:[17,5,1,""],GetH2Index:[17,5,1,""],GetH3Index:[17,5,1,""],GetHNIndex:[17,5,1,""],GetHydrogenIndex:[17,5,1,""],GetIndex:[17,5,1,""],GetMaxNumAtoms:[17,5,1,""],GetMaxNumHydrogens:[17,5,1,""],GetNumAtoms:[17,5,1,""],GetNumHydrogens:[17,5,1,""],GetOLC:[17,5,1,""]},"promod3.loop.BackboneList":{"__len__":[18,4,1,""],ApplyTransform:[18,4,1,""],BackboneList:[18,4,1,""],CARMSD:[18,4,1,""],Copy:[18,4,1,""],Extract:[18,4,1,""],GetAA:[18,4,1,""],GetBounds:[18,4,1,""],GetC:[18,4,1,""],GetCA:[18,4,1,""],GetCB:[18,4,1,""],GetN:[18,4,1,""],GetO:[18,4,1,""],GetOLC:[18,4,1,""],GetOmegaTorsion:[18,4,1,""],GetPhiTorsion:[18,4,1,""],GetPsiTorsion:[18,4,1,""],GetSequence:[18,4,1,""],GetTransform:[18,4,1,""],InsertInto:[18,4,1,""],MinCADistance:[18,4,1,""],RMSD:[18,4,1,""],ReconstructCBetaPositions:[18,4,1,""],ReconstructCStemOxygen:[18,4,1,""],ReconstructOxygenPositions:[18,4,1,""],ReplaceFragment:[18,4,1,""],RotateAroundOmegaTorsion:[18,4,1,""],RotateAroundPhiPsiTorsion:[18,4,1,""],RotateAroundPhiTorsion:[18,4,1,""],RotateAroundPsiTorsion:[18,4,1,""],Set:[18,4,1,""],SetAA:[18,4,1,""],SetAroundOmegaTorsion:[18,4,1,""],SetAroundPhiPsiTorsion:[18,4,1,""],SetAroundPhiTorsion:[18,4,1,""],SetAroundPsiTorsion:[18,4,1,""],SetBackrub:[18,4,1,""],SetC:[18,4,1,""],SetCA:[18,4,1,""],SetCB:[18,4,1,""],SetN:[18,4,1,""],SetO:[18,4,1,""],SetOLC:[18,4,1,""],SetSequence:[18,4,1,""],SuperposeOnto:[18,4,1,""],ToDensity:[18,4,1,""],ToEntity:[18,4,1,""],TransOmegaTorsions:[18,4,1,""],append:[18,4,1,""],clear:[18,4,1,""],empty:[18,4,1,""],resize:[18,4,1,""]},"promod3.loop.CoordInfo":{chain_name:[22,6,1,""],id:[22,6,1,""],offset:[22,6,1,""],shift:[22,6,1,""],size:[22,6,1,""],start_resnum:[22,6,1,""]},"promod3.loop.ForcefieldBondInfo":{bond_length:[21,6,1,""],force_constant:[21,6,1,""],index_one:[21,6,1,""],index_two:[21,6,1,""]},"promod3.loop.ForcefieldConnectivity":{harmonic_angles:[21,6,1,""],harmonic_bonds:[21,6,1,""],harmonic_impropers:[21,6,1,""],lj_pairs:[21,6,1,""],periodic_dihedrals:[21,6,1,""],periodic_impropers:[21,6,1,""],urey_bradley_angles:[21,6,1,""]},"promod3.loop.ForcefieldHarmonicAngleInfo":{angle:[21,6,1,""],force_constant:[21,6,1,""],index_one:[21,6,1,""],index_three:[21,6,1,""],index_two:[21,6,1,""]},"promod3.loop.ForcefieldHarmonicImproperInfo":{angle:[21,6,1,""],force_constant:[21,6,1,""],index_four:[21,6,1,""],index_one:[21,6,1,""],index_three:[21,6,1,""],index_two:[21,6,1,""]},"promod3.loop.ForcefieldLJPairInfo":{epsilon:[21,6,1,""],index_one:[21,6,1,""],index_two:[21,6,1,""],sigma:[21,6,1,""]},"promod3.loop.ForcefieldLookup":{GetAA:[21,4,1,""],GetCharges:[21,4,1,""],GetDefault:[21,5,1,""],GetDisulfidConnectivity:[21,4,1,""],GetEpsilons:[21,4,1,""],GetFudgeLJ:[21,4,1,""],GetFudgeQQ:[21,4,1,""],GetHeavyIndex:[21,4,1,""],GetHydrogenIndex:[21,4,1,""],GetInternalConnectivity:[21,4,1,""],GetMasses:[21,4,1,""],GetNumAtoms:[21,4,1,""],GetOXTIndex:[21,4,1,""],GetPeptideBoundConnectivity:[21,4,1,""],GetSigmas:[21,4,1,""],Load:[21,5,1,""],LoadCHARMM:[21,5,1,""],LoadPortable:[21,5,1,""],Save:[21,4,1,""],SavePortable:[21,4,1,""],SetCharges:[21,4,1,""],SetDefault:[21,5,1,""],SetDisulfidConnectivity:[21,4,1,""],SetEpsilons:[21,4,1,""],SetFudgeLJ:[21,4,1,""],SetFudgeQQ:[21,4,1,""],SetInternalConnectivity:[21,4,1,""],SetMasses:[21,4,1,""],SetPeptideBoundConnectivity:[21,4,1,""],SetSigmas:[21,4,1,""]},"promod3.loop.ForcefieldPeriodicDihedralInfo":{force_constant:[21,6,1,""],index_four:[21,6,1,""],index_one:[21,6,1,""],index_three:[21,6,1,""],index_two:[21,6,1,""],multiplicity:[21,6,1,""],phase:[21,6,1,""]},"promod3.loop.ForcefieldUreyBradleyAngleInfo":{angle:[21,6,1,""],angle_force_constant:[21,6,1,""],bond_force_constant:[21,6,1,""],bond_length:[21,6,1,""],index_one:[21,6,1,""],index_three:[21,6,1,""],index_two:[21,6,1,""]},"promod3.loop.FragDB":{AddFragments:[22,4,1,""],GetAngularBinSize:[22,4,1,""],GetDistBinSize:[22,4,1,""],GetNumFragments:[22,4,1,""],GetNumStemPairs:[22,4,1,""],HasFragLength:[22,4,1,""],Load:[22,5,1,""],LoadPortable:[22,5,1,""],MaxFragLength:[22,4,1,""],PrintStatistics:[22,4,1,""],Save:[22,4,1,""],SavePortable:[22,4,1,""],SearchDB:[22,4,1,""]},"promod3.loop.Fragger":{"__getitem__":[22,4,1,""],"__len__":[22,4,1,""],AddSSAgreeParameters:[22,4,1,""],AddSeqIDParameters:[22,4,1,""],AddSeqSimParameters:[22,4,1,""],AddSequenceProfileParameters:[22,4,1,""],AddStructureProfileParameters:[22,4,1,""],AddTorsionProbabilityParameters:[22,4,1,""],Fill:[22,4,1,""],GetFragmentInfo:[22,4,1,""],GetScore:[22,4,1,""]},"promod3.loop.FraggerMap":{"__getitem__":[22,4,1,""],"__setitem__":[22,4,1,""],Contains:[22,4,1,""],Load:[22,4,1,""],LoadBB:[22,4,1,""],Save:[22,4,1,""],SaveBB:[22,4,1,""]},"promod3.loop.FragmentInfo":{chain_index:[22,6,1,""],length:[22,6,1,""],offset:[22,6,1,""]},"promod3.loop.MmSystemCreator":{ExtractLoopPositions:[21,4,1,""],GetCpuPlatformSupport:[21,4,1,""],GetDisulfidBridges:[21,4,1,""],GetForcefieldAminoAcids:[21,4,1,""],GetIndexing:[21,4,1,""],GetLoopLengths:[21,4,1,""],GetLoopStartIndices:[21,4,1,""],GetNumLoopResidues:[21,4,1,""],GetNumResidues:[21,4,1,""],GetSimulation:[21,4,1,""],SetCpuPlatformSupport:[21,4,1,""],SetupSystem:[21,4,1,""],UpdatePositions:[21,4,1,""]},"promod3.loop.PsipredPrediction":{"__len__":[22,4,1,""],Add:[22,4,1,""],Extract:[22,4,1,""],FromHHM:[22,4,1,""],FromHoriz:[22,4,1,""],GetConfidence:[22,4,1,""],GetConfidences:[22,4,1,""],GetPrediction:[22,4,1,""],GetPredictions:[22,4,1,""],PsipredPrediction:[22,4,1,""]},"promod3.loop.StructureDB":{AddCoordinates:[22,4,1,""],GenerateStructureProfile:[22,4,1,""],GetBackboneList:[22,4,1,""],GetCoordIdx:[22,4,1,""],GetCoordInfo:[22,4,1,""],GetDSSPStates:[22,4,1,""],GetDihedralAngles:[22,4,1,""],GetNumCoords:[22,4,1,""],GetResidueDepths:[22,4,1,""],GetSequence:[22,4,1,""],GetSequenceProfile:[22,4,1,""],GetSolventAccessibilitites:[22,4,1,""],GetStructureProfile:[22,4,1,""],GetSubDB:[22,4,1,""],HasData:[22,4,1,""],Load:[22,5,1,""],LoadPortable:[22,5,1,""],PrintStatistics:[22,4,1,""],RemoveCoordinates:[22,4,1,""],Save:[22,4,1,""],SavePortable:[22,4,1,""],SetStructureProfile:[22,4,1,""]},"promod3.loop.TorsionSampler":{Draw:[23,4,1,""],DrawPhiGivenPsi:[23,4,1,""],DrawPsiGivenPhi:[23,4,1,""],ExtractStatistics:[23,4,1,""],GetBinSize:[23,4,1,""],GetBinsPerDimension:[23,4,1,""],GetHistogramIndex:[23,4,1,""],GetHistogramIndices:[23,4,1,""],GetPhiProbabilityGivenPsi:[23,4,1,""],GetProbability:[23,4,1,""],GetPsiProbabilityGivenPhi:[23,4,1,""],Load:[23,5,1,""],LoadPortable:[23,5,1,""],Save:[23,4,1,""],SavePortable:[23,4,1,""],UpdateDistributions:[23,4,1,""]},"promod3.modelling":{AllAtomRelaxer:[28,3,1,""],BackboneRelaxer:[28,3,1,""],BuildFromRawModel:[31,1,1,""],BuildRawModel:[31,1,1,""],BuildSidechains:[31,1,1,""],CCD:[28,3,1,""],CCDCloser:[30,3,1,""],CTerminalCloser:[30,3,1,""],CheckFinalModel:[31,1,1,""],ClearGaps:[25,1,1,""],CloseGaps:[31,1,1,""],CloseLargeDeletions:[31,1,1,""],CloseSmallDeletions:[31,1,1,""],CountEnclosedGaps:[25,1,1,""],CountEnclosedInsertions:[25,1,1,""],DirtyCCDCloser:[30,3,1,""],ExponentialCooler:[30,3,1,""],FillLoopsByDatabase:[31,1,1,""],FillLoopsByMonteCarlo:[31,1,1,""],FilterCandidates:[29,1,1,""],FilterCandidatesWithSC:[29,1,1,""],FraggerHandle:[24,3,1,""],FragmentSampler:[30,3,1,""],FullGapExtender:[25,3,1,""],GapExtender:[25,3,1,""],GenerateDeNovoTrajectories:[24,1,1,""],GetRingPunches:[29,1,1,""],GetRings:[29,1,1,""],GetScore:[30,4,1,""],HasRingPunches:[29,1,1,""],InsertLoop:[31,1,1,""],InsertLoopClearGaps:[25,1,1,""],IsAllAtomScoringSetUp:[31,1,1,""],IsBackboneScoringSetUp:[31,1,1,""],KIC:[28,3,1,""],KICCloser:[30,3,1,""],LoopCandidates:[27,3,1,""],MergeGaps:[25,1,1,""],MergeGapsByDistance:[31,1,1,""],MergeMHandle:[31,1,1,""],MinimizeModelEnergy:[31,1,1,""],ModelTermini:[31,1,1,""],ModellingHandle:[31,3,1,""],NTerminalCloser:[30,3,1,""],PhiPsiSampler:[30,3,1,""],ReconstructSidechains:[32,1,1,""],RemoveTerminalGaps:[31,1,1,""],ReorderGaps:[31,1,1,""],ReportMolProbityScores:[29,1,1,""],RigidBlocks:[24,4,1,""],RunMolProbity:[29,1,1,""],RunMolProbityEntity:[29,1,1,""],SampleMonteCarlo:[30,4,1,""],ScoreContainer:[27,3,1,""],ScoringGapExtender:[25,3,1,""],ScoringWeights:[27,3,1,""],SetPsipredPredictions:[31,1,1,""],SetSequenceProfiles:[31,1,1,""],SetupDefaultAllAtomScoring:[31,1,1,""],SetupDefaultBackboneScoring:[31,1,1,""],ShiftExtension:[25,3,1,""],SidechainReconstructionData:[32,3,1,""],SidechainReconstructor:[32,3,1,""],SoftSampler:[30,3,1,""],StructuralGap:[25,3,1,""],StructuralGapList:[25,3,1,""]},"promod3.modelling.AllAtomRelaxer":{GetSystemCreator:[28,4,1,""],Run:[28,4,1,""],UpdatePositions:[28,4,1,""]},"promod3.modelling.BackboneRelaxer":{AddCARestraint:[28,4,1,""],AddCBRestraint:[28,4,1,""],AddCRestraint:[28,4,1,""],AddNRestraint:[28,4,1,""],AddORestraint:[28,4,1,""],GetNonBondedCutoff:[28,4,1,""],Run:[28,4,1,""],SetNonBondedCutoff:[28,4,1,""]},"promod3.modelling.CCD":{CCD:[28,4,1,""],Close:[28,4,1,""]},"promod3.modelling.CCDCloser":{Close:[30,4,1,""]},"promod3.modelling.DirtyCCDCloser":{Close:[30,4,1,""]},"promod3.modelling.ExponentialCooler":{GetTemperature:[30,4,1,""],Reset:[30,4,1,""]},"promod3.modelling.FraggerHandle":{Get:[24,4,1,""],GetList:[24,4,1,""],LoadCached:[24,4,1,""],SaveCached:[24,4,1,""]},"promod3.modelling.FragmentSampler":{Initialize:[30,4,1,""],ProposeStep:[30,4,1,""]},"promod3.modelling.FullGapExtender":{Extend:[25,4,1,""]},"promod3.modelling.GapExtender":{Extend:[25,4,1,""]},"promod3.modelling.KIC":{Close:[28,4,1,""],KIC:[28,4,1,""]},"promod3.modelling.KICCloser":{Close:[30,4,1,""]},"promod3.modelling.LoopCandidates":{Add:[27,4,1,""],AddFragmentInfo:[27,4,1,""],ApplyCCD:[27,4,1,""],ApplyKIC:[27,4,1,""],CalculateAllAtomScores:[27,4,1,""],CalculateBackboneScores:[27,4,1,""],CalculateSequenceProfileScores:[27,4,1,""],CalculateStemRMSDs:[27,4,1,""],CalculateStructureProfileScores:[27,4,1,""],Extract:[27,4,1,""],FillFromDatabase:[27,5,1,""],FillFromMonteCarloSampler:[27,5,1,""],GetClusteredCandidates:[27,4,1,""],GetClusters:[27,4,1,""],GetFragmentInfo:[27,4,1,""],GetLargestCluster:[27,4,1,""],GetSequence:[27,4,1,""],HasFragmentInfos:[27,4,1,""],Remove:[27,4,1,""]},"promod3.modelling.ModellingHandle":{Copy:[31,4,1,""],all_atom_scorer:[31,6,1,""],all_atom_scorer_env:[31,6,1,""],all_atom_sidechain_env:[31,6,1,""],backbone_scorer:[31,6,1,""],backbone_scorer_env:[31,6,1,""],gaps:[31,6,1,""],model:[31,6,1,""],profiles:[31,6,1,""],psipred_predictions:[31,6,1,""],seqres:[31,6,1,""],sidechain_reconstructor:[31,6,1,""]},"promod3.modelling.PhiPsiSampler":{Initialize:[30,4,1,""],ProposeStep:[30,4,1,""]},"promod3.modelling.ScoreContainer":{Contains:[27,4,1,""],Copy:[27,4,1,""],Extend:[27,4,1,""],Extract:[27,4,1,""],Get:[27,4,1,""],GetNumCandidates:[27,4,1,""],IsEmpty:[27,4,1,""],LinearCombine:[27,4,1,""],Set:[27,4,1,""]},"promod3.modelling.ScoringGapExtender":{Extend:[25,4,1,""]},"promod3.modelling.ScoringWeights":{GetAllAtomScoringKeys:[27,5,1,""],GetAllAtomWeights:[27,5,1,""],GetBackboneScoringKeys:[27,5,1,""],GetBackboneWeights:[27,5,1,""],GetSequenceProfileScoresKey:[27,5,1,""],GetStemRMSDsKey:[27,5,1,""],GetStructureProfileScoresKey:[27,5,1,""],GetWeights:[27,5,1,""],SetAllAtomScoringKeys:[27,5,1,""],SetBackboneScoringKeys:[27,5,1,""],SetSequenceProfileScoresKey:[27,5,1,""],SetStemRMSDsKey:[27,5,1,""],SetStructureProfileScoresKey:[27,5,1,""],SetWeights:[27,5,1,""]},"promod3.modelling.ShiftExtension":{Extend:[25,4,1,""]},"promod3.modelling.SidechainReconstructionData":{disulfid_bridges:[32,6,1,""],env_pos:[32,6,1,""],is_c_ter:[32,6,1,""],is_n_ter:[32,6,1,""],loop_lengths:[32,6,1,""],loop_start_indices:[32,6,1,""],rotamer_res_indices:[32,6,1,""]},"promod3.modelling.SidechainReconstructor":{AttachEnvironment:[32,4,1,""],Reconstruct:[32,4,1,""]},"promod3.modelling.SoftSampler":{Initialize:[30,4,1,""],ProposeStep:[30,4,1,""]},"promod3.modelling.StructuralGap":{Copy:[25,4,1,""],ExtendAtCTerm:[25,4,1,""],ExtendAtNTerm:[25,4,1,""],GetChain:[25,4,1,""],GetChainIndex:[25,4,1,""],GetChainName:[25,4,1,""],GetLength:[25,4,1,""],IsCTerminal:[25,4,1,""],IsNTerminal:[25,4,1,""],IsTerminal:[25,4,1,""],ShiftCTerminal:[25,4,1,""],after:[25,6,1,""],before:[25,6,1,""],full_seq:[25,6,1,""],length:[25,6,1,""],seq:[25,6,1,""]},"promod3.scoring":{AllAtomClashScorer:[34,3,1,""],AllAtomInteractionScorer:[34,3,1,""],AllAtomOverallScorer:[34,3,1,""],AllAtomPackingScorer:[34,3,1,""],AllAtomScorer:[34,3,1,""],BackboneOverallScorer:[36,3,1,""],BackboneScoreEnv:[35,3,1,""],BackboneScorer:[36,3,1,""],CBPackingScorer:[36,3,1,""],CBetaScorer:[36,3,1,""],ClashScorer:[36,3,1,""],ConstraintFunction:[35,3,1,""],ContactFunction:[35,3,1,""],DiscoContainer:[35,3,1,""],HBondScorer:[36,3,1,""],LoadAllAtomInteractionScorer:[34,1,1,""],LoadAllAtomPackingScorer:[34,1,1,""],LoadCBPackingScorer:[36,1,1,""],LoadCBetaScorer:[36,1,1,""],LoadDefaultAllAtomOverallScorer:[34,1,1,""],LoadDefaultBackboneOverallScorer:[36,1,1,""],LoadHBondScorer:[36,1,1,""],LoadReducedScorer:[36,1,1,""],LoadSSAgreementScorer:[36,1,1,""],LoadTorsionScorer:[36,1,1,""],PairwiseFunction:[35,3,1,""],PairwiseFunctionType:[35,3,1,""],PairwiseScorer:[36,3,1,""],ReducedScorer:[36,3,1,""],SCWRL3DisulfidScore:[38,4,1,""],SCWRL3PairwiseScore:[38,4,1,""],SSAgreementScorer:[36,3,1,""],TorsionScorer:[36,3,1,""]},"promod3.scoring.AllAtomClashScorer":{DoExternalScores:[34,4,1,""],DoInternalScores:[34,4,1,""],DoNormalize:[34,4,1,""]},"promod3.scoring.AllAtomInteractionScorer":{DoExternalScores:[34,4,1,""],DoInternalScores:[34,4,1,""],DoNormalize:[34,4,1,""],Load:[34,5,1,""],LoadPortable:[34,5,1,""],Save:[34,4,1,""],SavePortable:[34,4,1,""],SetEnergy:[34,4,1,""]},"promod3.scoring.AllAtomOverallScorer":{"__getitem__":[34,4,1,""],"__setitem__":[34,4,1,""],AttachEnvironment:[34,4,1,""],CalculateLinearCombination:[34,4,1,""],Contains:[34,4,1,""],Get:[34,4,1,""]},"promod3.scoring.AllAtomPackingScorer":{DoNormalize:[34,4,1,""],Load:[34,5,1,""],LoadPortable:[34,5,1,""],Save:[34,4,1,""],SavePortable:[34,4,1,""],SetEnergy:[34,4,1,""]},"promod3.scoring.AllAtomScorer":{AttachEnvironment:[34,4,1,""],CalculateScore:[34,4,1,""],CalculateScoreProfile:[34,4,1,""]},"promod3.scoring.BackboneOverallScorer":{"__getitem__":[36,4,1,""],"__setitem__":[36,4,1,""],AttachEnvironment:[36,4,1,""],Calculate:[36,4,1,""],CalculateLinearCombination:[36,4,1,""],Contains:[36,4,1,""],Get:[36,4,1,""]},"promod3.scoring.BackboneScoreEnv":{AddPairwiseFunction:[35,4,1,""],ApplyPairwiseFunction:[35,4,1,""],ClearEnvironment:[35,4,1,""],Copy:[35,4,1,""],GetSeqres:[35,4,1,""],Pop:[35,4,1,""],SetEnvironment:[35,4,1,""],SetInitialEnvironment:[35,4,1,""],SetPsipredPrediction:[35,4,1,""],Stash:[35,4,1,""]},"promod3.scoring.BackboneScorer":{AttachEnvironment:[36,4,1,""],CalculateScore:[36,4,1,""],CalculateScoreProfile:[36,4,1,""]},"promod3.scoring.CBPackingScorer":{DoNormalize:[36,4,1,""],Load:[36,5,1,""],LoadPortable:[36,5,1,""],Save:[36,4,1,""],SavePortable:[36,4,1,""],SetEnergy:[36,4,1,""]},"promod3.scoring.CBetaScorer":{DoExternalScores:[36,4,1,""],DoInternalScores:[36,4,1,""],DoNormalize:[36,4,1,""],Load:[36,5,1,""],LoadPortable:[36,5,1,""],Save:[36,4,1,""],SavePortable:[36,4,1,""],SetEnergy:[36,4,1,""]},"promod3.scoring.ClashScorer":{DoExternalScores:[36,4,1,""],DoInternalScores:[36,4,1,""],DoNormalize:[36,4,1,""]},"promod3.scoring.DiscoContainer":{AddStructuralInfo:[35,1,1,""],AttachConstraints:[35,1,1,""]},"promod3.scoring.HBondScorer":{DoExternalScores:[36,4,1,""],DoInternalScores:[36,4,1,""],DoNormalize:[36,4,1,""],Load:[36,5,1,""],LoadPortable:[36,5,1,""],Save:[36,4,1,""],SavePortable:[36,4,1,""],SetEnergy:[36,4,1,""]},"promod3.scoring.PairwiseFunction":{Score:[35,4,1,""]},"promod3.scoring.PairwiseScorer":{DoExternalScores:[36,4,1,""],DoInternalScores:[36,4,1,""],DoNormalize:[36,4,1,""]},"promod3.scoring.ReducedScorer":{DoExternalScores:[36,4,1,""],DoInternalScores:[36,4,1,""],DoNormalize:[36,4,1,""],Load:[36,5,1,""],LoadPortable:[36,5,1,""],Save:[36,4,1,""],SavePortable:[36,4,1,""],SetEnergy:[36,4,1,""]},"promod3.scoring.SSAgreementScorer":{DoNormalize:[36,4,1,""],Load:[36,5,1,""],LoadPortable:[36,5,1,""],Save:[36,4,1,""],SavePortable:[36,4,1,""],SetScore:[36,4,1,""]},"promod3.scoring.TorsionScorer":{DoNormalize:[36,4,1,""],Load:[36,5,1,""],LoadPortable:[36,5,1,""],Save:[36,4,1,""],SavePortable:[36,4,1,""],SetEnergy:[36,4,1,""]},"promod3.sidechain":{AAToRotID:[46,4,1,""],BBDepRotamerLib:[47,3,1,""],DisulfidScore:[39,4,1,""],FRMRotamer:[44,3,1,""],FRMRotamerGroup:[44,3,1,""],Frame:[40,3,1,""],FrameResidue:[40,3,1,""],LoadDunbrackLib:[43,4,1,""],LoadPenultimateLib:[43,4,1,""],Particle:[44,3,1,""],RRMRotamer:[44,3,1,""],RRMRotamerGroup:[44,3,1,""],ReadDunbrackFile:[43,4,1,""],ResolveCysteins:[39,4,1,""],RotamerGraph:[41,3,1,""],RotamerID:[46,3,1,""],RotamerLib:[47,3,1,""],RotamerLibEntry:[47,3,1,""],SCWRLRotamerConstructor:[45,3,1,""],SidechainParticle:[44,3,1,""],SubrotamerOptimizer:[48,4,1,""],TLCToRotID:[46,4,1,""]},"promod3.sidechain.BBDepRotamerLib":{AddRotamer:[47,4,1,""],Load:[47,5,1,""],LoadPortable:[47,5,1,""],MakeStatic:[47,4,1,""],QueryLib:[47,4,1,""],Save:[47,4,1,""],SavePortable:[47,4,1,""],SetInterpolate:[47,4,1,""]},"promod3.sidechain.FRMRotamer":{"__getitem__":[44,4,1,""],"__len__":[44,4,1,""],AddFrameEnergy:[44,4,1,""],AddSubrotamerDefinition:[44,4,1,""],ApplyOnResidue:[44,4,1,""],GetActiveSubrotamer:[44,4,1,""],GetFrameEnergy:[44,4,1,""],GetInternalEnergy:[44,4,1,""],GetInternalEnergyPrefactor:[44,4,1,""],GetNumSubrotamers:[44,4,1,""],GetProbability:[44,4,1,""],GetSelfEnergy:[44,4,1,""],GetSubrotamerDefinition:[44,4,1,""],GetTemperature:[44,4,1,""],SetActiveSubrotamer:[44,4,1,""],SetFrameEnergy:[44,4,1,""],SetInternalEnergy:[44,4,1,""],SetInternalEnergyPrefactor:[44,4,1,""],SetProbability:[44,4,1,""],SetTemperature:[44,4,1,""],ToFrameResidue:[44,4,1,""],ToRRMRotamer:[44,4,1,""]},"promod3.sidechain.FRMRotamerGroup":{"__getitem__":[44,4,1,""],"__len__":[44,4,1,""],AddFrameEnergy:[44,4,1,""],ApplyOnResidue:[44,4,1,""],ApplySelfEnergyThresh:[44,4,1,""],Merge:[44,4,1,""],SetFrameEnergy:[44,4,1,""]},"promod3.sidechain.FrameResidue":{"__getitem__":[40,4,1,""],"__len__":[40,4,1,""]},"promod3.sidechain.Particle":{AddLonePair:[44,4,1,""],GetCharge:[44,4,1,""],GetName:[44,4,1,""],GetParticleType:[44,4,1,""],GetPos:[44,4,1,""],IsHBondAcceptor:[44,4,1,""],IsHBondDonor:[44,4,1,""],PairwiseEnergy:[44,4,1,""],SetPolarDirection:[44,4,1,""]},"promod3.sidechain.RRMRotamer":{"__getitem__":[44,4,1,""],"__len__":[44,4,1,""],AddFrameEnergy:[44,4,1,""],ApplyOnResidue:[44,4,1,""],GetFrameEnergy:[44,4,1,""],GetInternalEnergy:[44,4,1,""],GetInternalEnergyPrefactor:[44,4,1,""],GetProbability:[44,4,1,""],GetSelfEnergy:[44,4,1,""],SetFrameEnergy:[44,4,1,""],SetInternalEnergy:[44,4,1,""],SetInternalEnergyPrefactor:[44,4,1,""],SetProbability:[44,4,1,""],ToFrameResidue:[44,4,1,""]},"promod3.sidechain.RRMRotamerGroup":{"__getitem__":[44,4,1,""],"__len__":[44,4,1,""],AddFrameEnergy:[44,4,1,""],ApplyOnResidue:[44,4,1,""],ApplySelfEnergyThresh:[44,4,1,""],Merge:[44,4,1,""],SetFrameEnergy:[44,4,1,""]},"promod3.sidechain.RotamerGraph":{CreateFromFRMList:[41,5,1,""],CreateFromRRMList:[41,5,1,""]},"promod3.sidechain.RotamerLib":{AddRotamer:[47,4,1,""],Load:[47,5,1,""],LoadPortable:[47,5,1,""],MakeStatic:[47,4,1,""],QueryLib:[47,4,1,""],Save:[47,4,1,""],SavePortable:[47,4,1,""]},"promod3.sidechain.RotamerLibEntry":{FromResidue:[47,5,1,""],IsSimilar:[47,4,1,""],SimilarDihedral:[47,4,1,""],chi1:[47,6,1,""],chi2:[47,6,1,""],chi3:[47,6,1,""],chi4:[47,6,1,""],probability:[47,6,1,""],sig1:[47,6,1,""],sig2:[47,6,1,""],sig3:[47,6,1,""],sig4:[47,6,1,""]},"promod3.sidechain.SCWRLRotamerConstructor":{AssignInternalEnergies:[45,4,1,""],ConstructBackboneFrameResidue:[45,4,1,""],ConstructFrameResidue:[45,4,1,""],ConstructFrameResidueHeuristic:[45,4,1,""],ConstructRRMRotamerGroup:[45,4,1,""],ConstructSidechainFrameResidue:[45,4,1,""]},"test_actions.ActionTestCase":{RunAction:[1,4,1,""],RunExitStatusTest:[1,4,1,""],pm_action:[1,6,1,""],pm_bin:[1,6,1,""],testPMExists:[1,4,1,""]},promod3:{SetCompoundsChemlib:[12,1,1,""],core:[9,2,0,"-"],loop:[19,2,0,"-"],modelling:[26,2,0,"-"],scoring:[37,2,0,"-"],sidechain:[42,2,0,"-"]},test_actions:{ActionTestCase:[1,3,1,""]}},objnames:{"0":["cmake","command","CMake command"],"1":["py","function","Python function"],"2":["py","module","Python module"],"3":["py","class","Python class"],"4":["py","method","Python method"],"5":["py","staticmethod","Python static method"],"6":["py","attribute","Python attribute"]},objtypes:{"0":"cmake:command","1":"py:function","2":"py:module","3":"py:class","4":"py:method","5":"py:staticmethod","6":"py:attribute"},terms:{"10a":32,"1aki":22,"1akia":[],"1crn":[17,19,21,22,26,27,28,30,31,32,37,42],"1crn_cut":[26,27,31],"1crna":[22,27],"1ey":5,"1eye_rec":5,"2010dunbracklib":33,"20a":32,"2b1":2,"2jlp":0,"30a":32,"3x3":6,"655a":22,"__doc__":[8,10],"__getitem__":[22,34,36,40,44],"__init__":[1,5,10,13],"__len__":[18,22,40,44],"__main__":[1,5],"__name__":[1,5],"__setitem__":[22,34,36],"_data":33,"_name":4,"_run":[1,4],"_xml":4,"boolean":8,"break":[4,5,13],"byte":[7,33],"case":[0,1,5,13,18,22,23,25,28,30,31,32,33,36,39,42,44,45,47],"catch":22,"char":[18,33],"class":[],"const":33,"default":[],"enum":[22,46],"export":[5,17],"final":[5,15,22,24,26,27,31,35,37,39,41,42,44],"float":[6,7,17,18,21,22,23,24,25,27,28,29,30,31,32,33,34,35,36,38,39,44,45,47,48],"function":[],"import":[0,1,5,8,10,13,15,17,18,19,21,22,23,26,27,28,30,31,32,37,42,44,45],"int":[1,6,7,8,11,17,18,20,21,22,23,24,25,27,28,29,30,31,32,33,34,35,36,40,44,45,47,48],"long":31,"new":[1,3,5,10,13,14,17,18,21,22,25,27,28,30,31,32,33,42,44],"null":22,"public":[5,33,43],"return":[1,5,6,7,8,10,11,12,17,18,20,21,22,23,24,25,27,28,29,30,31,32,33,34,35,36,38,39,40,43,44,45,46,47],"s\u00f6ding":22,"short":[5,13,33],"static":[5,11,17,21,22,23,27,32,33,34,36,41,43,47],"super":42,"switch":[5,13,35],"throw":[1,33,42,43],"true":[1,8,10,11,17,18,19,20,21,22,25,27,28,29,30,31,32,33,34,36,39,42,45],"try":[1,5,15,25,31,33,47],"void":33,"while":[1,4,5,11,17,21,31,33],aa1:36,aa2:36,aa_aft:22,aa_befor:22,aa_clash:[31,34],aa_interact:[31,34],aa_pack:[31,34],aa_packing_scor:33,aa_relax_test:28,aa_res_idx:45,aa_scor:33,aa_with_rotam:42,aaa1:34,aaa2:34,aaa:[17,34],aaaaaaaa:18,aaaaggggggggggggggggggggaaaaaa:31,aafrequ:22,aafrequenciesstruct:22,aah:17,aatorotid:46,abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz:31,abil:13,abl:[2,5],abort:[5,7,28,31],about:[1,4,5,7,22,31],abov:[0,1,5,10,13,18,25,27,31,33,46,47],absolut:4,academ:5,accept:[7,10,27,28,30,31,32,33],acceptor:[36,45],access:[4,5,17,18,22,23,27,31,34,35,36,44,46],accessibili:[],accessibl:[],accessor:22,accord:[7,13,17,18,21,22,23,24,25,27,30,31,32,34,39,42,44,45,47],accordingli:[22,35],accur:24,accuraci:[24,28],achiev:[7,13],acknowledg:5,across:[1,47],act:28,action_nam:13,action_unit_test:1,actiontest:1,activ:[10,11,13,39,44,48],active_internal_energi:48,actual:[3,5,10,13,18,22,30,31,32,35,36,44,45,47],actual_posit:30,actual_step:30,adapt:[5,21,22,28,30,31,43],add:[1,2,4,5,7,10,15,17,22,23,27,28,31,32,34,35,36,39,42,44,45],add_argu:8,add_custom_target:5,add_doc_depend:4,add_doc_sourc:[4,5],add_subdirectori:5,addalign:10,addcarestraint:28,addcbrestraint:28,addcoordin:22,addcrestraint:28,addedg:7,addfrag:22,addfragmentinfo:27,addframeenergi:44,addharmonicangl:21,addharmonicbond:21,addharmonicimprop:21,addit:[4,8,10,11,13,18,19,21,22,29,31,33,45],addition:[1,4,13,17,21,22,45],addljpair:21,addlonepair:44,addnod:7,addnrestraint:28,addorestraint:28,addpairwisefunct:35,addperiodicdihedr:21,addperiodicimprop:21,address:33,addrotam:47,addseqidparamet:22,addseqsimparamet:[19,22],addsequenceprofileparamet:22,addssagreeparamet:22,addstructur:10,addstructuralinfo:35,addstructureprofileparamet:22,addsubrotamerdefinit:44,addtorsionprobabilityparamet:22,addureybradleyangl:21,admir:5,advanc:24,advantag:21,advic:[5,13],advis:[],affect:[5,18,45,46],after:[1,2,4,5,7,10,13,17,18,21,22,23,25,27,28,30,31,33,35,43,47],after_c_stem:18,afterward:[5,22,31],again:[2,3,5,22,24],against:34,agg:23,agglom:27,ago:1,agreement:[22,24,36],agress:[2,7],ala:[18,23,28,42,45,46],ala_cb:17,ala_h1:17,ala_h:17,alanin:[3,46],alg:[19,22,31],algorithm:[],alia:25,align:[0,10,15,22,24,26,31,35],alignedcuboid:18,alignmenthandl:[24,31,35],alignmentlist:[0,10,31],all:[],all_atom:[17,18,21,44,45],all_atom_env:17,all_atom_po:[17,45],all_atom_scor:31,all_atom_scorer_env:31,all_atom_sidechain_env:31,all_po:[17,21,28],all_scor:27,allatom:[28,31,32],allatomclashscor:[],allatominteractionscor:[],allatomoverallscor:[],allatompackingscor:[],allatomrelax:[21,28],alloc:22,allow:[0,2,3,5,8,13,18,22,23,24,27,30,31,33,34,36,41],allow_multitempl:10,allow_prepro_ci:18,almost:[4,28],aln:[0,24,26,27,31,35],aln_sourc:10,alon:8,along:[1,5],alot:5,alpha:[6,18,36,42],alpha_bin:36,alreadi:[1,4,5,7,13,18,21,22,24,27,31,32,34,35,36,44,45,47,48],also:[1,2,4,5,8,13,22,23,24,27,28,29,30,31,32,39,40,41,43,45,47],alter:[27,30],altern:[4,5,27,30,31,43,45],alwai:[0,1,5,13,25,30,31,33],amber:[17,31],ambig:47,ambigu:47,aminoacid:[17,18,21,23,36,46,47],aminoacidatom:[17,34],aminoacidhydrogen:17,aminoacidlookup:[17,21],among:27,amount:[15,24,47],analysi:[22,28,29],analyt:[27,47],anchor:[6,17],ancient:12,ang:35,angl:[],angle_bin:36,angle_bin_s:22,angle_force_const:21,angle_four:6,angle_on:6,angle_thre:6,angle_two:6,angstrom:[22,28],ani:[0,1,4,5,7,10,11,12,15,17,18,21,22,23,25,27,29,30,31,32,33,34,35,36,40,42,44,45],anneal:[7,27,30],announc:[1,5],anoth:[4,11,18,25,28,31,32,39],anymor:[3,7],anyon:[5,13],anyth:[0,2,5,10,11,12,27,28,32,34,36],anywai:5,anywher:13,apart:[1,27,31,32,34,36],append:[0,10,18,22,23,31,42],appli:[7,8,12,13,18,22,25,27,28,30,31,32,35,39,42,44],applic:[1,28,45],applyccd:27,applyde:7,applyedgedecomposit:7,applyk:27,applyonresidu:[42,44],applypairwisefunct:[35,36],applysd:21,applyselfenergythresh:[42,44],applytransform:18,approach:[2,7,22,24,31,33,39,42,45],appropri:[7,23,31,33,45],approx:31,approxim:[21,44],arbitrari:[3,17,22,39],arbitrarili:30,arg:[1,4,10,46],arg_ca:17,arg_hd3:17,arg_sorted_scor:27,arginin:46,argpars:10,argument:[],argumentpars:10,argv:10,around:[1,4,5,6,13,18,27,28,31,34,35,36],arrai:[0,5,33],artifici:22,ascend:25,ask:5,asn:46,asn_c:17,asn_hb2:17,asp:[17,44,46,47],asp_ha:17,asp_o:17,asparagin:46,aspart:[46,47],ass:30,assembl:10,assemblepars:10,assertequ:5,assess:[34,35],assign:[3,7,18,22,27,30,34,36,43,45,48],assigndssp:[],assigninternalenergi:45,assignsecstruct:31,associ:[22,25,40],assum:[1,4,5,21,22,28,31,33,35,36,39],assur:39,astar:3,astarsolv:7,atom:[],atom_idx:[17,21],atom_nam:[17,21],atomhandl:44,atomseq:[],attach:[0,4,5,10,17,21,24,25,27,31,32,34,35,36,37],attach_view:10,attachconstraint:35,attachenviron:[27,28,30,32,34,36,37],attachview:[26,27,31],attent:[1,13],attribut:[5,10,22,31,32,47],autom:[2,4],automat:[1,5,7,8,11,13,22,26,27,33,47],automatis:5,avaibl:45,avail:[1,2,3,5,12,13,15,21,22,27,30,35,42],availabl:5,averag:[27,35,39],avg:22,avg_sampling_per_posit:24,avoid:[3,8,12,22,28,30],awai:[13,32,44],awar:[5,45],awesom:[1,5],axi:[6,18],back:[1,13,21,30],backbon:[],backbone_scor:31,backbone_scorer_env:31,backbonelist:[],backboneoverallscor:[],backbonerelax:[28,31],backbonescor:[],backbonescoreenv:[],backbonescoreenvlisten:5,background:[2,32],backrub:18,backward:33,bad:21,base:[],base_target:4,bashrc:5,basi:[4,5,13,28,30,44],basic:[1,2,5,8,13,23,30,31,42,44,47],bb_list:[15,17,18,19,22,25,27,28,30,31,35],bb_list_on:24,bb_list_two:24,bb_score:27,bbdeprotamerlib:[32,33,43,45,47],becaus:[5,13,17,31,35],becom:[7,47],been:[2,3,7,13,20,22,27,28,31,34,36,39,43,47],befor:[1,4,5,10,13,18,21,22,23,25,27,28,30,31,32,33],begin:[1,5,17,18,30,35],behav:1,behaviour:[10,34,35,47],behind:5,bell:5,belong:[3,4,13,17,18,22,25,27,30,31,32,34,35,36,40,44,45],belov:22,below:[0,5,17,21,22,24,27,28,32,33,34,36,39],below_thre:22,besid:[2,4,7,10,22],best:[4,27,31,39],best_candid:27,beta:[6,18,29,36],beta_bin:36,better:[21,27,30,31,34,36],between:[1,3,7,10,18,21,22,24,25,27,28,30,31,32,33,34,35,36,37,38,39,40,44,45,47],beyond:10,big:[21,33],bilinearli:47,bin:[1,5,13,15,22,23,34,36,47],bin_siz:47,binari:[],bind:[],bins_per_dimens:23,bioinformat:22,biol:22,biophi:7,biopolym:22,bit:[1,2,5,13,27,31],bitwis:22,blank:5,block:[],blosum62:[19,22,24,35],bond:[],bond_force_const:21,bond_length:[6,21],bool:[1,5,7,8,10,11,17,18,20,21,22,25,27,28,29,30,31,32,33,34,36,39,44,45,47],boost:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49],boost_librari:4,boost_root:2,both:[17,22,25,31,39,42,47],bound:[17,21,24,27,44],bradlei:21,branch:[],branchnam:13,brew:4,bridg:[20,21,28,31,32],briefli:13,bring:5,broken:1,broyden:31,bug:[3,5,13],build_disulfid:32,builder:2,buildfromrawmodel:[26,31],buildrawmodel:[0,26,27,31],buildsidechain:31,buildup:[42,44],built:[4,21,22,35,40,45],bunch:[1,10,13],bytecod:1,c_coord:6,c_num:25,c_po:[6,18,36],c_stem:[6,19,22,25,27,28,30],c_stem_psi:30,c_str:33,c_ter:[28,45],ca_coord:6,ca_pairwise_funct:35,ca_po:[6,18],ca_pos_on:[38,39],ca_pos_two:[38,39],ca_posit:39,ca_rmsd:[19,22],cach:[2,22,24],calcul:[5,18,22,23,24,27,28,30,34,35,36,37,39,40,41,44,45],calculateallatomscor:27,calculatebackbonescor:27,calculatelinearcombin:[27,30,34,36],calculatescor:[34,36,37],calculatescoreprofil:[34,36],calculatesequenceprofilescor:27,calculatestemrmsd:27,calculatestructureprofilescor:27,calculatesurfac:[],call:[1,2,4,5,8,10,11,12,13,17,21,22,23,25,27,30,31,32,33,34,35,36,44,45,47],callabl:[10,13],calpha:31,calul:23,came:5,can:[],cand:31,candid:[],cannot:[0,5,10,21,22,23,25,31,33,34,36,43,46,47],canutescu2003:28,canutescu2003b:[34,36,38,39],canutescu:[28,38],cap:7,capabl:[20,26,30],captur:1,carbon:[6,18,38,44,45],carbonyl:[44,45],care:[0,5,7,27,28,31,33,36],carlo:[3,7,24,27,30,31,41],carmsd:[18,19,22],carri:[5,8],cast:33,categori:4,caus:[13,29],caution:17,caviti:22,cb_in_sidechain:45,cb_pack:[24,31,36],cb_packing_scor:33,cb_pairwise_funct:35,cb_po:18,cb_pos_on:[38,39],cb_pos_two:[38,39],cb_posit:39,cbeta:[24,27,30,31,36,37],cbeta_scor:[33,37],cbetaenvlisten:5,cbetascor:[],cbpackingscor:[],ccd:[],ccdcloser:30,center:29,central:[18,23,36],centroid:27,certain:[1,2,4,5,7,13,22,23,24,25,31,33,34,35,36],certainli:1,ch1particl:44,ch2particl:44,ch3particl:44,ch_name:22,chain:[],chain_id:[],chain_idx:[5,17,27,30,31,32,34,35,36],chain_idx_list:32,chain_idx_on:35,chain_idx_two:35,chain_index:[22,30,34],chain_indic:35,chain_nam:[22,31],chainhandl:[17,18,25],chainid:0,chainview:[],chakravarti:22,chakravarty1999:22,chanact:31,chanc:[5,7,31],chang:[1,3,4,5,7,13,17,23,24,25,28,30,31,32,34],change_frequ:[7,30],chapter:[25,29],charact:10,charg:[5,17,21,28,44,45],charmm:[17,21,31],check:[],check_io:33,check_xml:5,checkbasetyp:33,checkfinalmodel:31,checkmagicnumb:33,checkout:[5,13],checktypes:33,chemic:[12,17,34],chi1:47,chi2:47,chi3:47,chi4:47,chi:47,child:10,childclass:1,chmod:5,choos:[27,30],chosen:[0,10,30,31],cif:[0,10],ciiipgatcpgdyan:31,circumv:45,citat:28,clash:[3,24,27,28,30,31,34,36,37,39,42],clash_scor:37,clash_thresh:31,clashscor:[],classic:43,clean:[2,5,13],cleanli:33,clear:[11,17,18,27,31,35],clearenviron:[17,35],cleargap:25,clearpo:17,clearresidu:17,clip:10,clone:5,close:[13,15,18,22,27,28,30,31,32,39],closed_posit:30,closegap:31,closelargedelet:31,closer:[],closesmalldelet:[28,31],closest:[],closur:[28,31],clustal:[0,10],cluster:[3,27,33,35],cluster_thresh:[24,35],clutter:[1,5,22],cmake:[],cmake_support:[4,5,13],cmakecach:2,cmakelist:[1,2,4,5,13],cname:[],coars:5,code:[],codetest:[4,5],coil:[20,24],collect:[8,11,17,24,35],column:[22,24],combin:[21,22,23,24,27,30,31,34,36,39,47],come:[1,4,5,8,10,31,32,37,41],command:[],commandlin:10,comment:13,commerci:5,commit:[5,13],common:[5,10,24],commonli:[5,15,26,27,36],comp_lib:45,compar:[3,5,18,19,22,27,28,47],comparison:[22,31,47],compat:[13,21,33],compensatori:18,compil:[1,2,4,5,11,13,15,33,49],complain:1,complaint:13,complement:[],complet:[11,13,18,21,28,30,31,32,47],complex:[5,13,32,39,44,48],compon:[7,12,22,29,36],compound:[12,45],compoundlib:45,compress:[8,22],comput:[3,5,27,29,34,36],concaten:17,concept:5,concern:5,condit:[5,23],conf:[2,5],confid:[22,36],config:[4,5],config_head:4,configur:[2,5,7,13,27,47],conflict:13,conform:[7,22,28,30,41,42,47],connect:[4,7,13,17,21,22,27],conop:[17,18,21,23,36,45,46],conquer:5,consecut:[22,23,36],conserv:[15,25],consid:[4,5,7,11,13,17,18,22,23,24,27,28,30,31,32,34,35,36,39,43,45,47],consider_all_nod:7,consider_hydrogen:44,consider_ligand:32,consist:[3,5,17,21,24,25,27,28,30,31,32,33,35,39,44,47],constant:[3,21,28,34,36,48],constraint:[10,22,28,35],constraintfunct:35,construct:[],constructatompo:6,constructbackboneframeresidu:[42,45],constructcbetapo:6,constructcterminaloxygen:6,constructetd:7,constructframeresidu:45,constructframeresidueheurist:45,constructfrmrotamergroup:[42,45],constructor:[],constructrrmrotamergroup:45,constructsidechainframeresidu:45,contact:35,contactfunct:35,contain:[0,1,2,4,5,6,8,10,13,17,18,20,21,22,23,24,27,30,31,32,34,35,36,37,39,40,42,43,44,45,47],content:[5,9,14,16,19,22,37,42,49],contigu:[21,32,33],continu:[1,17,25,28,42],contrast:40,contribut:[],control:[0,3,5,7,27,30,32,35,44,45,47,48],conveni:[],convent:[1,46],converg:[24,27,28,30],convers:33,convert:[4,18,21,22,23,31,33,34,36,47,48],convert_module_data:4,convertbasetyp:33,cooler:[],cooling_factor:[7,30],coord:[22,27],coord_idx:22,coord_info:22,coordin:[3,6,22,27,28,31,34,42],coordinfo:22,cope:13,copi:[2,3,4,5,13,15,17,18,25,27,31,35],core:[],correct:21,correctli:31,correspond:[7,13,17,18,21,22,23,27,33,47],corrupt:[17,35],cotain:22,could:[1,4,5,10,13,21,22,31],count:[11,25,30,31,34,36],countenclosedgap:25,countenclosedinsert:25,counterpart:[27,36,45],coupl:[1,5,13,31],cours:5,coutsia:28,cover:[1,5,9,11,17,21,22,24,26,30],coverag:31,cparticl:44,cpp:4,cpr:[46,47],cpu:[15,21,31],cpu_platform_support:21,crambin:[22,27,30],crash:42,createalign:[27,31],createentityfromview:[32,42],createfromfrmlist:[41,42],createfromrrmlist:41,createfullview:[26,27,31],createsequ:[22,27,31],creation:[21,28],creator:[21,28],criteria:32,criterion:[7,30],criterium:27,croak:13,crucial:5,cterminalclos:30,cumul:45,current:[2,4,5,7,11,13,17,18,21,22,27,30,31,33,35,36,44,45,48],custom:[5,22,30,31,32,33,46],cutoff:[20,21,27,28,32,34,36],cycl:25,cyclic:[27,28],cyd:[46,47],cyh:[46,47],cys_hb3:17,cys_sg:17,cystein:[21,32,39,42,46],d_bin:36,dai:8,dampen:21,dare:4,dat:[22,33],data1:4,data2:4,data:[],data_:33,data_gener:33,data_to_stor:22,data_typ:22,databas:[],databs:22,datatyp:22,date:13,dbg:5,dcmake_install_prefix:2,deactiv:7,dead:7,deal:[31,32],debug:[5,7,17],decent:12,decid:[3,5,28],decis:23,declar:[4,5,13],decod:10,decompos:[3,7],decomposit:[7,24,41],decreas:30,dedic:[4,5,13],dee:7,deep:[18,31],def:[1,5,17,31],def_angl:17,defin:[],definem:5,degre:[18,22,23,43],delet:[0,2,5,18,31,44],deliv:[1,22,30,31],delta_scor:30,demand:31,demonstr:22,densiti:[18,28,43],dep1:4,dep2:4,dep:4,dependency1:4,dependency2:4,depends_on:4,depth:22,deriv:[1,22,38,39,43],descend:31,descent:[27,28],describ:[4,7,8,14,17,18,22,25,26,28,29,33,34,36,39,42,44,47,49],descript:[0,10,13,30,47],descriptor:22,descsrib:7,design:[1,3,43],desir:[6,15,21,27,28,30,31,34,35,36],detail:[0,6,10,13,21,22,23,27,29,30,31,34,36,47],detect:[],determin:[5,8,21,22,27,30,35,36],determinist:24,deuterium:31,develop:[],deviat:[18,29,30,43,47],devot:9,dict:[4,24,27,29,30,34,36],dictionari:[4,10,12,22,29],did:[5,22,27,31],differ:[1,2,4,5,7,12,13,17,22,24,25,27,31,34,36,42,46,47],dihedr:[],dihedral_angl:18,dihedral_bin:36,dihedral_idx:47,dihedral_pair:23,dimens:23,dir:[4,5],direct:[5,18,20,22,36,44,45],directli:[5,7,22,27,31,32,35,39,43,44,46,47],directori:[],dirti:1,dirtyccdclos:30,disabl:[1,13],disable_doctest:2,disable_document:2,disable_linkcheck:2,discard:22,discocontain:35,disconnect:3,discret:[34,36],discuss:22,disk:[5,21,24,34,36,47],displai:[8,10,11],dissimilar:24,dist:36,dist_bin:36,dist_bin_s:22,distanc:[6,18,22,24,27,31,32,34,35,36,38],distance_thresh:24,distant:35,distinct:[17,32],distribut:[1,5,21,22,23,30,33,34,36,43,47],disulfid:[],disulfid_bridg:[21,32],disulfid_score_thresh:32,disulfidscor:[32,39],dive:[13,31],diverg:5,divers:[22,24],dng:15,do_it:[34,36],doc:[2,4,5,13],docstr:10,doctest:[2,5,13],document:[],doe:[1,3,4,5,6,7,8,10,12,13,18,22,26,27,31,33,35,43],doesn:[5,13,25,28,30,47],doexternalscor:[34,36],dointernalscor:[34,36],domain:24,domin:7,don:[2,7,27,31,45],done:[1,5,8,10,13,19,21,23,27,30,31,33],donor:36,donorm:[34,36],dont_write_bytecod:1,dost_root:2,doubt:10,down:[10,18,22,30],dpm3_runtime_profiling_level:11,draw:[18,23,30],drawback:5,drawn:[23,30],drawphigivenpsi:23,drawpsigivenphi:23,drop:5,dssp:[3,22,36],dssp_state:36,due:[22,27,28,31,39,43],dump:47,dunbrack:[28,32,38,42,43],dure:[1,17,28,31,33,40,47],dynam:47,dynamicspatialorgan:3,e_cut:7,e_thresh:[7,31],e_tresh:7,each:[0,5,7,10,11,17,18,21,22,23,24,25,27,28,29,30,31,32,33,34,36],earli:3,earlier:2,easi:5,easier:[1,5],easili:[4,13,31],echo:5,edg:7,edge_idx:7,editor:1,educ:5,effect:[4,5,7,21,32,39],effici:[7,17,24,30],egg:22,eigen3_include_dir:2,eigen:[2,3],either:[0,5,10,13,17,18,23,25,27,28,30,31,32,33,34,35,36,40,44,46,47],elabor:5,electrostat:[21,28],element:[1,7,17,18,22,24,27,29,33,35,39],elimin:7,els:[5,13,32,33],emerg:1,empir:[38,39],emploi:13,empti:[5,8,10,18,22,24,27,31,44],enabl:[1,2,8,10,12,21,22],enable_mm:2,enable_ss:2,enclos:[25,31],encod:0,encount:[25,30],end:[0,1,2,4,5,7,8,10,13,17,18,22,24,25,27,31],end_resnum:31,end_transl:4,endian:33,energi:[3,5,7,15,21,28,30,31,34,36,39,40,41,44,45,48],enforc:[17,27,30,31,32,34,35,36],enough:[5,13,21,22,31,33],ensur:[2,5,15,27,31,33],ent:[0,10,17,21,22,29,32,37],ent_seq:37,enter:40,entiti:[5,10,11,17,18,22,29,31,37,42],entityhandl:[10,17,18,29,31,32,35],entityview:[22,23,24,29,31],entri:[],enumer:[5,7,17,21,22,27,35,42,44,45,46],env:[5,15,17,21,24,28,29,31,32,34,35,36,37],env_po:[28,32],env_structur:[17,35],environ:[],epsilon:[7,21,32,48],equal:[30,34,36,39,45],equidist:47,equival:[31,34,36],error:[0,8,10,11,22,28,31,33],especi:24,estim:[7,29,30,36,39,43],etc:[1,3,5,13,18,22,27,35],evalu:[],evaluategromacsposrul:6,even:[2,5,7,18,21,25,31],event:24,eventu:10,ever:[13,30],everi:[0,1,5,7,17,18,22,23,24,27,28,30,31,32,34,35,36,39,41,44,45,47,48],everyth:[],evolut:22,evolv:37,exact:[7,33],exactli:[2,7,22,24,27,31,35,39,45,46],exampl:[],example_reconstruct:42,exce:[34,36],exceed:[22,25],except:[0,3,10,22,25,31,45],exclud:[5,22],exclus:[1,5,21],execut:[],exisit:[],exist:[1,2,4,5,7,8,10,11,13,17,18,22,27,28,29,30,31,33,34,35,36,43,44,46,47],exit:[0,1,8,10],exit_cod:1,exit_statu:8,exot:5,exp:30,expect:[1,17,21,22,31,32,35,39,48],expens:22,experiment:31,explain:[1,5],explan:5,explicit:2,explr:7,exponenti:30,exponentialcool:30,expos:22,express:39,ext:8,extend:[],extendatcterm:25,extendatnterm:25,extended_search:[27,31],extens:[0,3,8,10,25,31],extension_penalti:25,extent:22,extern:[3,4,5],extra:[2,5,13,18,33],extra_bin:22,extra_force_field:31,extract:[5,6,17,18,19,21,22,23,24,26,27,28,30,31,32,34,35,36,39,43,45],extract_burial_statu:[],extractbackbon:17,extractloopposit:21,extractstatist:23,extrem:18,f_i:22,f_idx:35,facilit:24,factor:[7,21,30,43,44],fail:[0,1,5,8,11,18,27,28,31],failur:[0,5,8,10,47],fall:28,fallback:47,fals:[1,5,7,8,10,18,21,22,25,27,30,31,32,39,42,44,45],far:[27,31],fast:[6,15,17,21,22,23,33,34,35,36,47],fasta:[0,10,26,31],faster:[7,21,22,28,29,35],fastest:[28,31],favor:29,favourit:1,fed:[4,13],fedora:5,feed:[4,17,27],feel:[5,13],fellow:5,fetch:13,few:[2,5,13,21,33,37],ff_aa:21,ff_aa_on:21,ff_aa_two:21,ff_ala:21,ff_arg:21,ff_asn:21,ff_asp:21,ff_cy:21,ff_cys2:21,ff_gln:21,ff_glu:21,ff_gly:21,ff_hisd:21,ff_hise:21,ff_ile:21,ff_leu:21,ff_lookup:[21,28,31],ff_lookup_charmm:33,ff_ly:21,ff_met:21,ff_phe:21,ff_pro:21,ff_ser:21,ff_thr:21,ff_trp:21,ff_tyr:21,ff_val:21,ff_xxx:21,field:[31,33,47],figur:13,file:[],filecheck:13,fileexist:8,fileextens:8,filegzip:8,filenam:[0,5,8,10,21,22,23,24,33,34,36,43,47],filenotfound:29,fill:[4,5,10,13,19,22,25,26,27,29,31],fillfromdatabas:[27,31],fillfrommontecarlosampl:[27,31],fillloopsbydatabas:31,fillloopsbymontecarlo:31,filo:35,filtercandid:29,filtercandidateswithsc:29,final_model:[26,31],find:[],findchain:37,findwithin:5,fine:5,finish:48,fire:1,first:[0,1,5,7,10,13,15,17,18,21,22,23,24,25,27,28,30,31,32,34,35,36,38,39,42,44,47],fit:[],fix:[3,5,8,13,21,28,32,33,34,36],fix_cterm:28,fix_nterm:28,fix_surrounding_hydrogen:21,flag1:4,flag2:4,flag:[0,2,4,5,7,8,18,22,31,32,44,45],flanking_rot_angle_on:18,flanking_rot_angle_two:18,fletch:[22,42],fletcher:31,flexibl:[32,39,42,43,44,45,48],flip:47,flood:22,flush:[1,13],fold:22,folder:[2,4,5,13,15,33],follow:[0,1,2,4,5,7,8,13,15,18,19,21,22,24,25,26,27,31,32,33,34,36,42,44,45,46,47],fontsiz:23,forbidden:5,forc:[21,28,31],force_const:[21,28],forcefield:[],forcefieldaminoacid:21,forcefieldbondinfo:21,forcefieldconnect:21,forcefieldharmonicangleinfo:21,forcefieldharmonicimproperinfo:21,forcefieldljpairinfo:21,forcefieldlookup:[21,28,31,33],forcefieldperiodicdihedralinfo:21,forcefieldureybradleyangleinfo:21,forg:13,forget:[1,5],form:[11,20,21,22,26,31,35,47],formal:[27,28,44,47],format:[0,5,10,22,43],formatt:5,formula:29,forward:13,found:[1,4,5,8,10,13,17,19,22,24,27,28,29,30,31,32,39,41,47],foundat:1,four:[6,30],fraction:[22,24,28,30],frag_db:[19,22,27,33],frag_info:22,frag_length:[19,22,24],frag_map:22,frag_po:[19,22,24],frag_residu:[19,22],frag_seq:[19,22],frag_siz:22,fragdb:[19,20,22,27,31,33],fragger:[19,22,24,30,31],fragger_handl:31,fragger_map:22,fraggerhandl:[22,24,31],fraggermap:[22,24],fragment:[],fragment_db:31,fragment_handl:24,fragment_info:22,fragment_length:[22,24],fragmentinfo:[22,27],fragments_per_posit:24,fragmentsampl:30,frame:[],frame_energi:44,frame_residu:[40,42],frameresidu:[40,44,45],framework:5,free:[5,46,47],frequenc:[22,30],frm:32,frmrotam:[39,44,48],frmrotamergroup:[39,41,44,45],from:[],fromhhm:22,fromhoriz:22,fromresidu:47,front:[1,8,13],fstream:33,fudg:21,fulfil:[22,47],full:[0,1,5,7,17,20,21,22,25,26,27,30,32,42,44],full_seq:[25,27],fullgapextend:[25,31],fulli:[5,13,17,18,22,25,26,32],function_typ:35,functions_specific_to_your_act:5,fundament:33,funni:[2,5],further:[7,24,25,31,32,33],furthermor:33,futur:[21,22],gamma:[35,36,39],gamma_bin:36,gap:[],gapextend:[25,31],gapfre:22,gather:[4,9,13,22,24,42,44,47],gciiipgatcpgdyan:[27,31],gener:[],generatedenovotrajectori:24,generatestructureprofil:22,geom:[17,18,21,24,28,31,39,44],geometr:[],geoom:38,get:[],getaa:[17,18,21],getaaa:17,getaah:17,getactivesubrotam:44,getallatomposit:[17,28,32],getallatomscoringkei:27,getallatomweight:27,getanchoratomindex:17,getangl:42,getangularbins:22,getatomcount:5,getatomnam:17,getatomnameamb:17,getatomnamecharmm:17,getaveragescor:27,getbackbonelist:[19,22],getbackbonescoringkei:27,getbackboneweight:27,getbins:23,getbinsperdimens:23,getbound:18,getc:18,getca:18,getcb:18,getchain:25,getchainindex:25,getchainnam:25,getchains:5,getcharg:[21,44],getclust:27,getclusteredcandid:27,getconfid:22,getcoordidx:22,getcoordindex:[],getcoordinfo:22,getcpuplatformsupport:21,getdefault:[21,28,31],getdihedralangl:22,getdistbins:22,getdisulfidbridg:21,getdisulfidconnect:21,getdsspstat:22,getel:17,getenviron:17,getenvsetdata:5,getepsilon:21,getfirstindex:17,getforcefieldaminoacid:21,getfragmentinfo:[22,27],getframeenergi:44,getfudgelj:21,getfudgeqq:21,geth1index:17,geth2index:17,geth3index:17,getheavyindex:21,gethistogramindex:[18,23],gethistogramindic:23,gethnindex:17,gethydrogenindex:[17,21],getindex:[17,21],getinternalconnect:21,getinternalenergi:44,getinternalenergyprefactor:44,getlargestclust:27,getlastindex:17,getlength:25,getlist:24,getlooplength:21,getloopstartindic:21,getmass:21,getmaxnumatom:17,getmaxnumhydrogen:17,getn:18,getnam:[42,44],getnonbondedcutoff:28,getnum:27,getnumatom:[17,21],getnumb:27,getnumcandid:27,getnumchain:5,getnumcoord:22,getnumfrag:22,getnumhydrogen:17,getnumloopresidu:21,getnumresidu:[5,17,21],getnumstempair:22,getnumsubrotam:44,geto:18,getolc:[17,18],getomegators:[17,18],getoxtindex:21,getparticletyp:44,getpeptideboundconnect:21,getphiprobabilitygivenpsi:23,getphitors:[17,18,42],getpo:[17,44],getpotentialenergi:21,getpredict:22,getprob:[23,44],getpsiprobabilitygivenphi:23,getpsitors:[17,18,42],getr:29,getresiduedepth:22,getringpunch:29,getscor:[22,30],getselfenergi:44,getseqr:[17,35],getsequ:[17,18,22,27],getsequenceprofil:22,getsequenceprofilescoreskei:27,getsigma:21,getsimul:21,getsolventaccessibilitit:22,getstemrmsdskei:27,getstructureprofil:22,getstructureprofilescoreskei:27,getsubdb:22,getsubrotamerdefinit:44,getsystemcr:28,gettemperatur:[30,44],gettransform:18,getversionnumb:33,getweight:[24,27],ggg:31,gggaggg:31,gggggggggggggggggggg:31,git:[],gitignor:5,give:[4,5,13,19,27,30,31,44],given:[0,1,3,4,5,6,7,8,10,11,17,18,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,39,42,44,45,47],glass:7,gln:46,gln_ne2:17,global:[12,22,27,33],glu:[17,44,46,47],glu_oe1:17,glutam:46,glutamin:46,gly:[31,32,42,45,46],gly_n:17,glycin:[3,18,22,28,32,46],goal:[1,7,26],goe:[2,5,11,13,31,47],goldfarb:31,goldstein1994:7,goldstein:7,good:[4,5,15,21,22,31],got:2,grain:5,graph:[],graph_initial_epsilon:32,graph_intial_epsilon:32,graph_max_complex:32,graphminim:[7,41],grep:2,grid:22,gromac:6,group:[],group_definit:[23,36],group_idx:36,guarante:[22,24,27,32,33],gui:[5,23],guid:28,guidelin:[5,33],gzip:[0,8,10],hand:[2,4,10,44],handl:[],handler:24,happen:[1,5,21,22,24,25,30,31,44],hard:38,hardwar:15,harmon:[21,28],harmonic_angl:21,harmonic_bond:21,harmonic_improp:21,hasdata:22,hasfraglength:22,hasfragmentinfo:27,hash:22,hasringpunch:29,have:[],hbond:[24,31,36,44,45,46],hbond_scor:33,hbondscor:[],headach:5,header1:4,header2:4,header3:4,header4:4,header:[],header_output_dir:4,headlin:5,heavi:[17,21,32,34,45],heavili:[22,42],helic:[18,20,21,24,31,36,43],helix:[15,18,30,42],hello:33,hello_world:5,hellyeah:15,help:[0,1,2,4,5,10,13,15,21,36],helpactiontest:1,helper:[],hen:22,henc:[5,11,17,22,33],here:[0,1,2,4,5,8,10,11,13,15,17,18,21,22,23,24,26,27,28,30,31,33,34,36,39,47],het:31,heurist:[31,45],heuristicprocessor:17,hgfhvhefgdntngcmssgphfnpygkehgapvdenrhlg:0,hhm:[22,27],hhsearch:22,hhsuit:[],hidden:44,hide:[5,13],hierarch:[27,35],hierarchi:12,high:[3,5,13,26,31],high_resolut:18,higher:[2,27,35,36],highest:12,highli:[2,5],hint:10,histidin:[21,46],histogram:[23,30],histori:13,hit:[1,7,13,23,28],hmm:22,home:4,homolog:[0,9,15,22,31],homologu:22,honor:31,honour:31,hook:[],horiz:22,host:[4,13],hotfix:13,how:[],howev:22,hparticl:44,hpp:33,hsd:[46,47],hse:[46,47],html:[2,5,13],http:5,hydrogen:[3,17,18,21,22,31,36,44,45],hyphen:1,i_loop:[21,32],id_:33,idea:[1,5,17,19,21,22,31,35,44,48],ideal:[18,28,48],idenfifi:45,ident:[3,22,23,36,47],identifi:[0,10,11,22,27,31,32,34,36,45,47],idx:[7,17,18,21,22,24,28,35,44],idx_ca_res_37:17,idxhandl:5,iff:[22,25,29],ifstream:33,ignor:[0,21,28,31],illustr:22,imagehandl:18,imagin:5,imaginari:1,img:18,immedi:[1,5,12,13],impact:[21,22],implement:[3,13,22,24,25,28,31,33,38,39,41,42,46],implicit:2,improp:21,improv:[3,20,21,31,39,42],in_dir:4,in_fil:5,in_path:4,in_stream:33,in_stream_:33,inaccur:21,inaccurate_pot_energi:21,inact:48,inactive_internal_energi:48,incl:[21,22,31],includ:[2,5,8,13,15,17,20,21,22,25,27,29,31,33,34,36,42],include_ligand:31,inclus:31,incompat:[27,28],incomplet:[31,43],inconsist:[7,10,17,18,21,22,25,27,28,32,35],inconveni:13,increas:[7,24,27,28,31,45],independ:[21,32,43],index:[5,7,16,17,18,21,22,23,24,25,27,28,29,30,31,34,35,36,40,44,45,47],index_four:21,index_on:21,index_thre:21,index_two:21,indic:[],individu:[34,36],inf:[7,28],infin:28,infinit:28,influenc:[10,24,35],info:[22,27,31,35],inform:[5,10,13,18,19,20,22,24,25,27,31,35,36,37],inherit:[1,34,35,36,41],init:13,init_bb_list:30,init_frag:30,initi:[3,7,17,18,22,24,27,28,30,31,32,34,35,36,41,44,47],initial_bb:27,initial_epsilon:[7,48],initialis:1,inlin:[5,33],inner:11,input:[0,1,3,10,13,15,21,22,23,24,28,30,31,32,34,35,36,39,43,45,48],insert:[17,18,25,27,30,31,48],insertinto:[17,18,27],insertloop:[25,31],insertloopcleargap:[25,27,31],insid:[1,4],insight:13,inspir:28,instanc:[3,5,10,20,21,33],instead:[1,2,3,4,5,8,22,24,25,27,30,31,45],instruct:2,int16_t:33,int32_t:33,int_32_t:33,integ:[5,10,17,35],intend:[1,5,30],intent:22,interact:[3,5,21,28,34,35,36,38,39,40,44],intercept:[34,36],interest:[1,7,21,22,30,33,44,47],interfac:[0,4,5],intermedi:5,intern:[0,1,3,4,5,13,17,20,21,22,23,24,27,28,30,31,32,33,34,35,36,41,44,45,48],internal_e_prefac:45,internal_e_prefactor:44,internal_energi:44,internet:5,interpol:[35,47],interpret:[5,8],intervent:5,intrins:2,introduc:[1,4,5,13,28,31],invalid:[5,17,21,22,25,28,31,32,34,35,36,40,44,46,47],invok:[2,4,5,12,13],involv:[13,26,39],iostream:33,is_c_ter:[21,32],is_cter:21,is_n_ter:[21,32],is_nter:21,isallatomscoringsetup:[27,31],isallset:17,isanyset:17,isbackbonescoringsetup:31,isctermin:25,isempti:27,isen:11,ishbondacceptor:44,ishbonddonor:44,isntermin:25,isoleucin:46,isset:17,issimilar:47,issourc:33,istermin:25,isvalid:42,item:[1,5,13,17,18,21,22,31,35],iter:[7,22,23,24,27,28,30,31,44],itself:[3,4,5,13,22,30,32,33,34,36,44],job:[5,22,31],join:[5,17,19,22,27,28,30,32],jone:[22,44],jones1999:22,json:[0,10],just:[1,2,5,10,12,13,19,21,22,25,27,31,45],kabsch1983:22,kabsch:22,keep:[],keep_non_converg:27,keep_sidechain:[5,32],kei:[0,10,22,24,27,30,31,34,35,36],kept:[5,13,21,27,28,32,40],kernel:43,keyword:23,kic:[],kicclos:30,kick:10,kill_electrostat:21,kind:[1,5],kinemat:28,know:[2,47],known:[4,8,17,35,45],kortemm:28,krivov2009:[7,42,43],krivov:42,kwarg:1,l_e:44,lab:43,label:[13,21],lack:31,languag:4,larg:[23,28,31],larger:[7,11,18,22,31,45],largest:[24,27,39],last:[1,4,17,18,21,25,27,28,30,31,35,36,43],last_psi:18,later:[1,5,7,17],latest:[2,5],latter:[0,13,31],launcher:[4,5],layer:39,layout:[22,33],lazi:44,lbfg:31,leach1998:7,leach:7,lead:[0,5,6,8,18,21,27,28,32,34,36,43],least:[0,2,4,5,7,13,18,21,22,31,34,36,39],leav:1,left:[8,28],legal:5,lemon:7,len:[18,19,21,22,24,27,31,32,36,42],length:[6,7,17,20,21,22,23,24,25,27,28,31,32,33,34,35,39],length_dep_weight:31,length_depend:27,lennard:44,less:[0,7,13,18,21,22,23,27,31,34,36,47],let:[1,5,18,22,27,42],letter:[3,17,18,22,23,30,46],leu:46,leu_h:17,leucin:46,level:[2,3,5,11,12,13,26,31,44],lexicograph:31,lib64:5,libari:43,libexec:[4,5],libpromod3_nam:4,librari:[],library1:4,library2:4,licenc:43,life:13,ligand:[3,31,32,45],like:[1,4,5,13,31,33,43,44],limit:[3,22,28,31],line:[],linear:[22,24,27,30,34,36],linear_weight:[27,30,34,36],linearcombin:27,linearscor:30,liner:35,link:[2,4,5,13,17,21,22,24,30,32,34,35,36,37],link_cmd:4,linkcheck:[2,5,13],linker:[4,31],linker_length:31,list:[0,1,2,3,4,5,6,7,8,10,17,18,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,39,40,41,42,44,45,47,48],listen:5,literalinclud:5,littl:[4,5,13,33],live:[4,5],lj_pair:21,load:[],load_frequ:20,loadalign:[26,31],loadallatominteractionscor:34,loadallatompackingscor:34,loadamberforcefield:31,loadbb:22,loadcach:24,loadcbetascor:[27,30,36,37],loadcbpackingscor:36,loadcharmm:21,loadcharmmforcefield:31,loaddefaultallatomoverallscor:34,loaddefaultbackboneoverallscor:36,loaddunbracklib:[42,43],loadent:[0,10],loadfragdb:[19,20,27,31],loadhbondscor:36,loadpdb:[5,17,19,21,22,26,27,28,30,31,32,37,42],loadpenultimatelib:43,loadport:[21,22,23,33,34,36,47],loadreducedscor:36,loadsequenceprofil:[22,27],loadssagreementscor:36,loadstructuredb:[19,20,22,27,31],loadtorsionsampl:[18,20,23,30],loadtorsionsamplercoil:[20,27,31],loadtorsionsamplerextend:20,loadtorsionsamplerhel:20,loadtorsionscor:36,local:[2,21,22,23,34,36,47],locat:[2,3,4,7,18,22,25,33,34,36,44],log:[8,13,29,44,45],logic:0,loginfo:29,lone:44,lone_pair:44,longest:22,look:[5,8,13,18,22,32,35],lookup:[],looooooong:7,loop:[],loop_candid:27,loop_length:[21,22,27,32],loop_main:5,loop_po:21,loop_seq:27,loop_start_indic:[21,32],loopcandid:[],loss:13,lossi:22,lost:[1,13],lot:[1,5,10,13],lovel:43,lovell2000:43,low:[1,5,7,45],lower:[27,30,31,34,36],lowest:[27,30,44],lowest_energy_conform:30,lysin:46,machin:[21,22,23,33,34,36,47],macro:[4,5],made:[4,47],magic:[5,33],mai:[0,1,2,4,5,8,10,13,17,21,25,28,31],main:[31,33,47],mainli:[17,30,43,44],maintain:[5,13],major:13,makefil:[2,5],makestat:47,malici:13,man:[2,5],manag:[4,5],mandel:28,mandell2009:28,mani:[8,10,22,28,29,31,45],manipul:18,manner:[5,7,30],manual:[1,2,5,6,13,22,27,30,31,33,44],map:[17,18,22,24,29,32],mar:20,mark:[4,45],markup:5,mass:21,massiv:24,master:[5,13],mat3:6,mat4:[6,18,24,31],match:[0,4,21,22,23,27,28,30,31,35,36],materi:[1,5],math:29,mathemat:[27,28],matplotlib:23,matric:22,matrix:[6,22],matter:4,max:[6,7,17,25,29,31,32,36,47,48],max_alpha:36,max_beta:36,max_complex:[7,48],max_count:[34,36],max_d:36,max_dev:30,max_dist:[27,35],max_extens:31,max_gamma:36,max_iter:[24,27,31],max_iter_lbfg:31,max_iter_sd:31,max_length:25,max_loops_to_search:31,max_n:7,max_num_all_atom:31,max_p:45,max_prob:44,max_res_extens:31,max_step:28,max_to_show:11,max_visited_nod:7,maxfraglength:22,maxim:[7,20,22,24,27,28,30,31,35,36],maximum:[7,22,27,28,30,44,45],mc_closer:30,mc_cooler:30,mc_num_loop:31,mc_sampler:30,mc_scorer:30,mc_step:[7,31],mcsolv:7,mean:[4,5,10,13,17,21,28,31,32],meaning:[22,27,43],meant:[15,17,22,29,31,45],measur:24,mechan:[15,27,28,30,31,35],meddl:31,member:[5,10,27,31],memori:[7,22,31,33],mention:[1,2],merg:[13,21,24,25,27,31,32,35,44],merge_dist:31,mergegap:25,mergegapsbydist:31,mergemhandl:31,mess:[5,13,35],messi:13,met:46,methionin:[31,46],method:[0,1,7,10,17,21,22,23,28,31,32,33,45],metric:35,metropoli:[7,27,30],mhandl:[25,26,27,31],middl:13,might:[7,21,22,27,28,30,35,44,45,48],min:[27,36],min_alpha:36,min_beta:36,min_candid:27,min_d:36,min_dist:35,min_gamma:36,min_loops_requir:31,min_scor:27,mincadist:18,mind:[1,5],minim:[],minimizemodelenergi:31,minimum:[18,22,24,39],minor:[3,21],mirror:33,miser:11,mismatch:[17,35],miss:[0,8,10,21,31],mix:[0,4],mkdir:[2,5],mm_sy:[21,28],mm_sys_output:21,mm_system_cr:28,mmcif:8,mmsystemcr:[21,28],mod:5,mode:[1,47],modellinghandl:[25,27,31],modeltermini:31,modif:31,modifi:[5,13,18,27,31],modified_crambin:27,modul:[],module_data:4,mol:[],molecular:[15,28,31],molprob:[],molprobity_bin:29,molprobity_execut:29,moment:5,monitor:1,monolith:5,mont:[3,7,24,27,30,31,41],montecarlo:3,mood:5,more:[1,2,4,5,7,10,11,13,24,31,39,44],most:[0,3,4,5,18,21,22,23,24,27,28,31,34,36,43,45],mostli:[4,13,44],motion:18,movabl:21,move:[2,3,5,13,21,27,28,30,31,33],movement:24,mpscore:29,msg:8,msgerrorandexit:8,msm:3,msse4:2,much:[5,7,22,31],multi:15,multipl:[0,2,3,4,5,10,11,15,21,24,27,31,32,34,36],multipli:[7,30],multitempl:10,must:[],mutlipl:10,my_db:[],my_db_on:22,my_db_two:22,myclass:33,myclassptr:33,mytrg:0,n_coord:6,n_num:25,n_po:[6,18,36],n_stem:[6,19,22,25,27,28,30],n_stem_phi:30,n_ter:[28,45],naivesolv:7,name:[0,1,3,4,5,8,10,11,17,21,22,23,25,27,29,31,39,43,44,46,47],name_pymod:4,namespac:[10,33],nan:[28,47],nat:28,nativ:33,necessari:[5,18,30,35],necessarili:48,need:[1,2,3,4,5,8,10,12,13,18,21,22,23,24,27,28,31,32,33,34,35,36,42],need_config_head:4,neg:[1,7,21,28,35],neglect:[24,28,40,44],neglect_size_on:27,neighbor:[5,17,31],neighbour:[31,47],network:[18,39],never:[10,13,22,27,32,33,34,36],nevertheless:[5,44],new_default:21,new_env_po:17,new_po:17,new_res_nam:44,new_siz:18,newli:[17,30],next:[1,5,13,18,23,24,25,33],next_aa:30,nice:5,nitrogen:[6,18,28,38,44,45],nobodi:1,node:7,node_idx:7,node_idx_on:7,node_idx_two:7,non:[],nonbonded_cutoff:[21,28],none:[10,22,24,29,31,32],nonredund:22,nonrotamer:43,nonzero:47,norm:36,normal:[34,36],normalis:35,notabl:22,note:[0,2,5,10,11,17,18,21,22,24,27,28,30,31,32,33,34,35,36,42,45,46],noth:[4,5,11,30,44],notic:[1,4,13],novel:22,novo:[],now:[3,5,11,13,15,18,22],nparticl:44,nterminalclos:30,null_model:27,num:[19,24,27,28,32],num_frag:[22,31],num_gap_extens:25,num_loop:27,num_residu:[17,21,30,32,34,35,36],num_residues_list:32,num_trajectori:24,number:[0,1,5,6,7,10,11,15,17,18,20,21,22,23,24,25,27,28,30,31,32,33,34,35,36,37,39,40,44,47],numer:31,numpi:[23,30],o_po:18,object:[],observ:[7,22,28,48],obtain:[7,15,19,31],obviou:13,occupi:[40,45],occur:[17,24,35,36],ocparticl:44,odd:22,off:[1,5,11,31],offend:29,offer:[20,26,44],offset:[0,3,10,22,27,31],ofstream:33,often:[5,8,10,28],olc:18,old:[29,31],oligom:26,oligomer:3,olson:[],omega:[17,18],onc:[1,3,5,13,21,24,27,28,30,41,47,48],one_letter_cod:[17,19,22,27,28,30,32],onli:[0,1,2,4,5,7,8,10,11,12,13,17,18,21,22,24,25,27,29,30,31,32,33,34,36,39,42,43,45],only_longest_stretch:22,onto:[1,18,22,24],oparticl:44,open:[10,21,22,23,33,34,36,47],openmm:[2,15,21,28],openstructur:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49],oper:[3,7,13,15,17,22,35],opt:[8,10,13],optim:[],optimis:5,optimize_subrotam:[32,39],option:[0,2,3,10,22,27,28,31,47],order:[0,10,17,21,22,25,27,31,33,35],org:5,organ:[5,22,47],orient:[6,28,36],orig_indic:[27,29],origin:[6,10,13,18,22,27,30,31,35,48],ost:[],ost_double_precis:2,ost_ent:29,ost_librari:4,ost_root:[2,5],other:[],other_db:[],other_index:18,other_res_index:17,otherwis:[1,4,5,7,11,13,17,18,21,22,24,25,27,28,30,34,35,36,44],our:[4,5,13,22,27],out:[1,2,4,5,11,13,17,21,22,23,24,25,27,42,47],out_path:4,out_po:21,out_stream:33,out_stream_:33,outer:[11,22],outlier:29,output:[],output_dir:4,outsid:[5,35],over:[2,4,10,13,22,28,31,44],overal:[7,30,35,41],overhead:21,overlap:[21,30,31,32],overli:13,overload:33,overrid:[2,21],overridden:4,overview:[5,13],overwrit:27,overwritten:21,own:[],oxt:[6,17,21],oxygen:[18,31,38,44,45],pack:17,packag:[4,5,13],pad:[18,33],page:[2,5,16],pai:1,pair:[6,21,22,23,24,28,30,32,33,34,35,36,39,44,47],pairwis:[],pairwise_energi:7,pairwiseenergi:44,pairwisefunct:[35,36],pairwisefunctiontyp:35,pairwisescor:[],paper:[38,39,42,44],paragraph:[1,5],parallel:22,paramet:[1,4,5,6,7,8,10,11,12,17,18,20,21,22,23,24,25,27,28,29,30,31,32,34,35,36,38,39,40,41,43,44,45,46,47,48],parameter_index:22,parametr:[28,31,32,45],parent:31,pars:[],parser:[],part:[1,5,13,15,17,22,30,31,35,39,41,42,44],partial:25,particip:[32,39],particl:[],particular:[5,7,22,27,28,30,44,47],partner:[34,35,36,44],pass:[10,13,17,21,22,24,25,28,30,39,40,44,45],past:[5,13,18,25],path:[1,2,4,5,8,13,15,21,22,23,29,34,36,47],path_to_chemlib:12,pattern:22,paus:11,pdb:[0,5,8,10,15,17,18,19,20,21,22,26,27,28,29,30,31,32,37,42],pdb_id:[],penal:[25,31],penalti:[25,31],penultim:[32,43],penultimatelib:33,peopl:13,pep:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49],peptid:[17,19,21,22,31,32,42],per:[4,5,7,9,13,17,23,27,30,31,34,35,36,39],percentag:29,perfect:5,perfectli:5,perform:[0,7,13,15,21,24,27,28,29,30,31,33,35,39],period:21,periodic_dihedr:21,periodic_improp:21,permiss:5,permut:7,phase:21,phe:[46,47],phenix:29,phenylalanin:46,phi:[17,18,22,23,28,30,36,42,45,47],phi_bin:[36,47],phi_handl:42,phipsisampl:30,phosphoserin:31,phrase:5,pick:[27,30],pictur:5,piec:[5,24],pipelin:[],pivot:[27,28,30],pivot_on:[27,28],pivot_thre:[27,28],pivot_two:[27,28],place:[1,2,4,5,8,10,13,22],plain:[0,10],plan:13,plane:29,platform:[15,21],pleas:[2,5,13,22,24,27,28,31],plot:23,plt:23,plu:[5,10,12,22,39,44],pm3_csc:13,pm3_openmm_cpu_thread:[15,21,31],pm3_runtime_profiling_level:11,pm3argpars:[],pm3argumentpars:[0,8,10],pm_action:[1,4,5],pm_action_init:5,pm_bin:1,png:23,point:[2,5,10,12,17,22,24,30,31,35,47],pointer:[2,5,33],polar:[44,45],polar_direct:44,polici:5,pop:[13,27,30,35],popul:[2,13],port_str_db:22,portabl:[],portable_binary_seri:33,portable_fil:4,portablebinarydatasink:33,portablebinarydatasourc:33,pos_end:24,pos_on:24,pos_start:24,pos_two:24,posit:[],possibl:[0,3,5,7,10,13,18,21,22,23,25,27,28,30,31,32,33,34,35,36,39,41,44,46],post:10,postprocess:32,pot:21,pot_:28,potenti:[7,19,20,21,22,27,28,31,32,33,36],pqhpg:0,practic:[4,5,21,22],pre:[5,13],pre_commit:[5,13],preceed:32,precis:[2,27,31],precomput:[],pred:35,predefin:[4,15,21,31,34,36],predict:[22,24,31,35,36,38,42],prefactor:44,prefer:[2,4,22,47,48],prefilt:31,prefix:[1,4,5,8],prepar:[5,31],present:[18,24,28,32,44,45,47],prev_aa:30,prevent:[1,5],previous:[21,22,27,32,35],primary_rot_angl:18,principl:[30,35],print:[1,2,18,19,21,22,27,28,29,31,37],printstatist:22,printsummari:11,prior:31,privat:[1,33],pro:[17,23,46,47],probabilist:[22,45],probability_cutoff:45,probabl:[4,5,7,13,22,23,24,27,28,30,43,44,45,47],problem:[3,7,10,13,22,27,28,30,31,35,39,41,43,48],problemat:24,proce:37,procedur:[7,24,32],process:[1,10,13,17,21,24,28,30,31,33,35,40,44,47],produc:[0,1,2,4,5,7,22,25,29,31,43,45],product:[1,3,13],prof:[22,27],prof_dir:22,prof_path:22,profil:[],profiledb:22,profilehandl:[22,24,27,31],prog:10,program:[4,5,9],project:[4,5,13],prolin:[18,29,45,46],promin:0,promod3_mod:4,promod3_nam:4,promod3_name_head:4,promod3_path:5,promod3_root:5,promod3_shared_data_path:[5,33],promod3_unittest:[1,4,5],promot:5,prootein:7,propag:[5,18],proper:[13,22,45],properli:[1,31,34,36,45],properti:[17,18,31,47],propos:[25,27,28,30,39],proposed_posit:30,proposestep:30,prot:[5,19,22,28,30,32,42],prot_rec:5,protein:[],proton:[17,21,46,47],provid:[0,1,2,3,4,5,10,13,17,18,19,21,22,24,25,27,28,29,30,31,32,33,35,43,44,45,47],prune:[7,48],pseudo:[30,31,34,36],psi:[17,18,22,23,28,30,36,42,45,47],psi_bin:[36,47],psi_handl:42,psipr:[22,24,35,36],psipred_confid:36,psipred_pr:24,psipred_predict:[22,24,31],psipred_st:36,psipredpredict:[],pull:[5,13],punch:[],pure:0,purpos:[5,7,31,47],push:13,pushverbositylevel:10,put:[1,4,5,8,10,31],py_run:[1,4,5],pyc:1,pylint:13,pylintrc:13,pymod:[4,5,13],pyplot:23,pytest:5,python2:5,python:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49],python_root:2,pythonpath:5,qmean:2,qmeandisco:35,qualiti:31,queri:[22,47],querylib:47,question:[3,23],quickli:[5,28],quit:[5,10],rachovski:20,rackovski:20,radian:[6,18,21,23],radii:[29,38],radiu:[5,29,34,36],raihvhqfgdlsqgcestgphynplavph:0,rais:[0,6,7,10,17,18,21,22,23,24,25,27,28,29,30,31,32,34,35,36,39,40,44,45,47],rama_iffi:29,ramachandran:29,random:[7,18,20,23,27,28,30],random_se:27,randomized_frag:18,randomli:[23,30],rang:[5,6,17,18,19,21,22,23,24,25,28,30,31,34,35,36,47],rank:27,rapid:38,rare:5,rather:[5,8,13,47],raw:[],rawmodel:5,reach:[0,25,28],read:[0,5,8,10,13,21,22,23,25,32,33,34,36,43,47],readabl:[0,5,10,47],readdunbrackfil:43,reader:[13,15],readi:[2,47],readm:2,real:[5,10,33,45],realli:[1,2,5,8,13],reappear:13,reason:[5,13,28,30,48],rebas:13,rebuild:[2,5],recalcul:23,recent:13,recoginz:46,recogn:[0,10],recognis:[1,5,13],recognit:22,recommend:[2,5,21,31],reconstruct:[],reconstructcbetaposit:18,reconstructcstemoxygen:18,reconstructor:[28,31,32],reconstructoxygenposit:18,reconstructsidechain:[5,31,32],reconstructtest:5,record:[1,31],recreat:13,reduc:[3,21,24,31,36],reduced_scor:33,reducedscor:[],redund:[20,27],ref_backbon:[19,22],ref_fil:5,refactor:3,refer:[1,4,5,15,17,18,19,21,22],referenc:5,refresh:27,regard:[28,39],region:[21,24,25,28,30,31,40,45],regist:[4,5],regress:43,reinterpret_cast:33,reject:[27,28,30],rel:[4,6,7,22,24,28,36],relat:[4,5,7,10,22,24,33,44],relax:[],relev:[2,3,4,21,32],remain:[26,30,31],rememb:[1,5,30],remodel:[27,32],remodel_cutoff:32,remov:[2,3,7,18,21,22,25,27,29,31,32,35,42,44],removecoordin:22,removeterminalgap:31,renumb:[22,31],reorder:31,reordergap:31,replac:[17,18,30,31],replacefrag:18,report:[1,5,31],reportmolprobityscor:29,repositori:[1,4,5,13],repres:[],represent:[18,19,21,22,23,33,34,36,44,47],reproduc:31,request:[22,24,43,47],requir:[0,2,3,5,10,13,17,18,22,23,24,27,28,31,32,33,37,44,45,46,47],reread:22,res_depth:22,res_idx:44,res_index:17,res_indic:[17,21,32],res_list:[17,21,28,32],res_num:17,resembl:13,reserv:8,reset:[7,17,21,28,30,35,44],residu:[],residue_depth:22,residue_index:[40,44,45],residuedepth:22,residuehandl:[6,17,18,22,25,27,28,29,30,44,45,47],residuehandlelist:17,resiz:[18,33],resnum:[17,18,25,27,31,32,35],resnum_on:35,resnum_rang:31,resnum_two:35,resolut:[18,28],resolv:[13,17,28],resolvecystein:39,resort:31,respect:[6,21,31],respons:[5,13],rest:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49],restor:[18,27,30,35],restraint:[22,28],restrict:[5,13,25],restructuredtext:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49],result:[0,2,5,7,21,23,24,27,28,29,30,31,32,39,43,47],resum:11,reus:[31,32],review:13,reviv:13,rewrit:1,richardson:43,ridig:32,right:[1,2,5,10],rigid:[],rigid_frame_cutoff:32,rigidblock:24,rij:38,ring:[],ring_punch_detect:31,rmsd:[18,19,22,24,27,28],rmsd_cutoff:[22,27,28],rmsd_thresh:[22,24],rmsd_threshold:22,rnum:35,robot:28,role:10,root:[2,4,5,13],rosetta:36,rot:32,rot_constructor:42,rot_group:[42,45],rot_lib:45,rot_lib_entri:45,rota_out:29,rotam:[],rotamer_group:[39,41,42],rotamer_id:42,rotamer_librari:32,rotamer_model:32,rotamer_on:39,rotamer_res_indic:32,rotamer_two:39,rotamergraph:[32,41,42,44,48],rotamergroup:44,rotamerid:[],rotamerlib:[32,33,43,45,47],rotamerlibentri:[45,47],rotat:[6,18],rotatearoundomegators:18,rotatearoundphipsitors:18,rotatearoundphitors:18,rotatearoundpsitors:18,rotationaroundlin:6,roughli:20,round:47,routin:[1,15,27],rrm:32,rrmrotam:[39,44],rrmrotamergroup:[39,41,44,45],rst1:4,rst2:4,rst:[4,5,13],rsync:5,rule:[5,6,13],run:[],runact:1,runexitstatustest:1,runmolprob:29,runmolprobityent:29,runnabl:5,runner:1,runtest:[1,5],runtim:[],runtimeerror:[6,7,17,18,21,22,23,25,27,28,30,31,32,34,35,36,39,40,43,44,45,47],runtimeexcept:23,s_id:22,safe:2,said:4,same:[0,1,2,4,5,7,10,11,17,21,22,24,27,28,30,31,32,33,34,35,36,40,44,45,47],samiti:31,sampl:[],sampled_frag:30,samplemontecarlo:30,sampler:[],sampling_start_index:30,sander:22,saniti:2,sanity_check:2,sanner1996:[],sanner:[],satisfi:46,save:[5,13,18,21,22,23,24,27,30,33,34,35,36,47],savebb:22,savecach:24,savefig:23,savepdb:[15,17,18,21,22,26,27,28,30,31,32,42],saveport:[21,22,23,33,34,36,47],sc_data:28,sc_rec:[28,32],sc_rec_test:32,sc_result:28,scale:18,scatter:23,scheme:[1,5,10,17,22,25,30],sci:[28,38],scondari:31,scope:11,score:[],score_contain:27,score_env:[27,30,37],score_threshold:39,score_vari:31,scorecontain:27,scorer:[],scorer_env:[24,27,30],scoring_weight:24,scoringgapextend:[25,31],scoringweight:[24,27,31],scratch:22,scriptnam:8,scriptpath:5,scwrl3:[],scwrl3disulfidscor:[38,39],scwrl3pairwisescor:38,scwrl4:[39,42,44,45],scwrlrotamerconstructor:[42,44,45],seamlessli:13,search:[2,3,5,16,17,22,24,27,29,31,32,36,39,44,45],searchdb:[19,22],second:[5,7,18,21,22,24,27,28,31,34,35,36,38,39],secondari:[3,22,24,36],secondli:5,section:[1,4,14,49],see:[0,1,5,6,7,8,10,13,15,17,20,21,22,23,25,27,29,30,31,33,34,35,36,47],seed:[7,20,23,27,28,30],seem:13,segment:18,select:[3,7,22,24,30,31,32,42],selenium:31,self:[1,5,7,39,44],self_energi:[7,44],send:8,sensibl:31,separ:[1,3,5,7,21,23,31,34,36,39],seq:[10,17,19,22,24,25,27,31,35,37],seq_idx_on:24,seq_idx_two:24,seq_one_idx:24,seq_sep:[34,36],seq_tpl:[27,31],seq_trg:[27,31],seq_two_idx:24,seqid:22,seqr:[0,17,19,22,24,25,27,30,31,32,34,35,36],seqres_str:[17,28,32],seqsim:22,sequenc:[],sequencefromchain:37,sequencehandl:[17,22,24,25,31,35],sequencelist:[17,31,35],sequenceprofil:22,sequenti:[18,31],ser:46,serial:[22,33],serializ:33,serin:46,serv:[1,10,22,24,27,30],servic:13,set:[1,2,4,5,7,8,10,12,13,15,17,18,21,22,24,27,28,29,30,31,32,33,34,35,36,39,42,44,45,47,48],setaa:18,setactivesubrotam:44,setallatomscoringkei:27,setaroundomegators:18,setaroundphipsitors:18,setaroundphitors:18,setaroundpsitors:18,setbackbonescoringkei:27,setbackrub:18,setc:18,setca:18,setcb:18,setcharg:21,setcpuplatformsupport:21,setdefault:21,setdisulfidconnect:21,setenergi:[34,36],setenviron:[17,28,32,35],setepsilon:21,setframeenergi:[42,44],setfudgelj:21,setfudgeqq:21,setinitialenviron:[17,27,28,30,32,35,37],setinternalconnect:21,setinternalenergi:44,setinternalenergyprefactor:44,setinterpol:47,setmass:21,setn:18,setnonbondedcutoff:28,seto:18,setolc:18,setpeptideboundconnect:21,setphitors:18,setpo:17,setpolardirect:44,setprob:44,setpsipredpredict:[31,35,36],setpsitors:18,setresidu:17,setscor:36,setsequ:18,setsequenceoffset:31,setsequenceprofil:31,setsequenceprofilescoreskei:27,setsigma:21,setstemrmsdskei:27,setstructureprofil:22,setstructureprofilescoreskei:27,settemperatur:44,setup:[],setupdefaultallatomscor:[27,31],setupdefaultbackbonescor:[27,31],setupsystem:21,setweight:27,sever:[2,3,5,7,10,20,22,23,24,27,28,32,35,36,39,44,47,48],sg_pos_on:38,sg_pos_two:38,shake:30,shanno:31,shapovalov2011:43,shapovalov:[42,43],shared_ptr:33,shebang:5,sheet:[31,43],shelenkov:38,shell:[1,2,5,8],shift:[18,22,25],shiftctermin:25,shiftextens:25,shorten:31,shorter:31,shortest:27,shortli:5,should:[1,2,4,5,7,8,10,13,15,18,19,22,23,24,27,28,30,31,32,33,35,40,42,44],show:[1,5,10,11,27,30,42,45],showcas:[1,17,21,23],shown:[5,11,31],shrink:18,side:[5,7,31,38,42],sidechain:[],sidechain_pymod:5,sidechain_reconstructor:31,sidechain_rst:5,sidechain_test_data:5,sidechain_test_orig:32,sidechain_test_rec:32,sidechain_unit_test:5,sidechainparticl:[44,45],sidechainreconstructiondata:[],sidechainreconstructor:[],sidenot:[22,32],sig1:47,sig2:47,sig3:47,sig4:47,sigma:21,silent:1,sim:21,similar:[1,2,13,19,22,24,35,36,47],similardihedr:47,similarli:[2,21,31],simpl:[0,6,18,22,30,34,35,36,47],simpler:[21,31],simplest:[5,26],simpli:[17,18,27,28,30,31,45,46,47],simplic:[19,22],simplif:10,simplifi:[3,18,21,22],simul:[7,21,27,28,30],sinc:[1,2,4,5,7,8,13,15,18,21,22,23,24,43,46],singl:[2,4,5,7,17,18,21,22,24,27,28,30,31,32,35,36,40,43,44,45,48],single_chain_structur:[],singleton:21,singular:24,sink:33,sit:5,site:5,size:[5,17,18,22,23,28,30,33,34,35,36],sizeof:33,skip:[0,1,5,13,22,31,45],slide:24,slight:31,slightli:31,slow:33,slower:[15,21,22,23,31,34,36,47],small:[5,22,28,31,32],smaller:[18,22,24,28,36],smallest:[],smallish:[2,5],smart:13,smng:3,smooth:43,smtl:31,soding2005:22,softsampl:30,softwar:5,sol:42,sole:[1,13],soli:20,solut:[5,7,24,27,28,30,31,32,41,42],solv:[7,13,48],solvent:22,solvent_access:[],solvent_accessibility_str:[],solventaccess:22,solver:3,some:[1,2,4,5,10,13,17,19,22,26,29,30,31,32,33,35,37,42,45,47],somedata:33,someth:[1,5,8,13,22],sometim:13,somewher:4,soon:[7,28,36,42,47],sort:[1,4,7,11,27,47],sound:13,sourc:[1,2,4,5,8,10,12,13,22,24,27,28,29,31,32,33,47],source1:[4,13],source2:[4,13],source3:4,source4:4,source_chain_idx:31,source_mhandl:31,space:7,span:31,sparticl:44,spatial:5,spawn:[1,5],spdbv:31,spdbv_style:31,special:[1,2,4,5,21,45,46,47],specif:[1,5,21,22,23,24,27,30,35,37,43,45,47],specifi:[2,4,6,7,18,22,23,27,28,31,32,35,44,47],specimen:8,speed:[3,21,31],spehner:[],spend:5,spent:[11,15],sphere:38,sphinx:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49],spin:7,spit:25,split:37,sport:5,squar:22,src:[5,13],src_db:[],ss_agreement:36,ss_agreement_scor:33,ssagre:22,ssagreementscor:[],sse:2,sstream:33,stabil:22,stabl:[5,13],stack:13,stage:[],stai:[1,5,7,13],standard:[2,5,9,10,13,17,23,33,36,43,47],start:[],start_idx:27,start_resnum:[17,18,22,27,30,31,32,34,35,36],start_resnum_list:32,start_rnum:35,start_temperatur:[7,30],starter:1,startscop:11,stash:[13,27,30,35],state:[1,2,5,17,22,27,30,35,36,39,46,47],staticruntimeprofil:11,statist:[11,20,22],statu:[1,5],std:33,stderr:1,stdout:1,steadili:[7,30],steepest:[28,31],stem:[6,18,21,22,25,27,28,30,31,32],stemcoord:6,stempairorient:6,step:[],stereochem:31,steric:47,still:[5,11,21,22,31,33],stop:[1,5,11,25,28],stop_criterion:28,storabl:22,storag:[5,17,21,34,36],store:[0,1,3,5,6,13,15,17,18,21,22,23,24,25,27,28,30,31,32,33],stori:5,str:[1,8,10,11,12,17,18,21,22,23,24,25,27,28,29,30,31,32,33,34,35,36,44,46,47],str_len:33,straight:13,strategi:47,stream:33,stretch:[17,22,27,31,35,36],strict:13,strictli:3,string:[0,3,8,10,22,23,25,33],stringstream:33,strip:31,struct:[22,33],struct_db:19,structral:[17,35],structur:[],structural_db:27,structuralgap:[25,29],structuralgaplist:[25,31],structure_db:[22,24,27,31,33],structure_db_on:22,structure_db_two:22,structure_dir:22,structure_id:22,structure_path:22,structure_sourc:10,structuredb:[3,20,22,24,27,31,33],structuredbdatatyp:22,structureprofil:22,stuff:[22,34],style:[31,35,36],sub:[5,22,28],sub_frag:18,sub_res_list:22,subdir:5,subfold:5,subject:5,submodul:5,submodule1:13,subpart:24,subrotam:[],subrotameroptim:[32,48],subsequ:[7,18,31],subset:[21,22,24,27,28,31,32],subst:22,subst_matrix:22,substitut:22,substweightmatrix:22,subtre:[4,5],succeed:25,success:[7,8,30],suffici:22,suffix:8,suggest:[5,38],suit:[1,5,22],sulfur:[38,39,44,45],sum:[11,25,31,32,38,39],summari:11,superpos:[18,22,24,27,28,30],superpose_stem:18,superposed_rmsd:[18,27],superposeonto:18,superposit:[3,24,27,30],superpost:24,supervis:1,supos:[],support:[1,5,8,10,15,21,28,31],suppos:13,sure:[2,5,10,13,22],surf:[],surfac:22,surfacehandl:[],surotam:44,surround:[21,22,28,32,34,36],symmetr:[22,35,47],symmetri:[34,36],sync:5,system:[],t_sampler:23,tail:18,tailor:[17,31],take:[5,7,17,22,23,24,27,28,30,31,33,36,39,45,48],taken:[0,17,21,28,31,45],talk:1,target:[0,1,2,4,5,10,15,22,24,26,27,28,30,31,35],target_chain_idx:31,target_mhandl:31,target_pdb:29,target_sequ:22,task:[5,13,28,31,33,35],technic:[],techniqu:7,tell:[1,5,8,10,13,22],temperatur:[7,27,30,44],templat:[0,1,10,15,26,31,33,35],temporari:[22,31],temporarili:13,term:[5,22,44,46,47,48],termin:[1,6,8,15,17,18,21,25,27,28,30,31,32],terminal_len:30,terminal_seqr:30,termini:[25,30,31],terminu:[22,30,31,45],test_:5,test_action_:1,test_action_do_awesom:1,test_action_help:1,test_awesome_featur:5,test_check_io:33,test_cod:5,test_doctest:5,test_foo:4,test_portable_binari:33,test_reconstruct_sidechain:5,test_sidechain_reconstruct:5,test_submodule1:13,test_suite_:4,test_suite_your_module_run:5,test_your_modul:13,testcas:[1,5],testcasenam:5,testexit0:1,testpmexist:1,testreconstruct:5,testutil:[1,5],text:[1,10],than:[4,5,10,11,13,17,18,22,24,27,28,29,31,32,36,39],thei:[2,5,13,17,18,21,22,23,27,28,29,30,31,39,44,45,46,47],them:[4,5,13,18,21,22,23,24,25,27,31,32,35,40],themselv:21,theoret:30,theori:38,therefor:[5,18,20,22,24,28,30,31,47],thereof:21,thi:[0,1,2,3,4,5,7,8,9,10,11,12,13,14,15,17,18,19,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,39,42,44,45,46,47,48,49],thing:[1,2,5,13,22,24,31,47],think:[5,7],thoroughli:13,those:[0,1,2,4,5,7,10,13,21,27,31,32,33,34,36,42],though:[21,31,33],thr:46,thread:[15,20,21,31],three:[1,4,13,17,18,23,27,29,30,36,46],threonin:46,thresh:[18,44,47],threshold:[7,22,24,28,31,32,35,47],through:[1,5,6,18,22,25,31,34,36],throughout:[10,13,20,21],thrown:22,thu:8,tidi:13,tightli:13,time:[1,5,10,11,13,15,24,31],timer:11,tini:[13,31],titl:23,tlc:[17,46],tlc_an:17,tlctorotid:[42,46],tmp_buf:33,todens:18,toentiti:[15,17,18,21,22,28,30,32],toframeresidu:44,togeth:[5,13,22,39],too:[10,13,27,28,31,33,44],tool:[3,4,19,33,37,42],toolbox:13,top:[2,5,11,12,13,28],topic:[1,5,13],topolog:[21,28],torrmrotam:44,torsion:[],torsion_angl:42,torsion_bin:36,torsion_plot:23,torsion_sampl:[18,22,27,28,30,31,33],torsion_sampler_coil:[24,33],torsion_sampler_extend:[24,33],torsion_sampler_hel:33,torsion_sampler_helix:24,torsion_sampler_list:22,torsion_scor:33,torsionprob:22,torsionsampl:[18,20,22,23,24,27,28,30,31,33,36],torsionscor:[],total:[7,11,22,24],touch:[1,5,21,28],toward:[3,5,22,25,28,31,34,36,44,45,48],tpl:[0,26,27,31],tpr:[46,47],trace:31,track:[],tradition:8,trail:0,train:[20,27,31],trajectori:[24,30],tran:[18,46,47],transform:[6,18,24,31,47],translat:[4,5,22,46,47],transomegators:18,treat:[5,21,31,32,33,47],treatment:45,tree:[1,4,5,7,13,41,42],treepack:3,treesolv:[7,32,42],trg:[0,10,27,31],tri:[7,24,25,31,39,47],trick:[1,13],trigger:[1,4,5,43],tripeptid:23,tripl:8,triplet:[],trp:46,trustworthi:13,tryptophan:46,ttccpsivarsnfnvcrlpgtpea:[27,31],ttccpsivarsnfnvcrlpgtpeaicatgytciiipgatcpgdyan:31,ttccpsivarsnfnvcrlpgtpeaicatytgciiipgatcpgdyan:[27,31],tupl:[6,7,8,18,21,22,24,25,29,31,32,39],turn:[0,1,8,11,13,31],tutori:5,tweak:31,twice:[11,35],two:[1,5,7,13,17,18,21,22,24,25,27,28,31,32,33,34,35,36,38,39,42,44,46,47],txt:[1,2,4,5,13],type:[],typedef:33,typenam:33,typic:[18,24,30,42],tyr:[46,47],tyrosin:46,uint32_t:33,uint:33,ultra:22,uncertain:5,uncharg:45,undefin:21,under:[4,5],undergo:[24,28,30,32],underli:[25,27],underscor:1,understand:13,undo:7,unexpect:2,unfavor:[18,28],unfavour:[28,30,39],unfortun:13,unhandl:[0,10],uniform:28,uniqu:[24,27,30,47],unittest:[1,5,13],unix:13,unknown:21,unless:[10,17,18,21,27,34,36],unlik:42,unrecognis:8,unset:[17,21,32],unsupport:[10,33],until:[5,7,28,31,35,45],untouch:18,untrack:1,unus:13,updat:[3,5,13,17,21,25,27,28,31,32,35],updatedistribut:23,updateposit:[21,28],upon:[28,30],urei:21,urey_bradley_angl:21,usabl:13,usag:[0,3,7,10,20,22,27,28,32],use_amber_ff:31,use_bbdep_lib:32,use_frm:32,use_full_extend:31,use_scoring_extend:31,user:[],userlevel:1,usr:[2,5],usual:[1,2,4,5,10,11,13,18,27,31,34],utilis:[5,13],v_size:33,val:[23,46],valid:[0,7,13,18,22,25,30,31,32,43],valin:46,valu:[2,7,8,10,17,18,21,22,24,27,30,31,33,34,35,36,39,42,43,44,46,47,48],valueerror:[24,31],vanish:35,varadarajan:22,vari:[4,33],variabl:[1,2,5,11,15,21,29,31,33],variant:[21,27],variou:[1,2,4,13,26],vec3:[6,17,18,28,29,38,39,44],vec3list:24,vector:[21,23,27,33],verbos:1,veri:[1,5,8,13,21,24,31,33],verif:10,verifi:[1,8,13],version:[2,5,13,22,31,33,43,46],vertex:[],via:[1,5,10,12,21],view:[10,13,23,31,35],virtual:5,visibl:32,visual:15,wai:[1,2,4,5,13,18,19,21,27,36,42,43,46],wait:5,walk:[1,5],want:[1,2,3,5,12,13,18,22,24,27,28,31,35,44,45,47,48],warn:[5,13,31],watch:5,web:[2,5],weight:[3,22,24,27,30,31,34,36],weird:[24,28,42],well:[0,2,4,13,17,23,24,25,27,31,33,36,42,47],went:[0,5],were:[13,22,27,31],wether:7,what:[1,5,8,10,13,19,22,35],when:[1,4,5,7,10,11,17,18,21,22,23,24,25,27,30,31,32,33,35,36,39,43,44,45,47],whenev:[5,17,27,35],where:[0,1,3,4,5,7,8,10,11,13,17,18,21,22,23,27,31,33,34,35,36,43,44,45,47],wherea:22,whether:[3,5,7,8,18,21,22,27,28,30,32,34,35,36,44,45,47],which:[0,1,4,5,6,8,9,10,13,15,17,18,21,22,23,24,25,27,28,29,30,31,32,33,34,35,36,37,44,45,47],whistl:5,whitespac:0,who:[7,42],whole:[1,2,5,13,18,22,31,44],why:[1,13,45],width:[7,33,42],wild:4,window:24,window_length:24,wise:4,wish:[2,14,23,31],with_aa:27,with_db:27,within:[2,3,4,5,11,13,17,21,24,25,29,31,32,34,36,47],without:[1,4,5,8,10,21,25,28,31,35,43],won:[31,32,43,45],word:[4,43],work:[1,2,4,5,11,13,15,21,25,31,33,43],worst:13,would:[1,2,5,8,18,22,23,39,44],wrap:22,wrapper:[1,4,5,12,31],write:[],writebasetyp:33,writemagicnumb:33,writetypes:33,writeversionnumb:33,written:[5,33],wrong:[2,10],xlabel:23,xlim:23,xml:5,xxx:[18,46],xxx_num_atom:17,xxx_num_hydrogen:17,year:1,yet:[22,27],ylabel:23,ylim:23,you:[0,1,2,3,4,5,7,8,10,11,12,13,15,17,18,19,21,22,23,24,26,27,28,30,31,32,33,34,35,36,42,43,44,45,47,48],your:[],your_modul:[5,13],yourself:[2,5,7,13,31,45],zero:[0,22,31,47],zhou2005:22,zhou:22,zip:[22,42]},titles:["ProMod3 Actions","<code class=\"docutils literal\"><span class=\"pre\">test_actions</span></code> - Testing Actions","Building ProMod3","Changelog","ProMod3&#8216;s Share Of CMake","Contributing","Geometry functions","Graph Minimizer","<code class=\"docutils literal\"><span class=\"pre\">helper</span></code> - Shared Functionality For the Everything","<code class=\"docutils literal\"><span class=\"pre\">core</span></code> - ProMod3 Core Functionality","<code class=\"docutils literal\"><span class=\"pre\">pm3argparse</span></code> - Parsing Command Lines","Runtime profiling","<code class=\"docutils literal\"><span class=\"pre\">SetCompoundsChemlib()</span></code>","ProMod3 Setup","Documentation For Developers","Getting Started","Welcome To ProMod3&#8217;s Documentation!","Handling All Atom Positions","Representing Loops","<code class=\"docutils literal\"><span class=\"pre\">loop</span></code> - Loop Handling","Loading Precomputed Objects","Generate <code class=\"docutils literal\"><span class=\"pre\">ost.mol.mm</span></code> systems","Structural Data","Sampling Dihedral Angles","Modelling Algorithms","Handling Gaps","<code class=\"docutils literal\"><span class=\"pre\">modelling</span></code> - Protein Modelling","Handling Loop Candidates","Fitting Loops Into Gaps","Model Checking","Generating Loops De Novo","Modelling Pipeline","Sidechain Reconstruction","Using Binary Files In ProMod3","All Atom Scorers","Backbone Score Environment","Backbone Scorers","<code class=\"docutils literal\"><span class=\"pre\">scoring</span></code> - Loop Scoring","Other Scoring Functions","Disulfid Bond Evaluation","Frame","Rotamer Graph","<code class=\"docutils literal\"><span class=\"pre\">sidechain</span></code> - Sidechain Modelling","Loading Rotamer Libraries","Rotamers","Rotamer Constructor","RotamerID","Rotamer Library","Subrotamer Optimization","Documentation For Users"],titleterms:{"class":[17,18,22,23,25,27,32,34,35,36],"default":31,"function":[4,6,8,9,25,32,35,38],acid:[17,21,23],action:[0,1,4,5],actiontestcas:1,algorithm:24,all:[17,28,34],allatomclashscor:34,allatomenv:17,allatomenvposit:17,allatominteractionscor:34,allatomoverallscor:34,allatompackingscor:34,allatomposit:17,allatomscor:34,amino:[17,21,23],angl:23,api:1,argument:10,atom:[17,28,34],backbon:[28,35,36,47],backbonelist:18,backboneoverallscor:36,backbonescor:36,backbonescoreenv:35,base:[22,34,36],binari:33,block:[24,44],bond:39,branch:13,build:[0,2,31,44],can:46,candid:27,cbetascor:36,cbpackingscor:36,ccd:28,chain:22,changelog:3,check:29,clashscor:36,closer:30,cmake:[1,2,4,13],code:33,command:10,construct:[35,45],constructor:45,contribut:5,conveni:35,cooler:30,core:9,creat:[1,21],data:[22,33],databas:22,defin:[22,23],definit:4,depend:[2,47],detect:29,develop:14,dihedr:23,directori:13,distinguish:17,disulfid:39,document:[4,5,14,16,49],entri:47,environ:35,evalu:39,everyth:8,exampl:[27,33],execut:1,exisit:33,extend:25,featur:[5,22],file:[8,33],find:22,fit:28,forcefield:21,fragment:22,frame:[40,45],from:38,gap:[25,28],gener:[21,30],geometr:22,geometri:6,get:[15,46],git:13,graph:[7,41],group:44,handl:[17,19,25,27,31],have:1,hbondscor:36,header:33,helper:8,hook:13,how:[5,46],indic:16,instal:2,integr:1,introduct:[4,8,10],issu:5,keep:27,kic:28,librari:[43,47],licens:5,line:10,load:[20,43],lookup:21,loop:[18,19,21,27,28,30,37],loopcandid:27,mainten:4,make:[1,2],messag:8,minim:7,model:[0,15,24,26,27,29,31,42],modul:[4,5],mol:21,molprob:29,must:1,non:47,novo:[24,30],object:[20,30,40],optim:48,ost:21,other:38,output:1,own:5,pairwis:35,pairwisescor:36,pars:10,parser:10,parti:5,particl:44,pipelin:[15,31],pm3argpars:10,portabl:33,posit:17,precomput:20,profil:11,promod3:[0,2,4,5,9,13,15,16,33],protein:26,psipredpredict:22,punch:29,quick:5,raw:31,reconstruct:32,reducedscor:36,relax:28,releas:3,repres:18,residu:45,rigid:24,ring:29,rotam:[41,43,44,45,47],rotamerid:46,run:[1,2,15],runtim:11,sampl:23,sampler:[23,30],score:[27,35,37,38],scorer:[5,30,34,36],script:1,scwrl3:38,sequenc:22,setcompoundschemlib:12,setup:13,share:[4,8],sidechain:[32,42],sidechainreconstructiondata:32,sidechainreconstructor:32,smallest:44,ssagreementscor:36,stage:13,start:[5,15],step:31,structur:[13,22],subclass:1,subrotam:48,system:21,tabl:16,test:[1,4,5,8],test_act:1,third:5,torsion:23,torsionscor:36,track:27,triplet:23,type:47,unit:[1,4,5],user:49,welcom:16,write:5,your:5}})
\ No newline at end of file
diff --git a/doc/html/sidechain/disulfid.html b/doc/html/sidechain/disulfid.html
index 2c3f97b64a970412ba1934625659447d32ef65d5..3724f552e9c88343293899410277feb0d2ee412e 100644
--- a/doc/html/sidechain/disulfid.html
+++ b/doc/html/sidechain/disulfid.html
@@ -6,7 +6,7 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
-    <title>Disulfid Bond Evaluation &mdash; ProMod3 1.1.0 documentation</title>
+    <title>Disulfid Bond Evaluation &mdash; ProMod3 1.2.0 documentation</title>
     
     <link rel="stylesheet" href="../_static/alabaster.css" type="text/css" />
     <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
@@ -14,7 +14,7 @@
     <script type="text/javascript">
       var DOCUMENTATION_OPTIONS = {
         URL_ROOT:    '../',
-        VERSION:     '1.1.0',
+        VERSION:     '1.2.0',
         COLLAPSE_INDEX: false,
         FILE_SUFFIX: '.html',
         HAS_SOURCE:  true
@@ -23,16 +23,18 @@
     <script type="text/javascript" src="../_static/jquery.js"></script>
     <script type="text/javascript" src="../_static/underscore.js"></script>
     <script type="text/javascript" src="../_static/doctools.js"></script>
-    <link rel="top" title="ProMod3 1.1.0 documentation" href="../index.html" />
+    <link rel="top" title="ProMod3 1.2.0 documentation" href="../index.html" />
     <link rel="up" title="sidechain - Sidechain Modelling" href="index.html" />
     <link rel="next" title="Loading Rotamer Libraries" href="loading.html" />
     <link rel="prev" title="Rotamer Graph" href="graph.html" />
    
+  <link rel="stylesheet" href="../_static/custom.css" type="text/css" />
   
-  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
 
   </head>
-  <body role="document">  
+  <body role="document">
+  
 
     <div class="document">
       <div class="documentwrapper">
@@ -45,48 +47,26 @@
 a disulfid bond, one would get an unfavourable energy due to &#8220;clashes&#8221; between
 the sulfur atoms. It is possible to improve performance in sidechain
 reconstruction regarding cysteins when finding and separately handle
-disulfid bonds. PROMOD3 implements a simple geometrical description
-<a class="reference internal" href="#canutescu2003b" id="id1">[canutescu2003b]</a> . The paper proposes two rotamers to be in a disulfid
+disulfid bonds. The scoring module implements an empirically derived disulfid
+score (<a class="reference internal" href="../scoring/other_scoring_functions.html#promod3.scoring.SCWRL3DisulfidScore" title="promod3.scoring.SCWRL3DisulfidScore"><code class="xref py py-func docutils literal"><span class="pre">promod3.scoring.SCWRL3DisulfidScore()</span></code></a>) as defined in
+<a class="reference internal" href="../scoring/other_scoring_functions.html#canutescu2003b" id="id1">[canutescu2003b]</a>. The paper proposes two rotamers to be in a disulfid
 bonded state, if the resulting disulfid score plus the self energies of the
 involved rotamers is below 45. If there are several cysteines close together,
 this problem gets another layer of complexity. One has to assure, that
 every cysteine only participates in one disulfid bond but the network
 of disulfid bonds is geometrically optimal. SCWRL4 proposes an approach,
 that has also been implemented here.</p>
-<dl class="method">
-<dt id="promod3.sidechain.DisulfidRawScore">
-<code class="descclassname">promod3.sidechain.</code><code class="descname">DisulfidRawScore</code><span class="sig-paren">(</span><em>ca_pos_one</em>, <em>cb_pos_one</em>, <em>sg_pos_one</em>, <em>ca_pos_two</em>, <em>cb_pos_two</em>, <em>sg_pos_two</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.sidechain.DisulfidRawScore" title="Permalink to this definition">¶</a></dt>
-<dd><p>Evaluates the geometric expression based on the input positions</p>
-<table class="docutils field-list" frame="void" rules="none">
-<col class="field-name" />
-<col class="field-body" />
-<tbody valign="top">
-<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
-<li><strong>ca_pos_one</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.geom.Vec3</span></code></a>) &#8211; The CA position of first rotamer</li>
-<li><strong>cb_pos_one</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.geom.Vec3</span></code></a>) &#8211; The CB position of first rotamer</li>
-<li><strong>sg_pos_one</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.geom.Vec3</span></code></a>) &#8211; The gamma sulfur position of first rotamer</li>
-<li><strong>ca_pos_two</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.geom.Vec3</span></code></a>) &#8211; The CA position of second rotamer</li>
-<li><strong>cb_pos_two</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.geom.Vec3</span></code></a>) &#8211; The CB position of second rotamer</li>
-<li><strong>sg_pos_two</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.geom.Vec3</span></code></a>) &#8211; The gamma sulfur position of second rotamer</li>
-</ul>
-</td>
-</tr>
-<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">The result of the raw score</p>
-</td>
-</tr>
-</tbody>
-</table>
-</dd></dl>
-
 <dl class="method">
 <dt id="promod3.sidechain.DisulfidScore">
 <code class="descclassname">promod3.sidechain.</code><code class="descname">DisulfidScore</code><span class="sig-paren">(</span><em>rotamer_one</em>, <em>rotamer_two</em>, <em>ca_pos_one</em>, <em>cb_pos_one</em>, <em>ca_pos_two</em>, <em>cb_pos_two</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.sidechain.DisulfidScore" title="Permalink to this definition">¶</a></dt>
 <dd><p>Directly extracts the positions of the gamma sulfurs from the rotamers by
-searching for particles with the name &#8220;SG&#8221;. In case of <a class="reference internal" href="rotamer.html#promod3.sidechain.RRMRotamer" title="promod3.sidechain.RRMRotamer"><code class="xref py py-class docutils literal"><span class="pre">RRMRotamer</span></code></a>
-It expects exactly one gamma sulfur per rotamer. In case of
-<a class="reference internal" href="rotamer.html#promod3.sidechain.FRMRotamer" title="promod3.sidechain.FRMRotamer"><code class="xref py py-class docutils literal"><span class="pre">FRMRotamer</span></code></a> there can be an arbitrary number of gamma sulfurs per
-rotamer (at least one), it then evaluates the score for all possible
-combinations of gamma sulfurs and takes the minimum score.
+searching for particles with the name &#8220;SG&#8221;.
+The found positions are then passed to
+<a class="reference internal" href="../scoring/other_scoring_functions.html#promod3.scoring.SCWRL3DisulfidScore" title="promod3.scoring.SCWRL3DisulfidScore"><code class="xref py py-func docutils literal"><span class="pre">promod3.scoring.SCWRL3DisulfidScore()</span></code></a>.
+In case of <a class="reference internal" href="rotamer.html#promod3.sidechain.RRMRotamer" title="promod3.sidechain.RRMRotamer"><code class="xref py py-class docutils literal"><span class="pre">RRMRotamer</span></code></a> it expects exactly one gamma sulfur per
+rotamer. In case of <a class="reference internal" href="rotamer.html#promod3.sidechain.FRMRotamer" title="promod3.sidechain.FRMRotamer"><code class="xref py py-class docutils literal"><span class="pre">FRMRotamer</span></code></a> there can be an arbitrary number
+of gamma sulfurs per rotamer (at least one), it then evaluates the score
+for all possible combinations of gamma sulfurs and takes the minimum score.
 To get a final DisulfidScore, it finally adds the self energies of the
 rotamers to the result of the geometric expression.</p>
 <table class="docutils field-list" frame="void" rules="none">
@@ -96,10 +76,10 @@ rotamers to the result of the geometric expression.</p>
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
 <li><strong>rotamer_one</strong> (<a class="reference internal" href="rotamer.html#promod3.sidechain.RRMRotamer" title="promod3.sidechain.RRMRotamer"><code class="xref py py-class docutils literal"><span class="pre">RRMRotamer</span></code></a> , <a class="reference internal" href="rotamer.html#promod3.sidechain.FRMRotamer" title="promod3.sidechain.FRMRotamer"><code class="xref py py-class docutils literal"><span class="pre">FRMRotamer</span></code></a>) &#8211; First rotamer</li>
 <li><strong>rotamer_two</strong> (<a class="reference internal" href="rotamer.html#promod3.sidechain.RRMRotamer" title="promod3.sidechain.RRMRotamer"><code class="xref py py-class docutils literal"><span class="pre">RRMRotamer</span></code></a> , <a class="reference internal" href="rotamer.html#promod3.sidechain.FRMRotamer" title="promod3.sidechain.FRMRotamer"><code class="xref py py-class docutils literal"><span class="pre">FRMRotamer</span></code></a>) &#8211; Second rotamer</li>
-<li><strong>ca_pos_one</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.geom.Vec3</span></code></a>) &#8211; CA position of first rotamer</li>
-<li><strong>cb_pos_one</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.geom.Vec3</span></code></a>) &#8211; CB position of first rotamer</li>
-<li><strong>ca_pos_two</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.geom.Vec3</span></code></a>) &#8211; CA position of second rotamer</li>
-<li><strong>cb_pos_two</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.geom.Vec3</span></code></a>) &#8211; CB position of second rotamer</li>
+<li><strong>ca_pos_one</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.geom.Vec3</span></code></a>) &#8211; CA position of first rotamer</li>
+<li><strong>cb_pos_one</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.geom.Vec3</span></code></a>) &#8211; CB position of first rotamer</li>
+<li><strong>ca_pos_two</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.geom.Vec3</span></code></a>) &#8211; CA position of second rotamer</li>
+<li><strong>cb_pos_two</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.geom.Vec3</span></code></a>) &#8211; CB position of second rotamer</li>
 </ul>
 </td>
 </tr>
@@ -132,8 +112,8 @@ possible, the one with the optimal sum of scores gets estimated.</p>
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
 <li><strong>rotamer_groups</strong> (<code class="xref py py-class docutils literal"><span class="pre">list</span></code> of
 <a class="reference internal" href="rotamer.html#promod3.sidechain.FRMRotamerGroup" title="promod3.sidechain.FRMRotamerGroup"><code class="xref py py-class docutils literal"><span class="pre">FRMRotamerGroup</span></code></a>/<a class="reference internal" href="rotamer.html#promod3.sidechain.RRMRotamerGroup" title="promod3.sidechain.RRMRotamerGroup"><code class="xref py py-class docutils literal"><span class="pre">RRMRotamerGroup</span></code></a>) &#8211; Every group represents a cysteine</li>
-<li><strong>ca_positions</strong> (<code class="xref py py-class docutils literal"><span class="pre">list</span></code> of <a class="reference external" href="http://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.geom.Vec3</span></code></a>) &#8211; The CA positions of the according rotamers</li>
-<li><strong>cb_positions</strong> (<code class="xref py py-class docutils literal"><span class="pre">list</span></code> of <a class="reference external" href="http://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.geom.Vec3</span></code></a>) &#8211; The CB positions of the according rotamers</li>
+<li><strong>ca_positions</strong> (<code class="xref py py-class docutils literal"><span class="pre">list</span></code> of <a class="reference external" href="https://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.geom.Vec3</span></code></a>) &#8211; The CA positions of the according rotamers</li>
+<li><strong>cb_positions</strong> (<code class="xref py py-class docutils literal"><span class="pre">list</span></code> of <a class="reference external" href="https://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.geom.Vec3</span></code></a>) &#8211; The CB positions of the according rotamers</li>
 <li><strong>score_threshold</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>) &#8211; The score two rotamers must have to be considered
 as a disulfid bond</li>
 <li><strong>optimize_subrotamers</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#bool" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">bool</span></code></a>) &#8211; If set to true and the input consists of flexible
@@ -157,12 +137,6 @@ describe the optimal rotamers in the according rotamer groups.</p>
 </table>
 </dd></dl>
 
-<table class="docutils citation" frame="void" id="canutescu2003b" rules="none">
-<colgroup><col class="label" /><col /></colgroup>
-<tbody valign="top">
-<tr><td class="label"><a class="fn-backref" href="#id1">[canutescu2003b]</a></td><td>Canutescu AA, Shelenkov AA, Dunbrack RL Jr. (2003). A graph-theory algorithm for rapid protein side-chain prediction. Protein Sci (2003).</td></tr>
-</tbody>
-</table>
 </div>
 
 
@@ -198,9 +172,6 @@ describe the optimal rotamers in the according rotamer groups.</p>
       <input type="hidden" name="check_keywords" value="yes" />
       <input type="hidden" name="area" value="default" />
     </form>
-    <p class="searchtip" style="font-size: 90%">
-    Enter search terms or a module, class or function name.
-    </p>
 </div>
 <script type="text/javascript">$('#searchbox').show(0);</script>
         </div>
@@ -208,11 +179,11 @@ describe the optimal rotamers in the according rotamer groups.</p>
       <div class="clearer"></div>
     </div>
     <div class="footer">
-      &copy;2017, ProMod3 authors.
+      &copy;2018, ProMod3 authors.
       
       |
-      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a>
-      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.6</a>
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.4.1</a>
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
       
       |
       <a href="../_sources/sidechain/disulfid.txt"
diff --git a/doc/html/sidechain/frame.html b/doc/html/sidechain/frame.html
index 776c8e4fb4945ec18bc53f5325542164e279f4ef..9230a415148eeae3d628663743913f9c46ab6705 100644
--- a/doc/html/sidechain/frame.html
+++ b/doc/html/sidechain/frame.html
@@ -6,7 +6,7 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
-    <title>Frame &mdash; ProMod3 1.1.0 documentation</title>
+    <title>Frame &mdash; ProMod3 1.2.0 documentation</title>
     
     <link rel="stylesheet" href="../_static/alabaster.css" type="text/css" />
     <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
@@ -14,7 +14,7 @@
     <script type="text/javascript">
       var DOCUMENTATION_OPTIONS = {
         URL_ROOT:    '../',
-        VERSION:     '1.1.0',
+        VERSION:     '1.2.0',
         COLLAPSE_INDEX: false,
         FILE_SUFFIX: '.html',
         HAS_SOURCE:  true
@@ -23,16 +23,18 @@
     <script type="text/javascript" src="../_static/jquery.js"></script>
     <script type="text/javascript" src="../_static/underscore.js"></script>
     <script type="text/javascript" src="../_static/doctools.js"></script>
-    <link rel="top" title="ProMod3 1.1.0 documentation" href="../index.html" />
+    <link rel="top" title="ProMod3 1.2.0 documentation" href="../index.html" />
     <link rel="up" title="sidechain - Sidechain Modelling" href="index.html" />
     <link rel="next" title="Rotamer Library" href="rotamer_lib.html" />
     <link rel="prev" title="Rotamers" href="rotamer.html" />
    
+  <link rel="stylesheet" href="../_static/custom.css" type="text/css" />
   
-  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
 
   </head>
-  <body role="document">  
+  <body role="document">
+  
 
     <div class="document">
       <div class="documentwrapper">
@@ -159,9 +161,6 @@ can be passed to rotamer groups for calculating frame energies.</p>
       <input type="hidden" name="check_keywords" value="yes" />
       <input type="hidden" name="area" value="default" />
     </form>
-    <p class="searchtip" style="font-size: 90%">
-    Enter search terms or a module, class or function name.
-    </p>
 </div>
 <script type="text/javascript">$('#searchbox').show(0);</script>
         </div>
@@ -169,11 +168,11 @@ can be passed to rotamer groups for calculating frame energies.</p>
       <div class="clearer"></div>
     </div>
     <div class="footer">
-      &copy;2017, ProMod3 authors.
+      &copy;2018, ProMod3 authors.
       
       |
-      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a>
-      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.6</a>
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.4.1</a>
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
       
       |
       <a href="../_sources/sidechain/frame.txt"
diff --git a/doc/html/sidechain/graph.html b/doc/html/sidechain/graph.html
index 2a2e6c16b802c1cfb21a264e3725e8d1d46514ee..e547f6f72ad4a595a7f20713cf3469da52324898 100644
--- a/doc/html/sidechain/graph.html
+++ b/doc/html/sidechain/graph.html
@@ -6,7 +6,7 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
-    <title>Rotamer Graph &mdash; ProMod3 1.1.0 documentation</title>
+    <title>Rotamer Graph &mdash; ProMod3 1.2.0 documentation</title>
     
     <link rel="stylesheet" href="../_static/alabaster.css" type="text/css" />
     <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
@@ -14,7 +14,7 @@
     <script type="text/javascript">
       var DOCUMENTATION_OPTIONS = {
         URL_ROOT:    '../',
-        VERSION:     '1.1.0',
+        VERSION:     '1.2.0',
         COLLAPSE_INDEX: false,
         FILE_SUFFIX: '.html',
         HAS_SOURCE:  true
@@ -23,16 +23,18 @@
     <script type="text/javascript" src="../_static/jquery.js"></script>
     <script type="text/javascript" src="../_static/underscore.js"></script>
     <script type="text/javascript" src="../_static/doctools.js"></script>
-    <link rel="top" title="ProMod3 1.1.0 documentation" href="../index.html" />
+    <link rel="top" title="ProMod3 1.2.0 documentation" href="../index.html" />
     <link rel="up" title="sidechain - Sidechain Modelling" href="index.html" />
     <link rel="next" title="Disulfid Bond Evaluation" href="disulfid.html" />
     <link rel="prev" title="Rotamer Constructor" href="rotamer_constructor.html" />
    
+  <link rel="stylesheet" href="../_static/custom.css" type="text/css" />
   
-  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
 
   </head>
-  <body role="document">  
+  <body role="document">
+  
 
     <div class="document">
       <div class="documentwrapper">
@@ -44,15 +46,15 @@
 <p>Once having a frame representing the rigid parts, the internal energies in
 rotamer groups can be calculated. To come to a final solution of the sidechain
 modelling problem, the pairwise energies also have to be evaluated and an
-overall solution has to be found. PROMOD3 implements an interaction graph that
-takes a list of rotamer groups, calculates the pairwise energies, does edge
-decomposition and dead end elimination. Solutions can finally be found
-using Tree decomposition, AStar or Monte Carlo approaches.</p>
+overall solution has to be found. PROMOD3 implements a
+<a class="reference internal" href="../core/graph_minimizer.html#promod3.core.GraphMinimizer" title="promod3.core.GraphMinimizer"><code class="xref py py-class docutils literal"><span class="pre">promod3.core.GraphMinimizer</span></code></a> that allows to find solutions using
+tree decomposition, A* and Monte Carlo algorithms.</p>
 <dl class="class">
 <dt id="promod3.sidechain.RotamerGraph">
 <em class="property">class </em><code class="descclassname">promod3.sidechain.</code><code class="descname">RotamerGraph</code><a class="headerlink" href="#promod3.sidechain.RotamerGraph" title="Permalink to this definition">¶</a></dt>
-<dd><p>The Graph object has no constructor exported to python. It is meant to be
-constructed using the static create functions.</p>
+<dd><p>The <a class="reference internal" href="#promod3.sidechain.RotamerGraph" title="promod3.sidechain.RotamerGraph"><code class="xref py py-class docutils literal"><span class="pre">RotamerGraph</span></code></a> objects inherits from
+<a class="reference internal" href="../core/graph_minimizer.html#promod3.core.GraphMinimizer" title="promod3.core.GraphMinimizer"><code class="xref py py-class docutils literal"><span class="pre">promod3.core.GraphMinimizer</span></code></a> and extends the minimizer by static
+initialization functions.</p>
 <dl class="staticmethod">
 <dt id="promod3.sidechain.RotamerGraph.CreateFromRRMList">
 <em class="property">static </em><code class="descname">CreateFromRRMList</code><span class="sig-paren">(</span><em>rotamer_groups</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.sidechain.RotamerGraph.CreateFromRRMList" title="Permalink to this definition">¶</a></dt>
@@ -73,389 +75,6 @@ conformations for every amino acid position.</td>
 </table>
 </dd></dl>
 
-<dl class="method">
-<dt id="promod3.sidechain.RotamerGraph.Prune">
-<code class="descname">Prune</code><span class="sig-paren">(</span><em>epsilon</em><span class="optional">[</span>, <em>e_cut=0.0</em>, <em>consider_all_nodes=False</em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#promod3.sidechain.RotamerGraph.Prune" title="Permalink to this definition">¶</a></dt>
-<dd><p>Performs edge decomposition followed by dead end elimination in an
-iterative manner until no changes can be observed anymore given
-<strong>epsilon</strong>.</p>
-<table class="docutils field-list" frame="void" rules="none">
-<col class="field-name" />
-<col class="field-body" />
-<tbody valign="top">
-<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
-<li><strong>epsilon</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>) &#8211; The energy threshold to perform edge decomposition.</li>
-<li><strong>e_cut</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>) &#8211; Parameter to control dead end elimination. If set to
-0.0, the default goldstein criterion is applied =&gt;
-the rotamer gets removed if it&#8217;s dominated by all other
-rotamers in the same node. If you increase this value,
-a rotamer must be dominated by at least this <strong>e_cut</strong>.</li>
-<li><strong>consider_all_nodes</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#bool" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">bool</span></code></a>) &#8211; Flag, wether the dead end elimination should be
-applied to all nodes, or only those who are
-connected with an edge removed by edge
-decomposition. This is useful if already a Prune
-operation has been performed =&gt; only those nodes
-connected to a removed edge have the chance for
-successful dead end elimination.</li>
-</ul>
-</td>
-</tr>
-</tbody>
-</table>
-</dd></dl>
-
-<dl class="method">
-<dt id="promod3.sidechain.RotamerGraph.ApplyDEE">
-<code class="descname">ApplyDEE</code><span class="sig-paren">(</span><em>node_idx</em><span class="optional">[</span>, <em>e_cut=0.0</em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#promod3.sidechain.RotamerGraph.ApplyDEE" title="Permalink to this definition">¶</a></dt>
-<dd><p>Applies dead end elimination on one particular node and potentially
-deactivates certain rotamers.</p>
-<table class="docutils field-list" frame="void" rules="none">
-<col class="field-name" />
-<col class="field-body" />
-<tbody valign="top">
-<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
-<li><strong>node_idx</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Node to apply dead end elimination</li>
-<li><strong>e_cut</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>) &#8211; If set to
-0.0, the default goldstein criterion is applied =&gt;
-the rotamer gets removed if it&#8217;s dominated by all other
-rotamers in the same node. If you increase this value,
-a rotamer must be dominated by at least this <strong>e_cut</strong>.</li>
-</ul>
-</td>
-</tr>
-<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><a class="reference external" href="https://docs.python.org/2.7/library/functions.html#bool" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">bool</span></code></a> whether any rotamer has been deactivated.</p>
-</td>
-</tr>
-</tbody>
-</table>
-</dd></dl>
-
-<dl class="method">
-<dt id="promod3.sidechain.RotamerGraph.ApplyEdgeDecomposition">
-<code class="descname">ApplyEdgeDecomposition</code><span class="sig-paren">(</span><em>edge_idx</em>, <em>epsilon</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.sidechain.RotamerGraph.ApplyEdgeDecomposition" title="Permalink to this definition">¶</a></dt>
-<dd><p>Applies edge decomposition on one particular edge and potentially
-deactivates it.</p>
-<table class="docutils field-list" frame="void" rules="none">
-<col class="field-name" />
-<col class="field-body" />
-<tbody valign="top">
-<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
-<li><strong>edge_idx</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Edge to decompose.
-the idx relates to the list you get back
-when calling the <a class="reference internal" href="#promod3.sidechain.RotamerGraph.GetEdges" title="promod3.sidechain.RotamerGraph.GetEdges"><code class="xref py py-meth docutils literal"><span class="pre">GetEdges()</span></code></a> function.</li>
-<li><strong>epsilon</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>) &#8211; The energy threshold to perform edge decomposition.</li>
-</ul>
-</td>
-</tr>
-<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><a class="reference external" href="https://docs.python.org/2.7/library/functions.html#bool" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">bool</span></code></a> whether the edge has been decomposed and
-deactivated</p>
-</td>
-</tr>
-</tbody>
-</table>
-</dd></dl>
-
-<dl class="method">
-<dt id="promod3.sidechain.RotamerGraph.Reset">
-<code class="descname">Reset</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#promod3.sidechain.RotamerGraph.Reset" title="Permalink to this definition">¶</a></dt>
-<dd><p>Resets the graph by undoing any pruning operation (DEE and edge decomposition)</p>
-</dd></dl>
-
-<dl class="method">
-<dt id="promod3.sidechain.RotamerGraph.TreeSolve">
-<code class="descname">TreeSolve</code><span class="sig-paren">(</span><span class="optional">[</span><em>max_complexity=inf</em>, <em>initial_epsilon=0.02</em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#promod3.sidechain.RotamerGraph.TreeSolve" title="Permalink to this definition">¶</a></dt>
-<dd><p>The method solves a rotamer graph using a minimal width tree decomposition
-approach in an iterative manner. In every iteration, the algorithm performs
-a pruning step (DEE / Edge Decomposition) and subsequently tries to solve
-each connected component in the graph separately.
-If the number of possible enumerations in the tree constructetd from a
-particular connected component is is larger <strong>max_complexity</strong>,
-this component is solved in a later iteration. The algorithm iterates until
-all connected components are solved and steadily increases the epsilon value
-resulting in a more and more agressive edge decomposition. This function
-assumes all self energies of the rotamers to be calculated and properly set!</p>
-<table class="docutils field-list" frame="void" rules="none">
-<col class="field-name" />
-<col class="field-body" />
-<tbody valign="top">
-<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
-<li><strong>max_complexity</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Max number of possible permutations, that have to
-be enumerated in the resulting tree after tree
-decomposition.</li>
-<li><strong>initial_epsilon</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>) &#8211; The initial energy threshold to perform edge
-decomposition.</li>
-</ul>
-</td>
-</tr>
-<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A tuple with the first element being a list of indices
-representing the single rotamers minimizing
-the overall energy functions from every rotamer group.
-The second element is the according energy value.</p>
-</td>
-</tr>
-</tbody>
-</table>
-</dd></dl>
-
-<dl class="method">
-<dt id="promod3.sidechain.RotamerGraph.AStarSolve">
-<code class="descname">AStarSolve</code><span class="sig-paren">(</span><em>e_thresh</em><span class="optional">[</span>, <em>max_n=100</em>, <em>max_visited_nodes=100000000</em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#promod3.sidechain.RotamerGraph.AStarSolve" title="Permalink to this definition">¶</a></dt>
-<dd><p>The method solves a rotamer graph using the A* algorithm. Besides creating
-minimal energy solution, the function produces a maximum of <strong>max_n</strong>
-solutions sorted by energy. It aborts as soon as it sees the first solution
-with an energy difference of <strong>e_thresh</strong> to the optimal solution or hits
-<strong>max_n</strong>. If you&#8217;re only interested in the optimal solution you should use
-the TreeSolve function since it&#8217;s much faster and uses less memory.
-There is no automatic pruning of the graph using DEE or edge decomposition,
-so you have to do it by yourself, otherwise you&#8217;ll have a looooooong
-runtime or even hit the <strong>max_visited_nodes</strong> parameter that caps the memory
-usage.
-To have a valid solution you have to take care that you set the <strong>e_cut</strong>
-parameter in the pruning function to <strong>e_tresh</strong>.
-This function assumes all self energies of the rotamers to be calculated
-and properly set!</p>
-<table class="docutils field-list" frame="void" rules="none">
-<col class="field-name" />
-<col class="field-body" />
-<tbody valign="top">
-<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
-<li><strong>e_thresh</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>) &#8211; Maximal energy difference of a solution to the
-optimal solution to be considered.</li>
-<li><strong>max_n</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; The maximum number of solutions that will be generated.</li>
-<li><strong>max_visited_nodes</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Caps the memory usage of the algorithm. Besides
-The memory used for pairwise energies and self
-energies, the algorithm uses about
-<strong>max_visited_nodes</strong> * 20 bytes.</li>
-</ul>
-</td>
-</tr>
-<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A tuple with the first element being a list of
-solutions with indices representing the single rotamers
-selected for that solution. The second element is a list
-of energies for the according solutions.</p>
-</td>
-</tr>
-</tbody>
-</table>
-</dd></dl>
-
-<dl class="method">
-<dt id="promod3.sidechain.RotamerGraph.MCSolve">
-<code class="descname">MCSolve</code><span class="sig-paren">(</span><span class="optional">[</span><em>n=100</em>, <em>mc_steps=100000</em>, <em>start_temperature=1000.0</em>, <em>change_frequency=1000</em>, <em>cooling_factor=0.9</em>, <em>seed=0</em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#promod3.sidechain.RotamerGraph.MCSolve" title="Permalink to this definition">¶</a></dt>
-<dd><p>Does a total of <strong>n</strong> Monte Carlo runs to find low energy solutions
-of the RotamerGraph. Each run starts with a random rotamer
-configuration. At each of the <strong>mc_steps</strong> steps, a random location and
-a random rotamer at that location is selected and an energy difference
-of that random selection relative to the current configuration is
-estimated. If the difference in energy is negative, the step is
-accepted. If not, the step is accepted with a probability given by
-the temperature dependent Metropolis criterion (exp(-ediff/T)).
-The temperature for every run starts with <strong>start_temperature</strong>
-and is multiplied every <strong>change_frequency</strong> steps with <strong>cooling_factor</strong>
-to achieve a simulated annealing effect.
-There is no automatic pruning of the graph using DEE or edge decomposition,
-you have to do that by yourself.
-This function assumes all self energies of the rotamers to be calculated
-and properly set!</p>
-<table class="docutils field-list" frame="void" rules="none">
-<col class="field-name" />
-<col class="field-body" />
-<tbody valign="top">
-<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
-<li><strong>n</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Number of Monte Carlo runs</li>
-<li><strong>mc_steps</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Number of Monte Carlo steps per run</li>
-<li><strong>start_temperature</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>) &#8211; Start temperature for the temperature dependent
-Metropolis criterion</li>
-<li><strong>change_frequency</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Number of steps the temperature stays the same</li>
-<li><strong>cooling_factor</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>) &#8211; Factor to multiply temperature each
-<strong>change_frequency</strong> steps</li>
-<li><strong>seed</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>) &#8211; Seed for random number generator</li>
-</ul>
-</td>
-</tr>
-<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A tuple with the first element being a list of
-solutions with indices representing the single rotamers
-selected for that solution. The second element is a list
-of energies for the according solutions.</p>
-</td>
-</tr>
-</tbody>
-</table>
-</dd></dl>
-
-<dl class="method">
-<dt id="promod3.sidechain.RotamerGraph.GetNumNodes">
-<code class="descname">GetNumNodes</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#promod3.sidechain.RotamerGraph.GetNumNodes" title="Permalink to this definition">¶</a></dt>
-<dd><table class="docutils field-list" frame="void" rules="none">
-<col class="field-name" />
-<col class="field-body" />
-<tbody valign="top">
-<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The number of nodes in the graph
-=&gt; every RotamerGroup is a node</td>
-</tr>
-</tbody>
-</table>
-</dd></dl>
-
-<dl class="method">
-<dt id="promod3.sidechain.RotamerGraph.GetNumEdges">
-<code class="descname">GetNumEdges</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#promod3.sidechain.RotamerGraph.GetNumEdges" title="Permalink to this definition">¶</a></dt>
-<dd><table class="docutils field-list" frame="void" rules="none">
-<col class="field-name" />
-<col class="field-body" />
-<tbody valign="top">
-<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The number of edges in the graph, representing
-connections between nodes with at least one
-nonzero interaction</td>
-</tr>
-</tbody>
-</table>
-</dd></dl>
-
-<dl class="method">
-<dt id="promod3.sidechain.RotamerGraph.GetNumActiveNodes">
-<code class="descname">GetNumActiveNodes</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#promod3.sidechain.RotamerGraph.GetNumActiveNodes" title="Permalink to this definition">¶</a></dt>
-<dd><table class="docutils field-list" frame="void" rules="none">
-<col class="field-name" />
-<col class="field-body" />
-<tbody valign="top">
-<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The number of nodes having more than one active rotamer,
-even after performing pruning operations</td>
-</tr>
-</tbody>
-</table>
-</dd></dl>
-
-<dl class="method">
-<dt id="promod3.sidechain.RotamerGraph.GetNumActiveEdges">
-<code class="descname">GetNumActiveEdges</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#promod3.sidechain.RotamerGraph.GetNumActiveEdges" title="Permalink to this definition">¶</a></dt>
-<dd><table class="docutils field-list" frame="void" rules="none">
-<col class="field-name" />
-<col class="field-body" />
-<tbody valign="top">
-<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The number of edges representing nonzero interactions,
-even after performing pruning operations</td>
-</tr>
-</tbody>
-</table>
-</dd></dl>
-
-<dl class="method">
-<dt id="promod3.sidechain.RotamerGraph.GetNumRotamers">
-<code class="descname">GetNumRotamers</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#promod3.sidechain.RotamerGraph.GetNumRotamers" title="Permalink to this definition">¶</a></dt>
-<dd><table class="docutils field-list" frame="void" rules="none">
-<col class="field-name" />
-<col class="field-body" />
-<tbody valign="top">
-<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The total number of rotamers in the graph</td>
-</tr>
-</tbody>
-</table>
-</dd></dl>
-
-<dl class="method">
-<dt id="promod3.sidechain.RotamerGraph.GetNumActiveRotamers">
-<code class="descname">GetNumActiveRotamers</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#promod3.sidechain.RotamerGraph.GetNumActiveRotamers" title="Permalink to this definition">¶</a></dt>
-<dd><table class="docutils field-list" frame="void" rules="none">
-<col class="field-name" />
-<col class="field-body" />
-<tbody valign="top">
-<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The total number of active rotamers (Total number of
-rotamers minus those that have been deactivated by DEE)</td>
-</tr>
-</tbody>
-</table>
-</dd></dl>
-
-<dl class="method">
-<dt id="promod3.sidechain.RotamerGraph.GetEdges">
-<code class="descname">GetEdges</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#promod3.sidechain.RotamerGraph.GetEdges" title="Permalink to this definition">¶</a></dt>
-<dd><table class="docutils field-list" frame="void" rules="none">
-<col class="field-name" />
-<col class="field-body" />
-<tbody valign="top">
-<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">A list of tuples describing the edges
-connecting nodes with nonzero pairwise interactions</td>
-</tr>
-</tbody>
-</table>
-</dd></dl>
-
-<dl class="method">
-<dt id="promod3.sidechain.RotamerGraph.GetActiveEdges">
-<code class="descname">GetActiveEdges</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#promod3.sidechain.RotamerGraph.GetActiveEdges" title="Permalink to this definition">¶</a></dt>
-<dd><table class="docutils field-list" frame="void" rules="none">
-<col class="field-name" />
-<col class="field-body" />
-<tbody valign="top">
-<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">A <code class="xref py py-class docutils literal"><span class="pre">list</span></code> of <code class="xref py py-class docutils literal"><span class="pre">tuples</span></code> describing the edges
-connecting nodes with nonzero pairwise interactions
-(All edges minus those that have been deactived by edge
-decomposition)</td>
-</tr>
-</tbody>
-</table>
-</dd></dl>
-
-<dl class="method">
-<dt id="promod3.sidechain.RotamerGraph.GetActiveRotamers">
-<code class="descname">GetActiveRotamers</code><span class="sig-paren">(</span><em>node_idx</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.sidechain.RotamerGraph.GetActiveRotamers" title="Permalink to this definition">¶</a></dt>
-<dd><table class="docutils field-list" frame="void" rules="none">
-<col class="field-name" />
-<col class="field-body" />
-<tbody valign="top">
-<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>node_idx</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Specifies node from which the active rotamers should be
-extracted</td>
-</tr>
-<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">list of the rotamers that are active
-in specified node (all rotamers minus those that have
-been deactivated using DEE)</td>
-</tr>
-</tbody>
-</table>
-</dd></dl>
-
-<dl class="method">
-<dt id="promod3.sidechain.RotamerGraph.GetSelfEnergies">
-<code class="descname">GetSelfEnergies</code><span class="sig-paren">(</span><em>node_idx</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.sidechain.RotamerGraph.GetSelfEnergies" title="Permalink to this definition">¶</a></dt>
-<dd><table class="docutils field-list" frame="void" rules="none">
-<col class="field-name" />
-<col class="field-body" />
-<tbody valign="top">
-<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>node_idx</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Specifies node from which the self energies should be
-extracted</td>
-</tr>
-<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">list of self energies for all rotamers in
-specified node as they are fed into the solving
-algorithms. Note, that they might slightly differ
-from the original self energies in the input rotamers
-because of approximations introduced in edge
-decomposition.</td>
-</tr>
-</tbody>
-</table>
-</dd></dl>
-
-<dl class="method">
-<dt id="promod3.sidechain.RotamerGraph.GetPairwiseEnergies">
-<code class="descname">GetPairwiseEnergies</code><span class="sig-paren">(</span><em>edge_idx</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.sidechain.RotamerGraph.GetPairwiseEnergies" title="Permalink to this definition">¶</a></dt>
-<dd><table class="docutils field-list" frame="void" rules="none">
-<col class="field-name" />
-<col class="field-body" />
-<tbody valign="top">
-<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>edge_idx</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Specifies edge from which the pairwise energies should
-be extracted, the idx relates to the list you get back
-when calling the <a class="reference internal" href="#promod3.sidechain.RotamerGraph.GetEdges" title="promod3.sidechain.RotamerGraph.GetEdges"><code class="xref py py-meth docutils literal"><span class="pre">GetEdges()</span></code></a> function.</td>
-</tr>
-<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">list of list where you can extract
-the energy of rotamer i in the first node in the
-edge with rotamer j in the second node in the edge
-with: e = pairwise_energies[i][j]</td>
-</tr>
-</tbody>
-</table>
-</dd></dl>
-
 </dd></dl>
 
 </div>
@@ -493,9 +112,6 @@ with: e = pairwise_energies[i][j]</td>
       <input type="hidden" name="check_keywords" value="yes" />
       <input type="hidden" name="area" value="default" />
     </form>
-    <p class="searchtip" style="font-size: 90%">
-    Enter search terms or a module, class or function name.
-    </p>
 </div>
 <script type="text/javascript">$('#searchbox').show(0);</script>
         </div>
@@ -503,11 +119,11 @@ with: e = pairwise_energies[i][j]</td>
       <div class="clearer"></div>
     </div>
     <div class="footer">
-      &copy;2017, ProMod3 authors.
+      &copy;2018, ProMod3 authors.
       
       |
-      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a>
-      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.6</a>
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.4.1</a>
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
       
       |
       <a href="../_sources/sidechain/graph.txt"
diff --git a/doc/html/sidechain/index.html b/doc/html/sidechain/index.html
index 496c0b28c9766230aee6cad7725ffa469530248b..3af49da0fb86f519b9e07bbc4fd4a050449415a8 100644
--- a/doc/html/sidechain/index.html
+++ b/doc/html/sidechain/index.html
@@ -6,7 +6,7 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
-    <title>sidechain - Sidechain Modelling &mdash; ProMod3 1.1.0 documentation</title>
+    <title>sidechain - Sidechain Modelling &mdash; ProMod3 1.2.0 documentation</title>
     
     <link rel="stylesheet" href="../_static/alabaster.css" type="text/css" />
     <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
@@ -14,7 +14,7 @@
     <script type="text/javascript">
       var DOCUMENTATION_OPTIONS = {
         URL_ROOT:    '../',
-        VERSION:     '1.1.0',
+        VERSION:     '1.2.0',
         COLLAPSE_INDEX: false,
         FILE_SUFFIX: '.html',
         HAS_SOURCE:  true
@@ -23,16 +23,18 @@
     <script type="text/javascript" src="../_static/jquery.js"></script>
     <script type="text/javascript" src="../_static/underscore.js"></script>
     <script type="text/javascript" src="../_static/doctools.js"></script>
-    <link rel="top" title="ProMod3 1.1.0 documentation" href="../index.html" />
+    <link rel="top" title="ProMod3 1.2.0 documentation" href="../index.html" />
     <link rel="up" title="Documentation For Users" href="../users.html" />
     <link rel="next" title="RotamerID" href="rotamer_id.html" />
     <link rel="prev" title="Modelling Algorithms" href="../modelling/algorithms.html" />
    
+  <link rel="stylesheet" href="../_static/custom.css" type="text/css" />
   
-  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
 
   </head>
-  <body role="document">  
+  <body role="document">
+  
 
     <div class="document">
       <div class="documentwrapper">
@@ -51,21 +53,21 @@ algorithm using the functionality in the module. Note, that this code will crash
 as soon as you have structures containing all the weirdness the PDB throws at
 us. In this case, you should use the full fletched sidechain reconstruction
 pipelines available in the modelling module.</p>
-<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">ost</span> <span class="kn">import</span> <span class="n">io</span><span class="p">,</span><span class="n">mol</span>
-<span class="kn">from</span> <span class="nn">promod3</span> <span class="kn">import</span> <span class="n">sidechain</span>
+<div class="highlight-default"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">ost</span> <span class="k">import</span> <span class="n">io</span><span class="p">,</span><span class="n">mol</span>
+<span class="kn">from</span> <span class="nn">promod3</span> <span class="k">import</span> <span class="n">sidechain</span>
 
-<span class="c"># load a protein</span>
-<span class="n">prot</span> <span class="o">=</span> <span class="n">io</span><span class="o">.</span><span class="n">LoadPDB</span><span class="p">(</span><span class="s">&#39;data/1CRN.pdb&#39;</span><span class="p">)</span>
-<span class="c"># load rotamer library</span>
+<span class="c1"># load a protein</span>
+<span class="n">prot</span> <span class="o">=</span> <span class="n">io</span><span class="o">.</span><span class="n">LoadPDB</span><span class="p">(</span><span class="s1">&#39;data/1CRN.pdb&#39;</span><span class="p">)</span>
+<span class="c1"># load rotamer library</span>
 <span class="n">library</span> <span class="o">=</span> <span class="n">sidechain</span><span class="o">.</span><span class="n">LoadDunbrackLib</span><span class="p">()</span>
-<span class="c"># we need a rotamer constructor to create any rotamers or </span>
-<span class="c"># frame residues</span>
-<span class="n">rot_constructor</span> <span class="o">=</span> <span class="n">sidechain</span><span class="o">.</span><span class="n">SCWRLRotamerConstructor</span><span class="p">()</span>
+<span class="c1"># we need a rotamer constructor to create any rotamers or </span>
+<span class="c1"># frame residues </span>
+<span class="n">rot_constructor</span> <span class="o">=</span> <span class="n">sidechain</span><span class="o">.</span><span class="n">SCWRLRotamerConstructor</span><span class="p">(</span><span class="kc">False</span><span class="p">)</span>
 
-<span class="c"># create new entity from protein only containing the amino acids</span>
-<span class="n">prot</span> <span class="o">=</span> <span class="n">mol</span><span class="o">.</span><span class="n">CreateEntityFromView</span><span class="p">(</span><span class="n">prot</span><span class="o">.</span><span class="n">Select</span><span class="p">(</span><span class="s">&quot;peptide=true&quot;</span><span class="p">),</span> <span class="bp">True</span><span class="p">)</span>
+<span class="c1"># create new entity from protein only containing the amino acids</span>
+<span class="n">prot</span> <span class="o">=</span> <span class="n">mol</span><span class="o">.</span><span class="n">CreateEntityFromView</span><span class="p">(</span><span class="n">prot</span><span class="o">.</span><span class="n">Select</span><span class="p">(</span><span class="s2">&quot;peptide=true&quot;</span><span class="p">),</span> <span class="kc">True</span><span class="p">)</span>
 
-<span class="c"># gather some data, the rotamer ids and backbone torsion angles</span>
+<span class="c1"># gather some data, the rotamer ids and backbone torsion angles</span>
 <span class="n">torsion_angles</span> <span class="o">=</span> <span class="nb">list</span><span class="p">()</span>
 <span class="n">rotamer_ids</span> <span class="o">=</span> <span class="nb">list</span><span class="p">()</span>
 
@@ -74,7 +76,7 @@ pipelines available in the modelling module.</p>
     <span class="n">phi_handle</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">GetPhiTorsion</span><span class="p">()</span>
     <span class="n">psi_handle</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">GetPsiTorsion</span><span class="p">()</span>
 
-    <span class="c"># set typical default values for an alpha helix...</span>
+    <span class="c1"># set typical default values for an alpha helix...</span>
     <span class="n">phi</span> <span class="o">=</span> <span class="o">-</span><span class="mf">1.0472</span> 
     <span class="n">psi</span> <span class="o">=</span> <span class="o">-</span><span class="mf">0.7854</span>
     <span class="k">if</span> <span class="n">phi_handle</span><span class="o">.</span><span class="n">IsValid</span><span class="p">():</span>
@@ -84,8 +86,8 @@ pipelines available in the modelling module.</p>
 
     <span class="n">torsion_angles</span><span class="o">.</span><span class="n">append</span><span class="p">((</span><span class="n">phi</span><span class="p">,</span><span class="n">psi</span><span class="p">))</span>
 
-<span class="c"># first build a frame representing the rigid parts including</span>
-<span class="c"># cystein sidechains</span>
+<span class="c1"># first build a frame representing the rigid parts including</span>
+<span class="c1"># cystein sidechains</span>
 <span class="n">frame_residues</span> <span class="o">=</span> <span class="nb">list</span><span class="p">()</span>
 <span class="k">for</span> <span class="n">i</span><span class="p">,</span><span class="n">r</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">prot</span><span class="o">.</span><span class="n">residues</span><span class="p">):</span>
     <span class="n">frame_residue</span> <span class="o">=</span> <span class="n">rot_constructor</span><span class="o">.</span><span class="n">ConstructBackboneFrameResidue</span><span class="p">(</span>
@@ -97,12 +99,12 @@ pipelines available in the modelling module.</p>
 <span class="n">frame</span> <span class="o">=</span> <span class="n">sidechain</span><span class="o">.</span><span class="n">Frame</span><span class="p">(</span><span class="n">frame_residues</span><span class="p">)</span>
 
 
-<span class="c"># let&#39;s build up rotamer groups</span>
+<span class="c1"># let&#39;s build up rotamer groups</span>
 <span class="n">rotamer_groups</span> <span class="o">=</span> <span class="nb">list</span><span class="p">()</span>
 <span class="n">aa_with_rotamers</span> <span class="o">=</span> <span class="nb">list</span><span class="p">()</span>
 <span class="k">for</span> <span class="n">i</span><span class="p">,</span><span class="n">r</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">prot</span><span class="o">.</span><span class="n">residues</span><span class="p">):</span>
 
-    <span class="k">if</span> <span class="n">r</span><span class="o">.</span><span class="n">GetName</span><span class="p">()</span> <span class="o">==</span> <span class="s">&quot;ALA&quot;</span> <span class="ow">or</span> <span class="n">r</span><span class="o">.</span><span class="n">GetName</span><span class="p">()</span> <span class="o">==</span> <span class="s">&quot;GLY&quot;</span><span class="p">:</span>
+    <span class="k">if</span> <span class="n">r</span><span class="o">.</span><span class="n">GetName</span><span class="p">()</span> <span class="o">==</span> <span class="s2">&quot;ALA&quot;</span> <span class="ow">or</span> <span class="n">r</span><span class="o">.</span><span class="n">GetName</span><span class="p">()</span> <span class="o">==</span> <span class="s2">&quot;GLY&quot;</span><span class="p">:</span>
       <span class="k">continue</span>
 
     <span class="n">rot_group</span> <span class="o">=</span> <span class="n">rot_constructor</span><span class="o">.</span><span class="n">ConstructFRMRotamerGroup</span><span class="p">(</span>
@@ -110,27 +112,27 @@ pipelines available in the modelling module.</p>
                     <span class="n">torsion_angles</span><span class="p">[</span><span class="n">i</span><span class="p">][</span><span class="mi">0</span><span class="p">],</span> <span class="n">torsion_angles</span><span class="p">[</span><span class="n">i</span><span class="p">][</span><span class="mi">1</span><span class="p">])</span>
 
     <span class="n">rot_group</span><span class="o">.</span><span class="n">SetFrameEnergy</span><span class="p">(</span><span class="n">frame</span><span class="p">)</span>
-    <span class="c"># remove super unlikely rotamer in rotamer group </span>
-    <span class="c"># e.g. those who clash with the frame</span>
+    <span class="c1"># remove super unlikely rotamer in rotamer group </span>
+    <span class="c1"># e.g. those who clash with the frame</span>
     <span class="n">rot_group</span><span class="o">.</span><span class="n">ApplySelfEnergyThresh</span><span class="p">()</span>
-    <span class="c"># finally add it and keep track of the indices</span>
+    <span class="c1"># finally add it and keep track of the indices</span>
     <span class="n">rotamer_groups</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">rot_group</span><span class="p">)</span>
     <span class="n">aa_with_rotamers</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">i</span><span class="p">)</span>
 
 
-<span class="c"># buildup a graph given the rotamer groups</span>
+<span class="c1"># buildup a graph given the rotamer groups</span>
 <span class="n">graph</span> <span class="o">=</span> <span class="n">sidechain</span><span class="o">.</span><span class="n">RotamerGraph</span><span class="o">.</span><span class="n">CreateFromFRMList</span><span class="p">(</span><span class="n">rotamer_groups</span><span class="p">)</span>
 
-<span class="c"># and get a solution out of it using a minimal width tree approach</span>
+<span class="c1"># and get a solution out of it using a minimal width tree approach</span>
 <span class="n">solution</span> <span class="o">=</span> <span class="n">graph</span><span class="o">.</span><span class="n">TreeSolve</span><span class="p">()[</span><span class="mi">0</span><span class="p">]</span>
 
-<span class="c"># let&#39;s finally apply the solution to the residues</span>
+<span class="c1"># let&#39;s finally apply the solution to the residues</span>
 <span class="k">for</span> <span class="p">(</span><span class="n">i</span><span class="p">,</span> <span class="n">rot_group</span><span class="p">,</span> <span class="n">sol</span><span class="p">)</span> <span class="ow">in</span> <span class="nb">zip</span><span class="p">(</span><span class="n">aa_with_rotamers</span><span class="p">,</span>
                                <span class="n">rotamer_groups</span><span class="p">,</span>
                                <span class="n">solution</span><span class="p">):</span>
     <span class="n">rot_group</span><span class="p">[</span><span class="n">sol</span><span class="p">]</span><span class="o">.</span><span class="n">ApplyOnResidue</span><span class="p">(</span><span class="n">prot</span><span class="o">.</span><span class="n">residues</span><span class="p">[</span><span class="n">i</span><span class="p">])</span>
 
-<span class="n">io</span><span class="o">.</span><span class="n">SavePDB</span><span class="p">(</span><span class="n">prot</span><span class="p">,</span> <span class="s">&quot;example_reconstruction.pdb&quot;</span><span class="p">)</span>
+<span class="n">io</span><span class="o">.</span><span class="n">SavePDB</span><span class="p">(</span><span class="n">prot</span><span class="p">,</span> <span class="s2">&quot;example_reconstruction.pdb&quot;</span><span class="p">)</span>
 </pre></div>
 </div>
 <p>Contents:</p>
@@ -206,9 +208,6 @@ pipelines available in the modelling module.</p>
       <input type="hidden" name="check_keywords" value="yes" />
       <input type="hidden" name="area" value="default" />
     </form>
-    <p class="searchtip" style="font-size: 90%">
-    Enter search terms or a module, class or function name.
-    </p>
 </div>
 <script type="text/javascript">$('#searchbox').show(0);</script>
         </div>
@@ -216,11 +215,11 @@ pipelines available in the modelling module.</p>
       <div class="clearer"></div>
     </div>
     <div class="footer">
-      &copy;2017, ProMod3 authors.
+      &copy;2018, ProMod3 authors.
       
       |
-      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a>
-      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.6</a>
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.4.1</a>
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
       
       |
       <a href="../_sources/sidechain/index.txt"
diff --git a/doc/html/sidechain/loading.html b/doc/html/sidechain/loading.html
index 449c456a2d3cd28a1f5db305a69782fb3ea119e6..cca071873f529654b50e681922af16e723f72672 100644
--- a/doc/html/sidechain/loading.html
+++ b/doc/html/sidechain/loading.html
@@ -6,7 +6,7 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
-    <title>Loading Rotamer Libraries &mdash; ProMod3 1.1.0 documentation</title>
+    <title>Loading Rotamer Libraries &mdash; ProMod3 1.2.0 documentation</title>
     
     <link rel="stylesheet" href="../_static/alabaster.css" type="text/css" />
     <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
@@ -14,7 +14,7 @@
     <script type="text/javascript">
       var DOCUMENTATION_OPTIONS = {
         URL_ROOT:    '../',
-        VERSION:     '1.1.0',
+        VERSION:     '1.2.0',
         COLLAPSE_INDEX: false,
         FILE_SUFFIX: '.html',
         HAS_SOURCE:  true
@@ -23,16 +23,18 @@
     <script type="text/javascript" src="../_static/jquery.js"></script>
     <script type="text/javascript" src="../_static/underscore.js"></script>
     <script type="text/javascript" src="../_static/doctools.js"></script>
-    <link rel="top" title="ProMod3 1.1.0 documentation" href="../index.html" />
+    <link rel="top" title="ProMod3 1.2.0 documentation" href="../index.html" />
     <link rel="up" title="sidechain - Sidechain Modelling" href="index.html" />
     <link rel="next" title="Subrotamer Optimization" href="subrotamer_optimizer.html" />
     <link rel="prev" title="Disulfid Bond Evaluation" href="disulfid.html" />
    
+  <link rel="stylesheet" href="../_static/custom.css" type="text/css" />
   
-  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
 
   </head>
-  <body role="document">  
+  <body role="document">
+  
 
     <div class="document">
       <div class="documentwrapper">
@@ -158,9 +160,6 @@ incomplete if the last problem gets triggered.</td>
       <input type="hidden" name="check_keywords" value="yes" />
       <input type="hidden" name="area" value="default" />
     </form>
-    <p class="searchtip" style="font-size: 90%">
-    Enter search terms or a module, class or function name.
-    </p>
 </div>
 <script type="text/javascript">$('#searchbox').show(0);</script>
         </div>
@@ -168,11 +167,11 @@ incomplete if the last problem gets triggered.</td>
       <div class="clearer"></div>
     </div>
     <div class="footer">
-      &copy;2017, ProMod3 authors.
+      &copy;2018, ProMod3 authors.
       
       |
-      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a>
-      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.6</a>
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.4.1</a>
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
       
       |
       <a href="../_sources/sidechain/loading.txt"
diff --git a/doc/html/sidechain/rotamer.html b/doc/html/sidechain/rotamer.html
index 1ae73b516dbffd03010d02c937fdc44924db455f..582ce7f7647665d09d4bb7ee052bdda578fd494e 100644
--- a/doc/html/sidechain/rotamer.html
+++ b/doc/html/sidechain/rotamer.html
@@ -6,7 +6,7 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
-    <title>Rotamers &mdash; ProMod3 1.1.0 documentation</title>
+    <title>Rotamers &mdash; ProMod3 1.2.0 documentation</title>
     
     <link rel="stylesheet" href="../_static/alabaster.css" type="text/css" />
     <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
@@ -14,7 +14,7 @@
     <script type="text/javascript">
       var DOCUMENTATION_OPTIONS = {
         URL_ROOT:    '../',
-        VERSION:     '1.1.0',
+        VERSION:     '1.2.0',
         COLLAPSE_INDEX: false,
         FILE_SUFFIX: '.html',
         HAS_SOURCE:  true
@@ -23,16 +23,18 @@
     <script type="text/javascript" src="../_static/jquery.js"></script>
     <script type="text/javascript" src="../_static/underscore.js"></script>
     <script type="text/javascript" src="../_static/doctools.js"></script>
-    <link rel="top" title="ProMod3 1.1.0 documentation" href="../index.html" />
+    <link rel="top" title="ProMod3 1.2.0 documentation" href="../index.html" />
     <link rel="up" title="sidechain - Sidechain Modelling" href="index.html" />
     <link rel="next" title="Frame" href="frame.html" />
     <link rel="prev" title="RotamerID" href="rotamer_id.html" />
    
+  <link rel="stylesheet" href="../_static/custom.css" type="text/css" />
   
-  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
 
   </head>
-  <body role="document">  
+  <body role="document">
+  
 
     <div class="document">
       <div class="documentwrapper">
@@ -84,11 +86,11 @@ has to be defined at initialization.</p>
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
 <li><strong>type</strong> (<a class="reference internal" href="#promod3.sidechain.SidechainParticle" title="promod3.sidechain.SidechainParticle"><code class="xref py py-class docutils literal"><span class="pre">SidechainParticle</span></code></a>) &#8211; Type of particle</li>
-<li><strong>pos</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.geom.Vec3</span></code></a>) &#8211; Positions of particle</li>
+<li><strong>pos</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.geom.Vec3</span></code></a>) &#8211; Positions of particle</li>
 <li><strong>charge</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>) &#8211; Charge of particle, will be used in case H-Bonds</li>
 <li><strong>name</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#str" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">str</span></code></a>) &#8211; Name of particle. This name will be given to an actual
-<a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.AtomHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.AtomHandle</span></code></a> if a rotamer gets applied
-to a <a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a></li>
+<a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.AtomHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.AtomHandle</span></code></a> if a rotamer gets applied
+to a <a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a></li>
 </ul>
 </td>
 </tr>
@@ -196,7 +198,7 @@ to a <a class="reference external" href="http://www.openstructure.org/docs/dev/m
 <col class="field-name" />
 <col class="field-body" />
 <tbody valign="top">
-<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>lone_pair</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.geom.Vec3</span></code></a>) &#8211; Lone pair direction</td>
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>lone_pair</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.geom.Vec3</span></code></a>) &#8211; Lone pair direction</td>
 </tr>
 </tbody>
 </table>
@@ -211,7 +213,7 @@ hydrogen, this would be the direction of backbone-N to backbone-H.</p>
 <col class="field-name" />
 <col class="field-body" />
 <tbody valign="top">
-<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>polar_direction</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.geom.Vec3</span></code></a>) &#8211; Polar direction of particle</td>
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>polar_direction</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.geom.Vec3</span></code></a>) &#8211; Polar direction of particle</td>
 </tr>
 </tbody>
 </table>
@@ -281,13 +283,14 @@ particular <a class="reference internal" href="#promod3.sidechain.RRMRotamerGrou
 <code class="descname">ApplyOnResidue</code><span class="sig-paren">(</span><em>res</em>, <em>consider_hydrogens=False</em>, <em>new_res_name=&quot;&quot;</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.sidechain.RRMRotamer.ApplyOnResidue" title="Permalink to this definition">¶</a></dt>
 <dd><p>Iterates over every particle and searches for the according atom in
 <strong>res</strong>. If it&#8217;s present, the position gets reset to the particle position.
-If not, a new atom gets added to <strong>res</strong>.</p>
+If not, a new atom gets added to <strong>res</strong>. No atoms are removed from <strong>res</strong>
+in this process.</p>
 <table class="docutils field-list" frame="void" rules="none">
 <col class="field-name" />
 <col class="field-body" />
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
-<li><strong>res</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; Residue to be reconstructed</li>
+<li><strong>res</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; Residue to be reconstructed</li>
 <li><strong>consider_hydrogens</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#bool" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">bool</span></code></a>) &#8211; Flag, whether polar hydrogens should be added to
 <strong>res</strong></li>
 <li><strong>new_res_name</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#str" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">str</span></code></a>) &#8211; New name of <strong>res</strong>. Nothing happens in case of the
@@ -556,13 +559,14 @@ particular <a class="reference internal" href="#promod3.sidechain.FRMRotamerGrou
 <code class="descname">ApplyOnResidue</code><span class="sig-paren">(</span><em>res</em>, <em>consider_hydrogens=False</em>, <em>new_res_name=&quot;&quot;</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.sidechain.FRMRotamer.ApplyOnResidue" title="Permalink to this definition">¶</a></dt>
 <dd><p>Iterates over every particle of the active subrotamer and searches for the
 according atom in <strong>res</strong>. If it&#8217;s present, the position gets reset to the
-particle position. If not, a new atom gets added to <strong>res</strong>.</p>
+particle position. If not, a new atom gets added to <strong>res</strong>.
+No atoms are removed from <strong>res</strong> in this process.</p>
 <table class="docutils field-list" frame="void" rules="none">
 <col class="field-name" />
 <col class="field-body" />
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
-<li><strong>res</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; Residue to be reconstructed</li>
+<li><strong>res</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; Residue to be reconstructed</li>
 <li><strong>consider_hydrogens</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#bool" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">bool</span></code></a>) &#8211; Flag, whether polar hydrogens should be added to
 the sidechain</li>
 <li><strong>new_res_name</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#str" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">str</span></code></a>) &#8211; New name of residue. Nothing happens in case of the
@@ -962,7 +966,7 @@ particles of the same residue.</li>
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
 <li><strong>index</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Rotamer index</li>
-<li><strong>res</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; Residue to be reconstructed</li>
+<li><strong>res</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; Residue to be reconstructed</li>
 <li><strong>consider_hydrogens</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#bool" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">bool</span></code></a>) &#8211; Flag, whether polar hydrogens should be added to
 the sidechain</li>
 <li><strong>new_res_name</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#str" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">str</span></code></a>) &#8211; New name of residue. Nothing happens in case of the
@@ -1096,7 +1100,7 @@ particles of the same residue.</li>
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
 <li><strong>index</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Rotamer index</li>
-<li><strong>res</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; Residue to be reconstructed</li>
+<li><strong>res</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; Residue to be reconstructed</li>
 <li><strong>consider_hydrogens</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#bool" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">bool</span></code></a>) &#8211; Flag, whether polar hydrogens should be added to
 the sidechain</li>
 <li><strong>new_res_name</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#str" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">str</span></code></a>) &#8211; New name of residue. Nothing happens in case of the
@@ -1213,9 +1217,6 @@ rotamers with <em>self_energy</em> &gt; <em>l_e</em> + <em>thresh</em></p>
       <input type="hidden" name="check_keywords" value="yes" />
       <input type="hidden" name="area" value="default" />
     </form>
-    <p class="searchtip" style="font-size: 90%">
-    Enter search terms or a module, class or function name.
-    </p>
 </div>
 <script type="text/javascript">$('#searchbox').show(0);</script>
         </div>
@@ -1223,11 +1224,11 @@ rotamers with <em>self_energy</em> &gt; <em>l_e</em> + <em>thresh</em></p>
       <div class="clearer"></div>
     </div>
     <div class="footer">
-      &copy;2017, ProMod3 authors.
+      &copy;2018, ProMod3 authors.
       
       |
-      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a>
-      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.6</a>
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.4.1</a>
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
       
       |
       <a href="../_sources/sidechain/rotamer.txt"
diff --git a/doc/html/sidechain/rotamer_constructor.html b/doc/html/sidechain/rotamer_constructor.html
index f277f8341490d2efbf65997eec857ada4429787c..0a026c732216121edf1f9e241a6df6442596da23 100644
--- a/doc/html/sidechain/rotamer_constructor.html
+++ b/doc/html/sidechain/rotamer_constructor.html
@@ -6,7 +6,7 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
-    <title>Rotamer Constructor &mdash; ProMod3 1.1.0 documentation</title>
+    <title>Rotamer Constructor &mdash; ProMod3 1.2.0 documentation</title>
     
     <link rel="stylesheet" href="../_static/alabaster.css" type="text/css" />
     <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
@@ -14,7 +14,7 @@
     <script type="text/javascript">
       var DOCUMENTATION_OPTIONS = {
         URL_ROOT:    '../',
-        VERSION:     '1.1.0',
+        VERSION:     '1.2.0',
         COLLAPSE_INDEX: false,
         FILE_SUFFIX: '.html',
         HAS_SOURCE:  true
@@ -23,16 +23,18 @@
     <script type="text/javascript" src="../_static/jquery.js"></script>
     <script type="text/javascript" src="../_static/underscore.js"></script>
     <script type="text/javascript" src="../_static/doctools.js"></script>
-    <link rel="top" title="ProMod3 1.1.0 documentation" href="../index.html" />
+    <link rel="top" title="ProMod3 1.2.0 documentation" href="../index.html" />
     <link rel="up" title="sidechain - Sidechain Modelling" href="index.html" />
     <link rel="next" title="Rotamer Graph" href="graph.html" />
     <link rel="prev" title="Rotamer Library" href="rotamer_lib.html" />
    
+  <link rel="stylesheet" href="../_static/custom.css" type="text/css" />
   
-  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
 
   </head>
-  <body role="document">  
+  <body role="document">
+  
 
     <div class="document">
       <div class="documentwrapper">
@@ -47,12 +49,29 @@ functionality provided by PROMOD3</p>
 <h2>Constructing Rotamers and Frame Residues<a class="headerlink" href="#constructing-rotamers-and-frame-residues" title="Permalink to this headline">¶</a></h2>
 <dl class="class">
 <dt id="promod3.sidechain.SCWRLRotamerConstructor">
-<em class="property">class </em><code class="descclassname">promod3.sidechain.</code><code class="descname">SCWRLRotamerConstructor</code><a class="headerlink" href="#promod3.sidechain.SCWRLRotamerConstructor" title="Permalink to this definition">¶</a></dt>
+<em class="property">class </em><code class="descclassname">promod3.sidechain.</code><code class="descname">SCWRLRotamerConstructor</code><span class="sig-paren">(</span><em>cb_in_sidechain</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.sidechain.SCWRLRotamerConstructor" title="Permalink to this definition">¶</a></dt>
 <dd><p>Constructing rotamers and frame residues that are parametrized according to
 the SCWRL4 method. They contain all heavy atoms, but also the
-polar hydrogens. The rotamers start after the CB atom (typically CG).
+polar hydrogens.
 In case of the <a class="reference internal" href="frame.html#promod3.sidechain.FrameResidue" title="promod3.sidechain.FrameResidue"><code class="xref py py-class docutils literal"><span class="pre">FrameResidue</span></code></a> construction, the
 constructor distinguishes between backbone and sidechain frame residues.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>cb_in_sidechain</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#bool" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">bool</span></code></a>) &#8211; If set to true, all constructed rotamers will contain
+the cb atom. This flag also affects the construction
+of frame residues and controls whether the cb atom
+shows up in the backbone frame residues or sidechain
+frame residues.
+This is useful when you want to represent ALA or
+GLY with actual rotamers, but be aware of increased
+runtime. This flag can be set to False for most
+modeling applications and you just don&#8217;t generate
+any rotamers for ALA and GLY.</td>
+</tr>
+</tbody>
+</table>
 <dl class="method">
 <dt id="promod3.sidechain.SCWRLRotamerConstructor.ConstructRRMRotamerGroup">
 <code class="descname">ConstructRRMRotamerGroup</code><span class="sig-paren">(</span><em>res</em>, <em>id</em>, <em>residue_index</em>, <em>rot_lib</em><span class="optional">[</span>, <em>probability_cutoff = 0.98</em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#promod3.sidechain.SCWRLRotamerConstructor.ConstructRRMRotamerGroup" title="Permalink to this definition">¶</a></dt>
@@ -63,11 +82,6 @@ constructor distinguishes between backbone and sidechain frame residues.</p>
 <code class="descname">ConstructRRMRotamerGroup</code><span class="sig-paren">(</span><em>all_atom_pos</em>, <em>aa_res_idx</em>, <em>id</em>, <em>residue_index</em>, <em>rot_lib</em><span class="optional">[</span>, <em>probability_cutoff = 0.98</em><span class="optional">]</span><span class="sig-paren">)</span></dt>
 <dd></dd></dl>
 
-<dl class="method">
-<dt>
-<code class="descname">ConstructRRMRotamerGroup</code><span class="sig-paren">(</span><em>n_pos</em>, <em>ca_pos</em>, <em>cb_pos</em>, <em>id</em>, <em>residue_index</em>, <em>rot_lib</em><span class="optional">[</span>, <em>probability_cutoff = 0.98</em><span class="optional">]</span><span class="sig-paren">)</span></dt>
-<dd></dd></dl>
-
 <dl class="method">
 <dt>
 <code class="descname">ConstructRRMRotamerGroup</code><span class="sig-paren">(</span><em>res</em>, <em>id</em>, <em>residue_index</em>, <em>rot_lib</em><span class="optional">[</span>, <em>phi = -1.0472</em>, <em>psi = -0.7854</em>, <em>probability_cutoff = 0.98</em><span class="optional">]</span><span class="sig-paren">)</span></dt>
@@ -78,11 +92,6 @@ constructor distinguishes between backbone and sidechain frame residues.</p>
 <code class="descname">ConstructRRMRotamerGroup</code><span class="sig-paren">(</span><em>all_atom_pos</em>, <em>aa_res_idx</em>, <em>id</em>, <em>residue_index</em>, <em>rot_lib</em><span class="optional">[</span>, <em>phi = -1.0472</em>, <em>psi = -0.7854</em>, <em>probability_cutoff = 0.98</em><span class="optional">]</span><span class="sig-paren">)</span></dt>
 <dd></dd></dl>
 
-<dl class="method">
-<dt>
-<code class="descname">ConstructRRMRotamerGroup</code><span class="sig-paren">(</span><em>n_pos</em>, <em>ca_pos</em>, <em>cb_pos</em>, <em>id</em>, <em>residue_index</em>, <em>rot_lib</em><span class="optional">[</span>, <em>phi = -1.0472</em>, <em>psi = -0.7854</em>, <em>probability_cutoff = 0.98</em><span class="optional">]</span><span class="sig-paren">)</span></dt>
-<dd></dd></dl>
-
 <dl class="method">
 <dt>
 <code class="descname">ConstructRRMRotamerGroup</code><span class="sig-paren">(</span><em>res</em>, <em>id</em>, <em>residue_index</em>, <em>rot_lib_entries</em><span class="optional">[</span>, <em>probability_cutoff = 0.98</em><span class="optional">]</span><span class="sig-paren">)</span></dt>
@@ -91,11 +100,6 @@ constructor distinguishes between backbone and sidechain frame residues.</p>
 <dl class="method">
 <dt>
 <code class="descname">ConstructRRMRotamerGroup</code><span class="sig-paren">(</span><em>all_atom_pos</em>, <em>aa_res_idx</em>, <em>id</em>, <em>residue_index</em>, <em>rot_lib_entries</em><span class="optional">[</span>, <em>probability_cutoff = 0.98</em><span class="optional">]</span><span class="sig-paren">)</span></dt>
-<dd></dd></dl>
-
-<dl class="method">
-<dt>
-<code class="descname">ConstructRRMRotamerGroup</code><span class="sig-paren">(</span><em>n_pos</em>, <em>ca_pos</em>, <em>cb_pos</em>, <em>id</em>, <em>residue_index</em>, <em>rot_lib_entries</em><span class="optional">[</span>, <em>probability_cutoff = 0.98</em><span class="optional">]</span><span class="sig-paren">)</span></dt>
 <dd><p>All functions are also avaible for their flexible rotamer model counterpart.
 =&gt;ConstructFRMRotamerGroup(...) with exactly the same parameters.</p>
 <table class="docutils field-list" frame="void" rules="none">
@@ -103,13 +107,10 @@ constructor distinguishes between backbone and sidechain frame residues.</p>
 <col class="field-body" />
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
-<li><strong>res</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; To extract the N, CA, CB backbone anchor</li>
-<li><strong>all_atom_pos</strong> (<a class="reference internal" href="../loop/all_atom.html#promod3.loop.AllAtomPositions" title="promod3.loop.AllAtomPositions"><code class="xref py py-class docutils literal"><span class="pre">promod3.loop.AllAtomPositions</span></code></a>) &#8211; To extract the N, CA, CB backbone anchor</li>
+<li><strong>res</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; To extract the required backbone atoms</li>
+<li><strong>all_atom_pos</strong> (<a class="reference internal" href="../loop/all_atom.html#promod3.loop.AllAtomPositions" title="promod3.loop.AllAtomPositions"><code class="xref py py-class docutils literal"><span class="pre">promod3.loop.AllAtomPositions</span></code></a>) &#8211; To extract the required backbone atoms</li>
 <li><strong>aa_res_idx</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Index of residue in <strong>all_atom_pos</strong> from which to
-extract the backbone anchor</li>
-<li><strong>n_pos</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.geom.Vec3</span></code></a>) &#8211; To directly feed in the backbone anchor positions</li>
-<li><strong>ca_pos</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.geom.Vec3</span></code></a>) &#8211; To directly feed in the backbone anchor positions</li>
-<li><strong>cb_pos</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.geom.Vec3</span></code></a>) &#8211; To directly feed in the backbone anchor positions</li>
+extract the required backbone atoms</li>
 <li><strong>id</strong> (<a class="reference internal" href="rotamer_id.html#promod3.sidechain.RotamerID" title="promod3.sidechain.RotamerID"><code class="xref py py-class docutils literal"><span class="pre">RotamerID</span></code></a>) &#8211; Identifies the sidechain.</li>
 <li><strong>residue_index</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Important for the energy calculations towards the
 <a class="reference internal" href="frame.html#promod3.sidechain.Frame" title="promod3.sidechain.Frame"><code class="xref py py-class docutils literal"><span class="pre">Frame</span></code></a> you don&#8217;t want to calculate a pairwise
@@ -139,9 +140,8 @@ probabilities extracted from the rotamer library.</p>
 </td>
 </tr>
 <tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last"><a class="reference external" href="https://docs.python.org/2.7/library/exceptions.html#exceptions.RuntimeError" title="(in Python v2.7)"><code class="xref py py-exc docutils literal"><span class="pre">RuntimeError</span></code></a> when not all required backbone
-atoms are present in <strong>residue</strong>, not all required atom
-positions are set in <strong>all_atom_pos</strong> or when the rotamer library
-does not contain any entries for <strong>id</strong></p>
+atoms are present in <strong>residue</strong> or not all required atom
+positions are set in <strong>all_atom_pos</strong></p>
 </td>
 </tr>
 </tbody>
@@ -156,14 +156,8 @@ does not contain any entries for <strong>id</strong></p>
 <dl class="method">
 <dt>
 <code class="descname">ConstructBackboneFrameResidue</code><span class="sig-paren">(</span><em>all_atom_pos</em>, <em>aa_res_idx</em>, <em>id</em>, <em>residue_index</em>, <em>Real phi</em><span class="optional">[</span>, <em>n_ter = False</em>, <em>c_ter = False</em><span class="optional">]</span><span class="sig-paren">)</span></dt>
-<dd></dd></dl>
-
-<dl class="method">
-<dt>
-<code class="descname">ConstructBackboneFrameResidue</code><span class="sig-paren">(</span><em>n_pos</em>, <em>ca_pos</em>, <em>c_pos</em>, <em>o_pos</em>, <em>cb_pos</em>, <em>id</em>, <em>residue_index</em>, <em>Real phi</em><span class="optional">[</span>, <em>n_ter = False</em>, <em>c_ter = False</em><span class="optional">]</span><span class="sig-paren">)</span></dt>
-<dd><p>Constructs backbone frame residues for amino acid residues. It extracts
-the n, ca, c, o and cb positions and constructs a frame residue based on
-the parametrizations of SCWRL4. In case of <strong>n_ter</strong>, there are additional
+<dd><p>Constructs backbone frame residues for amino acid residues based on the
+parametrizations of SCWRL4. In case of <strong>n_ter</strong>, there are additional
 hydrogens added at the nitrogen to represent a proper n-terminus. The same
 is true for <strong>c_ter</strong>, an additional oxygen is built instead. In any case,
 a single hydrogen is added to the nitrogen (except proline), this is
@@ -173,15 +167,10 @@ why the phi angle of the residue is required as an input.</p>
 <col class="field-body" />
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
-<li><strong>res</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; Residue from which to extract the backbone positions</li>
+<li><strong>res</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; Residue from which to extract the backbone positions</li>
 <li><strong>all_atom_pos</strong> (<a class="reference internal" href="../loop/all_atom.html#promod3.loop.AllAtomPositions" title="promod3.loop.AllAtomPositions"><code class="xref py py-class docutils literal"><span class="pre">promod3.loop.AllAtomPositions</span></code></a>) &#8211; To extract the backbone positions</li>
 <li><strong>aa_res_idx</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Index of residue in <strong>all_atom_pos</strong> from which to
 extract the backbone positions</li>
-<li><strong>n_pos</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.geom.Vec3</span></code></a>) &#8211; To directly feed in the backbone positions</li>
-<li><strong>ca_pos</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.geom.Vec3</span></code></a>) &#8211; To directly feed in the backbone positions</li>
-<li><strong>c_pos</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.geom.Vec3</span></code></a>) &#8211; To directly feed in the backbone positions</li>
-<li><strong>o_pos</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.geom.Vec3</span></code></a>) &#8211; To directly feed in the backbone positions</li>
-<li><strong>cb_pos</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/geom/vec/#ost.geom.Vec3" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.geom.Vec3</span></code></a>) &#8211; To directly feed in the backbone positions</li>
 <li><strong>id</strong> (<a class="reference internal" href="rotamer_id.html#promod3.sidechain.RotamerID" title="promod3.sidechain.RotamerID"><code class="xref py py-class docutils literal"><span class="pre">RotamerID</span></code></a>) &#8211; Identifies the sidechain</li>
 <li><strong>residue_index</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Important for the energy calculations towards the
 <a class="reference internal" href="frame.html#promod3.sidechain.Frame" title="promod3.sidechain.Frame"><code class="xref py py-class docutils literal"><span class="pre">Frame</span></code></a> you don&#8217;t want to calculate a pairwise
@@ -200,7 +189,7 @@ represent a proper c-terminus</li>
 </td>
 </tr>
 <tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last"><a class="reference external" href="https://docs.python.org/2.7/library/exceptions.html#exceptions.RuntimeError" title="(in Python v2.7)"><code class="xref py py-exc docutils literal"><span class="pre">RuntimeError</span></code></a> when not all required backbone
-atoms are present in <strong>residue</strong>, not all required atom
+atoms are present in <strong>residue</strong> or not all required atom
 positions are set in <strong>all_atom_pos</strong>.</p>
 </td>
 </tr>
@@ -224,7 +213,7 @@ particles for all polar hydrogens.</p>
 <col class="field-body" />
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
-<li><strong>res</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; Residue from which to extract the sidechain positions</li>
+<li><strong>res</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; Residue from which to extract the sidechain positions</li>
 <li><strong>all_atom_pos</strong> (<a class="reference internal" href="../loop/all_atom.html#promod3.loop.AllAtomPositions" title="promod3.loop.AllAtomPositions"><code class="xref py py-class docutils literal"><span class="pre">promod3.loop.AllAtomPositions</span></code></a>) &#8211; To extract the sidechain positions</li>
 <li><strong>aa_res_idx</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Index of residue in <strong>all_atom_pos</strong> from which to
 extract the sidechain positions</li>
@@ -248,7 +237,7 @@ atom positions are set in <strong>all_atom_pos</strong>.</p>
 <dl class="method">
 <dt id="promod3.sidechain.SCWRLRotamerConstructor.ConstructFrameResidue">
 <code class="descname">ConstructFrameResidue</code><span class="sig-paren">(</span><em>residue</em>, <em>residue_index</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.sidechain.SCWRLRotamerConstructor.ConstructFrameResidue" title="Permalink to this definition">¶</a></dt>
-<dd><p>Constructs a <a class="reference internal" href="frame.html#promod3.sidechain.FrameResidue" title="promod3.sidechain.FrameResidue"><code class="xref py py-class docutils literal"><span class="pre">FrameResidue</span></code></a> from a <a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>.
+<dd><p>Constructs a <a class="reference internal" href="frame.html#promod3.sidechain.FrameResidue" title="promod3.sidechain.FrameResidue"><code class="xref py py-class docutils literal"><span class="pre">FrameResidue</span></code></a> from a <a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>.
 This can be useful to mark a region occupied by a ligand. Note, that
 there won&#8217;t be any parametrization of hbonds in this function. All atoms
 of the residue will be represented as carbons and hydrogens are skipped.</p>
@@ -257,7 +246,7 @@ of the residue will be represented as carbons and hydrogens are skipped.</p>
 <col class="field-body" />
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
-<li><strong>residue</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; Residue from which all atoms will be taken to
+<li><strong>residue</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; Residue from which all atoms will be taken to
 construct a <a class="reference internal" href="frame.html#promod3.sidechain.FrameResidue" title="promod3.sidechain.FrameResidue"><code class="xref py py-class docutils literal"><span class="pre">FrameResidue</span></code></a>.</li>
 <li><strong>residue_index</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Index this <a class="reference internal" href="frame.html#promod3.sidechain.FrameResidue" title="promod3.sidechain.FrameResidue"><code class="xref py py-class docutils literal"><span class="pre">FrameResidue</span></code></a> belongs to.</li>
 </ul>
@@ -273,7 +262,7 @@ construct a <a class="reference internal" href="frame.html#promod3.sidechain.Fra
 <dl class="method">
 <dt id="promod3.sidechain.SCWRLRotamerConstructor.ConstructFrameResidueHeuristic">
 <code class="descname">ConstructFrameResidueHeuristic</code><span class="sig-paren">(</span><em>residue</em>, <em>residue_index</em>, <em>comp_lib</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.sidechain.SCWRLRotamerConstructor.ConstructFrameResidueHeuristic" title="Permalink to this definition">¶</a></dt>
-<dd><p>Constructs a <a class="reference internal" href="frame.html#promod3.sidechain.FrameResidue" title="promod3.sidechain.FrameResidue"><code class="xref py py-class docutils literal"><span class="pre">FrameResidue</span></code></a> from a <a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a> using
+<dd><p>Constructs a <a class="reference internal" href="frame.html#promod3.sidechain.FrameResidue" title="promod3.sidechain.FrameResidue"><code class="xref py py-class docutils literal"><span class="pre">FrameResidue</span></code></a> from a <a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a> using
 a heuristic treatment of the atoms based on the passed compounds library.
 This is meant to be used as an alternative to <a class="reference internal" href="#promod3.sidechain.SCWRLRotamerConstructor.ConstructFrameResidue" title="promod3.sidechain.SCWRLRotamerConstructor.ConstructFrameResidue"><code class="xref py py-func docutils literal"><span class="pre">ConstructFrameResidue()</span></code></a>,
 which will be called by this function if the residue is not known by the given
@@ -291,10 +280,10 @@ as in the <a class="reference internal" href="rotamer.html#promod3.sidechain.Sid
 <col class="field-body" />
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
-<li><strong>residue</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; Residue from which all atoms will be taken to
+<li><strong>residue</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; Residue from which all atoms will be taken to
 construct a <a class="reference internal" href="frame.html#promod3.sidechain.FrameResidue" title="promod3.sidechain.FrameResidue"><code class="xref py py-class docutils literal"><span class="pre">FrameResidue</span></code></a>.</li>
 <li><strong>residue_index</strong> (<a class="reference external" href="https://docs.python.org/2.7/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) &#8211; Index this <a class="reference internal" href="frame.html#promod3.sidechain.FrameResidue" title="promod3.sidechain.FrameResidue"><code class="xref py py-class docutils literal"><span class="pre">FrameResidue</span></code></a> belongs to.</li>
-<li><strong>comp_lib</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/conop/compoundlib/#ost.conop.CompoundLib" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.CompoundLib</span></code></a>) &#8211; OST compound library to use</li>
+<li><strong>comp_lib</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/conop/compoundlib/#ost.conop.CompoundLib" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.CompoundLib</span></code></a>) &#8211; OST compound library to use</li>
 </ul>
 </td>
 </tr>
@@ -372,9 +361,6 @@ to be assigned</td>
       <input type="hidden" name="check_keywords" value="yes" />
       <input type="hidden" name="area" value="default" />
     </form>
-    <p class="searchtip" style="font-size: 90%">
-    Enter search terms or a module, class or function name.
-    </p>
 </div>
 <script type="text/javascript">$('#searchbox').show(0);</script>
         </div>
@@ -382,11 +368,11 @@ to be assigned</td>
       <div class="clearer"></div>
     </div>
     <div class="footer">
-      &copy;2017, ProMod3 authors.
+      &copy;2018, ProMod3 authors.
       
       |
-      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a>
-      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.6</a>
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.4.1</a>
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
       
       |
       <a href="../_sources/sidechain/rotamer_constructor.txt"
diff --git a/doc/html/sidechain/rotamer_id.html b/doc/html/sidechain/rotamer_id.html
index bda098709cdddf59bd795f334d6559be95a71453..e324b292b422c8a57350ef8cfba159adabf832f7 100644
--- a/doc/html/sidechain/rotamer_id.html
+++ b/doc/html/sidechain/rotamer_id.html
@@ -6,7 +6,7 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
-    <title>RotamerID &mdash; ProMod3 1.1.0 documentation</title>
+    <title>RotamerID &mdash; ProMod3 1.2.0 documentation</title>
     
     <link rel="stylesheet" href="../_static/alabaster.css" type="text/css" />
     <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
@@ -14,7 +14,7 @@
     <script type="text/javascript">
       var DOCUMENTATION_OPTIONS = {
         URL_ROOT:    '../',
-        VERSION:     '1.1.0',
+        VERSION:     '1.2.0',
         COLLAPSE_INDEX: false,
         FILE_SUFFIX: '.html',
         HAS_SOURCE:  true
@@ -23,16 +23,18 @@
     <script type="text/javascript" src="../_static/jquery.js"></script>
     <script type="text/javascript" src="../_static/underscore.js"></script>
     <script type="text/javascript" src="../_static/doctools.js"></script>
-    <link rel="top" title="ProMod3 1.1.0 documentation" href="../index.html" />
+    <link rel="top" title="ProMod3 1.2.0 documentation" href="../index.html" />
     <link rel="up" title="sidechain - Sidechain Modelling" href="index.html" />
     <link rel="next" title="Rotamers" href="rotamer.html" />
     <link rel="prev" title="sidechain - Sidechain Modelling" href="index.html" />
    
+  <link rel="stylesheet" href="../_static/custom.css" type="text/css" />
   
-  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
 
   </head>
-  <body role="document">  
+  <body role="document">
+  
 
     <div class="document">
       <div class="documentwrapper">
@@ -91,7 +93,7 @@ or as <code class="docutils literal"><span class="pre">promod3.sidechain.Rotamer
 <div class="section" id="how-can-i-get-an-id">
 <h2>How can I get an ID?<a class="headerlink" href="#how-can-i-get-an-id" title="Permalink to this headline">¶</a></h2>
 <p>The RotamerID enum can directly be accessed from Python. Two convenient
-functions exist to get RotamerIDs from the <a class="reference external" href="http://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.AminoAcid</span></code></a> enum
+functions exist to get RotamerIDs from the <a class="reference external" href="https://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.AminoAcid</span></code></a> enum
 or from amino acid three letter codes.</p>
 <dl class="method">
 <dt id="promod3.sidechain.TLCToRotID">
@@ -116,12 +118,12 @@ exactly the naming convention defined above.</p>
 <dd><p>Directly translates <strong>aa</strong> into a RotamerID. Note, that it is not possible
 to generate special IDs this way
 (e.g. HSD, HSE or the special prolines/cysteins) since they&#8217;re simply not
-defined in <a class="reference external" href="http://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.AminoAcid</span></code></a></p>
+defined in <a class="reference external" href="https://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.AminoAcid</span></code></a></p>
 <table class="docutils field-list" frame="void" rules="none">
 <col class="field-name" />
 <col class="field-body" />
 <tbody valign="top">
-<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>aa</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.AminoAcid</span></code></a>) &#8211; AA enum of amino acid</td>
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>aa</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/conop/aminoacid/#ost.conop.AminoAcid" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.conop.AminoAcid</span></code></a>) &#8211; AA enum of amino acid</td>
 </tr>
 <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><a class="reference internal" href="#promod3.sidechain.RotamerID" title="promod3.sidechain.RotamerID"><code class="xref py py-class docutils literal"><span class="pre">RotamerID</span></code></a>, XXX if <strong>aa</strong> is invalid.</td>
 </tr>
@@ -174,9 +176,6 @@ defined in <a class="reference external" href="http://www.openstructure.org/docs
       <input type="hidden" name="check_keywords" value="yes" />
       <input type="hidden" name="area" value="default" />
     </form>
-    <p class="searchtip" style="font-size: 90%">
-    Enter search terms or a module, class or function name.
-    </p>
 </div>
 <script type="text/javascript">$('#searchbox').show(0);</script>
         </div>
@@ -184,11 +183,11 @@ defined in <a class="reference external" href="http://www.openstructure.org/docs
       <div class="clearer"></div>
     </div>
     <div class="footer">
-      &copy;2017, ProMod3 authors.
+      &copy;2018, ProMod3 authors.
       
       |
-      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a>
-      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.6</a>
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.4.1</a>
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
       
       |
       <a href="../_sources/sidechain/rotamer_id.txt"
diff --git a/doc/html/sidechain/rotamer_lib.html b/doc/html/sidechain/rotamer_lib.html
index 84f762d5194755fcd32bd35b6e184ba4309fe834..7bfcf345dae719027bd12f4096db2da54f3ca84b 100644
--- a/doc/html/sidechain/rotamer_lib.html
+++ b/doc/html/sidechain/rotamer_lib.html
@@ -6,7 +6,7 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
-    <title>Rotamer Library &mdash; ProMod3 1.1.0 documentation</title>
+    <title>Rotamer Library &mdash; ProMod3 1.2.0 documentation</title>
     
     <link rel="stylesheet" href="../_static/alabaster.css" type="text/css" />
     <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
@@ -14,7 +14,7 @@
     <script type="text/javascript">
       var DOCUMENTATION_OPTIONS = {
         URL_ROOT:    '../',
-        VERSION:     '1.1.0',
+        VERSION:     '1.2.0',
         COLLAPSE_INDEX: false,
         FILE_SUFFIX: '.html',
         HAS_SOURCE:  true
@@ -23,16 +23,18 @@
     <script type="text/javascript" src="../_static/jquery.js"></script>
     <script type="text/javascript" src="../_static/underscore.js"></script>
     <script type="text/javascript" src="../_static/doctools.js"></script>
-    <link rel="top" title="ProMod3 1.1.0 documentation" href="../index.html" />
+    <link rel="top" title="ProMod3 1.2.0 documentation" href="../index.html" />
     <link rel="up" title="sidechain - Sidechain Modelling" href="index.html" />
     <link rel="next" title="Rotamer Constructor" href="rotamer_constructor.html" />
     <link rel="prev" title="Frame" href="frame.html" />
    
+  <link rel="stylesheet" href="../_static/custom.css" type="text/css" />
   
-  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
 
   </head>
-  <body role="document">  
+  <body role="document">
+  
 
     <div class="document">
       <div class="documentwrapper">
@@ -80,7 +82,7 @@ less machine-dependent).</p>
 <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference internal" href="#promod3.sidechain.RotamerLib" title="promod3.sidechain.RotamerLib"><code class="xref py py-class docutils literal"><span class="pre">RotamerLib</span></code></a></td>
 </tr>
 <tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/2.7/library/exceptions.html#exceptions.RuntimeError" title="(in Python v2.7)"><code class="xref py py-exc docutils literal"><span class="pre">RuntimeError</span></code></a> if file cannot be opened or if
-file cannot be parsed (see <a class="reference internal" href="../portableIO.html#portableio"><span>here</span></a> for details).</td>
+file cannot be parsed (see <a class="reference internal" href="../portableIO.html#portableio"><span class="std std-ref">here</span></a> for details).</td>
 </tr>
 </tbody>
 </table>
@@ -92,7 +94,7 @@ file cannot be parsed (see <a class="reference internal" href="../portableIO.htm
 <dt id="promod3.sidechain.RotamerLib.SavePortable">
 <code class="descname">SavePortable</code><span class="sig-paren">(</span><em>filename</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.sidechain.RotamerLib.SavePortable" title="Permalink to this definition">¶</a></dt>
 <dd><p>Saves a raw / portable binary representation. Use portable files for
-distribution and convert locally to raw files. See <a class="reference internal" href="../portableIO.html#portableio"><span>here</span></a>
+distribution and convert locally to raw files. See <a class="reference internal" href="../portableIO.html#portableio"><span class="std std-ref">here</span></a>
 for details.</p>
 <table class="docutils field-list" frame="void" rules="none">
 <col class="field-name" />
@@ -200,7 +202,7 @@ less machine-dependent).</p>
 <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference internal" href="#promod3.sidechain.BBDepRotamerLib" title="promod3.sidechain.BBDepRotamerLib"><code class="xref py py-class docutils literal"><span class="pre">BBDepRotamerLib</span></code></a></td>
 </tr>
 <tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/2.7/library/exceptions.html#exceptions.RuntimeError" title="(in Python v2.7)"><code class="xref py py-exc docutils literal"><span class="pre">RuntimeError</span></code></a> if file cannot be opened or if
-file cannot be parsed (see <a class="reference internal" href="../portableIO.html#portableio"><span>here</span></a> for details).</td>
+file cannot be parsed (see <a class="reference internal" href="../portableIO.html#portableio"><span class="std std-ref">here</span></a> for details).</td>
 </tr>
 </tbody>
 </table>
@@ -212,7 +214,7 @@ file cannot be parsed (see <a class="reference internal" href="../portableIO.htm
 <dt id="promod3.sidechain.BBDepRotamerLib.SavePortable">
 <code class="descname">SavePortable</code><span class="sig-paren">(</span><em>filename</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.sidechain.BBDepRotamerLib.SavePortable" title="Permalink to this definition">¶</a></dt>
 <dd><p>Saves a raw / portable binary representation. Use portable files for
-distribution and convert locally to raw files. See <a class="reference internal" href="../portableIO.html#portableio"><span>here</span></a>
+distribution and convert locally to raw files. See <a class="reference internal" href="../portableIO.html#portableio"><span class="std std-ref">here</span></a>
 for details.</p>
 <table class="docutils field-list" frame="void" rules="none">
 <col class="field-name" />
@@ -438,7 +440,7 @@ standard deviations are NaN.</p>
 <col class="field-name" />
 <col class="field-body" />
 <tbody valign="top">
-<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>res</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; Source of dihedral angles</td>
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>res</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; Source of dihedral angles</td>
 </tr>
 <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><a class="reference internal" href="#promod3.sidechain.RotamerLibEntry" title="promod3.sidechain.RotamerLibEntry"><code class="xref py py-class docutils literal"><span class="pre">RotamerLibEntry</span></code></a></td>
 </tr>
@@ -462,7 +464,7 @@ are NaN.</p>
 <col class="field-body" />
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
-<li><strong>res</strong> (<a class="reference external" href="http://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.6.0)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; Source of dihedral angles</li>
+<li><strong>res</strong> (<a class="reference external" href="https://www.openstructure.org/docs/dev/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v1.7.1)"><code class="xref py py-class docutils literal"><span class="pre">ost.mol.ResidueHandle</span></code></a>) &#8211; Source of dihedral angles</li>
 <li><strong>id</strong> (<a class="reference internal" href="rotamer_id.html#promod3.sidechain.RotamerID" title="promod3.sidechain.RotamerID"><code class="xref py py-class docutils literal"><span class="pre">RotamerID</span></code></a>) &#8211; The identity of the returned <a class="reference internal" href="#promod3.sidechain.RotamerLibEntry" title="promod3.sidechain.RotamerLibEntry"><code class="xref py py-class docutils literal"><span class="pre">RotamerLibEntry</span></code></a></li>
 </ul>
 </td>
@@ -640,9 +642,6 @@ considered similar</li>
       <input type="hidden" name="check_keywords" value="yes" />
       <input type="hidden" name="area" value="default" />
     </form>
-    <p class="searchtip" style="font-size: 90%">
-    Enter search terms or a module, class or function name.
-    </p>
 </div>
 <script type="text/javascript">$('#searchbox').show(0);</script>
         </div>
@@ -650,11 +649,11 @@ considered similar</li>
       <div class="clearer"></div>
     </div>
     <div class="footer">
-      &copy;2017, ProMod3 authors.
+      &copy;2018, ProMod3 authors.
       
       |
-      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a>
-      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.6</a>
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.4.1</a>
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
       
       |
       <a href="../_sources/sidechain/rotamer_lib.txt"
diff --git a/doc/html/sidechain/subrotamer_optimizer.html b/doc/html/sidechain/subrotamer_optimizer.html
index 115320995a81dc0ba9270cb4f10ab83b5c8e2759..569714780b9983a1a1ad56afc95d30978e7b9a21 100644
--- a/doc/html/sidechain/subrotamer_optimizer.html
+++ b/doc/html/sidechain/subrotamer_optimizer.html
@@ -6,7 +6,7 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
-    <title>Subrotamer Optimization &mdash; ProMod3 1.1.0 documentation</title>
+    <title>Subrotamer Optimization &mdash; ProMod3 1.2.0 documentation</title>
     
     <link rel="stylesheet" href="../_static/alabaster.css" type="text/css" />
     <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
@@ -14,7 +14,7 @@
     <script type="text/javascript">
       var DOCUMENTATION_OPTIONS = {
         URL_ROOT:    '../',
-        VERSION:     '1.1.0',
+        VERSION:     '1.2.0',
         COLLAPSE_INDEX: false,
         FILE_SUFFIX: '.html',
         HAS_SOURCE:  true
@@ -23,16 +23,18 @@
     <script type="text/javascript" src="../_static/jquery.js"></script>
     <script type="text/javascript" src="../_static/underscore.js"></script>
     <script type="text/javascript" src="../_static/doctools.js"></script>
-    <link rel="top" title="ProMod3 1.1.0 documentation" href="../index.html" />
+    <link rel="top" title="ProMod3 1.2.0 documentation" href="../index.html" />
     <link rel="up" title="sidechain - Sidechain Modelling" href="index.html" />
     <link rel="next" title="scoring - Loop Scoring" href="../scoring/index.html" />
     <link rel="prev" title="Loading Rotamer Libraries" href="loading.html" />
    
+  <link rel="stylesheet" href="../_static/custom.css" type="text/css" />
   
-  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
 
   </head>
-  <body role="document">  
+  <body role="document">
+  
 
     <div class="document">
       <div class="documentwrapper">
@@ -116,9 +118,6 @@ internal <a class="reference internal" href="graph.html#promod3.sidechain.Rotame
       <input type="hidden" name="check_keywords" value="yes" />
       <input type="hidden" name="area" value="default" />
     </form>
-    <p class="searchtip" style="font-size: 90%">
-    Enter search terms or a module, class or function name.
-    </p>
 </div>
 <script type="text/javascript">$('#searchbox').show(0);</script>
         </div>
@@ -126,11 +125,11 @@ internal <a class="reference internal" href="graph.html#promod3.sidechain.Rotame
       <div class="clearer"></div>
     </div>
     <div class="footer">
-      &copy;2017, ProMod3 authors.
+      &copy;2018, ProMod3 authors.
       
       |
-      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a>
-      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.6</a>
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.4.1</a>
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
       
       |
       <a href="../_sources/sidechain/subrotamer_optimizer.txt"
diff --git a/doc/html/users.html b/doc/html/users.html
index 2a206b56c716fc91b19016a617ef5596bbb76efc..cbda6deb9b452b831f78abc83db49bf749632748 100644
--- a/doc/html/users.html
+++ b/doc/html/users.html
@@ -6,7 +6,7 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
-    <title>Documentation For Users &mdash; ProMod3 1.1.0 documentation</title>
+    <title>Documentation For Users &mdash; ProMod3 1.2.0 documentation</title>
     
     <link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
     <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
@@ -14,7 +14,7 @@
     <script type="text/javascript">
       var DOCUMENTATION_OPTIONS = {
         URL_ROOT:    './',
-        VERSION:     '1.1.0',
+        VERSION:     '1.2.0',
         COLLAPSE_INDEX: false,
         FILE_SUFFIX: '.html',
         HAS_SOURCE:  true
@@ -23,15 +23,17 @@
     <script type="text/javascript" src="_static/jquery.js"></script>
     <script type="text/javascript" src="_static/underscore.js"></script>
     <script type="text/javascript" src="_static/doctools.js"></script>
-    <link rel="top" title="ProMod3 1.1.0 documentation" href="index.html" />
+    <link rel="top" title="ProMod3 1.2.0 documentation" href="index.html" />
     <link rel="next" title="Getting Started" href="gettingstarted.html" />
     <link rel="prev" title="Welcome To ProMod3’s Documentation!" href="index.html" />
    
+  <link rel="stylesheet" href="_static/custom.css" type="text/css" />
   
-  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
 
   </head>
-  <body role="document">  
+  <body role="document">
+  
 
     <div class="document">
       <div class="documentwrapper">
@@ -88,6 +90,7 @@ scripts using the functionality of this library.</p>
 <li class="toctree-l2"><a class="reference internal" href="scoring/backbone_score_env.html">Backbone Score Environment</a></li>
 <li class="toctree-l2"><a class="reference internal" href="scoring/backbone_scorers.html">Backbone Scorers</a></li>
 <li class="toctree-l2"><a class="reference internal" href="scoring/all_atom_scorers.html">All Atom Scorers</a></li>
+<li class="toctree-l2"><a class="reference internal" href="scoring/other_scoring_functions.html">Other Scoring Functions</a></li>
 </ul>
 </li>
 <li class="toctree-l1"><a class="reference internal" href="loop/index.html"><code class="docutils literal"><span class="pre">loop</span></code> - Loop Handling</a><ul>
@@ -104,6 +107,7 @@ scripts using the functionality of this library.</p>
 <li class="toctree-l2"><a class="reference internal" href="core/helper.html"><code class="docutils literal"><span class="pre">helper</span></code> - Shared Functionality For the Everything</a></li>
 <li class="toctree-l2"><a class="reference internal" href="core/geometry.html">Geometry functions</a></li>
 <li class="toctree-l2"><a class="reference internal" href="core/runtime_profiling.html">Runtime profiling</a></li>
+<li class="toctree-l2"><a class="reference internal" href="core/graph_minimizer.html">Graph Minimizer</a></li>
 </ul>
 </li>
 <li class="toctree-l1"><a class="reference internal" href="core/setcompoundschemlib.html"><code class="docutils literal"><span class="pre">SetCompoundsChemlib()</span></code></a></li>
@@ -140,9 +144,6 @@ scripts using the functionality of this library.</p>
       <input type="hidden" name="check_keywords" value="yes" />
       <input type="hidden" name="area" value="default" />
     </form>
-    <p class="searchtip" style="font-size: 90%">
-    Enter search terms or a module, class or function name.
-    </p>
 </div>
 <script type="text/javascript">$('#searchbox').show(0);</script>
         </div>
@@ -150,11 +151,11 @@ scripts using the functionality of this library.</p>
       <div class="clearer"></div>
     </div>
     <div class="footer">
-      &copy;2017, ProMod3 authors.
+      &copy;2018, ProMod3 authors.
       
       |
-      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a>
-      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.6</a>
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.4.1</a>
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
       
       |
       <a href="_sources/users.txt"
diff --git a/doc/tests/data/port_str_db.dat b/doc/tests/data/port_str_db.dat
index 5c183190ce902c88a35cc99fb5e4fd69a71ef62f..a861977c6a974dd2a15929b9f5c71415d57901d3 100644
Binary files a/doc/tests/data/port_str_db.dat and b/doc/tests/data/port_str_db.dat differ
diff --git a/doc/tests/scripts/loop_frag_db.py b/doc/tests/scripts/loop_frag_db.py
index c1489985dbb9d51bbea02cf9f41ea9075a1f0556..0efd8226859dbfc115f5973d3d456b6e1b88bfed 100644
--- a/doc/tests/scripts/loop_frag_db.py
+++ b/doc/tests/scripts/loop_frag_db.py
@@ -31,4 +31,4 @@ fragment_infos = frag_db.SearchDB(n_stem, c_stem, 5)
 for i,f_i in enumerate(fragment_infos):
     bb_list = structure_db.GetBackboneList(n_stem, c_stem,
                                            f_i, frag_seq)
-    io.SavePDB(bb_list.ToEntity(), str(i) + ".pdb")
\ No newline at end of file
+    io.SavePDB(bb_list.ToEntity(), str(i) + ".pdb")
diff --git a/doc/tests/scripts/loop_structure_db.py b/doc/tests/scripts/loop_structure_db.py
index 65e87c37a572d47a7fc126082f04e07353cf81a6..e8aca38a2d3b101be4a486209203f62116caf01b 100644
--- a/doc/tests/scripts/loop_structure_db.py
+++ b/doc/tests/scripts/loop_structure_db.py
@@ -1,74 +1,89 @@
 from promod3 import loop
-from ost import io
+from ost import io, seq
 import os
 
-# we also need the external tools dssp and msms, you have to make
-# sure that they are somewhere in your PATH
-from ost.bindings import dssp
-from ost.bindings import msms
+# StructureDB where all data get extracted
+structure_db_one = loop.StructureDB(loop.StructureDBDataType.All)
 
-structure_db = loop.StructureDB()
+# StructureDB where we only have the default data 
+# (positions and sequence) plus residue depths and dihedrals.
+# In order to pass the required flags, we use a bitwise or.
+structure_db_two = loop.StructureDB(
+                   loop.StructureDBDataType.ResidueDepths |
+                   loop.StructureDBDataType.Dihedrals)
 
-# lets fill in some structures. It gets assumed, that all required
-# data lies in the following directories
+# Lets fill in some structures. It gets assumed, that all required
+# data lies in the following directories.
 structure_dir = "data"
 prof_dir = "data"
 
-# the first 4 letters are suposed to be the pdb id, and the last one
-# the corresponding chain name. The naming of the files in the
-# directories is e.g. 1CRN.pdb for the structure and 1CRNA.hhm for
-# the profile. Please note, that the structure can contain several
-# chains, whereas the hhm file is only for that specific chain.
-ids = ["1CRNA", "1AKIA"]
+# The naming of the files in the directories is e.g. 1CRN.pdb for 
+# the structure and 1CRNA.hhm for the profile. Please note, 
+# that the structure can contain several chains, whereas the hhm 
+# file is only for that specific chain.
+structure_ids = ["1CRN", "1AKI"]
+chain_names = ["A", "A"]
 
-for i in ids:
+for s_id, ch_name in zip(structure_ids, chain_names):
 
-    pdb_id = i[:4]
-    chain_id = i[4]
+    # Join together the data paths.
+    structure_path = os.path.join(structure_dir, s_id + ".pdb")
+    prof_path = os.path.join(prof_dir, s_id + ch_name + ".hhm")
 
-    # join together the data paths
-    structure_path = os.path.join(structure_dir, pdb_id + ".pdb")
-    prof_path = os.path.join(prof_dir, pdb_id + chain_id + ".hhm")
-
-    # let's load the structure
+    # Let's load the structure.
     structure = io.LoadPDB(structure_path).Select("peptide=True")
-    single_chain_structure = structure.Select("cname=" + chain_id)
     
-    # and the according profile in hhm format
+    # And the according profile in hhm format.
     prof = io.LoadSequenceProfile(prof_path)
 
-    # we run dssp in a way, that the secondary structure, as well as
-    # the solvent accessibily gets assigned
-    dssp.AssignDSSP(structure, extract_burial_status=True)
+    # For simplicity we use as SEQRES the sequence from the profile.
+    # In this case the numbering of the structures already matches.
+    seqres = seq.CreateSequence(ch_name, prof.sequence)
 
-    # as a final step we need the surface as calculated by msms
-    surf = msms.CalculateSurface(structure)[0]
+    # Add the stuff to the first StructureDB
+    structure_db_one.AddCoordinates(s_id, ch_name, structure, 
+                                    seqres, prof)
 
-    # let's add it! Please note, that we calculated solvent 
-    # accessiblity / secondary structure and surface on the full
-    # structure but only add one of the chains.
-    structure_db.AddCoordinates(pdb_id, chain_id,
-                                single_chain_structure.chains[0], 
-                                surf, prof)
+    # Add the stuff to the second StructureDB, 
+    # No profile required here...
+    structure_db_two.AddCoordinates(s_id, ch_name, structure, 
+                                    seqres)
 
-# we now have two structures in the database...
+                                
+# We now have two structures in both databases...
 
 # Please note, that there is no profile derived from structures
-# assigned yet. To demonstrate, we use our small db to derive
-# profiles.
-src_db = structure_db
-# In practice you might want to use the default StructureDB instead:
-# src_db = loop.LoadStructureDB()
+# assigned yet to structure_db_one, the memory is only allocated
+# and set to zero. In structure_db_two, there'll never be stored a 
+# structure profile as we did not initialize it accordingly. 
+# However, we can still use its coordinates and residue depths to
+# generate profiles!  
+# To demonstrate, we use our structure_db_two to derive profiles 
+# and set them in structure_db_one.
+
+for i in range(structure_db_one.GetNumCoords()):
 
-for i in range(structure_db.GetNumCoords()):
     # get the CoordInfo for chain with index i 
-    coord_info = structure_db.GetCoordInfo(i)
+    coord_info = structure_db_one.GetCoordInfo(i)
+
     # define a fragment, that covers the full length
     frag_info = loop.FragmentInfo(i, 0, coord_info.size)
-    # generate a profile based on the structural data in the src_db
-    prof = src_db.GenerateStructureProfile(structure_db, frag_info)
+
+    # extract all required information
+    sequence = structure_db_one.GetSequence(frag_info)
+    bb_list = structure_db_one.GetBackboneList(frag_info, sequence)
+    res_depths = structure_db_one.GetResidueDepths(frag_info)
+
+    # generate structure profiles based on structure_db_two
+    prof = structure_db_two.GenerateStructureProfile(bb_list, 
+                                                     res_depths)
     # and add it to the previously created structure_db
-    structure_db.SetStructureProfile(i, prof)
+    structure_db_one.SetStructureProfile(i, prof)
 
-# That's it! Let's save it down...
-structure_db.Save("my_db.dat")
+# That's it! Let's save both databases down.
+# structure_db_two will use much less memory, as it contains less data. 
+# Sidenote: We're saving the portable version. If you intent to use 
+# your database only on one system, the Save / Load functions should
+# be preferred, as the loading will be much faster.
+structure_db_one.SavePortable("my_db_one.dat")
+structure_db_two.SavePortable("my_db_two.dat")
diff --git a/doc/tests/scripts/modelling_loop_candidates.py b/doc/tests/scripts/modelling_loop_candidates.py
index 7c351c224f05541004af964c30cbab8deb99a670..60d4abeb8836fd3e035c877bfe1c09982958fa67 100644
--- a/doc/tests/scripts/modelling_loop_candidates.py
+++ b/doc/tests/scripts/modelling_loop_candidates.py
@@ -40,7 +40,7 @@ scorer.AttachEnvironment(score_env)
 # the scorer can then be used on the LoopCandidates object to
 # calculate desired scores (here: cbeta & clash, start resnum = 24)
 bb_scores = modelling.ScoreContainer()
-loop_candidates.CalculateBackboneScores(bb_scores, scorer,
+loop_candidates.CalculateBackboneScores(bb_scores, scorer, score_env,
                                         ["cbeta", "clash"], 24)
 # we finally perform a weighted linear combination of the scores,
 # pick the best one, insert it into our structure and save it
diff --git a/doc/tests/scripts/modelling_loop_scoring.py b/doc/tests/scripts/modelling_loop_scoring.py
index a3b97a71fa295692176887c0c09d2b26248f2f39..b6456842b3765897d54c6fd9bb5060a142604291 100644
--- a/doc/tests/scripts/modelling_loop_scoring.py
+++ b/doc/tests/scripts/modelling_loop_scoring.py
@@ -64,8 +64,7 @@ candidates.CalculateSequenceProfileScores(all_scores, structure_db,
 candidates.CalculateStructureProfileScores(all_scores, structure_db,
                                            prof, start_idx)
 # add backbone scores
-scorer = mhandle.backbone_scorer
-candidates.CalculateBackboneScores(all_scores, scorer, start_resnum)
+candidates.CalculateBackboneScores(all_scores, mhandle, start_resnum)
 # add all atom scores
 candidates.CalculateAllAtomScores(all_scores, mhandle, start_resnum)
 
diff --git a/doc/tests/scripts/modelling_monte_carlo.py b/doc/tests/scripts/modelling_monte_carlo.py
index 1ba67afd737052b0cfb7becd7b09026cef786f47..b3d7d07b76016f7f9f3746a5ea683a4dd9630165 100644
--- a/doc/tests/scripts/modelling_monte_carlo.py
+++ b/doc/tests/scripts/modelling_monte_carlo.py
@@ -32,7 +32,8 @@ scorer.AttachEnvironment(score_env)
 weights = dict()
 weights["cbeta"] = 10.0
 weights["clash"] = 0.1
-mc_scorer = modelling.LinearScorer(scorer, start_resnum,
+mc_scorer = modelling.LinearScorer(scorer, score_env,
+                                   start_resnum, terminal_len,
                                    chain_index, weights)
 
 # setup mc_cooler
diff --git a/doc/tests/scripts/scoring_main.py b/doc/tests/scripts/scoring_main.py
index 827ac2908250392428b24bcc50e8a90a680b6e4a..a5bb94771e369e18b2f14720e4c312689386e566 100644
--- a/doc/tests/scripts/scoring_main.py
+++ b/doc/tests/scripts/scoring_main.py
@@ -15,13 +15,8 @@ clash_scorer.AttachEnvironment(score_env)
 cbeta_scorer = scoring.LoadCBetaScorer()
 cbeta_scorer.AttachEnvironment(score_env)
 
-# get backbone list to be scored
-# (here extracted from the structure, but it could be anything)
-ev = ent.Select("rnum >= 23 and rnum <= 30")
-bb_seq = ''.join([r.one_letter_code for r in ev.residues])
-bb_res = [r.handle for r in ev.residues]
-bb_list = loop.BackboneList(bb_seq, bb_res)
-
-# score it (note that 23 is the starting res. num.)
-print "Clash-Score", clash_scorer.CalculateScore(bb_list, 23)
-print "CBeta-Score", cbeta_scorer.CalculateScore(bb_list, 23)
+# calculate scores for 10 residues starting at residue number 23.
+# all required structural information comes from the environment
+# that can evolve as the modelling proceeds.
+print "Clash-Score", clash_scorer.CalculateScore(23, 10)
+print "CBeta-Score", cbeta_scorer.CalculateScore(23, 10)
diff --git a/doc/tests/scripts/sidechain_steps.py b/doc/tests/scripts/sidechain_steps.py
index bf1a3866356d84db21819df5fa63218a41575b58..aa903d2477f57fcdaee574060afddb3b6c4a013e 100644
--- a/doc/tests/scripts/sidechain_steps.py
+++ b/doc/tests/scripts/sidechain_steps.py
@@ -6,8 +6,8 @@ prot = io.LoadPDB('data/1CRN.pdb')
 # load rotamer library
 library = sidechain.LoadDunbrackLib()
 # we need a rotamer constructor to create any rotamers or 
-# frame residues
-rot_constructor = sidechain.SCWRLRotamerConstructor()
+# frame residues 
+rot_constructor = sidechain.SCWRLRotamerConstructor(False)
 
 # create new entity from protein only containing the amino acids
 prot = mol.CreateEntityFromView(prot.Select("peptide=true"), True)
diff --git a/doc/tests/test_doctests.py b/doc/tests/test_doctests.py
index 533148559befc5dc1d2fd23e01fcea2c4a2d962d..bd9d89a001f8f883e1804a08bf7dd3d48dbbf009 100644
--- a/doc/tests/test_doctests.py
+++ b/doc/tests/test_doctests.py
@@ -204,31 +204,14 @@ class DocTests(unittest.TestCase):
         os.remove('randomized_fragment.pdb')
 
     def testLoopStructureDB(self):
-        # check binaries
-        binaries_found = True
-        try:
-            # same check used in OST
-            settings.Locate(['dsspcmbi','dssp','mkdssp'],
-                            env_name='DSSP_EXECUTABLE')
-        except settings.FileNotFound:
-            print 'dssp binary is missing. Please install it and make it ' + \
-                  'available in your PATH to execute test testLoopStructureDB.'
-            binaries_found = False
-        try:
-            # same check used in OST
-            settings.Locate('msms')
-        except settings.FileNotFound:
-            print 'msms binary is missing. Please install it and make it ' + \
-                  'available in your PATH to execute test testLoopStructureDB.'
-            binaries_found = False
-        if not binaries_found:
-            return
         # run it
         self.checkPMRun('loop_structure_db.py', [], 0)
         # check that result exists and is readable
-        loop.StructureDB.Load('my_db.dat')
+        loop.StructureDB.LoadPortable('my_db_one.dat')
+        loop.StructureDB.LoadPortable('my_db_two.dat')        
         # clean up
-        os.remove('my_db.dat')
+        os.remove('my_db_one.dat')
+        os.remove('my_db_two.dat')
 
     def testLoopFragDB(self):
         # run it
@@ -248,7 +231,7 @@ class DocTests(unittest.TestCase):
         self.assertEqual(len(out_lines), 101)
         # NOTE: this last output depends on the structure-db!
         self.assertEqual(out_lines[-1].strip(),
-                         'Fraction of fragments below 3A: 0.48')
+                         'Fraction of fragments below 3A: 0.47')
         # check that result exists and is readable
         loop.FraggerMap.LoadBB('frag_map.dat')
         # clean up
diff --git a/extras/data_generation/frag_db/build_frag_db.py b/extras/data_generation/frag_db/build_frag_db.py
index 19602b2f274ac4bd04699dac11c4c89053ceeacf..5faa5ad22d6b209846544ddbc1900aa43e5c7b36 100644
--- a/extras/data_generation/frag_db/build_frag_db.py
+++ b/extras/data_generation/frag_db/build_frag_db.py
@@ -16,5 +16,5 @@ for i in range(3,15):
   fragdb.AddFragments(i,max_pairwise_rmsd,structure_db)
 
 fragdb.PrintStatistics()
-fragdb.Save('frag_db.dat')
+fragdb.SavePortable('frag_db.dat')
 
diff --git a/extras/data_generation/structure_db/README b/extras/data_generation/structure_db/README
index ed5115ddf021c6095061af6b05ae971248816da0..f86fa19e8c37a82083e61ecc780679ff606a4dbb 100644
--- a/extras/data_generation/structure_db/README
+++ b/extras/data_generation/structure_db/README
@@ -9,6 +9,8 @@ Steps to obtain a structural database:
    from PISCES: http://dunbrack.fccc.edu/PISCES.php
    The get_data_from_smtl.py script directly reads in such a file and produces
    the input for the second step in StructureDB generation. 
+   BUT: THE CHAIN NAMING WILL BE THE ONE AS IN THE SMTL, IT DOESN'T RELATE
+   ANYMORE TO THE PDB NAMING!
 
 2. Build an initial database: use build_structure_db.py with input generated
    in step one.
@@ -20,9 +22,12 @@ BUT BE AWARE, THE ACCORDING FREQUENCIES IN THE DATABASE WILL BE SET TO 0.0!
    The script calculates the structure profiles for a subset of the
    sequences in the desired StructureDB and is intended for parallelization
    
-4. Parallelize step 3: use submit_structure_profile_calculations.py
-   This script uses the SGE submission on BC2 and you might have to 
-   adapt for your system
+4. Parallelize step 3: use prepare_slurm_submission_structure_profiles.py
+   This script generates a submission script and a batch command file 
+   that you can submit with sbatch structure_profile_generation_array.sh.
+   This is intended to be used with the SLURM submission system.
+   IMPORTANT: there are many paths to adapt on top of
+              prepare_slurm_submission_structure_profiles.py
 
 5. Assign the structure profiles generated in step 3 and 4 to the 
    initial database generated in step 2: 
@@ -31,10 +36,9 @@ BUT BE AWARE, THE ACCORDING FREQUENCIES IN THE DATABASE WILL BE SET TO 0.0!
 
 To qualitatively reproduce the default StructuralDB in ProMod3, you first 
 perform step 1 and 2 with a non redundant set of protein structures as 
-defined by PISCES with around 25000 chains (e.g. seq id threshold: 90, 
-resolution threshold: 2.2). 
+defined by PISCES with around 20000 chains (e.g. seq id threshold: 60, 
+resolution threshold: 2.5). 
 Repeat step 1 and 2 with a smaller PISCES list (5000-6000 entries, 
-e.g. seq id threshold: 25 , resolution threshold: 1.8). 
+e.g. seq id threshold: 20 , resolution threshold: 2.0). 
 The first database serves as default StructureDB and the second db as 
 the source db for the structural profiles generated in steps 3-5.
-
diff --git a/extras/data_generation/structure_db/assign_structure_profiles.py b/extras/data_generation/structure_db/assign_structure_profiles.py
index 64029be3aedf16222f622dd102fd8c664b5295c5..2c14c44087fbd2a84be740c1f626565cfae81dd4 100644
--- a/extras/data_generation/structure_db/assign_structure_profiles.py
+++ b/extras/data_generation/structure_db/assign_structure_profiles.py
@@ -1,49 +1,50 @@
 import os
 from promod3 import loop
-
+from ost import seq
 
 # Path to StructureDB to which you want to assign the profile information.
 # (relative to current working directory!)
-db_path = "structure_db.dat"
+db_path = "portable_structure_db_60.dat"
 
 # Directory that contains the profile databases (and only profile databases)
 # as generated by the create_structure_profiles.py script.
 # (relative to current working directory)
-profile_dir = "profile_dbs"
+profile_dir = "structure_profile_dbs"
 
 # path to store the StructureDB with assigned_profiles
 # (relative to current working directory!)
-db_out_path = "structure_db_with_structure_profiles.dat"
-
+db_out_path = "portable_structure_db_60_with_structure_profiles.dat"
 
-structure_db = loop.StructureDB.Load(db_path)
+structure_db = loop.StructureDB.LoadPortable(db_path)
 
 # lets gather all profiles in one ProfileDB
 profile_db_files = os.listdir(profile_dir)
-profile_db = ost.seq.ProfileDB()
+profile_db = seq.ProfileDB()
 
 for f in profile_db_files:
   db_path = os.path.join(profile_dir, f)
-  loaded_db = ost.seq.ProfileDB.Load(db_path)
+  loaded_db = seq.ProfileDB.Load(db_path)
   entry_names = loaded_db.GetNames()
   for name in entry_names:
     profile_db.AddProfile(name, loaded_db.GetProfile(name))
-    print name
 
 # Assign the profiles
 for coord_idx in range(structure_db.GetNumCoords()):
   coord_info = structure_db.GetCoordInfo(coord_idx)
-  entry_id = coord_info.pdb_id
+
+  entry_id = coord_info.id
+  entry_chain_name = coord_info.chain_name
+  full_id = '_'.join([entry_id, entry_chain_name])
 
   structure_profile = None
   try:
-    structure_profile = profile_db.GetProfile(entry_id)
+    structure_profile = profile_db.GetProfile(full_id)
   except:
-    print "Could not find structure profile for ", entry_id, " skip..."
+    print "Could not find structure profile for ", full_id, " skip..."
     continue
     
   structure_db.SetStructureProfile(coord_idx, structure_profile)
 
 # DONE! 
-structure_db.Save(db_out_path)
+structure_db.SavePortable(db_out_path)
 
diff --git a/extras/data_generation/structure_db/build_structure_db.py b/extras/data_generation/structure_db/build_structure_db.py
index 409f67b34a8f775ad00db032a1f963282936e447..450899c4e2d2f9e95ee001cbaf19f6e2032543e5 100644
--- a/extras/data_generation/structure_db/build_structure_db.py
+++ b/extras/data_generation/structure_db/build_structure_db.py
@@ -2,115 +2,14 @@ from promod3 import loop
 import os
 import traceback
 from ost import io
-from ost.bindings import msms
-from ost.mol.alg import AssignSecStruct
-from ost.mol.alg import Accessibility
-
-###############
-# SCROLL DOWN #
-###############
-
-bb_atoms = ["N","CA","C","O","CB"]
-
-parent_residues = dict()
-parent_residues["MSE"] = "MET"
-parent_residues["CSX"] = "CYS"
-parent_residues["FP9"] = "PRO"
-parent_residues["HYP"] = "PRO"
-parent_residues["SEP"] = "SER"
-parent_residues["SAH"] = "CYS"
-parent_residues["MLY"] = "LYS"
-parent_residues["NLE"] = "LEU"
-parent_residues["ABA"] = "ALA"
-parent_residues["SLZ"] = "LYS"
-parent_residues["KCX"] = "LYS"
-parent_residues["OCS"] = "CYS"
-parent_residues["HIC"] = "HIS"
-parent_residues["TPO"] = "THR"
-parent_residues["CME"] = "CYS"
-parent_residues["ALY"] = "LYS"
-parent_residues["SAM"] = "MET"
-parent_residues["MEN"] = "ASN"
-parent_residues["LLP"] = "LYS"
-parent_residues["CSD"] = "ALA"
-parent_residues["PCA"] = "PRO"
-parent_residues["SCY"] = "CYS"
-parent_residues["CSO"] = "CYS"
-parent_residues["PHD"] = "ASP"
-parent_residues["SLZ"] = "LYS"
-parent_residues["TYS"] = "TYR"
-parent_residues["CAS"] = "CYS"
-parent_residues["TRQ"] = "TRP"
-parent_residues["DPR"] = "PRO"
-parent_residues["CSW"] = "CYS"
-parent_residues["CAF"] = "CYS"
-parent_residues["NIY"] = "TYR"
-parent_residues["LYZ"] = "LYS"
-parent_residues["SME"] = "MET"
-parent_residues["CSS"] = "CYS"
-parent_residues["MLZ"] = "LYS"
-parent_residues["DAH"] = "PHE"
-parent_residues["MSO"] = "MET"
-parent_residues["PHI"] = "PHE"
-parent_residues["TYI"] = "TYR"
-parent_residues["GLX"] = "GLU" #could also be GLN
-parent_residues["OMT"] = "MET"
-parent_residues["CSU"] = "CYS"
-parent_residues["HZP"] = "PRO"
-parent_residues["SEC"] = "CYS"
-parent_residues["DPN"] = "PHE"
-parent_residues["NEP"] = "HIS"
-parent_residues["HIP"] = "HIS"
-parent_residues["DGL"] = "GLU"
-
-one_letter_codes = dict()
-one_letter_codes["ALA"] = 'A'
-one_letter_codes["ARG"] = 'R'
-one_letter_codes["HIS"] = 'H'
-one_letter_codes["LYS"] = 'K'
-one_letter_codes["ASP"] = 'D'
-one_letter_codes["GLU"] = 'E'
-one_letter_codes["SER"] = 'S'
-one_letter_codes["THR"] = 'T'
-one_letter_codes["ASN"] = 'N'
-one_letter_codes["GLN"] = 'Q'
-one_letter_codes["CYS"] = 'C'
-one_letter_codes["GLY"] = 'G'
-one_letter_codes["PRO"] = 'P'
-one_letter_codes["VAL"] = 'V'
-one_letter_codes["ILE"] = 'I'
-one_letter_codes["LEU"] = 'L'
-one_letter_codes["MET"] = 'M'
-one_letter_codes["PHE"] = 'F'
-one_letter_codes["TYR"] = 'Y'
-one_letter_codes["TRP"] = 'W'
-
-def Clean(prot):
-  ed = prot.handle.EditXCS()
-
-  for r_view in prot.residues:
-    if r_view.GetName() in parent_residues:
-      r = r_view.handle
-      ed.RenameResidue(r,parent_residues[r.GetName()])
-      r.SetOneLetterCode(one_letter_codes[r.GetName()])
- 
-      atoms_to_delete = list()
-
-      for a in r.atoms:
-        if a.GetName() not in bb_atoms:
-          atoms_to_delete.append(a)
-        else:
-          a.is_hetatom=False
-
-
-      for a in atoms_to_delete:
-        ed.DeleteAtom(a)
-
-
+from ost import seq
+from ost import mol
+from ost import conop
 
 # This script generates a StructureDB using a list of nonredundant pdb
-# files. All pdb files get cleaned using some basic heuristics.
-# please note, that the values for the structure profile in the produced
+# files. All pdb files get cleaned using Molck from openstructure with
+# with settings specified below.
+# Please note, that the values for the structure profile in the produced
 # db are only allocated and simply set to zero.
 # You therefore need to create an initial db, from which you can create
 # these structure profiles and set them in a second step.
@@ -125,7 +24,7 @@ def Clean(prot):
 # file generated by get_data_from_smtl.py (or by yourself)
 # every line requires to be in the format: pdb_id chain_name
 # e.g. 5UZG A
-data = open("data_extracted_from_smtl.txt",'r').readlines()
+data = open("cullpdb_pc60_res2.5_R1.0_d180524_chains25634_data_extracted_from_smtl.txt", 'r').readlines()
 
 # directory containing the structures. naming: pdb_id.pdb
 # (pdb_id in upper case!) e.g. 5UZG.pdb
@@ -135,12 +34,22 @@ structure_dir = "structures"
 # (pdb_id and chain_id in upper case!) e.g. 5UZGA.hhm
 profile_dir = "hmms" 
 
+# molck settings to process the input structures
+molck_settings = mol.alg.MolckSettings()
+molck_settings.rm_unk_atoms = True
+molck_settings.rm_non_std = True
+molck_settings.rm_hyd_atoms = True
+molck_settings.rm_oxt_atoms = True
+molck_settings.rm_zero_occ_atoms = True
+molck_settings.map_nonstd_res = True
+molck_settings.assign_elem = True
 
-path_to_msms_binary = "/scicore/soft/apps/msms/2.6.1-linux-x86_64/msms.x86_64Linux2.2.6.1"
-
+# Assumes that a proper compound lib has been specified when 
+# compiling openstructure
+compound_lib = conop.GetDefaultLib()
 
 # Do it!!
-structure_db = loop.StructureDB()
+structure_db = loop.StructureDB(loop.StructureDBDataType.All)
 
 for i,line in enumerate(data):
 
@@ -149,6 +58,7 @@ for i,line in enumerate(data):
   chain_id = split_line[1]
 
   try:
+
     print 'processing: ',prot_id,' on line: ',i
 
     prot_path = os.path.join(structure_dir, prot_id+'.pdb')
@@ -161,25 +71,27 @@ for i,line in enumerate(data):
       print "Could not find hhm file... skip..."
       continue
 
-    prot = io.LoadPDB(prot_path).Select('peptide=true')
+    # load and clean full structure
+    prot = io.LoadPDB(prot_path)
+    mol.alg.Molck(prot, compound_lib, molck_settings)
+
+    # we're only interested in the peptide chains...
+    prot = prot.Select("peptide=true")
+
+    # get profile and seqres
     hmm = io.LoadSequenceProfile(hhm_path)
+    raw_seqres = hmm.sequence
+    seqres = seq.CreateSequence("seqres", raw_seqres)
 
-    Clean(prot)
-    AssignSecStruct(prot)
-    Accessibility(prot, algorithm=mol.alg.AccessibilityAlgorithm.DSSP)
-    surf = msms.CalculateSurface(prot, msms_exe=path_to_msms_binary)[0]
-    prot_single_chain = prot.Select("cname="+chain_id)
-    idx = structure_db.AddCoordinates(prot_id, chain_id, 
-                                      prot_single_chain.chains[0], surf, hmm,
-                                      solvent_accessibility_string="asaAbs") 
-   
-      
+    # add it
+    structure_db.AddCoordinates(prot_id, chain_id, 
+                                prot, seqres, hmm) 
+     
   except:
     traceback.print_exc()
 
 
 structure_db.PrintStatistics()
-structure_db.Save('structure_db.dat')
-
+structure_db.SavePortable('portable_structure_db_60.dat')
 
 
diff --git a/extras/data_generation/structure_db/create_structure_profiles.py b/extras/data_generation/structure_db/create_structure_profiles.py
index ec227549785f97790208abaa3764af16eb06ea6c..a0e335925a4ed4fa5ced2e07a44bd0b379da4bb8 100644
--- a/extras/data_generation/structure_db/create_structure_profiles.py
+++ b/extras/data_generation/structure_db/create_structure_profiles.py
@@ -3,6 +3,7 @@ import sys
 from promod3 import loop
 from ost import seq
 import time
+import traceback
 
 if len(sys.argv) != 6:
 
@@ -47,14 +48,30 @@ profile_db = seq.ProfileDB()
 for i in range(start,end):
   print "processing chain with idx", i
 
-  # generate fragment info object
-  coord_info = structure_db.GetCoordInfo(i)
-  fragment_info = loop.FragmentInfo(i,0,coord_info.size)
-  
-  # generate the structure profile given the source StructureDB
-  profile = structure_db.GenerateStructureProfile(structure_db_source, fragment_info)
-  profile_db.AddProfile(coord_info.pdb_id, profile)
+  try:
+    # generate fragment info object
+    coord_info = structure_db.GetCoordInfo(i)
+    fragment_info = loop.FragmentInfo(i,0,coord_info.size)
+    sequence = structure_db.GetSequence(fragment_info)
+    bb_list = structure_db.GetBackboneList(fragment_info, sequence)
+    residue_depths = structure_db.GetResidueDepths(fragment_info)  
 
+    print "id: ", coord_info.id
+    print "chain_name: ", coord_info.chain_name
+    print "sequence length: ", len(sequence)
+
+    # generate the structure profile given the source StructureDB
+    start = time.time()
+    profile = structure_db_source.GenerateStructureProfile(bb_list, residue_depths)
+    end = time.time()
+
+    print "it took: ", end-start
+
+    profile_db.AddProfile('_'.join([coord_info.id, coord_info.chain_name]), profile)
+
+  except:
+    traceback.print_exc()
+    print "failed to create structure profile... skip..."
 
 profile_db.Save(profile_db_out_path)
 
diff --git a/extras/data_generation/structure_db/get_data_from_smtl.py b/extras/data_generation/structure_db/get_data_from_smtl.py
index a881e5206502bd07fe11234d0162d7e4dc274fa7..7965046a728bd55260ab275073d7449ce7147db7 100644
--- a/extras/data_generation/structure_db/get_data_from_smtl.py
+++ b/extras/data_generation/structure_db/get_data_from_smtl.py
@@ -15,7 +15,7 @@ from sm import smtl
 # 2. Fetch the data manually from the PDB and obtain the profiles with 
 #    the hh-suite available at: https://github.com/soedinglab/hh-suite.
 
-pisces_path = "cullpdb_pc20_res1.8_R0.25_d170820_chains4892"
+pisces_path = "cullpdb_pc20_res2.0_R0.25_d180524_chains6670"
 smtl_path = "/scicore/data/databases/SMTL/"
 
 profile_out_dir = "hmms"
@@ -29,13 +29,11 @@ pisces_data = open(pisces_path).readlines()
 # in here we store pdb id and chain name relative to the SMTL
 fetched_structures = list()
 
-
 if not os.path.exists(profile_out_dir):
   os.makedirs(profile_out_dir)
 if not os.path.exists(structure_out_dir):
   os.makedirs(structure_out_dir)
 
-
 for i,line in enumerate(pisces_data[1:]):
 
   prot_id = line[:4]
@@ -76,8 +74,8 @@ for i,line in enumerate(pisces_data[1:]):
           structure = ch.structure
           profile_path = tpl_lib.ProfileForTemplate(unique_name)
 
-          profile_out_path = os.path.join(profile_out_dir, prot_id+ch.name+".hhm")
-          structure_out_path = os.path.join(structure_out_dir, prot_id+".pdb")
+          profile_out_path = os.path.join(profile_out_dir, prot_id + ch.name + ".hhm")
+          structure_out_path = os.path.join(structure_out_dir, prot_id + ".pdb")
 
           # copy over the profile
           os.system(' '.join(["cp", profile_path, profile_out_path]))
@@ -98,7 +96,7 @@ for i,line in enumerate(pisces_data[1:]):
   
 
 
-outfile = open("data_extracted_from_smtl.txt",'w')
+outfile = open(pisces_path + "_data_extracted_from_smtl.txt",'w')
 outfile.write('\n'.join([(x[0] + ' ' + x[1]) for x in fetched_structures]))
 outfile.close()
 
diff --git a/extras/data_generation/structure_db/prepare_slurm_submission_structure_profiles.py b/extras/data_generation/structure_db/prepare_slurm_submission_structure_profiles.py
new file mode 100644
index 0000000000000000000000000000000000000000..d982a468161a2ccfbcceb994961f4f7e706f543d
--- /dev/null
+++ b/extras/data_generation/structure_db/prepare_slurm_submission_structure_profiles.py
@@ -0,0 +1,57 @@
+from promod3 import loop
+import os
+
+profiles_per_job = 60
+structure_db_path = "/scicore/home/schwede/studga00/data/promod3_databases/final_shit/structure_db_60.dat"
+source_structure_db_path = "/scicore/home/schwede/studga00/data/promod3_databases/final_shit/structure_db_20.dat"
+profile_db_out_dir = "/scicore/home/schwede/studga00/data/promod3_databases/final_shit/structure_profile_dbs"
+awesome_script = "/scicore/home/schwede/studga00/data/promod3_databases/final_shit/create_structure_profiles.py"
+
+
+structure_db = loop.StructureDB.Load(structure_db_path)
+n_entries = structure_db.GetNumCoords()
+
+from_idx = 0
+to_idx = profiles_per_job
+
+n_jobs = int(n_entries / profiles_per_job) + 1
+
+commands = list()
+
+for job_idx in range(n_jobs):
+
+  current_cmd = list()
+  current_cmd.append("pm")
+  current_cmd.append(awesome_script)
+  current_cmd.append(structure_db_path)
+  current_cmd.append(source_structure_db_path)
+  current_cmd.append(str(from_idx))
+  current_cmd.append(str(to_idx))
+  current_cmd.append(os.path.join(profile_db_out_dir, str(job_idx)+".dat"))
+
+  commands.append(' '.join(current_cmd))  
+
+  from_idx = min(n_entries - 1, from_idx + profiles_per_job)
+  to_idx = min(n_entries, to_idx + profiles_per_job)
+
+outfile = open("structure_profile_generation.cmd", 'w')
+outfile.write('\n'.join(commands))
+outfile.close()
+
+stuff_to_write = list()
+stuff_to_write.append("#!/bin/bash")
+stuff_to_write.append("#SBATCH --job-name=structure_scoring_array")
+stuff_to_write.append("#SBATCH --time=06:00:00")
+stuff_to_write.append("#SBATCH --output=%s"%(os.path.join("stdout", "%A_%a.out")))
+stuff_to_write.append("#SBATCH --mem=8G")
+stuff_to_write.append("#SBATCH --array=1-%i"%(len(commands)))
+stuff_to_write.append("source /scicore/home/schwede/studga00/data/promod3_databases/final_shit/setup_bc2_centos7")
+stuff_to_write.append("SEEDFILE=%s"%(os.path.join(os.getcwd(), "structure_profile_generation.cmd")))
+stuff_to_write.append("SEED=$(sed -n ${SLURM_ARRAY_TASK_ID}p $SEEDFILE)")
+stuff_to_write.append("eval $SEED")
+
+outfile = open("structure_profile_generation_array.sh", 'w')
+outfile.write('\n'.join(stuff_to_write))
+outfile.close()
+
+
diff --git a/extras/data_generation/structure_db/submit_structure_profile_calculations.py b/extras/data_generation/structure_db/submit_structure_profile_calculations.py
deleted file mode 100644
index 87f26a5f99cd2df34a38958f6a5f8acaf54a7fd2..0000000000000000000000000000000000000000
--- a/extras/data_generation/structure_db/submit_structure_profile_calculations.py
+++ /dev/null
@@ -1,115 +0,0 @@
-import os, math
-from promod3 import loop
-
-# path to StructureDB for which you want to calculate the profiles:
-# (relative to current working directory!)
-structure_db_path = "structure_db.dat"
-
-# path to StructureDB from which you extract the structural information
-# if the StructureDB above is very large, you might want to give it a smaller
-# database here to limit CPU time. A database with around 5000 chains should 
-# be sufficient
-# (relative to current working directory!)
-structure_db_source_path = "structure_db.dat"
-
-# the profiles that get generated end up here:
-# (relative to current working directory!)
-out_dir = "profile_dbs"
-
-# number of jobs
-num_jobs = 100
-
-# all stdout, stderr and submission_script files will go here
-# (relative to current working directory!)
-submission_workspace = "submission_workspace"
-
-
-# path to the pm bash script
-# Once we have the latest and greatest ProMod3 module, this should not 
-# be necessary anymore and we can simply call pm
-pm_path = "/scicore/home/schwede/studga00/prog/promod3_dev/build/stage/bin/pm"
-
-
-# This is stuff relevant for the submission script
-max_runtime = "13:00:00"
-membycore = "3G"
-my_email = "gabriel.studer@unibas.ch"
-
-# we only need ost and promod3 as soon as they're released...
-required_modules = ["Boost/1.53.0-goolf-1.4.10-Python-2.7.5",
-                    "Python/2.7.5-goolf-1.4.10",
-                    "OpenMM/7.1.1-goolf-1.4.10-Python-2.7.5"]
-
-# they won't be necessary anymore as soon as there are ost
-# and promod3 modules
-ost_python_path = "/scicore/home/schwede/studga00/prog/ost_dev/build/stage/lib64/python2.7/site-packages"
-promod_python_path = "/scicore/home/schwede/studga00/prog/promod3_dev/build/stage/lib64/python2.7/site-packages"
-
-
-#################################################################
-# NO EDITING BELOW THIS POINT (EXCEPT ON DIFFERENT SYSTEMS ;) ) #
-#################################################################
-
-if not os.path.exists(submission_workspace):
-  os.makedirs(submission_workspace)
-
-if not os.path.exists(out_dir):
-  os.makedirs(out_dir)
-
-structure_db = loop.StructureDB.Load(structure_db_path)
-num_coords = structure_db.GetNumCoords()
-chunk_size = math.ceil(float(num_coords ) / num_jobs)
-current_start = 0
-current_end = chunk_size
-
-for job_idx in range(num_jobs):
-
-  start = current_start
-  end = current_end
-  if end > num_coords:
-    end = num_coords
-
-  # we estimate the chunk size with a ceil => we might get away with even
-  # less jobs...
-  if start >= end:
-    break
-
-  start = int(start)
-  end = int(end)
-
-  current_start += chunk_size
-  current_end += chunk_size
-
-  cmd = [pm_path, \
-         os.path.join(os.getcwd(),"create_structure_profiles.py"), \
-         os.path.join(os.getcwd(),structure_db_path), \
-         os.path.join(os.getcwd(),structure_db_source_path), \
-         str(start), str(end), \
-         os.path.join(os.getcwd(), out_dir, str(job_idx)+".dat")]
-
-  stdout_path = os.path.join(os.getcwd(), submission_workspace, str(job_idx) + ".stdout")
-  stderr_path = os.path.join(os.getcwd(), submission_workspace, str(job_idx) + ".stderr")
-
-  content = list()
-  content.append("#!/bin/bash")
-  content.append("#$ -o " + stdout_path)
-  content.append("#$ -e " + stderr_path)
-  content.append("#$ -l runtime=" + max_runtime)
-  content.append("#$ -l membycore=" + membycore)
-  content.append("#$ -m as -M " + my_email)   
-
-  for module in required_modules:
-    content.append("ml " + module)
-
-  content.append("export PYTHONPATH=" + ost_python_path + ":PYTHONPATH")
-  content.append("export PYTHONPATH=" + promod_python_path + ":PYTHONPATH")
-  content.append(' '.join(cmd))
-
-  s_script_path = os.path.join(submission_workspace, "sub_"+str(job_idx)+".sh")
-  outfile = open(s_script_path,'w')
-  outfile.write('\n'.join(content))
-  outfile.close()
-
-  # FIRE!!!
-  os.system("qsub "+ s_script_path)
-
diff --git a/extras/data_generation/torsion_sampler/train_torsion_sampler.py b/extras/data_generation/torsion_sampler/train_torsion_sampler.py
index 4bba5cc57f66b86ac3f04bfcca8021065e29600c..1c6eb9d809068664075f554c9aa8a1dde93db2f1 100644
--- a/extras/data_generation/torsion_sampler/train_torsion_sampler.py
+++ b/extras/data_generation/torsion_sampler/train_torsion_sampler.py
@@ -1,40 +1,40 @@
 from promod3 import loop
+from ost import mol
 import os
 import pickle
 import traceback
-from ost.bindings import dssp
 
-#Tested group definitions are:
-# 1. simple_group_definitions.txt
-# 2. solis_group_definitions.txt
+# Tested group definitions are:
+#   1. simple_group_definitions.txt
+#   2. solis_group_definitions.txt
 #
-#The first group definition file is taken from:
+# The first group definition file is taken from:
 #
-#R. J. Read, P. D. Adams, W. B. Arendall, A. T. Brunger, P. Em-
-#sley, R. P. Joosten, G. J. Kleywegt, E. B. Krissinel, T. Lutteke,
-#Z. Otwinowski, A. Perrakis, J. S. Richardson, W. H. Sheffler, J. L.
-#Smith, I. J. Tickle, G. Vriend, and P. H. Zwart. A new genera-
-#tion of crystallographic validation tools for the protein data bank.
-#Structure, Oct 2011.
+# R. J. Read, P. D. Adams, W. B. Arendall, A. T. Brunger, P. Em-
+# sley, R. P. Joosten, G. J. Kleywegt, E. B. Krissinel, T. Lutteke,
+# Z. Otwinowski, A. Perrakis, J. S. Richardson, W. H. Sheffler, J. L.
+# Smith, I. J. Tickle, G. Vriend, and P. H. Zwart. A new genera-
+# tion of crystallographic validation tools for the protein data bank.
+# Structure, Oct 2011.
 #
-#The latter from:
+# The latter from:
 #
-#A. D. Solis and S. Rackovsky. Improvement of statistical poten-
-#tials and threading score functions using information maximiza-
-#tion. Proteins, Mar 2006.
+# A. D. Solis and S. Rackovsky. Improvement of statistical poten-
+# tials and threading score functions using information maximiza-
+# tion. Proteins, Mar 2006.
 #
 #
-#The file containing the prot data has been pulled from:
-#http://dunbrack.fccc.edu/PISCES.php
+# The file containing the prot data has been pulled from:
+# http://dunbrack.fccc.edu/PISCES.php
 #
-#To finally train the torsion samplers using this information
-#you have to  get the pdb structure files from somewhere and dump
-#them into the structure_dir defined below.
-#Their name must be in the format pdb_id + chain_id
-#e.g.   1AKEA.pdb
+# To finally train the torsion samplers using this information
+# you have to  get the pdb structure files from somewhere and dump
+# them into the structure_dir defined below.
+# Their name must be in the format pdb_id + chain_id
+# e.g.   1AKEA.pdb
 
 group_definition_file = "solis_group_definitions.txt"
-structure_dir = "/home/schdaude/workspace/promod_tests/structures"
+structure_dir = "/home/schdaude/workspace/promod_test/structures"
 prot_data = open('cullpdb_pc50_res2.5_R1.0_d140401_chains19001','r').readlines()
 
 
@@ -43,58 +43,51 @@ group_data = open(group_definition_file,'r')
 for line in group_data:
   group_definitions.append(line.strip())
 
-#initialize one sampler being trained with all data
-#and three secondary structure dependent samplers
+# initialize one sampler being trained with all data
+# and three secondary structure dependent samplers
 sampler = loop.TorsionSampler(group_definitions, 72,0)
 coil_sampler = loop.TorsionSampler(group_definitions, 72,0)
 helix_sampler = loop.TorsionSampler(group_definitions,72,0)
 sheet_sampler = loop.TorsionSampler(group_definitions,72,0)
 
 
-#Internally, the TorsionHandles get used to extract the
-#phi/psi dihedrals. We have to make sure, that they're really
-#assigned when loading a structure
+# Internally, the TorsionHandles get used to extract the
+# phi/psi dihedrals. We have to make sure, that they're really
+# assigned when loading a structure
 proc = conop.HeuristicProcessor(assign_torsions=True)
 prof = io.IOProfile(dialect='PDB', fault_tolerant=False,
                     quack_mode=False, processor=proc)
 
 for i,line in enumerate(prot_data[1:]):
-  prot_id = line[:4]
-  chain_id = line[4]
-  try:
-    print 'processing: ',prot_id,' on line: ',i
-
-    prot = io.LoadPDB(os.path.join(structure_dir,prot_id+chain_id+'.pdb'), profile=prof).Select('peptide=true and cname='+chain_id)
-
-    dssp.AssignDSSP(prot)
-
-    for r in prot.residues:
-      if r.GetSecStructure().IsHelical():
-        r.SetIntProp('ss',0)
-        continue
-      if r.GetSecStructure().IsExtended():
-        r.SetIntProp('ss',1)
-        continue
-      r.SetIntProp('ss',2)
-   
-    helix_selection = prot.Select('grss=0')
-    extended_selection = prot.Select('grss=1')
-    coil_selection = prot.Select('grss=2')
-
-
+    prot_id = line[:4]
+    chain_id = line[4]
     try:
-      sampler.ExtractStatistics(prot)
-      helix_sampler.ExtractStatistics(helix_selection)
-      coil_sampler.ExtractStatistics(coil_selection)
-      sheet_sampler.ExtractStatistics(extended_selection)
+        print 'processing: ',prot_id,' on line: ',i
+        prot = io.LoadPDB(os.path.join(structure_dir,prot_id+chain_id+'.pdb'), 
+                          profile=prof).Select('peptide=true and cname='+chain_id)
+        mol.alg.AssignSecStruct(prot)
+        for r in prot.residues:
+            if r.GetSecStructure().IsHelical():
+                r.SetIntProp('ss',0)
+                continue
+            if r.GetSecStructure().IsExtended():
+                r.SetIntProp('ss',1)
+                continue
+            r.SetIntProp('ss',2)
+        helix_selection = prot.Select('grss=0')
+        extended_selection = prot.Select('grss=1')
+        coil_selection = prot.Select('grss=2')
+        try:
+            sampler.ExtractStatistics(prot)
+            helix_sampler.ExtractStatistics(helix_selection)
+            coil_sampler.ExtractStatistics(coil_selection)
+            sheet_sampler.ExtractStatistics(extended_selection)
+        except:
+            traceback.print_exc()
     except:
-      traceback.print_exc()
-  except:
-    traceback.print_exc()
+        traceback.print_exc()
 
 sampler.Save('torsion_sampler.dat')
 helix_sampler.Save('torsion_sampler_helical.dat')
 sheet_sampler.Save('torsion_sampler_extended.dat')
 coil_sampler.Save('torsion_sampler_coil.dat')
-
-
diff --git a/extras/sanity_checks/Makefile b/extras/sanity_checks/Makefile
index c3bba635362ed6e67810b0a9368c371c2b38ebbf..454cab058d2dafb2d214cbdc1dc5f96382581e81 100644
--- a/extras/sanity_checks/Makefile
+++ b/extras/sanity_checks/Makefile
@@ -26,7 +26,7 @@ INCLUDES = -I$(OST_ROOT)/include -I$(PROMOD3_ROOT)/include
 LIB_DIRS = -L$(OST_ROOT)/lib64 -L$(PROMOD3_ROOT)/lib64
 LIBS = -lpromod3_core -lpromod3_loop -lpromod3_modelling -lpromod3_sidechain
 LIBS += -lost_io -lost_mol -lost_seq -lost_seq_alg -lost_mol_alg -lost_conop
-LIBS += -lost_base -lost_geom -lost_mol_mm
+LIBS += -lost_base -lost_geom -lost_mol_mm -lboost_system
 
 # add rpath to find shared objects (req. gcc)
 LDFLAGS += "-Wl,-rpath,$(PROMOD3_ROOT)/lib64:$(OST_ROOT)/lib64"
diff --git a/extras/sanity_checks/run_pipeline.py b/extras/sanity_checks/run_pipeline.py
index a1ebbc51571006b94eed4f5e1be19b6883d1da78..4fd77a97db72a32b82ede9b5a164b121cf69f1a7 100644
--- a/extras/sanity_checks/run_pipeline.py
+++ b/extras/sanity_checks/run_pipeline.py
@@ -1,6 +1,5 @@
 import ost
-from ost import io
-from ost.bindings import dssp
+from ost import io, mol
 from promod3 import modelling
 import time
 
@@ -11,7 +10,7 @@ ost.PushVerbosityLevel(3)
 aln = io.LoadAlignment("aln.fasta")
 template = io.LoadPDB("template.pdb")
 # add sec. structure
-dssp.AssignDSSP(template)
+mol.alg.AssignSecStruct(template)
 # get raw model
 aln.AttachView(1,template.Select('peptide=true'))
 mhandle = modelling.BuildRawModel(aln)
diff --git a/extras/scoring_weight_training/generate_bft_chunks.py b/extras/scoring_weight_training/generate_bft_chunks.py
index 835e0368e05dd637bb16720c8080c24b7c8ff102..c31ca52f887e7e6704e7a053a67d2ef4102cf17f 100644
--- a/extras/scoring_weight_training/generate_bft_chunks.py
+++ b/extras/scoring_weight_training/generate_bft_chunks.py
@@ -130,7 +130,7 @@ def GetLoopData(lc):
   start_res_num = start_idx + 1
   for key in bb_scorers:
     score_container = modelling.ScoreContainer()
-    lc.CalculateBackboneScores(score_container, bb_scorer, [key], start_res_num)
+    lc.CalculateBackboneScores(score_container, bb_scorer, bb_score_env, [key], start_res_num)
     lc_data[key] = score_container.Get(key)
 
   ##########################################################
diff --git a/extras/scoring_weight_training/generate_bft_testset.py b/extras/scoring_weight_training/generate_bft_testset.py
index 5dfefe5f42561e7c64dbfd278045a84f7ae2004c..d7fc423f3eba8c0bb8b908ed2bd9268def37a135 100644
--- a/extras/scoring_weight_training/generate_bft_testset.py
+++ b/extras/scoring_weight_training/generate_bft_testset.py
@@ -16,7 +16,7 @@ min_coord_size = 50        # min. size for StructureDB entry to be considered
 terminal_res_to_skip = 2   # first and last x residues are never chosen for loop
 num_chains = 4000          # get x random chains from structure DB
 num_loops_per_len = 5000   # number of loops to pick for each loop length
-loop_range = range(3,13)   # range of loop lengths (uniformly distributed)
+loop_range = range(3,15)   # range of loop lengths (uniformly distributed)
 random.seed(42)            # fixed seed for reproducibilty
 out_fragments = "fragments.json"  # full path!
 
diff --git a/loop/data/portable_frag_db.dat b/loop/data/portable_frag_db.dat
index 802c3651567e94c49ffa483cab3827049869c141..f612b3cd9f7ae1d878363545027ea4158565b71e 100644
Binary files a/loop/data/portable_frag_db.dat and b/loop/data/portable_frag_db.dat differ
diff --git a/loop/data/portable_structure_db.dat b/loop/data/portable_structure_db.dat
index 73ab352c929d9c0c693b57f4a8da568c833d8cb5..0498195c094fbc0dae623c42903b5c91c5990a2c 100644
Binary files a/loop/data/portable_structure_db.dat and b/loop/data/portable_structure_db.dat differ
diff --git a/loop/doc/structure_db.rst b/loop/doc/structure_db.rst
index 631811ed79575c01da39b5dba4b94ad6a54729b2..a967d08a3823e6ae0eba26410ba7bdfa313ba358 100644
--- a/loop/doc/structure_db.rst
+++ b/loop/doc/structure_db.rst
@@ -3,30 +3,37 @@ Structural Data
 
 .. currentmodule:: promod3.loop
 
-The structural database serves as a container for structural backbone
-and profile data. It can be filled with chains of pdb structures with their
-corresponding profiles as they are produced by the HHSuite tools [soding2005]_. 
-Structural and profile data get complemented by with additional information.
-Following features get stored on a per residue basis:
-
-* The amino acid one letter code
-* The coordinates of the backbone atoms (N,CA,C,O)
-* The phi/psi dihedral angles
-* The secondary structure state as defined by dssp
-* The solvent accessibility in square Angstrom 
-* The residue depth defined as the average distance from all atoms of a
-  residue to the closest surface vertex as calculated by msms [sanner1996]_.
-  This is a simplified version of the residue depth as discussed in
-  [chakravarty1999]_ and gets directly calculated when structural information
-  gets added to the StructureDB.
-* The amino acid frequencies as given by an input sequence profile
-* The amino acid frequency derived from structural alignments as described
-  in [zhou2005]_ - Since the calculation of such a profile already requires a 
-  StructureDB, we end up in a hen and egg problem here... When adding
-  structural information to the StructureDB, the according memory gets
-  just allocated and set to zero. The usage of this information
-  is therefore only meaningful if you calculate these profiles
-  and manually set them (or load the provided default database).
+The structural database serves as a container for structural backbone and 
+sequence data. Custom accessor objects can be implemented that relate
+arbitrary features to structural data. Examples provided by ProMod3 include
+accession using matching stem geometry (see: :class:`FragDB`) or sequence
+features (see: :class:`Fragger`). 
+Besides backbone and sequence data, derived features can  
+optionally be stored. E.g. sequence profiles or secondary structure information.
+Optional data includes:
+
+  * The phi/psi dihedral angles
+  * The secondary structure state as defined by dssp
+  * The solvent accessibility in square Angstrom 
+  * The amino acid frequencies as given by an input sequence profile
+  * The residue depth - The residue depth is defined as the minimum distance of 
+    a residue towards any of the exposed residues. 
+    Distances are calculated using CB positions (artificially constructed in case 
+    of glycine) and exposed is defined as:
+    relative solvent accessibility > 25% and at least one atom being exposed
+    to the OUTER surface. To determine whether an atom is part of that outer 
+    surface, the full structure is placed into a 3D grid and a flood fill 
+    algorithm is used to determine the atoms of interest. 
+    Internal cavities are excluded by using this approach. This is a simplified 
+    version of the residue depth as discussed in [chakravarty1999]_ and gets 
+    directly calculated when structural information is added to the StructureDB.
+  * The amino acid frequency derived from structural alignments as described
+    in [zhou2005]_ - Since the calculation of such a profile already requires a 
+    StructureDB, we end up in a hen and egg problem here... When adding
+    structural information to the StructureDB, the according memory gets
+    just allocated and set to zero. The usage of this information
+    is therefore only meaningful if you calculate these profiles
+    and manually set them (or load the provided default database).
 
 Defining Chains and Fragments
 --------------------------------------------------------------------------------
@@ -34,27 +41,45 @@ Defining Chains and Fragments
 .. class:: CoordInfo()
 
   The CoordInfo gets automatically generated when new chains are added to
-  the structural database. It contains internal information of how
-  the according chain is stored in the database.
+  the structural database. It contains internal information of how a 
+  connected stretch of residues is stored in the database.
 
-  .. attribute:: pdb_id
+  .. attribute:: id
 
-    A character residue string containing the 4 character pdb_id and the
-    1 character chain_id. (:class:`str`) 
+    An id string specified when adding the corresponding stretch to the 
+    structure db
+
+  .. attribute:: chain_name
+
+    A chain name string specified when adding the corresponding stretch to the
+    structure db
 
   .. attribute:: offset
 
-    All residues of the added structures are stored in a linear memory layout.
-    The offset parameter tells us where it exactly starts. (:class:`int`)
+    All residues of the added stretch are stored in a linear memory layout.
+    The offset parameter tells us where it exactly starts in the global data 
+    structure. (:class:`int`)
 
   .. attribute:: size
 
-    The length of the stretch of residues. (:class:`int`)
+    The number of residues in that stretch (:class:`int`)
+
+  .. attribute:: start_resnum
+
+    Residue number of first residue in the added stretch. The residue number
+    is relative to the SEQRES provided in the input profile when adding the 
+    stuff to the structure db.
+
+  .. attribute:: shift
+
+    Translation from original coordinates that has been applied before storing
+    structural information in db.
 
 
 .. class:: FragmentInfo(chain_index, offset, length)
 
-  The FragmentInfo defines a fragment in the structural database.
+  The FragmentInfo defines any fragment in the structural database. If you 
+  implement your own accessor object, thats the information you want to store.
 
   :param chain_index:   Fills :attr:`chain_index`
 
@@ -64,17 +89,19 @@ Defining Chains and Fragments
 
   .. attribute:: chain_index
     
-    The index of the chain (defined by :class:`CoordInfo`) in the structure db this particle belongs to. (:class:`int`)
+    The index of the chain (defined by :class:`CoordInfo`) in the structure db 
+    this particle belongs to. (:class:`int`)
 
   .. attribute:: offset
 
-    Index of residue in **chain** the fragment starts. (:class:`int`)
+    Index of residue in **chain** the fragment starts. (0-based, :class:`int`)
 
   .. attribute:: length
 
     Length of the fragment (:class:`int`)
 
 
+
 The Structure Database
 --------------------------------------------------------------------------------
 
@@ -83,18 +110,46 @@ and fill it with content.
 
 .. literalinclude:: ../../../tests/doc/scripts/loop_structure_db.py
 
-Calculating the structural profiles is highly expensive and heavily depends on
+Calculating the structural profiles is expensive and heavily depends on
 the size of the database used as source. If you want to do this for a larger
 database, you might want to consider two things:
 
-1. Use a database of limited size as structural source (something
+1. Use a database of limited size to generate the actual profiles (something
    in between 5000 and 10000 nonredundant chains is enough)
 2. Use the :class:`ost.seq.ProfileDB` to gather profiles produced from jobs
    running in parallel
 
-.. class:: StructureDB()
 
-  .. staticmethod:: Load(filename, load_frequencies=True)
+.. class:: StructureDBDataType
+
+  The StructureDBDataType enum has to be passed at initialization of a 
+  StructureDB in order to define what data you want to store additionally
+  to backbone coordinates and sequence.
+  If you want to store all data possible, use All. If you only want a subset,
+  you can combine some of the datatypes with a bitwise or operation 
+  (see example script for StructureDB). One important note:
+  If you enable AAFrequenciesStruct, the actual information is not automatically
+  assigned. Only the according memory is allocated and set to zero, the actual 
+  information must be assigned manually (see example script again...).
+
+  All, Dihedrals, SolventAccessibilities, ResidueDepths, DSSP, AAFrequencies,
+  AAFrequenciesStruct
+  
+
+.. class:: StructureDB(data_to_store)
+
+  Generates an empty StructureDB that can be filled with content through
+  :func:`AddCoordinates`. The information extracted there is defined by
+  *data_to_store*. Have a look at the :class:`StructureDBDataType` 
+  documentation and at the example script...
+
+  :param data_to_store: Specifies what data to store in the database, several
+                        flags can be combined with a bitwise or operator.
+  :type data_to_store:  :class:`StructureDBDataType` 
+
+
+
+  .. staticmethod:: Load(filename)
                     LoadPortable(filename)
 
     Loads raw binary file generated with :meth:`Save` (optimized for fast
@@ -103,13 +158,6 @@ database, you might want to consider two things:
     
     :param filename: Path to the file from which to load the database.
     :type filename:  :class:`str`
-    :param load_frequencies: If True, the full database including profile
-                             information for every position gets loaded.
-                             A database without profiles loads faster and 
-                             requires less memory. But it's not possible
-                             to add new coordinates or call one of the
-                             profile dependent functions.
-    :type load_frequencies:  :class:`bool`
 
     :returns: The loaded data base
     :rtype:   :class:`StructureDB`
@@ -117,6 +165,7 @@ database, you might want to consider two things:
     :raises:  :exc:`~exceptions.RuntimeError` if file cannot be opened or if
               file cannot be parsed (see :ref:`here <portableIO>` for details).
 
+
   .. method:: Save(filename)
               SavePortable(filename)
 
@@ -127,73 +176,127 @@ database, you might want to consider two things:
     :param filename: Path to the file where the database will be saved
     :type filename:  :class:`str`
 
-    :raises:  :exc:`~exceptions.RuntimeError` if file cannot be opened or if
-              db has been loaded with load_frequencies=False (enforces only
-              complete databases to be saved down)
-
-  .. method:: AddCoordinates(pdb_id, chain_name, chain, surf, prof, \
-                             solvent_accessibility_string="solvent_accessibility")
-
-    This method takes a structural chain and searches the longest stretch of
-    connected residues containing all necessary backbone atoms. This stretch
-    gets then added to the database. Due to technical reasons, The maximal
-    extent along one of the base axis cannot exceed 650 A.
-    Following features are expected to be set on a per residue level in *chain*:
-    The secondary structure (e.g. call :meth:`ost.mol.alg.AssignSecStruct` on the
-    full :class:`ost.mol.EntityView` the *chain* belongs to) and
-    the solvent accessibility assigned using a float property with name 
-    *solvent_accessibility_string* as name on a per residue level (e.g. call 
-    :meth:`ost.mol.alg.Accessibility` on the full :class:`ost.mol.EntityView`
-    the chain belongs to and take care to pass the appropriate
-    *solvent_accessibility_string*).
-
-    :param pdb_id:      4-letter code of the structure the chain belongs to
-    :param chain_name:  Name of the chain consisting of one letter
-    :param chain:       The actual chain 
-    :param surf:        A surface describing the solvent accessible surface
-                        (we advise you to provide a surface estimated with the
-                        full :class:`ost.mol.EntityView` the *chain* belongs to)
-    :param prof:        Profile information for this *chain*.
-    :param solvent_accessibility_string: Name of float property where the 
-                                         solvent accessibilities are stored
-                                         on a per residue basis in *chain*
-
-    :type pdb_id:       :class:`str`
+    :raises:  :exc:`~exceptions.RuntimeError` if file cannot be opened 
+
+
+  .. method:: HasData(data_type)
+
+    Checks, whether requested data type is available in the current database.
+
+    :param data_type:   Data type to check
+    :type data_type:    :class:`StructureDBDataType`
+
+    :returns:           Whether the requested datatype is available
+    :rtype:             :class:`bool`
+
+
+  .. method:: AddCoordinates(id, chain_name, ent, seqres, prof=None, \
+                             only_longest_stretch=True)
+
+    This method takes an entity and adds coordinates and the sequence 
+    of one of its chains to the structural database. Additionally, all 
+    data as specified at the initialization of the database is extracted
+    fully automatically by considering the full *ent* (e.g. when 
+    calculating solvent accessibilities etc.).
+    The only exception is AAFrequencies, where a valid sequence profile 
+    is expected in *prof* that has matching sequence with *seqres*
+    All residues in chain with name *chain_name* must have residue numbers 
+    that directly relate them to the *seqres* with an indexing scheme 
+    starting from one.
+    If this is not the case, an error gets thrown. You might want to
+    consider to use :meth:`ost.seq.Renumber` for proper numbering.
+    Based on consecutive numbering and additionally checking for valid
+    peptide bonds, connected stretches are identified
+    and every added connected stretch gets its own entry with 
+    :class:`CoordInfo` as a descriptor. 
+    To avoid cluttering the database with many small fragments, the flag:
+    *only_longest_stretch* can be used. Set it to False if all
+    connected stretches of chain with name *chain_name* should be added.
+    There is one final catch you have to consider: Due to the internal
+    lossy data compression for the positions, the extent in x, y and
+    z - direction for every connected stretch is limited to 655A. This should
+    be sufficient for most structures, but stretches exceeding this maximum
+    are discarded. For storing the structural data given these restraints,
+    a translation is applied that gets stored as the *shift* attribute
+    in the according :class:`CoordInfo` object.
+
+    :param id:          identifier of the added structure (e.g. pdb id)
+    :param chain_name:  Name of the chain in *ent* you want to add
+    :param ent:         The full entity that must contain a chain named
+                        as specified by *chain_name*.
+    :param seqres:      The reference sequence of chain with name *chain_name*
+    :param prof:        Profile information for the chain with name 
+                        *chain_name*. The profile sequence must match *seqres*.
+    :param only_longest_stretch: Flag whether you want to add only the longest
+                                 connected stretch of residues are all connected
+                                 stretches of residues
+
+    :type id:           :class:`str`
     :type chain_name:   :class:`str`
-    :type chain:        :class:`ost.mol.ChainView`
-    :type surf:         :class:`ost.mol.SurfaceHandle`
+    :type ent:          :class:`ost.mol.EntityView`
+    :type seqres:       :class:`ost.seq.SequenceHandle`
     :type prof:         :class:`ost.seq.ProfileHandle`
-    :type solvent_accessibility_string: :class:`str`
+    :type only_longest_strech: :class:`bool`
 
-    :returns: DB index of added chain.
-    :rtype:   :class:`int`
+    :returns: indices of added stretches in db
+    :rtype:   :class:`list` of `int`
 
-    :raises:  :exc:`~exceptions.RuntimeError` if size of chain is too large,
-              when db has been loaded with load_frequencies=False or when the
-              ATOMSEQ form the *chain* can't be aligned with the SEQRES from
-              the *prof*.
+    :raises:  :exc:`~exceptions.RuntimeError` if the residues in chain with
+              name *chain_name* do not match *seqres* given the 
+              residue numbers, when AAFrequencies have to to be extracted and
+              the sequence in *prof* does not match the *seqres* or *prof* is 
+              invalid. 
 
-  .. method:: GetCoordIndex(pdb_id, chain_name)
 
-    :returns: The StructureDB index (in [0, :meth:`GetNumCoords`-1]) of the
-              chain of interest, -1 if it cannot be found.
-    :rtype:   :class:`int`
+  .. method:: RemoveCoordinates(coord_idx) 
+
+    Removes coordinates at specified location and all its associated data. This
+    has an impact on the offset values of all :class:`CoordInfo` objects 
+    that are internally stored afterwards and on the actual coord indices 
+    (all shifted by one). So make sure that you adapt your data access 
+    accordingly! 
+
+    :param coord_idx:   Specifies coordinates to be removed
+    :type coord_idx:    :class:`int`
 
-    :param pdb_id:      4-letter code of the structure the chain belongs to
-    :param chain_name:  Name of the chain consisting of one letter
+    :raises:  :exc:`~exceptions.RuntimeError` if *coord_idx* is invalid
+
+  .. method:: GetCoordIdx(id, chain_name)
+
+    :returns: The StructureDB indices (in [0, :meth:`GetNumCoords`-1]) of 
+              of all coords (connected stretches) with matching 
+              *id* / *chain_name*.
+    :rtype:   :class:`list` of :class:`int`
+
+    :param id:          Identifier given when calling :meth:`AddCoordinates`
+    :param chain_name:  Name of chain given when calling :meth:`AddCoordinates`
 
     :type pdb_id:       :class:`str`
     :type chain_name:   :class:`str`
 
+
   .. method:: GetCoordInfo(idx)
 
-    :returns: Object describing the chain with index *idx*.
+    :returns: Object describing the stretch of connected residues with 
+              index *idx*.
     :rtype:   :class:`CoordInfo`
 
     :param idx: The StructureDB index (in [0, :meth:`GetNumCoords`-1])
     :type idx:  :class:`int`
 
 
+  .. method:: GetNumCoords()
+
+    :returns: Number of connected stretches of residues that have been added to 
+              the database.
+    :rtype:   :class:`int`
+
+
+  .. method:: PrintStatistics()
+
+    Prints out some information about the db.
+
+
   .. method:: GetBackboneList(fragment, sequence)
               GetBackboneList(n_stem, c_stem, fragment, sequence)
 
@@ -212,20 +315,9 @@ database, you might want to consider two things:
     :type c_stem:  :class:`ost.mol.ResidueHandle`
 
     :raises:  :exc:`~exceptions.RuntimeError` if fragment is invalid (happens
-              if the fragment does not fully fit into one of the chains in the
-              database) or if *sequence* contains a one letter code which is not
-              one of the 20 default amino acids.
-
-
-  .. method:: GetNumCoords()
-
-    :returns: Number of chains that have been added to the database.
-    :rtype:   :class:`int`
-
-
-  .. method:: PrintStatistics()
-
-    Prints out some information about the db.
+              if the fragment does not fully fit into one of the connected 
+              stretches in the database) or if *sequence* contains a one letter 
+              code which is not one of the 20 default amino acids.
 
 
   .. method:: GetSequence(fragment)
@@ -238,7 +330,7 @@ database, you might want to consider two things:
 
     :raises:  :exc:`~exceptions.RuntimeError` if fragment is invalid. This is
               the case when the fragment does not fully fit into one of the
-              chains in the database.
+              connected stretches of residues in the database.
 
 
   .. method:: GetDSSPStates(fragment)
@@ -249,9 +341,10 @@ database, you might want to consider two things:
     :param fragment: Fragment definition from which to extract the states.
     :type fragment:  :class:`FragmentInfo`
 
-    :raises:  :exc:`~exceptions.RuntimeError` if fragment is invalid. This is
+    :raises:  :exc:`~exceptions.RuntimeError` if database does not contain dssp 
+              data or if fragment is invalid. This is
               the case when the fragment does not fully fit into one of the
-              chains in the database.
+              connected stretches of residues in the database.
 
 
   .. method:: GetDihedralAngles(fragment)
@@ -262,9 +355,11 @@ database, you might want to consider two things:
     :param fragment: Fragment definition from which to extract the dihedrals.
     :type fragment:  :class:`FragmentInfo`
 
-    :raises:  :exc:`~exceptions.RuntimeError` if fragment is invalid. This is
+    :raises:  :exc:`~exceptions.RuntimeError` if database does not contain 
+              dihedral angle data or if fragment is invalid. This is
               the case when the fragment does not fully fit into one of the
-              chains in the database.
+              connected stretches of residues in the database.
+
 
   .. method:: GetResidueDepths(fragment)
 
@@ -275,9 +370,11 @@ database, you might want to consider two things:
                      depths
     :type fragment:  :class:`FragmentInfo`
 
-    :raises:  :exc:`~exceptions.RuntimeError` if fragment is invalid. This is
+    :raises:  :exc:`~exceptions.RuntimeError` if database does not contain 
+              residue depth data or if fragment is invalid. This is
               the case when the fragment does not fully fit into one of the
-              chains in the database.
+              connected stretches of residues in the database.
+
 
   .. method:: GetSolventAccessibilitites(fragment)
 
@@ -289,9 +386,11 @@ database, you might want to consider two things:
                      accessibilities
     :type fragment:  :class:`FragmentInfo`
 
-    :raises:  :exc:`~exceptions.RuntimeError` if fragment is invalid. This is
+    :raises:  :exc:`~exceptions.RuntimeError` if database does not contain 
+              solvent accessibility data or if fragment is invalid. This is
               the case when the fragment does not fully fit into one of the
-              chains in the database.
+              connected stretches of residues in the database.
+
 
   .. method:: GetSequenceProfile(fragment)
 
@@ -304,10 +403,12 @@ database, you might want to consider two things:
 
     :type fragment:     :class:`FragmentInfo`
 
-    :raises:  :exc:`~exceptions.RuntimeError` if fragment is invalid. This is
+    :raises:  :exc:`~exceptions.RuntimeError` if database does not cotain
+              aa frequency data or if fragment is invalid. This is
               the case when the fragment does not fully fit into one of the
-              chains in the database.
-                        
+              connected stretches of residues in the database.
+                    
+
   .. method:: GetStructureProfile(fragment)
 
     :returns: The structure profile for the residues defined by *fragment* with
@@ -319,44 +420,50 @@ database, you might want to consider two things:
 
     :type fragment:     :class:`FragmentInfo`
 
-    :raises:  :exc:`~exceptions.RuntimeError` if fragment is invalid. This is
+    :raises:  :exc:`~exceptions.RuntimeError` if database does not contain
+              aa frequencies struct data or if fragment is invalid. This is
               the case when the fragment does not fully fit into one of the
-              chains in the database.
+              connected stretches of residues in the database.
 
-  .. method:: GenerateStructureProfile(other_db, fragment)
 
-    Takes the CA positions and residue depths for *fragment* defined from
-    *other_db* to calculate a structure profile using the full internal
-    structural data of this database with their corresponding residue depths.
+  .. method:: GenerateStructureProfile(bb_list, residue_depths)
 
-    :param fragment: Fragment definition from *other_db*.
-    :type fragment:  :class:`FragmentInfo`
-    :param other_db: Structural database from which we extract CA positions and
-                     residue depths for *fragment*.
-    :type other_db:  :class:`StructureDB`
+    Calculates a structure profile for *bb_list* with given *residue_depths*
+    using the full internal data of this StructureDB.
+
+    :param bb_list:  Positions for which to calculate the structural profile
+    :type bb_list:   :class:`BackboneList`
+    :param residue_depths: The residue depth for each residue in *bb_list* 
+                           as you would extract it from any StructureDB 
+                           containing that data. 
+    :type residue_depths:  :class:`list` of :class:`float`
 
     :returns: The structure profile for the input with the BLOSUM62
               probabilities as NULL model.
     :rtype:   :class:`ost.seq.ProfileHandle`
 
     :raises:  :exc:`~exceptions.RuntimeError` if *bb_list* and 
-              *residue_depths* differ in size or when their size is 0
+              *residue_depths* differ in size, when their size is 0
+              or when database does not contain aa frequencies struct data.
 
-  .. method:: SetStructureProfile(chain_idx, prof)
+
+  .. method:: SetStructureProfile(coord_idx, prof)
 
     Takes the *prof* and sets the corresponding StructureProfile
-    frequencies in entry with *chain_idx*
+    frequencies in entry with *coord_idx*
 
     :param prof:      Source of profile frequencies
-    :param chain_idx: StructureDB index of entry for which to set frequencies
+    :param coord_idx: StructureDB index of entry for which to set frequencies
                       (in [0, :meth:`GetNumCoords`-1])
 
     :type prof:       :class:`ost.seq.ProfileHandle`
-    :type chain_idx:  :class:`int`
+    :type coord_idx:  :class:`int`
+
+    :raises: :exc:`~exceptions.RuntimeError` if *coord_idx* does not match
+             any entry in the db, when the size of the *prof* does not
+             exactly match the size of entry at *coord_idx* or when database
+             does not contain aa frequency struct data.
 
-    :raises: :exc:`~exceptions.RuntimeError` if *chain_idx* does not match
-             any entry in the db or when the size of the *prof* does not
-             exactly match the size of entry at *chain_idx*
 
   .. method:: GetSubDB(indices)
 
@@ -437,6 +544,7 @@ This example illustrates how to create a custom FragDB based on a StructureDB:
     :return:    The bin size
     :rtype:     :class:`float`
 
+
   .. method:: AddFragments(fragment_length, rmsd_cutoff, structure_db)
 
     Iterates over all fragments of length **fragment_length** in the given structural database and adds them to the fragment database. Fragments will be skipped if there is already a fragment in the database that has an RMSD to the one being added smaller than **rmsd_cutoff**.
@@ -870,7 +978,6 @@ The PsipredPrediction class
 
 
 .. [soding2005] Söding J (2005). Protein homology detection by HMM-HMM comparison. Bioinformatics 21 (7): 951–960.
-.. [sanner1996] Sanner M, Olson AJ, Spehner JC (1996). Reduced Surface: an Efficient Way to Compute Molecular Surfaces. Biopolymers 38 (3): 305-320.
 .. [chakravarty1999] Chakravarty S, Varadarajan R (1999). Residue depth: a novel parameter for the analysis of protein structure and stability. Structure 7 (7): 723–732.
 .. [zhou2005] Zhou H, Zhou Y (2005). Fold Recognition by Combining Sequence Profiles Derived From Evolution and From Depth-Dependent Structural Alignment of Fragments. Proteins 58 (2): 321–328.
 .. [Jones1999] Jones DT (1999) Protein secondary structure prediction based on position-specific scoring matrices. J. Mol. Biol. 292: 195-202. 
diff --git a/loop/pymod/export_loop_object_loader.cc b/loop/pymod/export_loop_object_loader.cc
index 276690cf9fabed11f24cb20c8ff3c11f16fffeb4..fb6cb09087e4950cb473d4255fd2dc1ad5731ccb 100644
--- a/loop/pymod/export_loop_object_loader.cc
+++ b/loop/pymod/export_loop_object_loader.cc
@@ -12,5 +12,5 @@ void export_LoopObjectLoader() {
       (arg("seed")=0));
   def("LoadTorsionSamplerCoil", &LoadTorsionSamplerCoil, (arg("seed")=0));
   def("LoadFragDB", &LoadFragDB);
-  def("LoadStructureDB", &LoadStructureDB, (arg("load_frequencies")=true));
+  def("LoadStructureDB", &LoadStructureDB);
 }
diff --git a/loop/pymod/export_structure_db.cc b/loop/pymod/export_structure_db.cc
index 072ae4dd308069e7b304f075fc9515ef05106ab2..954614498a7b99168f1c1598211a7be1e7a86889 100644
--- a/loop/pymod/export_structure_db.cc
+++ b/loop/pymod/export_structure_db.cc
@@ -29,6 +29,16 @@ namespace {
     return bb_list;
   }
 
+  boost::python::list WrapGetCoordIdx(StructureDBPtr db,
+                                      const String& id,
+                                      const String& chain_name) {
+
+    std::vector<int> indices = db->GetCoordIdx(id, chain_name);
+    boost::python::list return_list;
+    core::AppendVectorToList(indices, return_list);
+    return return_list;
+  }
+
   boost::python::list WrapGetDihedralAngles(StructureDBPtr db, FragmentInfo& info){
 
     std::vector<std::pair<Real,Real> > dihedrals = db->GetDihedralAngles(info);
@@ -58,19 +68,30 @@ namespace {
     return db->GetSubDB(v_indices);
   }
 
+  ost::seq::ProfileHandlePtr WrapGenerateStructureProfile(StructureDBPtr db,
+                                                          const BackboneList& bb_list,
+                                                          const list& residue_depths) {
+    std::vector<Real> v_residue_depths;
+    core::ConvertListToVector(residue_depths, v_residue_depths);
+    return db->GenerateStructureProfile(bb_list, v_residue_depths);
+  } 
+
 }
 
 
 void export_StructureDB(){
 
-  class_<CoordInfo>("CoordInfo", init<>())
-    .def_readonly("pdb_id", &CoordInfo::GetFullID)
+  class_<CoordInfo>("CoordInfo", no_init)
+    .def_readonly("id", &CoordInfo::id)
+    .def_readonly("chain_name", &CoordInfo::chain_name)
     .def_readonly("offset", &CoordInfo::offset)
     .def_readonly("size", &CoordInfo::size)
+    .def_readonly("start_resnum", &CoordInfo::start_resnum)
+    .def_readonly("shift", &CoordInfo::shift)
   ;
 
   class_<FragmentInfo>
-    ("FragmentInfo", init<unsigned short, unsigned short, unsigned short>())
+    ("FragmentInfo", init<unsigned int, unsigned short, unsigned short>())
     .def_readwrite("chain_index", &FragmentInfo::chain_index)
     .def_readwrite("offset", &FragmentInfo::offset)
     .def_readwrite("length", &FragmentInfo::length)
@@ -78,25 +99,40 @@ void export_StructureDB(){
     .def(self != self)
   ;
 
-  class_<StructureDB, boost::noncopyable> ("StructureDB", init<>())
+  enum_<StructureDB::DBDataType>("StructureDBDataType")
+    .value("All", StructureDB::All)
+    .value("Dihedrals", StructureDB::Dihedrals)
+    .value("SolventAccessibilities", StructureDB::SolventAccessibilities)
+    .value("ResidueDepths", StructureDB::ResidueDepths)
+    .value("DSSP", StructureDB::DSSP)
+    .value("AAFrequencies", StructureDB::AAFrequencies)
+    .value("AAFrequenciesStruct", StructureDB::AAFrequenciesStruct)
+  ;
+
+  class_<StructureDB, boost::noncopyable> ("StructureDB", init<int>())
     .def("Load", &StructureDB::Load,
-         (arg("filename"), arg("load_frequencies")=true))
+         (arg("filename")))
     .staticmethod("Load")
     .def("Save", &StructureDB::Save, (arg("filename")))
     .def("LoadPortable", &StructureDB::LoadPortable, (arg("filename")))
     .staticmethod("LoadPortable")
     .def("SavePortable", &StructureDB::SavePortable, (arg("filename")))
+    .def("HasData", &StructureDB::HasData, (arg("structure_db_data_type")))
     .def("AddCoordinates", &StructureDB::AddCoordinates,
-         (arg("pdb_id"), arg("chain_name"), 
-          arg("chain"), arg("surf"), arg("prof"), 
-          arg("solvent_accessibility_string")="solvent_accessibility"))
-    .def("GetCoordIndex", &StructureDB::GetCoordIndex,
+         (arg("id"), arg("chain_name"), 
+          arg("ent"), arg("seqres"), 
+          arg("prof")=ost::seq::ProfileHandlePtr(), 
+          arg("only_longest_stretch")=true))
+    .def("RemoveCoordinates", &StructureDB::RemoveCoordinates, 
+         (arg("coord_idx")))
+    .def("GetCoordIndex", &WrapGetCoordIdx,
          (arg("pdb_id"), arg("chain_name")))
     .def("GetBackboneList", &wrap_get_bb_list_one,
          (arg("fragment"), arg("sequence")))
     .def("GetBackboneList", &wrap_get_bb_list_two,
          (arg("stem_one"), arg("stem_two"), arg("fragment"), arg("sequence")))
-    .def("GetCoordInfo", &StructureDB::GetCoordInfo,(arg("index")))
+    .def("GetCoordInfo", &StructureDB::GetCoordInfo,(arg("index")), 
+         return_value_policy<reference_existing_object>())
     .def("GetNumCoords", &StructureDB::GetNumCoords)
     .def("PrintStatistics", &StructureDB::PrintStatistics)
     .def("GetSequence", &StructureDB::GetSequence, (arg("fragment")))
@@ -109,8 +145,9 @@ void export_StructureDB(){
          (arg("fragment")))
     .def("GetStructureProfile", &StructureDB::GetStructureProfile,
          (arg("fragment")))
-    .def("GenerateStructureProfile", &StructureDB::GenerateStructureProfile,
-         (arg("other_db"), arg("fragment")))
+    .def("GetStartResnum", &StructureDB::GetStartResnum, (arg("fragment")))
+    .def("GenerateStructureProfile", &WrapGenerateStructureProfile,
+         (arg("bb_list"), arg("residue_depths")))
     .def("SetStructureProfile", &StructureDB::SetStructureProfile,
          (arg("chain_idx"), arg("prof")))
     .def("GetSubDB", &WrapGetSubDB,(arg("indices")))
diff --git a/loop/src/CMakeLists.txt b/loop/src/CMakeLists.txt
index 93597f2d68460db36f8f43d3cd474eb02bcc10a6..6c874f584b1f8b29cba7803c056a816c5a0ce365 100644
--- a/loop/src/CMakeLists.txt
+++ b/loop/src/CMakeLists.txt
@@ -19,13 +19,13 @@ set(LOOP_HEADERS
   mm_system_creator.hh
   paged_array.hh
   psipred_prediction.hh
-  sec_struct.hh
   stem_geom.hh
   structure_db.hh
   torsion_sampler.hh
   ushort_vec.hh
   sidechain_atom_rule_lookup.hh
   sidechain_atom_constructor.hh
+  structure_db_custom_types.hh
 )
 
 set(LOOP_SOURCES
@@ -44,7 +44,6 @@ set(LOOP_SOURCES
   loop_object_loader.cc
   mm_system_creator.cc
   psipred_prediction.cc
-  sec_struct.cc
   structure_db.cc
   torsion_sampler.cc
   sidechain_atom_rule_lookup.cc
diff --git a/loop/src/all_atom_env.cc b/loop/src/all_atom_env.cc
index cb12451b065d2c54e89be6532767c138e1daec49..cef7b4eca18ebfd5ada74f84012cfd95807185f2 100644
--- a/loop/src/all_atom_env.cc
+++ b/loop/src/all_atom_env.cc
@@ -76,7 +76,7 @@ void AllAtomEnv::SetInitialEnvironment(const ost::mol::EntityHandle& env) {
       const ost::conop::AminoAcid myaa = all_pos_->GetAA(res_idx);
 
       if (myaa != ost::conop::OneLetterCodeToAminoAcid(olc)) {
-        String err = "Sequence mismatch when settings loop scorers env! ";
+        String err = "Sequence mismatch when setting loop scorers env! ";
         err += j->GetQualifiedName() + " should be a ";
         err += ost::conop::AminoAcidToResidueName(myaa);
         throw promod3::Error(err);
diff --git a/loop/src/frag_db.cc b/loop/src/frag_db.cc
index e69cf20f6d8930accd32e9a86b7e0c4f6c5fb3a1..73f75b903efc17f72edbf402f63acd58e989ec9c 100644
--- a/loop/src/frag_db.cc
+++ b/loop/src/frag_db.cc
@@ -30,7 +30,7 @@ FragDBPtr FragDB::Load(const String& file_name) {
   // header for consistency checks
   core::CheckMagicNumber(in_stream);
   uint32_t version = core::GetVersionNumber(in_stream);
-  if (version > 1) {
+  if (version != 2) {
     std::stringstream ss;
     ss << "Unsupported file version '" << version << "' in '" << file_name;
     throw promod3::Error(ss.str());
@@ -84,7 +84,7 @@ void FragDB::Save(const String& filename) {
 
   // header for consistency checks
   core::WriteMagicNumber(out_stream);
-  core::WriteVersionNumber(out_stream, 1);
+  core::WriteVersionNumber(out_stream, 2);
   // required base types: int, Real, uint, char, unsigned int, unsigned short
   // required structs: std::pair<StemPairGeom, BagInfo>, FragmentInfo
   typedef FragmentData::BagInfo BI;
@@ -134,7 +134,7 @@ FragDBPtr FragDB::LoadPortable(const String& file_name) {
   // header for consistency checks
   core::CheckMagicNumber(in_stream);
   uint32_t version = core::GetVersionNumber(in_stream);
-  if (version > 1) {
+  if (version != 2) {
     std::stringstream ss;
     ss << "Unsupported file version '" << version << "' in '" << file_name;
     throw promod3::Error(ss.str());
@@ -178,7 +178,7 @@ void FragDB::SavePortable(const String& filename) {
 
   // header for consistency checks
   core::WriteMagicNumber(out_stream);
-  core::WriteVersionNumber(out_stream, 1);
+  core::WriteVersionNumber(out_stream, 2);
   // here: only base-type-checks needed (we store Real as float!)
   core::WriteTypeSize<int16_t>(out_stream);
   core::WriteTypeSize<int32_t>(out_stream);
@@ -242,10 +242,11 @@ void FragDB::AddFragments(uint fragment_length,
 
     //extract all stem information of this chain to create the
     //stem geoms later on
+    const PagedArray<PeptideCoords, 65536>& db_coords = structure_db->GetCoords();
     stem_coords.clear();
     for(uint j = 0; j < size; ++j){
-      const Peptide& peptide = structure_db->GetPeptide(offset+j);
-      stem_coords.push_back(StemCoordsFromPeptides(peptide,peptide));
+      const PeptideCoords& coords = db_coords[offset + j];
+      stem_coords.push_back(StemCoordPairFromPeptideCoords(coords, coords));
     }
 
     //create a sliding window and go over all possible fragments
@@ -280,7 +281,7 @@ void FragDB::SearchDB(const ost::mol::ResidueHandle& n_stem,
                       uint frag_size, std::vector<FragmentInfo>& fragments,
                       uint extra_bins) {
 
-  StemCoordPair stems = StemCoordsFromResidues(n_stem, c_stem);
+  StemCoordPair stems = StemCoordPairFromResidues(n_stem, c_stem);
   SearchDB(stems, frag_size, fragments, extra_bins);
 }
 
@@ -349,7 +350,7 @@ int FragDB::GetNumFragments(int length) const{
   return count; 
 }
 
-FragDB::StemCoordPair FragDB::StemCoordsFromResidues(
+FragDB::StemCoordPair FragDB::StemCoordPairFromResidues(
                                 const ost::mol::ResidueHandle& n_res,
                                 const ost::mol::ResidueHandle& c_res) {
 
@@ -358,19 +359,20 @@ FragDB::StemCoordPair FragDB::StemCoordsFromResidues(
   return std::make_pair(n_stem, c_stem);
 }
 
-FragDB::StemCoordPair FragDB::StemCoordsFromPeptides(const Peptide& n_pep,
-                                                     const Peptide& c_pep) {
+FragDB::StemCoordPair FragDB::StemCoordPairFromPeptideCoords(
+                                           const PeptideCoords& n_coords,
+                                           const PeptideCoords& c_coords) {
 
   core::StemCoords n_stem;
   core::StemCoords c_stem;
 
-  n_stem.n_coord = n_pep.coords.n.ToVec3();
-  n_stem.ca_coord = n_pep.coords.ca.ToVec3();
-  n_stem.c_coord = n_pep.coords.c.ToVec3();
+  n_stem.n_coord = n_coords.n.ToVec3();
+  n_stem.ca_coord = n_coords.ca.ToVec3();
+  n_stem.c_coord = n_coords.c.ToVec3();
 
-  c_stem.n_coord = c_pep.coords.n.ToVec3();
-  c_stem.ca_coord = c_pep.coords.ca.ToVec3();
-  c_stem.c_coord = c_pep.coords.c.ToVec3();
+  c_stem.n_coord = c_coords.n.ToVec3();
+  c_stem.ca_coord = c_coords.ca.ToVec3();
+  c_stem.c_coord = c_coords.c.ToVec3();
 
   return std::make_pair(n_stem,c_stem);
 }
diff --git a/loop/src/frag_db.hh b/loop/src/frag_db.hh
index 4a53521edfb8adfea616d8bdecc45d0a4a9f4627..6bb3134df3e2084734a02dd8b5b27573ffa5b120 100644
--- a/loop/src/frag_db.hh
+++ b/loop/src/frag_db.hh
@@ -106,13 +106,11 @@ private:
                 std::vector<FragmentInfo>& fragments,
                 uint extra_bins = 0);
 
-  FragDB(const FragDB& other) { };
+  StemCoordPair StemCoordPairFromResidues(const ost::mol::ResidueHandle& n_res,
+                                          const ost::mol::ResidueHandle& c_res);
 
-  StemCoordPair StemCoordsFromResidues(const ost::mol::ResidueHandle& n_res,
-                                       const ost::mol::ResidueHandle& c_res);
-
-  StemCoordPair StemCoordsFromPeptides(const Peptide& n_pep,
-                                       const Peptide& c_pep);
+  StemCoordPair StemCoordPairFromPeptideCoords(const PeptideCoords& n_coords,
+                                               const PeptideCoords& c_coords);
 
   std::vector<StemPairGeom> MakeStemPairGeom(const core::StemCoords& n_stem,
                                              const core::StemCoords& c_stem,
diff --git a/loop/src/fragger.cc b/loop/src/fragger.cc
index cf9f39164709b0963955f28b4f3ed41da75573f5..aa6bc18dd72ad8699eddf2493eac9dfc2353ef48 100644
--- a/loop/src/fragger.cc
+++ b/loop/src/fragger.cc
@@ -162,20 +162,6 @@ void Fragger::Fill(StructureDBPtr db, Real max_rmsd, uint num_fragments){
                          "type to fill Fragger!");
   }
 
-  // if there is any profile feature, we have to make sure the 
-  // db contains frequencies...
-  for(std::vector<FraggerScoreType>::iterator i = score_types_.begin(); 
-      i != score_types_.end(); ++i){
-    if(*i == SequenceProfile || *i == StructureProfile){
-      if(!db->HasFrequencies()){
-        std::stringstream ss;
-        ss << "You must provide a StructureDB with loaded frequencies ";
-        ss << "to apply any profile features in the Fragger!";
-        throw promod3::Error(ss.str());
-      }
-    }
-  }
-
   this->LinearFill(db, max_rmsd, num_fragments);
 }
 
@@ -498,14 +484,14 @@ void Fragger::FillProfiles(StructureDBPtr db,
         break;
       }
       case SequenceProfile:{
-        const PagedArray<AAFreq,4096>& frequencies = 
+        const PagedArray<AAFreq, 65536>& frequencies = 
         db->GetAAFrequencies();
         this->GenerateProfileProfile(db, profiles[i], chain_idx, frequencies, 
                                      profiles_[i]);
         break;
       }
       case StructureProfile:{
-        const PagedArray<AAFreq,4096>& frequencies = 
+        const PagedArray<AAFreq, 65536>& frequencies = 
         db->GetAAStructFrequencies();        
         this->GenerateProfileProfile(db, profiles[i], chain_idx, frequencies, 
                                      profiles_[i]);
@@ -551,7 +537,7 @@ void Fragger::GenerateSeqSimProfile(StructureDBPtr db,
                           const ost::seq::alg::SubstWeightMatrix& subst) const{
 
   const std::vector<CoordInfo>& coord_toc = db->GetCoordToc();
-  const PagedArray<Peptide,4096>& coords = db->GetCoords();
+  const PagedArray<char, 65536>& full_db_seq = db->GetSeq();
 
   profile.clear();
 
@@ -562,7 +548,7 @@ void Fragger::GenerateSeqSimProfile(StructureDBPtr db,
   String db_seq(chain_size,'X');
   uint coord_index = coord_toc[index].offset;
   for(uint i = 0; i < chain_size; ++i, ++coord_index){
-    db_seq[i] = coords[coord_index].olc;
+    db_seq[i] = full_db_seq[coord_index];
   }
 
   Real score = 0.0;
@@ -589,7 +575,7 @@ void Fragger::GenerateSeqIDProfile(StructureDBPtr db,
                                    uint index) const{
 
   const std::vector<CoordInfo>& coord_toc = db->GetCoordToc();
-  const PagedArray<Peptide,4096>& coords = db->GetCoords();
+  const PagedArray<char, 65536>& full_db_seq = db->GetSeq();
 
   profile.clear();
 
@@ -600,7 +586,7 @@ void Fragger::GenerateSeqIDProfile(StructureDBPtr db,
   String db_seq(chain_size,'X');
   uint coord_index = coord_toc[index].offset;
   for(uint i = 0; i < chain_size; ++i, ++coord_index){
-    db_seq[i] = coords[coord_index].olc;
+    db_seq[i] = full_db_seq[coord_index];
   }
 
   int matches = 0;
@@ -620,7 +606,7 @@ void Fragger::GenerateSSAgreementProfile(StructureDBPtr db,
                               const std::vector<int>& confidence) const {
 
   const std::vector<CoordInfo>& coord_toc = db->GetCoordToc();
-  const PagedArray<Peptide,4096>& coords = db->GetCoords();
+  const PagedArray<char, 65536>& full_db_dssp = db->GetDSSP();
 
   profile.clear();
 
@@ -633,7 +619,7 @@ void Fragger::GenerateSSAgreementProfile(StructureDBPtr db,
   
   uint coord_index = coord_toc[index].offset;
   for(uint i = 0; i < chain_size; ++i){
-    chain_dssp_states[i] = GetDSSPIdx(coords[coord_index].dssp_state);
+    chain_dssp_states[i] = GetDSSPIdx(full_db_dssp[coord_index]);
     ++coord_index;
   }
 
@@ -656,7 +642,7 @@ void Fragger::GenerateTorsionProbabilityProfile(StructureDBPtr db,
                               const std::vector<int>& t_sampler_indices) const {
 
   const std::vector<CoordInfo>& coord_toc = db->GetCoordToc();
-  const PagedArray<Peptide,4096>& coords = db->GetCoords();
+  const PagedArray<DihedralInfo, 65536>& full_db_dihedrals = db->GetDihedrals();
 
   profile.clear();
 
@@ -669,8 +655,9 @@ void Fragger::GenerateTorsionProbabilityProfile(StructureDBPtr db,
 
   uint coord_idx = coord_toc[index].offset;
   for(uint i = 0; i < chain_size; ++i){
-    phi_bins[i] = t_sampler[0]->GetAngleBin(coords[coord_idx].dihedrals.GetPhi());
-    psi_bins[i] = t_sampler[0]->GetAngleBin(coords[coord_idx].dihedrals.GetPsi());
+    const DihedralInfo& db_dihedrals = full_db_dihedrals[coord_idx];
+    phi_bins[i] = t_sampler[0]->GetAngleBin(db_dihedrals.GetPhi());
+    psi_bins[i] = t_sampler[0]->GetAngleBin(db_dihedrals.GetPsi());
     ++coord_idx;
   }
 
@@ -690,7 +677,7 @@ void Fragger::GenerateTorsionProbabilityProfile(StructureDBPtr db,
 void Fragger::GenerateProfileProfile(StructureDBPtr db,
                                      std::vector<Real>& profile,
                                      uint index,
-                                     const PagedArray<AAFreq,4096>& frequencies,
+                                     const PagedArray<AAFreq,65536>& frequencies,
                                      short** prof) const {
 
   const std::vector<CoordInfo>& coord_toc = db->GetCoordToc();
diff --git a/loop/src/fragger.hh b/loop/src/fragger.hh
index 88e2d5e9164f2b6c749239f577afa0e573dd8f04..b109770cc5d2ace6a75d4da6d08e24d8355a8c04 100644
--- a/loop/src/fragger.hh
+++ b/loop/src/fragger.hh
@@ -118,7 +118,7 @@ private:
 
   void GenerateProfileProfile(StructureDBPtr db, std::vector<Real>& profile,
                               uint index,
-                              const PagedArray<AAFreq,4096>& frequencies,
+                              const PagedArray<AAFreq, 65536>& frequencies,
                               short** prof) const;
 
 
diff --git a/loop/src/idx_handler.cc b/loop/src/idx_handler.cc
index 5cee45a4da30b96e3c0c6e5be5943074290e15db..dfc50c26c159112638e248fde20750fa17ba362c 100644
--- a/loop/src/idx_handler.cc
+++ b/loop/src/idx_handler.cc
@@ -28,12 +28,12 @@ uint IdxHandler::ToIdx(uint resnum, uint chain_idx) const {
   if (resnum == 0 || resnum - 1 >= chain_sizes_[chain_idx]) {
     throw promod3::Error("Invalid resnum!");
   }
-
   return chain_start_idx_[chain_idx] + (resnum - 1);
 }
 
 std::vector<uint> IdxHandler::ToIdxVector(uint start_resnum, uint num_residues,
                                           uint chain_idx) const {
+
   // check/get start index
   uint start_idx = ToIdx(start_resnum, chain_idx);
   // check size
@@ -84,6 +84,71 @@ void IdxHandler::SetupScoreCalculation(const loop::BackboneList& bb_list,
                         start_idx, end_idx);
 }
 
+void IdxHandler::SetupScoreCalculation(uint start_resnum, uint num_residues,
+                           uint chain_idx, std::vector<uint>& indices,
+                           std::vector<bool>& occupied) const {
+
+  indices = this->ToIdxVector(start_resnum, num_residues, chain_idx);
+  occupied.assign(this->GetNumResidues(), false);
+  for(std::vector<uint>::const_iterator i = indices.begin(); 
+      i != indices.end(); ++i) {
+    occupied[*i] = true;
+  }  
+}
+
+void IdxHandler::SetupScoreCalculation(const std::vector<uint>& start_resnum, 
+                           const std::vector<uint>& num_residues,
+                           const std::vector<uint>& chain_idx, 
+                           std::vector<std::vector<uint> >& indices,
+                           std::vector<bool>& occupied) const {
+
+  if(start_resnum.size() != num_residues.size()) {
+    throw promod3::Error("Inconsistent input data in Score Setup!");
+  }
+
+  if(start_resnum.size() != chain_idx.size()) {
+    throw promod3::Error("Inconsistent input data in Score Setup!");
+  }
+
+  indices.resize(start_resnum.size());
+  occupied.assign(this->GetNumResidues(), false);
+  for(uint i = 0; i < start_resnum.size(); ++i) {
+    indices[i] = this->ToIdxVector(start_resnum[i], num_residues[i],
+                                   chain_idx[i]);
+    const std::vector<uint>& vec = indices[i];
+    for(std::vector<uint>::const_iterator j = vec.begin(); 
+        j != vec.end(); ++j) {
+      occupied[*j] = true;
+    }
+  }
+}
+
+void IdxHandler::SetupScoreCalculation(uint start_resnum, uint num_residues,
+                           uint chain_idx, std::vector<uint>& indices) const {
+
+  indices = this->ToIdxVector(start_resnum, num_residues, chain_idx);
+}
+
+void IdxHandler::SetupScoreCalculation(const std::vector<uint>& start_resnum, 
+                           const std::vector<uint>& num_residues,
+                           const std::vector<uint>& chain_idx, 
+                           std::vector<std::vector<uint> >& indices) const {
+
+  if(start_resnum.size() != num_residues.size()) {
+    throw promod3::Error("Inconsistent input data in Score Setup!");
+  }
+
+  if(start_resnum.size() != chain_idx.size()) {
+    throw promod3::Error("Inconsistent input data in Score Setup!");
+  }
+
+  indices.resize(start_resnum.size());
+  for(uint i = 0; i < start_resnum.size(); ++i) {
+    indices[i] = this->ToIdxVector(start_resnum[i], num_residues[i],
+                                   chain_idx[i]);
+  }
+}
+
 void IdxHandler::SetupScoreCalculation(uint start_resnum, uint num_residues,
                                        uint chain_idx, uint& start_idx,
                                        uint& end_idx) const {
diff --git a/loop/src/idx_handler.hh b/loop/src/idx_handler.hh
index c16463f2f100a626206acdf50b78b480599e1c7b..193520286029bdf138bbd6c738a37405ef905d27 100644
--- a/loop/src/idx_handler.hh
+++ b/loop/src/idx_handler.hh
@@ -57,6 +57,20 @@ public:
                              uint start_resnum, uint chain_idx,
                              uint& bb_list_size, uint& start_idx,
                              uint& end_idx) const;
+  void SetupScoreCalculation(uint start_resnum, uint num_residues,
+                             uint chain_idx, std::vector<uint>& indices,
+                             std::vector<bool>& occupied) const;
+  void SetupScoreCalculation(const std::vector<uint>& start_resnum, 
+                             const std::vector<uint>& num_residues,
+                             const std::vector<uint>& chain_idx, 
+                             std::vector<std::vector<uint> >& indices,
+                             std::vector<bool>& occupied) const;
+  void SetupScoreCalculation(uint start_resnum, uint num_residues,
+                             uint chain_idx, std::vector<uint>& indices) const;
+  void SetupScoreCalculation(const std::vector<uint>& start_resnum, 
+                             const std::vector<uint>& num_residues,
+                             const std::vector<uint>& chain_idx, 
+                             std::vector<std::vector<uint> >& indices) const;
   void SetupScoreCalculation(uint start_resnum, uint num_residues,
                              uint chain_idx, uint& start_idx,
                              uint& end_idx) const;
diff --git a/loop/src/loop_object_loader.cc b/loop/src/loop_object_loader.cc
index 671a0679747c2051d4a328643c0bd655dd34622f..4eeff56860e15a6603312f8fa62104ad1e3f87af 100644
--- a/loop/src/loop_object_loader.cc
+++ b/loop/src/loop_object_loader.cc
@@ -45,11 +45,11 @@ FragDBPtr LoadFragDB() {
   return p; 
 }
 
-StructureDBPtr LoadStructureDB(bool load_frequencies) {
+StructureDBPtr LoadStructureDB() {
   core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
                                 "loop::LoadStructureDB", 2);
   String path = GetProMod3BinaryPath("loop_data", "structure_db.dat");
-  StructureDBPtr p = StructureDB::Load(path, load_frequencies);
+  StructureDBPtr p = StructureDB::Load(path);
   return p; 
 }
 
diff --git a/loop/src/loop_object_loader.hh b/loop/src/loop_object_loader.hh
index 66e9d7cca3cce744ff40efa5100ca2e1acea8d64..0b89e68a50ba2f96e453d3a3d1aab52b2fbe6d21 100644
--- a/loop/src/loop_object_loader.hh
+++ b/loop/src/loop_object_loader.hh
@@ -17,7 +17,7 @@ TorsionSamplerPtr LoadTorsionSamplerCoil(uint seed = 0);
 
 FragDBPtr LoadFragDB();
 
-StructureDBPtr LoadStructureDB(bool load_frequencies = true);
+StructureDBPtr LoadStructureDB();
 
 }} //ns
 
diff --git a/loop/src/paged_array.hh b/loop/src/paged_array.hh
index fbe20b91d30e2aebcae93dbaad190b2b42f10f6c..3591e2915fb9b3acc07ce9ffd10720860ada420c 100644
--- a/loop/src/paged_array.hh
+++ b/loop/src/paged_array.hh
@@ -61,6 +61,31 @@ public:
   {
     pages_.clear();
   }
+
+    // clears everything in [from, to[ and shifts every datapoint after the specified
+  // range at the location defined by from
+  void ClearRange(uint64_t from, uint64_t to) 
+  {
+    if(to <= from) return; // invalid range
+    uint64_t current_size = this->size();
+    if(from >= current_size) return; // nothing to delete
+    if(to > current_size) to = current_size; // from is in the valid range, but
+                                             // to is too large. Let's just kill
+                                             // [from, this->size()[
+
+    uint64_t num_elements_to_shift = current_size - to;
+    for(uint64_t i = 0; i < num_elements_to_shift; ++i) {
+      (*this)[from + i] = (*this)[to + i];
+    }
+
+    uint64_t num_elements_deleted = to - from;
+    uint64_t new_size = current_size - num_elements_deleted;
+    uint64_t new_last_element_idx = new_size - 1;
+    uint64_t new_last_page_idx = this->GetPage(new_last_element_idx);
+    pages_.resize(new_last_page_idx + 1);
+    uint64_t offset = this->GetOffset(new_last_element_idx);
+    pages_.back().resize(offset + 1);
+  }
   
   void Write(std::ofstream& out_stream, bool treat_as_pod=true)
   {
diff --git a/loop/src/sec_struct.cc b/loop/src/sec_struct.cc
deleted file mode 100644
index 08628dc1a32123c52de047b3ccc32774958d7001..0000000000000000000000000000000000000000
--- a/loop/src/sec_struct.cc
+++ /dev/null
@@ -1,405 +0,0 @@
-#include <promod3/loop/sec_struct.hh>
-
-namespace promod3{ namespace loop{
-
-void RawEstimateSS(const std::vector<geom::Vec3>& ca_positions, 
-	                 int start_idx,
-                   const std::vector<int>& donor_for_one,
-                   const std::vector<int>& donor_for_two, 
-                   const std::vector<int>& acceptor_for_one,
-                   const std::vector<int>& acceptor_for_two,
-                   String& ss_assignment){
-  
-  int size = ca_positions.size();
-
-  if(size != static_cast<int>(donor_for_one.size())){
-    throw promod3::Error("Position and donor data are inconsistent for dssp calculation!");
-  }
-
-  if(size != static_cast<int>(donor_for_two.size())){
-    throw promod3::Error("Position and donor data are inconsistent for dssp calculation!");
-  }
-
-  if(size != static_cast<int>(acceptor_for_one.size())){
-    throw promod3::Error("Position and acceptor data are inconsistent for dssp calculation!");
-  }
-
-  if(size != static_cast<int>(acceptor_for_two.size())){
-    throw promod3::Error("Position and acceptor data are inconsistent for dssp calculation!");
-  }
-
-  if(size < 3){
-    throw promod3::Error("Size of input positions are too small!");
-  }
-
-  ss_assignment.assign(size,'C');
-
-  int bends[size];
-  int turn_3[size];
-  int turn_4[size];
-  int turn_5[size];
-  int para_bridge[size];
-  int antipara_bridge[size];
-  
-  memset(bends,0,size*sizeof(int));
-  memset(turn_3,0,size*sizeof(int));
-  memset(turn_4,0,size*sizeof(int));
-  memset(turn_5,0,size*sizeof(int));
-  memset(para_bridge,0,size*sizeof(int));
-  memset(antipara_bridge,0,size*sizeof(int));
-  
-  //let's first search for the bends, i.e. pieces with high curvature
-  Real angle;
-  for(int i = 2; i < size-2; ++i){
-    angle = geom::Angle(ca_positions[i]-ca_positions[i-2],
-                        ca_positions[i+2]-ca_positions[i]);
-    if(angle > 1.2217) bends[i] = 1;   
-  }
-  
-  //let's search for turns
-  int three = start_idx + 3;
-  int four = start_idx + 4;
-  int five = start_idx + 5;
-  for(int i = 0; i < size; ++i, ++three, ++four, ++five){
-    if(acceptor_for_one[i] == four) turn_4[i] = 1;
-    if(acceptor_for_one[i] == three) turn_3[i] = 1;
-    if(acceptor_for_one[i] == five) turn_5[i] = 1;
-    if(acceptor_for_two[i] == four) turn_4[i] = 1;
-    if(acceptor_for_two[i] == three) turn_3[i] = 1;
-    if(acceptor_for_two[i] == five) turn_5[i] = 1;
-  }
-
-  //let's search for antiparallel beta bridges
-  for(int i = 0; i < size; ++i){
-    if(acceptor_for_one[i] != -1){
-      if(acceptor_for_one[i] == donor_for_one[i]) antipara_bridge[i] = 1;
-      if(acceptor_for_one[i] == donor_for_two[i]) antipara_bridge[i] = 1;
-    }
-    if(acceptor_for_two[i] != -1){
-      if(acceptor_for_two[i] == donor_for_one[i]) antipara_bridge[i] = 1;
-      if(acceptor_for_two[i] == donor_for_two[i]) antipara_bridge[i] = 1;
-    }
-  }
-
-  for(int i = 1; i < size-1; ++i){
-    if(donor_for_one[i+1] != -1){
-      if(donor_for_one[i+1] + 2 == acceptor_for_one[i-1]) antipara_bridge[i] = 1;
-      if(donor_for_one[i+1] + 2 == acceptor_for_two[i-1]) antipara_bridge[i] = 1;
-    }
-
-    if(donor_for_two[i+1] != -1){
-      if(donor_for_two[i+1] + 2 == acceptor_for_one[i-1]) antipara_bridge[i] = 1;
-      if(donor_for_two[i+1] + 2 == acceptor_for_two[i-1]) antipara_bridge[i] = 1;
-    }
-  }
-
-  //let's search for parallel beta bridges
-  for(int i = 1; i < size-1; ++i){
-    if(acceptor_for_one[i-1] != -1){
-      if(acceptor_for_one[i-1] == donor_for_one[i+1]) para_bridge[i] = 1;
-      if(acceptor_for_one[i-1] == donor_for_two[i+1]) para_bridge[i] = 1;
-    }
-    if(acceptor_for_two[i-1] != -1){
-      if(acceptor_for_two[i-1] == donor_for_one[i+1]) para_bridge[i] = 1; 
-      if(acceptor_for_two[i-1] == donor_for_two[i+1]) para_bridge[i] = 1;      
-    } 
-  }
-
-  for(int i = 0; i < size; ++i){
-    if(donor_for_one[i] != -1){
-      if(donor_for_one[i] + 2 == acceptor_for_one[i]) para_bridge[i] = 1;
-      if(donor_for_one[i] + 2 == acceptor_for_two[i]) para_bridge[i] = 1;
-    }
-
-    if(donor_for_two[i] != -1){
-      if(donor_for_two[i] + 2 == acceptor_for_one[i]) para_bridge[i] = 1;
-      if(donor_for_two[i] + 2 == acceptor_for_two[i]) para_bridge[i] = 1;        
-    }
-  }
-
-  //priority according to the dssp paper is: H,B,E,G,I,T,S
-  //we therefore start to assign from lowest to highest priority,
-  //potentially overwriting low priority elements
-  
-  //do S
-  for(int i = 0; i < size; ++i){
-    if(bends[i]) ss_assignment[i] = 'S';
-  }
-
-  //do T
-  for(int i = 0; i < size - 2; ++i){
-    if(turn_3[i]){
-      ss_assignment[i+1] = 'T';
-      ss_assignment[i+2] = 'T';
-    }
-  }
-
-  for(int i = 0; i < size - 3; ++i){
-    if(turn_4[i]){
-      ss_assignment[i+1] = 'T';
-      ss_assignment[i+2] = 'T';
-      ss_assignment[i+3] = 'T';
-    }
-  }
-
-  for(int i = 0; i < size - 4; ++i){
-    if(turn_5[i]){
-      ss_assignment[i+1] = 'T';
-      ss_assignment[i+2] = 'T';
-      ss_assignment[i+3] = 'T';
-      ss_assignment[i+4] = 'T';
-    }
-  }
-
-  //let's do the helices... we use the bend arrays to fill helices
-  //and start with H, we then fill in G if there is no space occupied by H
-  //and finally I if there is nothing in that range occupied.
-  memset(bends,0,size*sizeof(int));
-  for(int i = 1; i < size-4; ++i){
-    if(turn_4[i-1] && turn_4[i]){
-      bends[i] = 1;
-      bends[i+1] = 1;
-      bends[i+2] = 1;
-      bends[i+3] = 1;
-    }  
-  }
-
-  int start;
-  int end;
-  for(int i = 1; i < size-3; ++i){
-    if(turn_3[i-1] && turn_3[i]){
-      start = i;
-      end = i+3;
-      //let's search how long it continues...
-      while(true && end < size){
-        if(turn_3[end-3] && turn_3[end-2]){
-          ++end;
-        }
-        else break;
-      }
-      //check, whether there already is something in this range
-      bool empty = true;
-      for(int j = start; j < end; ++j){
-        if(bends[j]){
-          empty = false;
-          break;
-        }
-      }
-      if(empty){
-        //let's fill!
-        for(int j = start; j < end; ++j){
-          bends[j] = 2;
-        }
-      }
-    }
-  }
-
-  for(int i = 1; i < size-5; ++i){
-    if(turn_5[i-1] && turn_5[i]){
-      start = i;
-      end = i+5;
-      //let's search how long it continues...
-      while(true && end < size){
-        if(turn_5[end-5] && turn_5[end-4]){
-          ++end;
-        }
-        else break;
-      }
-      //check, whether there already is something in this range
-      bool empty = true;
-      for(int j = start; j < end; ++j){
-        if(bends[j]){
-          empty = false;
-          break;
-        }
-      }
-      if(empty){
-        //let's fill!
-        for(int j = start; j < end; ++j){
-          bends[j] = 3;
-        }
-      }
-    }
-  }
-
-  //do I
-  for(int i = 0; i < size; ++i){
-    if(bends[i] == 3) ss_assignment[i] = 'I';
-  }
-
-  //do G
-  for(int i = 0; i < size; ++i){
-    if(bends[i] == 2) ss_assignment[i] = 'G';
-  }
-
-  //do E
-  if(para_bridge[0]){
-    if(para_bridge[1]) ss_assignment[0] = 'E';
-  }
-  if(antipara_bridge[0]){
-    if(antipara_bridge[1]) ss_assignment[0] = 'E';
-  }
-
-  for(int i = 1; i < size - 1; ++i){
-    if(para_bridge[i]){
-      if(para_bridge[i-1] || para_bridge[i+1]) ss_assignment[i] = 'E';
-    }
-    if(antipara_bridge[i]){
-      if(antipara_bridge[i-1] || antipara_bridge[i+1]) ss_assignment[i] = 'E';
-    }
-  }
-
-  if(para_bridge[size-1]){
-    if(para_bridge[size-2]) ss_assignment[size-1] = 'E';
-  }
-  if(antipara_bridge[size-1]){
-    if(antipara_bridge[size-2]) ss_assignment[size-1] = 'E';
-  }
-
-  //do B
-  if(para_bridge[0]){
-    if(!para_bridge[1]) ss_assignment[0] = 'B';
-  }
-  if(antipara_bridge[0]){
-    if(!antipara_bridge[1]) ss_assignment[0] = 'B';
-  }
-
-  for(int i = 1; i < size-1; ++i){
-    if(para_bridge[i]){
-      if(!(para_bridge[i-1] || para_bridge[i+1])) ss_assignment[i] = 'B';
-    }
-    if(antipara_bridge[i]){
-      if(!(antipara_bridge[i-1] ||antipara_bridge[i+1])) ss_assignment[i] = 'B';
-    }
-  }
-
-  if(para_bridge[size-1]){
-    if(!para_bridge[size-2]) ss_assignment[size-1] = 'B';
-  }
-  if(antipara_bridge[size-1]){
-    if(!antipara_bridge[size-2]) ss_assignment[size-1] = 'B';
-  }
-
-  //do H
-  for(int i = 0; i < size; ++i){
-    if(bends[i] == 1) ss_assignment[i] = 'H';
-  }
-}
-
-void EstimateSS(const BackboneList& bb_list, String& ss_assignment){
-
-  int size = bb_list.size();
-
-  if(size == 0){
-    throw promod3::Error("Cannot estimate SS with empty BackboneList!");
-  }
-
-  std::vector<int> donor_for_one(size,-1);
-  std::vector<int> donor_for_two(size,-1);
-  std::vector<int> acceptor_for_one(size,-1);
-  std::vector<int> acceptor_for_two(size,-1);
-  std::vector<Real> donor_one_energies(size,std::numeric_limits<Real>::max());
-  std::vector<Real> donor_two_energies(size,std::numeric_limits<Real>::max());
-  std::vector<Real> acceptor_one_energies(size,std::numeric_limits<Real>::max());
-  std::vector<Real> acceptor_two_energies(size,std::numeric_limits<Real>::max());
-  std::vector<geom::Vec3> ca_positions(size,geom::Vec3(0,0,0));
-  std::vector<geom::Vec3> h_positions(size,geom::Vec3(0,0,0));
-
-  //first residue is expected not to be an hbond donor,
-  //we don't do anything for the first h_position...
-  ca_positions[0] = bb_list.GetCA(0);
-
-  geom::Vec3 co_vec;
-  for(int i = 1; i < size; ++i){
-  	ca_positions[i] = bb_list.GetCA(i);
-    co_vec = geom::Normalize(bb_list.GetO(i-1) - bb_list.GetC(i-1));
-    h_positions[i] = bb_list.GetN(i) - co_vec; 
-  }
-
-  Real e;
-  for(int i = 0; i < size-3; ++i){
-    for(int j = i+3; j < size; ++j){
-      if(geom::Length2(ca_positions[i]-ca_positions[j]) < 81.0){
-        //i as acceptor ; j as donor
-        if(bb_list.GetOLC(j) != 'P'){
-          e = DSSPHBondEnergy(h_positions[j], bb_list.GetN(j),
-                              bb_list.GetC(i), bb_list.GetO(i));
-
-          if(e < -0.5){
-            //it is an hbond... let's see, whether it is the best for i as acceptor
-            if(e < acceptor_two_energies[i]){
-              if(e < acceptor_one_energies[i]){
-                acceptor_two_energies[i] = acceptor_one_energies[i];
-                acceptor_for_two[i] = acceptor_for_one[i];
-                acceptor_one_energies[i] = e;
-                acceptor_for_one[i] = j;
-              }
-              else{
-                acceptor_two_energies[i] = e;
-                acceptor_for_two[i] = j;
-              }
-            }
-
-            //let's see, whether it is the best for j as donor
-            if(e < donor_two_energies[j]){
-              if(e < donor_one_energies[j]){
-                donor_two_energies[j] = donor_one_energies[j];
-                donor_for_two[j] = donor_for_one[j];
-                donor_one_energies[j] = e;
-                donor_for_one[j] = i;
-              }
-              else{
-                donor_two_energies[j] = e;
-                donor_for_two[j] = i;
-              }              
-            }             
-          }
-        }
-
-        //i as donor, j as acceptor
-        // note, that the first residue is not considered for donor
-        // and last element not as acceptor
-        if(bb_list.GetOLC(i) != 'P' && i > 0 && j < size-1){
-
-          e = DSSPHBondEnergy(h_positions[i], bb_list.GetN(i),
-                              bb_list.GetC(j), bb_list.GetO(j));
-
-          if(e < -0.5){
-            //it is an hbond... let's see, whether it is the best for i as donor
-            if(e < donor_two_energies[i]){
-              if(e < donor_one_energies[i]){
-                donor_two_energies[i] = donor_one_energies[i];
-                donor_for_two[i] = donor_for_one[i];
-                donor_one_energies[i] = e;
-                donor_for_one[i] = j;
-              }
-              else{
-                donor_two_energies[i] = e;
-                donor_for_two[i] = j;
-              }
-            }
-
-            //let's see, whether it is the best for j as acceptor
-            if(e < acceptor_two_energies[j]){
-              if(e < acceptor_one_energies[j]){
-                acceptor_two_energies[j] = acceptor_one_energies[j];
-                acceptor_for_two[j] = acceptor_for_one[j];
-                acceptor_one_energies[j] = e;
-                acceptor_for_one[j] = i;
-              }
-              else{
-                acceptor_two_energies[j] = e;
-                acceptor_for_two[j] = i;
-              }              
-            }             
-          }
-        }
-      }
-    }
-  }
-
-  RawEstimateSS(ca_positions, 0, donor_for_one, donor_for_two, 
-                acceptor_for_one, acceptor_for_two, ss_assignment);
-}
-
-}} //ns 
diff --git a/loop/src/sec_struct.hh b/loop/src/sec_struct.hh
deleted file mode 100644
index b808265bfe6869c5c0dbaa8ec8d88499512f2448..0000000000000000000000000000000000000000
--- a/loop/src/sec_struct.hh
+++ /dev/null
@@ -1,63 +0,0 @@
-#ifndef PROMOD_LOOP_SEC_STRUCT_HH
-#define PROMOD_LOOP_SEC_STRUCT_HH
-
-#include <promod3/loop/backbone.hh>
-#include <algorithm>
-#include <limits>
-#include <math.h>
-
-namespace promod3 { namespace loop {
-
-inline Real DSSPHBondEnergy(const geom::Vec3& h_pos, const geom::Vec3& n_pos,
-                            const geom::Vec3& c_pos, const geom::Vec3& o_pos){
-  Real on = 1.0/geom::Distance(o_pos,n_pos);
-  Real ch = 1.0/geom::Distance(c_pos,h_pos);
-  Real oh = 1.0/geom::Distance(o_pos,h_pos);
-  Real cn = 1.0/geom::Distance(c_pos,n_pos);
-  return 27.888 * (on+ch-oh-cn);
-}
-
-//Raw estimation of secondary structure
-//
-// This function is not intended for Python export, since the
-// input has to be prepared carefully. It basically estimates
-// the secondary structure based on the hydrogen pattern as
-// described for the dssp tool. Some simplifications lead to
-// same estimation for roughly 98-99 % of the residues.
-// Please note, that there is absolutely no handling of chain
-// breaks!
-//
-// The idea is, that secondary structure estimation can be performed
-// for a small stretch in the environment of a full structure.
-// ca_positions contains the CA-positions of this stretch.
-// Every residue is considered to serve as donor/acceptor 
-// for two other residues (note, that Proline cannot be a donor,
-// you have to consider that in the input data!!). 
-// This acceptor/donor information is
-// given in the other four vectors. donor_for_one[i] means,
-// that residue i of the stretch is donor for the corresponding
-// entry, where a value of -1 means that i is NOT a donor at all.
-// The entry indices are based on the residue index in
-// the full structure. For the proper positioning of the stretch 
-// in the full structure, the parameter start_idx is used.
-//
-//
-// Some points to consider when preparing the input data:
-// Only check for hbonds of residue i beginning at i+3
-// => at least 3 residue apart... Only consider HBonds 
-// with DSSPHBondEnergy < -0.5
-
-
-void RawEstimateSS(const std::vector<geom::Vec3>& ca_positions, 
-	                 int start_idx,
-	                 const std::vector<int>& donor_for_one,
-                   const std::vector<int>& donor_for_two, 
-	                 const std::vector<int>& acceptor_for_one,
-                   const std::vector<int>& acceptor_for_two,
-  	               String& ss_assignment);
-
-void EstimateSS(const BackboneList& bb_list, String& ss_assignment);
-
-}} //ns
-
-#endif
diff --git a/loop/src/sidechain_atom_constructor.cc b/loop/src/sidechain_atom_constructor.cc
index 5648ea0f0489f11b186c60caf9709f4f6001af67..0fb09cefbb5367fd9b24103448f62ee32a3db2dc 100644
--- a/loop/src/sidechain_atom_constructor.cc
+++ b/loop/src/sidechain_atom_constructor.cc
@@ -67,10 +67,26 @@ void ConstructSidechainAtoms(AllAtomPositions& all_pos, uint res_idx,
     throw promod3::Error("Invalid res_idx in ConstructSidechainAtoms!");
   }
 
+  ost::conop::AminoAcid aa = all_pos.GetAA(res_idx);
+
+  // We make sure that ALL backbone positions are present of ALL heavy atoms
+  // This way we can guarantee that all heavy atoms of the FULL residue are
+  // set when this function ran through.
   if(!(all_pos.IsSet(res_idx, BB_N_INDEX) &&
        all_pos.IsSet(res_idx, BB_CA_INDEX) &&
-       all_pos.IsSet(res_idx, BB_CB_INDEX))){
-    throw promod3::Error("N, CA and CB must be set in ConstructSidechainAtoms!");
+       all_pos.IsSet(res_idx, BB_C_INDEX) &&
+       all_pos.IsSet(res_idx, BB_O_INDEX)) ||
+     (aa != ost::conop::GLY && !all_pos.IsSet(res_idx, BB_CB_INDEX))) {
+    throw promod3::Error("All backbone heavy atoms must be set in "
+                         "ConstructSidechainAtoms!");
+  }
+
+  const std::vector<SidechainAtomRule>& rules = 
+  SidechainAtomRuleLookup::GetInstance().GetRules(aa);
+
+  if(rules.empty()) {
+    // no sidechain atoms to construct! (e.g. ALA or GLY)
+    return;
   }
 
   Real chi_angles[5];
@@ -80,9 +96,6 @@ void ConstructSidechainAtoms(AllAtomPositions& all_pos, uint res_idx,
   chi_angles[3] = chi4;
   chi_angles[4] = 0.0;
 
-  const std::vector<SidechainAtomRule>& rules = 
-  SidechainAtomRuleLookup::GetInstance().GetRules(all_pos.GetAA(res_idx));
-
   for(uint rule_idx = 0; rule_idx < rules.size(); ++rule_idx){
 
     const SidechainAtomRule& rule = rules[rule_idx];
@@ -90,7 +103,7 @@ void ConstructSidechainAtoms(AllAtomPositions& all_pos, uint res_idx,
     Real dihedral_angle = chi_angles[rule.dihedral_idx];
 
     if(dihedral_angle != dihedral_angle){
-      if(all_pos.GetAA(res_idx) == ost::conop::PRO && rule.dihedral_idx == 1){
+      if(aa == ost::conop::PRO && rule.dihedral_idx == 1){
         dihedral_angle = ProlineChi2Fallback(all_pos, res_idx, rule);
       }
       else{
diff --git a/loop/src/structure_db.cc b/loop/src/structure_db.cc
index 20f37d00500c07318bf57717114b4908d41160ae..7eb3fe33e6c722c526f44403d9f1c727c1c30cd1 100644
--- a/loop/src/structure_db.cc
+++ b/loop/src/structure_db.cc
@@ -2,132 +2,349 @@
 #include <promod3/core/portable_binary_serializer.hh>
 #include <promod3/core/check_io.hh>
 #include <promod3/core/runtime_profiling.hh>
+#include <ost/mol/alg/accessibility.hh>
+#include <ost/mol/alg/sec_struct.hh>
 
 namespace {
-//returns the number of connnected residues ongoing from start with all backbone
-//atoms present 
-uint cont_fragment_length(const ost::mol::ResidueViewList& rvl, uint start) {
-  if(rvl.empty() || start >= rvl.size()) return 0;
-  uint size=0;
-  while (true) {
-    ost::mol::AtomView n = rvl[start].FindAtom("N");
-    ost::mol::AtomView ca = rvl[start].FindAtom("CA");
-    ost::mol::AtomView c=rvl[start].FindAtom("C");
-    ost::mol::AtomView o = rvl[start].FindAtom("O");
-    if(!n.IsValid() || !ca.IsValid() || !c.IsValid() || !o.IsValid()) break;
-    ++size;
-    ++start;
-    if(start>=rvl.size()) break;
-    ost::mol::AtomView n_next=rvl[start].FindAtom("N");
-    if (!BondExists(c.GetHandle(), n_next.GetHandle())) break;
-  }
-  return size;
-}
 
-std::pair<uint,uint> max_cont_fragment_length(const ost::mol::ResidueViewList& rvl){
+void FloodLevel(char* data, int x_start, int y_start, 
+                int x_extent, int y_extent, 
+                int orig_value, int dest_value) {
+
+  //http://lodev.org/cgtutor/floodfill.html
+  if(orig_value != data[x_start*y_extent + y_start]) {
+    return;
+  }
 
-  uint actual_start = 0;
-  uint actual_length = cont_fragment_length(rvl,actual_start);
-  uint max_start = actual_start;
-  uint max_length = actual_length;
+  std::vector<std::pair<int,int> > queue;
+  queue.push_back(std::make_pair(x_start, y_start));
+
+  int y1,y,x; 
+  bool spanLeft, spanRight;
+  std::pair<int,int> actual_position;
+    
+  while(!queue.empty()){    
 
-  while(actual_start + actual_length < rvl.size()){
-    if(actual_length == 0) ++actual_start;
-    else actual_start += actual_length;
-    actual_length = cont_fragment_length(rvl,actual_start);
-    if(actual_length > max_length){
-      max_start = actual_start;
-      max_length = actual_length;
+    actual_position = queue.back();
+    queue.pop_back();
+    x = actual_position.first;
+    y = actual_position.second;
+
+    y1 = y;
+
+    while(y1 >= 0 && data[x*y_extent + y1] == orig_value) {
+      --y1;
     }
-  }
 
-  return std::make_pair(max_start,max_length);
-}
+    y1++;
+    spanLeft = spanRight = 0;
 
-Real FindClosestDist(const geom::Vec3& pos, 
-                     const std::vector<geom::Vec3>& surrounding){
-   
-  Real dist = std::numeric_limits<Real>::max();
-  for(std::vector<geom::Vec3>::const_iterator i = surrounding.begin(),
-      e = surrounding.end(); i != e; ++i){
-    Real actual_dist = geom::Length2(pos-(*i));
-    if(actual_dist < dist) dist = actual_dist;
+    while(y1 < y_extent && 
+          data[x*y_extent + y1] == orig_value ) {
+
+      data[x*y_extent + y1] = dest_value;
+
+      if(!spanLeft && x > 0 && 
+         data[(x-1)*y_extent + y1] == orig_value) {
+        queue.push_back(std::make_pair(x-1,y1));
+        spanLeft = 1;
+      }
+      else if(spanLeft && x > 0 && 
+              data[(x-1)*y_extent + y1] != orig_value) {
+        spanLeft = 0;
+      }
+
+      if(!spanRight && x < x_extent - 1 && 
+         data[(x+1)*y_extent + y1] == orig_value) {
+        queue.push_back(std::make_pair(x+1,y1));
+        spanRight = 1;
+      }
+      else if(spanRight && x < x_extent - 1 && 
+              data[(x+1)*y_extent + y1] != orig_value) {
+        spanRight = 0;
+      } 
+      ++y1;
+    }
   }
-  return std::sqrt(dist);
 }
 
-void FillVertexPositions(const ost::mol::SurfaceHandle& surf, 
-                         std::vector<geom::Vec3>& positions){
-  ost::mol::SurfaceVertexIDList v_id_list = surf.GetVertexIDList();
-  positions.clear();
-  positions.reserve(v_id_list.size());
-  for(ost::mol::SurfaceVertexIDList::iterator i = v_id_list.begin(),
-      e = v_id_list.end(); i!=e;  ++i){
-    ost::mol::SurfaceVertex v = surf.GetVertex(*i);
-    positions.push_back(v.position);
+
+void AssignResidueDepths(const ost::mol::EntityView& ent,
+                         const ost::mol::ChainView& chain) {
+
+
+  // sum of approx. vdw radius of the present heavy atoms (1.8) 
+  // plus 1.4 for water.
+  Real radius = 3.2;
+  Real one_over_radius = Real(1.0) / radius;
+
+  // lets setup a grid in which we place the atoms
+  Real min_x = std::numeric_limits<Real>::max();
+  Real max_x = -min_x;
+
+  Real min_y = std::numeric_limits<Real>::max();
+  Real max_y = -min_y;
+
+  Real min_z = std::numeric_limits<Real>::max();
+  Real max_z = -min_z;
+
+  std::vector<geom::Vec3> atom_positions;
+  ost::mol::AtomViewList atom_list = ent.GetAtomList();
+  
+  for(ost::mol::AtomViewList::iterator it = atom_list.begin();
+      it != atom_list.end(); ++it) {
+    geom::Vec3 pos = it->GetPos();
+    min_x = std::min(min_x, pos[0]);
+    max_x = std::max(max_x, pos[0]);
+    min_y = std::min(min_y, pos[1]);
+    max_y = std::max(max_y, pos[1]);
+    min_z = std::min(min_z, pos[2]);
+    max_z = std::max(max_z, pos[2]);
+    atom_positions.push_back(pos);
   }
-}
 
-Real SingleResidueDepth(const ost::mol::ResidueView& res,
-                        const std::vector<geom::Vec3>& surface_positions){
-  ost::mol::AtomViewList atom_list = res.GetAtomList();
-  Real depth = 0.0;
-  for(ost::mol::AtomViewList::iterator i = atom_list.begin(),
-      e = atom_list.end(); i!=e; ++i){
-    depth += FindClosestDist(i->GetPos(),surface_positions);
+  // we guarantee that the thing is properly solvated in the x-y plane and add 
+  // some space around this is also necessary to avoid overflow checks in 
+  // different places
+  min_x -= Real(2.1) * radius;
+  min_y -= Real(2.1) * radius;
+  min_z -= Real(2.1) * radius;
+  max_x += Real(2.1) * radius;
+  max_y += Real(2.1) * radius;
+  max_z += Real(2.1) * radius;
+
+  int num_xbins = std::ceil((max_x - min_x) * one_over_radius);
+  int num_ybins = std::ceil((max_y - min_y) * one_over_radius);
+  int num_zbins = std::ceil((max_z - min_z) * one_over_radius);
+  int num_bins = num_xbins * num_ybins * num_zbins;
+  char* grid = new char[num_bins];
+  memset(grid, 0, num_bins);
+
+  for(uint i = 0; i < atom_positions.size(); ++i) {
+
+    const geom::Vec3& pos = atom_positions[i];
+    int x_bin = (pos[0] - min_x) * one_over_radius;
+    int y_bin = (pos[1] - min_y) * one_over_radius;
+    int z_bin = (pos[2] - min_z) * one_over_radius;
+
+    // we're really crude here and simply set all 27 cubes with central
+    // cube defined by x_bin, y_bin and z_bin to one
+    for(int z = z_bin - 1; z <= z_bin + 1; ++z) {
+      for(int x = x_bin - 1; x <= x_bin + 1; ++x) {
+        for(int y = y_bin - 1; y <= y_bin + 1; ++y) {
+          grid[z*num_xbins*num_ybins + x*num_ybins + y] = 1;
+        }
+      }
+    }
+  }
+
+  // lets call flood fill for every layer along the z-axis from every 
+  // corner in the x-y plane. 
+  for(int z = 0; z < num_zbins; ++z) {
+    char* level = &grid[z*num_xbins*num_ybins];
+    FloodLevel(level, 0,             0,             num_xbins, num_ybins, 0, 2);
+    FloodLevel(level, 0,             num_ybins - 1, num_xbins, num_ybins, 0, 2);
+    FloodLevel(level, num_xbins - 1, 0,             num_xbins, num_ybins, 0, 2);
+    FloodLevel(level, num_xbins - 1, num_ybins - 1, num_xbins, num_ybins, 0, 2);
   }
-  return (depth/atom_list.size() + 1.4);
-}
 
-void ResidueDepth(const ost::mol::ChainView& chain, const ost::mol::SurfaceHandle& surf,
-                  std::vector<Real>& depth){
+  // we filled the xy-planes but we also need to consider stuff along the z-axis
+  bool something_happened = true;
+  while(something_happened) {
+
+    something_happened = false;
+
+    char* level; 
+    char* upper_level; 
+    char* lower_level;
+    int idx;
+
+    // do first layer
+    level = &grid[0];
+    upper_level = &grid[num_xbins*num_ybins];
+    idx = 0;
+    for(int x = 0; x < num_xbins; ++x) {
+      for(int y = 0; y < num_ybins; ++y, ++idx) {
+        if(level[idx] == 2 && upper_level[idx] == 0) {
+          FloodLevel(upper_level, x, y, num_xbins, num_ybins, 0, 2);
+          something_happened = true;
+        }
+      }
+    }
 
-  ost::mol::ResidueViewList res_list = chain.GetResidueList();
-  depth.clear();
-  depth.reserve(res_list.size());
-  std::vector<geom::Vec3> vertex_positions;
-  FillVertexPositions(surf,vertex_positions);
-  for(ost::mol::ResidueViewList::iterator i = res_list.begin(),
-      e = res_list.end(); i != e; ++i){
-    depth.push_back(SingleResidueDepth(*i,vertex_positions));
+    // do all layers in between
+    for(int z = 1; z < num_zbins - 1; ++z) {
+      level = &grid[z*num_xbins*num_ybins];
+      upper_level = &grid[(z+1)*num_xbins*num_ybins];
+      lower_level = &grid[(z-1)*num_xbins*num_ybins];
+      idx = 0;
+      for(int x = 0; x < num_xbins; ++x) {
+        for(int y = 0; y < num_ybins; ++y, ++idx) {
+          if(level[idx] == 2 && upper_level[idx] == 0) {
+            FloodLevel(upper_level, x, y, num_xbins, num_ybins, 0, 2);
+            something_happened = true;
+          }
+          if(level[idx] == 2 && lower_level[idx] == 0) {
+            FloodLevel(lower_level, x, y, num_xbins, num_ybins, 0, 2);
+            something_happened = true;
+          }
+        }
+      }
+    }
+
+    // do last layer
+    level = &grid[(num_zbins - 1) * num_xbins*num_ybins];
+    lower_level = &grid[(num_zbins - 2) * num_xbins*num_ybins];
+    idx = 0;
+    for(int x = 0; x < num_xbins; ++x) {
+      for(int y = 0; y < num_ybins; ++y, ++idx) {
+        if(level[idx] == 2 && lower_level[idx] == 0) {
+          FloodLevel(lower_level, x, y, num_xbins, num_ybins, 0, 2);
+          something_happened = true;
+        }
+      }
+    }
+  }
+  
+  // every cube in every layer that has currently value 1 that has a city-block
+  // distance below 3 to any cube with value 2 is considered to be in contact
+  // with the outer surface... lets set them to a value of three
+  for(int z = 0; z < num_zbins; ++z) {
+    for(int x = 0; x < num_xbins; ++x) {
+      for(int y = 0; y < num_ybins; ++y) {
+        if(grid[z*num_xbins*num_ybins + x*num_ybins + y] == 1) {
+          int x_from = std::max(0, x - 3);
+          int x_to = std::min(num_xbins-1, x + 3);
+          int y_from = std::max(0, y - 3);
+          int y_to = std::min(num_ybins-1, y + 3);
+          int z_from = std::max(0, z - 3);
+          int z_to = std::min(num_zbins-1, z + 3);
+          bool exposed = false;
+          for(int i = x_from; i <= x_to && !exposed; ++i) {
+            for(int j = y_from; j <= y_to; ++j) {
+              for(int k = z_from; k < z_to; ++k) {
+                if(grid[k*num_xbins*num_ybins + i*num_ybins + j] == 2) {
+                  grid[z*num_xbins*num_ybins + x*num_ybins + y] = 3;
+                  exposed = true;
+                  break;
+                }
+              }
+            }
+          }
+        }
+      }
+    }
   }
-}
 
+  // All residues that have at least one atom in a cube with value 3 AND have a 
+  // relative solvent accessibility > 0.25 are considered to be exposed.
+  // To finally calculate a distance, we use the CB position.
+  ost::mol::ResidueViewList all_residues = ent.GetResidueList();
+  std::vector<geom::Vec3> exposed_positions;
+
+  for(ost::mol::ResidueViewList::iterator res_it = all_residues.begin();
+      res_it != all_residues.end(); ++res_it) {
+
+    if(res_it->HasProp("asaRel") && res_it->GetFloatProp("asaRel") > Real(25)) {
+
+      bool has_exposed_atom = false;
+      ost::mol::AtomViewList at_list = res_it->GetAtomList();
+      for(ost::mol::AtomViewList::iterator at_it = at_list.begin();
+          at_it != at_list.end(); ++at_it) {
+        const geom::Vec3& pos = at_it->GetPos();
+        int x_bin = (pos[0] - min_x) * one_over_radius;
+        int y_bin = (pos[1] - min_y) * one_over_radius;
+        int z_bin = (pos[2] - min_z) * one_over_radius;
+        if(grid[z_bin*num_xbins*num_ybins + x_bin*num_ybins + y_bin] == 3) {
+          has_exposed_atom = true;
+          break;
+        }
+      }
 
-}
+      if(has_exposed_atom) {
+        ost::mol::AtomView cb = res_it->FindAtom("CB");
+        if(cb.IsValid()) {
+          exposed_positions.push_back(cb.GetPos());
+        } else {
+          ost::mol::AtomView n = res_it->FindAtom("N");
+          ost::mol::AtomView ca = res_it->FindAtom("CA");
+          ost::mol::AtomView c = res_it->FindAtom("C");
+          if(n.IsValid() && ca.IsValid() && c.IsValid()) {
+            geom::Vec3 cb_pos;
+            promod3::core::ConstructCBetaPos(n.GetPos(), ca.GetPos(),
+                                             c.GetPos(), cb_pos);
+            exposed_positions.push_back(cb_pos);
+          }
+        }
+      }
+    }
+  }
 
-namespace promod3 { namespace loop {
+  ost::mol::ResidueViewList chain_residues = chain.GetResidueList();
+  for(ost::mol::ResidueViewList::iterator res_it = chain_residues.begin();
+      res_it != chain_residues.end(); ++res_it) {
+
+    Real min_dist_2 = std::numeric_limits<Real>::max();
+
+    bool valid_pos = false;
+    geom::Vec3 pos;
+
+    ost::mol::AtomView cb = res_it->FindAtom("CB"); 
+    if(cb.IsValid()) {
+      pos = cb.GetPos();  
+      valid_pos = true;
+    } else {
+      ost::mol::AtomView n = res_it->FindAtom("N");
+      ost::mol::AtomView ca = res_it->FindAtom("CA");
+      ost::mol::AtomView c = res_it->FindAtom("C");
+      if(n.IsValid() && ca.IsValid() && c.IsValid()) {
+        promod3::core::ConstructCBetaPos(n.GetPos(), ca.GetPos(),
+                                         c.GetPos(), pos);
+        valid_pos = true;
+      }
+    }
+    if(valid_pos) {
+      for(uint i = 0; i < exposed_positions.size(); ++i) {
+        min_dist_2 = std::min(min_dist_2, 
+                              geom::Length2(pos - exposed_positions[i]));
+      }
+    } else {
+      // dont do anything, we just leave it at the max value...
+    }
 
-void AAFreq::AssignProfileColumn(const ost::seq::ProfileColumn& col) {
-  const Real* col_freq_ptr = col.freqs_begin();
-  short* freq_ptr = &freqs[0];
-  for(uint i = 0; i < 20; ++i){
-    *freq_ptr = (*col_freq_ptr)*10000;
-    ++freq_ptr;
-    ++col_freq_ptr;
+    res_it->SetFloatProp("residue_depth", std::sqrt(min_dist_2));
   }
+
+  // cleanup
+  delete [] grid;
+}
+
 }
 
-StructureDBPtr StructureDB::Load(const String& file_name,
-                                 bool load_frequencies) {
+namespace promod3 { namespace loop {
+
+StructureDBPtr StructureDB::Load(const String& file_name) {
   
   core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
                                 "StructureDB::Load", 2);
   
-  std::ifstream in_stream(file_name.c_str(), std::ios::binary);
-  if (!in_stream) {
+  std::ifstream in_stream_(file_name.c_str(), std::ios::binary);
+  if (!in_stream_) {
     std::stringstream ss;
     ss << "The file '" << file_name << "' does not exist.";
     throw promod3::Error(ss.str());
   }
+  core::PortableBinaryDataSource in_stream(in_stream_);
+
   // header for consistency checks
   core::CheckMagicNumber(in_stream);
   uint32_t version = core::GetVersionNumber(in_stream);
-  if (version > 1) {
+  if (version != 2) {
     std::stringstream ss;
     ss << "Unsupported file version '" << version << "' in '" << file_name;
     throw promod3::Error(ss.str());
   }
+
   // see Save for required types...
   typedef ost::FixedString<5> MyString;
   core::CheckTypeSize<uint>(in_stream);
@@ -137,7 +354,6 @@ StructureDBPtr StructureDB::Load(const String& file_name,
   core::CheckTypeSize<short>(in_stream);
   core::CheckTypeSize<MyString>(in_stream);
   core::CheckTypeSize<CoordInfo>(in_stream);
-  core::CheckTypeSize<Peptide>(in_stream);
   core::CheckTypeSize<AAFreq>(in_stream);
   core::CheckTypeSize<PeptideCoords>(in_stream);
   core::CheckTypeSize<UShortVec>(in_stream);
@@ -151,40 +367,55 @@ StructureDBPtr StructureDB::Load(const String& file_name,
   core::CheckBaseType<short>(in_stream);
   // raw data
   StructureDBPtr db_p(new StructureDB);
-  uint toc_len;
-  in_stream.read(reinterpret_cast<char*>(&toc_len), sizeof(uint));
-  db_p->coord_toc_.resize(toc_len);
-  in_stream.read(reinterpret_cast<char*>(&db_p->coord_toc_.front()),
-                  sizeof(CoordInfo)*toc_len);
-  db_p->coords_.Read(in_stream);
-  if(load_frequencies){
-    db_p->aa_frequencies_.Read(in_stream);
-    db_p->aa_frequencies_struct_.Read(in_stream);
-  }
-  db_p->frequencies_present_ = load_frequencies;
-  in_stream.close();
+
+  in_stream & db_p->stored_data_;
+  in_stream & db_p->coord_toc_;  
+  db_p->seq_.Read(in_stream.Stream());
+  db_p->coords_.Read(in_stream.Stream());
+
+  if(db_p->HasData(Dihedrals)) {
+    db_p->dihedrals_.Read(in_stream.Stream());
+  }
+
+  if(db_p->HasData(SolventAccessibilities)) {
+    db_p->solv_acc_.Read(in_stream.Stream());
+  }
+
+  if(db_p->HasData(ResidueDepths)) {
+    db_p->res_depths_.Read(in_stream.Stream());
+  }
+
+  if(db_p->HasData(DSSP)) {
+    db_p->dssp_.Read(in_stream.Stream());
+  }
+
+  if(db_p->HasData(AAFrequencies)) {
+    db_p->aa_frequencies_.Read(in_stream.Stream());
+  }
+
+  if(db_p->HasData(AAFrequenciesStruct)) {
+    db_p->aa_frequencies_struct_.Read(in_stream.Stream());
+  }
+
+  in_stream_.close();
   
   return db_p;
 }
 
 void StructureDB::Save(const String& filename) {
-  if (!frequencies_present_) {
-    std::stringstream ss;
-    ss << "Can only save a database that has newly been created ";
-    ss << "or loaded with load_frequencies=true!";
-    throw promod3::Error(ss.str());
-  }
-  std::ofstream out_stream(filename.c_str(), std::ios::binary);
-  if (!out_stream) {
+  std::ofstream out_stream_(filename.c_str(), std::ios::binary);
+  if (!out_stream_) {
     std::stringstream ss;
     ss << "The file '" << filename << "' cannot be opened.";
     throw promod3::Error(ss.str());
   }
+  core::PortableBinaryDataSink out_stream(out_stream_);
+
   // header for consistency checks
   core::WriteMagicNumber(out_stream);
-  core::WriteVersionNumber(out_stream, 1);
+  core::WriteVersionNumber(out_stream, 2);
   // required base types: uint, char, unsigned short, uint64_t, short
-  // required structs: ost::FixedString<5>, CoordInfo, Peptide, AAFreq
+  // required structs: ost::FixedString<5>, CoordInfo, AAFreq
   //                   PeptideCoords, UShortVec, DihedralInfo
   typedef ost::FixedString<5> MyString;
   core::WriteTypeSize<uint>(out_stream);
@@ -194,7 +425,6 @@ void StructureDB::Save(const String& filename) {
   core::WriteTypeSize<short>(out_stream);
   core::WriteTypeSize<MyString>(out_stream);
   core::WriteTypeSize<CoordInfo>(out_stream);
-  core::WriteTypeSize<Peptide>(out_stream);
   core::WriteTypeSize<AAFreq>(out_stream);
   core::WriteTypeSize<PeptideCoords>(out_stream);
   core::WriteTypeSize<UShortVec>(out_stream);
@@ -207,14 +437,37 @@ void StructureDB::Save(const String& filename) {
   core::WriteBaseType<uint64_t>(out_stream);
   core::WriteBaseType<short>(out_stream);
   // raw data
-  uint toc_len=coord_toc_.size();
-  out_stream.write(reinterpret_cast<char*>(&toc_len), sizeof(uint));
-  out_stream.write(reinterpret_cast<char*>(&coord_toc_.front()),
-                  sizeof(CoordInfo)*toc_len);
-  coords_.Write(out_stream);
-  aa_frequencies_.Write(out_stream);
-  aa_frequencies_struct_.Write(out_stream);
-  out_stream.close();
+
+  out_stream & stored_data_;
+  out_stream & coord_toc_;
+  seq_.Write(out_stream.Stream());
+  coords_.Write(out_stream.Stream());
+
+  if(this->HasData(Dihedrals)) {
+    dihedrals_.Write(out_stream.Stream());
+  }
+
+  if(this->HasData(SolventAccessibilities)) {
+    solv_acc_.Write(out_stream.Stream());
+  }
+
+  if(this->HasData(ResidueDepths)) {
+    res_depths_.Write(out_stream.Stream());
+  }
+
+  if(this->HasData(DSSP)) {
+    dssp_.Write(out_stream.Stream());
+  }
+
+  if(this->HasData(AAFrequencies)) {
+    aa_frequencies_.Write(out_stream.Stream());
+  }
+
+  if(this->HasData(AAFrequenciesStruct)) {
+    aa_frequencies_struct_.Write(out_stream.Stream());
+  }
+
+  out_stream_.close();
 }
 
 StructureDBPtr StructureDB::LoadPortable(const String& file_name) {
@@ -230,7 +483,7 @@ StructureDBPtr StructureDB::LoadPortable(const String& file_name) {
   // header for consistency checks
   core::CheckMagicNumber(in_stream);
   uint32_t version = core::GetVersionNumber(in_stream);
-  if (version > 1) {
+  if (version != 2) {
     std::stringstream ss;
     ss << "Unsupported file version '" << version << "' in '" << file_name;
     throw promod3::Error(ss.str());
@@ -247,23 +500,44 @@ StructureDBPtr StructureDB::LoadPortable(const String& file_name) {
 
   // data
   StructureDBPtr db_p(new StructureDB);
+  in_stream & db_p->stored_data_;
   in_stream & db_p->coord_toc_;
+  // seq_ has fundamental type
+  db_p->seq_.Read(in_stream.Stream());
   in_stream & db_p->coords_;
-  in_stream & db_p->aa_frequencies_;
-  in_stream & db_p->aa_frequencies_struct_;
-  db_p->frequencies_present_ = true;
+  
+  if(db_p->HasData(Dihedrals)) {
+    in_stream & db_p->dihedrals_;
+  }
+
+  if(db_p->HasData(SolventAccessibilities)) {
+    // solv_acc_ has fundamental type
+    db_p->solv_acc_.Read(in_stream.Stream());
+  }
+
+  if(db_p->HasData(ResidueDepths)) {
+    // res_depths_ has fundamental type
+    db_p->res_depths_.Read(in_stream.Stream());
+  }
+
+  if(db_p->HasData(DSSP)) {
+    // dssp_ has fundamental type
+    db_p->dssp_.Read(in_stream.Stream());
+  }
+
+  if(db_p->HasData(AAFrequencies)) {
+    in_stream & db_p->aa_frequencies_;
+  }
 
+  if(db_p->HasData(AAFrequenciesStruct)) {
+    in_stream & db_p->aa_frequencies_struct_;
+  }
+  
   in_stream_.close();
   return db_p;
 }
 
 void StructureDB::SavePortable(const String& filename) {
-  if (!frequencies_present_) {
-    std::stringstream ss;
-    ss << "Can only save a database that has newly been created ";
-    ss << "or loaded with load_frequencies=true!";
-    throw promod3::Error(ss.str());
-  }
   // open file
   std::ofstream out_stream_(filename.c_str(), std::ios::binary);
   if (!out_stream_) {
@@ -275,7 +549,7 @@ void StructureDB::SavePortable(const String& filename) {
 
   // header for consistency checks
   core::WriteMagicNumber(out_stream);
-  core::WriteVersionNumber(out_stream, 1);
+  core::WriteVersionNumber(out_stream, 2);
   // here: only base-type-checks needed
   core::WriteTypeSize<int16_t>(out_stream);
   core::WriteTypeSize<int32_t>(out_stream);
@@ -287,10 +561,38 @@ void StructureDB::SavePortable(const String& filename) {
   core::WriteBaseType<char>(out_stream);
 
   // data
+  out_stream & stored_data_;
   out_stream & coord_toc_;
-  out_stream & coords_;
-  out_stream & aa_frequencies_;
-  out_stream & aa_frequencies_struct_;
+  // seq_ has fundamental type
+  seq_.Write(out_stream.Stream());
+  out_stream & coords_;  
+
+  if(this->HasData(Dihedrals)) {
+    out_stream & dihedrals_;
+  }
+
+  if(this->HasData(SolventAccessibilities)) {
+    // solv_acc_ has fundamental type
+    solv_acc_.Write(out_stream.Stream());
+  }
+
+  if(this->HasData(ResidueDepths)) {
+    // res_depths_ has fundamental type
+    res_depths_.Write(out_stream.Stream());
+  }
+
+  if(this->HasData(DSSP)) {
+    // dssp_ has fundamental type
+    dssp_.Write(out_stream.Stream());
+  }
+
+  if(this->HasData(AAFrequencies)) {
+    out_stream & aa_frequencies_;
+  }
+
+  if(this->HasData(AAFrequenciesStruct)) {
+    out_stream & aa_frequencies_struct_;
+  }
 
   out_stream_.close();
 }
@@ -299,221 +601,343 @@ bool StructureDB::operator==(const StructureDB& rhs) const {
   return coord_toc_ == rhs.coord_toc_
       && coords_ == rhs.coords_
       && aa_frequencies_ == rhs.aa_frequencies_
-      && aa_frequencies_struct_ == rhs.aa_frequencies_struct_
-      && frequencies_present_ == rhs.frequencies_present_;
+      && aa_frequencies_struct_ == rhs.aa_frequencies_struct_;
 }
 
-int StructureDB::AddCoordinates(const String& pdb_id,
-                                const String& chain_name,
-                                const ost::mol::ChainView& chain,
-                                const ost::mol::SurfaceHandle& surf,
-                                ost::seq::ProfileHandlePtr prof,
-                                const String& solvent_accessibility_string) {
+std::vector<int> StructureDB::AddCoordinates(const String& id,
+                                             const String& chain_name,
+                                             ost::mol::EntityView& ent,
+                                             ost::seq::SequenceHandle& seqres,
+                                             ost::seq::ProfileHandlePtr prof,
+                                             bool only_longest_stretch) {
 
-  if(!frequencies_present_){
-    std::stringstream ss;
-    ss << "Can only add coordinates if database has newly been created ";
-    ss << "or loaded with load_frequencies=true!";
-    throw promod3::Error(ss.str());
-  } 
+  ost::mol::ChainView chain = ent.FindChain(chain_name);
 
-  uint chain_index = coord_toc_.size();
-  if(chain_index > std::numeric_limits<unsigned int>::max()){
-    std::stringstream ss;
-    ss << "Due to technical reasons, the database can only contain ";
-    ss << std::numeric_limits<unsigned int>::max();
-    ss << " chains.";
-    throw promod3::Error(ss.str());
+  if(!chain.IsValid()) {
+    throw promod3::Error("Could not find specified chain in input entity!");
   }
 
-  ost::mol::ResidueViewList res_list = chain.GetResidueList();
-  uint offset=coords_.size();
+  // if we want the amino acid frequencies, we must ensure a valid profile
+  // that has matching sequence with seqres
+  if(this->HasData(AAFrequencies)) {
 
-  //Let's find the longest connected stretch of residues in the provided chain
-  std::pair<uint,uint> subfrag_info = max_cont_fragment_length(res_list);
-  uint frag_start = subfrag_info.first;
-  uint connected_size = subfrag_info.second;
+    if(!prof) {
+      throw promod3::Error("You must provide a valid sequence profile when you"
+                           " add coordinates to this StructureDB!"); 
+    }
 
-  if(connected_size > std::numeric_limits<unsigned short>::max()){
-    std::stringstream ss;
-    ss << "Due to technical reasons, the max number of residues per chain is: ";
-    ss << std::numeric_limits<unsigned short>::max();
-    throw promod3::Error(ss.str());
+    if(prof->GetSequence() != seqres.GetString()) {
+      std::stringstream ss;
+      ss << "Profile sequence does not match with seqres: ";
+      ss << prof->GetSequence() << " vs " << seqres.GetString();
+      throw promod3::Error(ss.str());
+    }
   }
-  if(connected_size == 0) return -1;
 
-  geom::AlignedCuboid bounds=chain.GetBounds();
-  geom::Vec3 cuboid_size = bounds.GetSize();
-  Real max_extent = std::max(cuboid_size[0],std::max(cuboid_size[1],cuboid_size[2]));
-  if(max_extent >= std::floor(std::numeric_limits<unsigned short>::max()*0.01)){
-    std::stringstream ss;
-    ss << "Max extent of structure to be added must not exceed ";
-    ss << std::floor(std::numeric_limits<unsigned short>::max()*0.01);
-    ss <<" Angstrom!";
-    throw promod3::Error(ss.str());
+  std::vector<int> return_vec;
+  ost::mol::ResidueViewList residues = chain.GetResidueList();
+
+  if(residues.empty()) {
+    return return_vec;
   }
 
-  //extract according sequences
-  String prof_seq = prof->GetSequence();
-  String structure_seq(connected_size,'X');
-  for(uint j = 0; j < connected_size; ++j){
-    structure_seq[j] = res_list[j].GetOneLetterCode();
-  }
-
-  //generate sequence handles and generate the alignment
-  ost::seq::SequenceHandle prof_seq_handle = ost::seq::CreateSequence("A",prof_seq);
-  ost::seq::SequenceHandle structure_seq_handle = ost::seq::CreateSequence("B",structure_seq);
-  ost::seq::alg::SubstWeightMatrixPtr subst(new ost::seq::alg::SubstWeightMatrix);
-  subst->AssignPreset(ost::seq::alg::SubstWeightMatrix::BLOSUM100);
-  ost::seq::AlignmentHandle aln = ost::seq::alg::SemiGlobalAlign(prof_seq_handle,structure_seq_handle,subst)[0];
-
-  //get the profile column indices of the aligned structural residues
-  std::vector<int> prof_indices;
-  prof_indices.reserve(connected_size);
-  bool invalid_sequence = false;
-  char a,b;
-  int aln_pos_idx = 0;
-  for(ost::seq::AlignmentHandle::iterator col_it = aln.begin();
-      col_it != aln.end(); ++col_it){
-    a = (*col_it)[0];
-    b = (*col_it)[1];
-    if(a == '-' || a == '?'){
-      invalid_sequence = true; // "SEQRES" olcs must be valid and not a gap!
+  // check for consistency of the residue numbers with seqres
+  int seqres_size = seqres.GetLength();
+  std::vector<int> resnums;
+  ost::mol::AtomView c_prev; 
+  Real optimal_peptide_bond_length = 1.348435;
+  std::vector<bool> connected_to_prev;
+
+  for(ost::mol::ResidueViewList::iterator it = residues.begin();
+      it != residues.end(); ++it) {
+    int rnum = it->GetNumber().GetNum();
+    char olc = it->GetOneLetterCode();
+    if(rnum < 1 || rnum > seqres_size || olc != seqres[rnum-1]) {
+      std::stringstream ss;
+      ss << "Residue " << *it << " doesnt match with seqres: ";
+      ss << seqres;
+      throw promod3::Error(ss.str());
     }
 
-    if(a != b && b != '-'){
-      if(!(b == 'X' || b == '?')){
-        if(a != 'X'){
-          invalid_sequence = true; //let's allow alignment mismatch if '?' or 'X' is allowed
-        }
+    // only consider residue if all required backbone atoms are present
+    ost::mol::AtomView n = it->FindAtom("N");
+    ost::mol::AtomView ca = it->FindAtom("CA");
+    ost::mol::AtomView c = it->FindAtom("C");
+    ost::mol::AtomView o = it->FindAtom("O");
+
+    if(!(n.IsValid() && ca.IsValid() && c.IsValid() && o.IsValid())) {
+      continue;
+    }
+
+    resnums.push_back(rnum);
+
+    Real d = 0.0;
+    if(c_prev.IsValid()) {
+      d = geom::Distance(c_prev.GetPos(), n.GetPos());
+    }
+    if(std::abs(d - optimal_peptide_bond_length) > 0.5) {
+      connected_to_prev.push_back(false);
+    } else {
+      connected_to_prev.push_back(true);
+    }
+    c_prev = c;
+  }
+
+  // find connected stretches of residue numbers
+  std::vector<std::vector<int> > connected_stretches;
+  std::vector<int> current_resnums;
+  current_resnums.push_back(resnums[0]);
+  for(uint i = 1; i < resnums.size(); ++i) {
+    if(resnums[i] == current_resnums.back() + 1 && connected_to_prev[i]) {
+      current_resnums.push_back(resnums[i]);
+    } else {
+      connected_stretches.push_back(current_resnums);
+      current_resnums = std::vector<int>();
+      current_resnums.push_back(resnums[i]);
+    }
+  }
+  if(!current_resnums.empty()) {
+    connected_stretches.push_back(current_resnums);
+  }
+
+  // depending on the only_longest_stretch flag, we only add one stretch 
+  // or all of them
+  std::vector<int> stretches_to_add;
+  if(only_longest_stretch) {
+    uint max_size = 0;
+    int max_idx = 0;
+    for(uint i = 0; i < connected_stretches.size(); ++i) {
+      if(connected_stretches[i].size() > max_size) {
+        max_size = connected_stretches[i].size();
+        max_idx = i;
       }
-    } 
+    }
+    stretches_to_add.push_back(max_idx);
+  } else {
+    for(uint i = 0; i < connected_stretches.size(); ++i) {
+      stretches_to_add.push_back(i);
+    }
+  }
 
-    if(b != '-') prof_indices.push_back(aln_pos_idx);
-    ++aln_pos_idx;
-  }   
+  // If required, we assign secondary structures, solvent accessibilities and 
+  // residue depths given the full complex. Since they relate
+  // to the same underlying data, the stuff will also be accessible from the 
+  // residues in the ChainView.
+  if(this->HasData(DSSP)) {
+    ost::mol::alg::AssignSecStruct(ent);
+  }
 
-  if(invalid_sequence){
-    std::stringstream ss;
-    ss << "Could not align the ATOMSEQ from the given chain to the ";
-    ss << "SEQRES given by the profile!";
-    throw promod3::Error(ss.str());
+  if(this->HasData(SolventAccessibilities) || 
+     this->HasData(ResidueDepths)) {
+    ost::mol::alg::Accessibility(ent);
   }
 
-  //extract dssp information, solvent accessibilities and residue depths 
-  std::vector<char> dssp_states;
-  std::vector<unsigned short> solvent_accessibilities;
-  std::vector<Real> residue_depths;
-  ResidueDepth(chain,surf,residue_depths);
-  String valid_dssp_states = "GHIBETSC";
-  for(ost::mol::ResidueViewList::const_iterator i = res_list.begin(),
-      e = res_list.end(); i != e; ++i){
-    char dssp_state = char(i->GetSecStructure());
-    if(valid_dssp_states.find(dssp_state) == String::npos){
+  if(this->HasData(ResidueDepths)) {
+    AssignResidueDepths(ent, chain);
+  }
+
+  /////////////////
+  // Lets do it! //
+  /////////////////
+
+  for(std::vector<int>::iterator stretch_idx_it = stretches_to_add.begin();
+      stretch_idx_it != stretches_to_add.end(); ++stretch_idx_it) {
+
+    const std::vector<int>& stretch = connected_stretches[*stretch_idx_it];
+
+    // chain must not exceed length...
+    if(stretch.size() >= std::numeric_limits<unsigned short>::max()) {
       std::stringstream ss;
-      ss << "Residue \"" << i->GetQualifiedName() <<"\" has invalid dssp state \'";
-      ss << dssp_state << "\'. Adding \'C\' instead!";
-      std::cerr<<ss.str()<<std::endl;
-      dssp_state = 'C';
+      ss << "Due to technical reasons, the maximum length of added chains is ";
+      ss << std::numeric_limits<unsigned short>::max() << ". skip...";
+      LOG_ERROR(ss.str());
+      continue;
     }
-    dssp_states.push_back(dssp_state);
-    if(i->HasProp(solvent_accessibility_string)){
-      Real acc = i->GetFloatProp(solvent_accessibility_string);
-      solvent_accessibilities.push_back(acc);
+
+    // lets build a BackboneList of the stretch to simplify feature extraction
+    ost::mol::ResidueHandleList stretch_residues;
+    String stretch_sequence(stretch.size(), 'X');
+
+    for(uint rnum_idx = 0; rnum_idx < stretch.size(); ++rnum_idx) {
+      ost::mol::ResNum rnum(stretch[rnum_idx]);
+      ost::mol::ResidueView res = chain.FindResidue(rnum);
+      stretch_residues.push_back(res.GetHandle());
+      stretch_sequence[rnum_idx] = res.GetOneLetterCode();
     }
-    else{
-      String err = "Residue \"" + i->GetQualifiedName() + "\" has no ";
-      err += ("property " + solvent_accessibility_string + " describing ");
-      err += "its solvent accessibility. Adding 0.0 instead.";
-      std::cerr<<err<<std::endl;
-      solvent_accessibilities.push_back(0.0);
+
+    promod3::loop::BackboneList bb_list(stretch_sequence, stretch_residues);
+
+    // get the bounds and check whether they're small enough for our custom
+    // position data type
+    geom::AlignedCuboid bounds = bb_list.GetBounds();
+    geom::Vec3 cuboid_size = bounds.GetSize();
+    Real max_extent = std::max(cuboid_size[0],
+                               std::max(cuboid_size[1],
+                                        cuboid_size[2]));
+    Real max_v = std::floor(std::numeric_limits<unsigned short>::max() * 0.01); 
+    if(max_extent >= max_v) {
+      std::stringstream ss;
+      ss << "Max extent of stretch to be added must not exceed ";
+      ss << std::floor(std::numeric_limits<unsigned short>::max() * 0.01);
+      ss <<" Angstrom! skip...";
+      LOG_ERROR(ss.str());
+      continue;
     }
-  }
 
-  coord_toc_.push_back(CoordInfo(pdb_id, chain_name, offset, connected_size));
-
-  std::vector<Peptide> peptides;
-  for(uint i = 0; i < connected_size; ++i){
-    ost::mol::ResidueView r=res_list[frag_start+i];
-    Peptide peptide;
-    peptide.coords.n=UShortVec(r.FindAtom("N").GetPos()-bounds.GetMin());
-    peptide.coords.ca=UShortVec(r.FindAtom("CA").GetPos()-bounds.GetMin());
-    peptide.coords.c=UShortVec(r.FindAtom("C").GetPos()-bounds.GetMin());
-    peptide.coords.o=UShortVec(r.FindAtom("O").GetPos()-bounds.GetMin());
-    peptide.olc=r.GetOneLetterCode();
-    peptide.dssp_state=dssp_states[frag_start+i];
-    peptide.solv_acc=solvent_accessibilities[frag_start+i];
-    Real transformed_residue_depth = residue_depths[frag_start+i]*10;
-    if(transformed_residue_depth >= std::numeric_limits<unsigned short>::max()){
-      peptide.res_depth = std::numeric_limits<unsigned short>::max();
+    // we're ready to go, from now on we should have no errors anymore
+    uint offset = coords_.size();
+    geom::Vec3 shift = -bounds.GetMin();
+    coord_toc_.push_back(CoordInfo(id, chain_name, offset, 
+                         bb_list.size(), stretch[0], shift));
+
+    for(uint rnum_idx = 0; rnum_idx < bb_list.size(); ++rnum_idx) {
+      PeptideCoords coords;
+      coords.n = UShortVec(bb_list.GetN(rnum_idx) + shift);
+      coords.ca = UShortVec(bb_list.GetCA(rnum_idx) + shift);
+      coords.c = UShortVec(bb_list.GetC(rnum_idx) + shift);
+      coords.o = UShortVec(bb_list.GetO(rnum_idx) + shift);
+      seq_.push_back(bb_list.GetOLC(rnum_idx));
+      coords_.push_back(coords);
+    }
+
+    if(this->HasData(Dihedrals)) {
+
+      dihedrals_.push_back(DihedralInfo(-1.0472,
+                                        bb_list.GetPsiTorsion(0)));
+      for(uint i = 1; i < bb_list.size() - 1; ++i) {
+        dihedrals_.push_back(DihedralInfo(bb_list.GetPhiTorsion(i),
+                                          bb_list.GetPsiTorsion(i)));
+      }
+      dihedrals_.push_back(DihedralInfo(bb_list.GetPhiTorsion(bb_list.size()-1),
+                                        -0.78540));
+    }
+
+    if(this->HasData(SolventAccessibilities)) {
+      for(ost::mol::ResidueHandleList::iterator it = stretch_residues.begin();
+        it != stretch_residues.end(); ++it) {
+        if(it->HasProp("asaAbs")) {
+          Real acc = static_cast<unsigned short>(it->GetFloatProp("asaAbs"));
+          solv_acc_.push_back(acc);
+        } else {
+          std::stringstream ss;
+          ss << "Residue " << *it << " has no valid solvent accessibility ";
+          ss << "assigned. Use 0.0..."<<std::endl;
+          LOG_ERROR(ss.str());
+
+          solv_acc_.push_back(0);
+        }
+      }
     }
-    else peptide.res_depth = static_cast<unsigned short>(transformed_residue_depth);
-    peptides.push_back(peptide);
+    
+    if(this->HasData(ResidueDepths)) {
+      for(ost::mol::ResidueHandleList::iterator it = stretch_residues.begin();
+          it != stretch_residues.end(); ++it) {
+        Real residue_depth = it->GetFloatProp("residue_depth");
+        Real transformed_r_depth = residue_depth * 10;
+        unsigned short final_depth;
+        if(transformed_r_depth >= std::numeric_limits<unsigned short>::max()) {
+          final_depth = std::numeric_limits<unsigned short>::max();
+        } else {
+          final_depth = static_cast<unsigned short>(transformed_r_depth);
+        }
+        res_depths_.push_back(final_depth);
+      }       
+    }
+
+    if(this->HasData(DSSP)) {
+      for(ost::mol::ResidueHandleList::const_iterator it = 
+          stretch_residues.begin(); it != stretch_residues.end(); ++it) {
+        char dssp_state = char(it->GetSecStructure());
+        dssp_.push_back(dssp_state);
+      }
+    }
+
+    if(this->HasData(AAFrequencies)) {
+      for(uint rnum_idx = 0; rnum_idx < bb_list.size(); ++rnum_idx) {
+        AAFreq aa_freq;
+        const ost::seq::ProfileColumn& col = (*prof)[stretch[rnum_idx] - 1];
+        aa_freq.AssignProfileColumn(col);
+        aa_frequencies_.push_back(aa_freq);
+      }
+    }
+
+    if(this->HasData(AAFrequenciesStruct)) {
+      for(uint rnum_idx = 0; rnum_idx < bb_list.size(); ++rnum_idx) {
+        AAFreq aa_freq_struct;
+        aa_frequencies_struct_.push_back(aa_freq_struct);
+      }
+    }
+
+    return_vec.push_back(coord_toc_.size() - 1);
   }
 
-  //calculate all dihedrals
-  Real phi,psi;
+  return return_vec;
+}
 
-  //first one
-  phi = -1.0472;
-  psi = geom::DihedralAngle(peptides[0].coords.n.ToVec3(),
-                            peptides[0].coords.ca.ToVec3(),
-                            peptides[0].coords.c.ToVec3(),
-                            peptides[1].coords.n.ToVec3());
 
-  peptides[0].dihedrals = DihedralInfo(phi,psi);
+void StructureDB::RemoveCoordinates(uint coord_idx) {
 
-  //the middle stuff
-  for(uint i = 1; i < peptides.size()-1; ++i){
-    phi = geom::DihedralAngle(peptides[i-1].coords.c.ToVec3(),
-                              peptides[i].coords.n.ToVec3(),
-                              peptides[i].coords.ca.ToVec3(),
-                              peptides[i].coords.c.ToVec3());
-    psi = geom::DihedralAngle(peptides[i].coords.n.ToVec3(),
-                              peptides[i].coords.ca.ToVec3(),
-                              peptides[i].coords.c.ToVec3(),
-                              peptides[i+1].coords.n.ToVec3());
-    peptides[i].dihedrals = DihedralInfo(phi,psi);
+  if(coord_idx >= coord_toc_.size()) {
+    throw promod3::Error("Invalid input idx!");
   }
 
-  //last one
-  phi = geom::DihedralAngle(peptides[peptides.size()-1-1].coords.c.ToVec3(),
-                            peptides[peptides.size()-1].coords.n.ToVec3(),
-                            peptides[peptides.size()-1].coords.ca.ToVec3(),
-                            peptides[peptides.size()-1].coords.c.ToVec3());
-  psi = -0.78540;
+  // lets first remove everything from the paged arrays
+  uint64_t from = coord_toc_[coord_idx].offset;
+  uint64_t to = from + coord_toc_[coord_idx].size;
 
-  peptides[peptides.size()-1].dihedrals = DihedralInfo(phi,psi);
+  seq_.ClearRange(from, to);
+  coords_.ClearRange(from, to);
 
+  if(this->HasData(Dihedrals)) {
+    dihedrals_.ClearRange(from, to);
+  }
 
-  //finally add all peptides to the coords_ and the frequencies to
-  //aa_frequencies_
-  for(std::vector<Peptide>::iterator i = peptides.begin();
-      i != peptides.end(); ++i){
-    coords_.push_back(*i);
+  if(this->HasData(SolventAccessibilities)) {
+    solv_acc_.ClearRange(from, to); 
   }
 
-  for(uint i = 0; i < connected_size; ++i){
-    AAFreq aa_freq;
-    const ost::seq::ProfileColumn& col = (*prof)[prof_indices[i]];
-    aa_freq.AssignProfileColumn(col);
-    aa_frequencies_.push_back(aa_freq);
-    AAFreq aa_freq_struct;
-    aa_frequencies_struct_.push_back(aa_freq_struct);
+  if(this->HasData(ResidueDepths)) {
+    res_depths_.ClearRange(from, to);
   }
 
-  return chain_index;
+  if(this->HasData(DSSP)) {
+    dssp_.ClearRange(from, to);
+  }
+
+  if(this->HasData(AAFrequencies)) {
+    aa_frequencies_.ClearRange(from, to);
+  }
+
+  if(this->HasData(AAFrequenciesStruct)) {
+    aa_frequencies_struct_.ClearRange(from, to);
+  }
+
+  // correct all offset values of the coords that are stored afterwards
+  for(uint i = coord_idx + 1; i < coord_toc_.size(); ++i) {
+    coord_toc_[i].offset -= coord_toc_[coord_idx].size;
+  }
+
+  // and finally kill the CoordInfo itself
+  coord_toc_.erase(coord_toc_.begin() + coord_idx);
 }
 
-int StructureDB::GetCoordIndex(const String& pdb_id, const String& chain_name) const{
-  ost::FixedString<5> id(pdb_id+chain_name);
+
+std::vector<int> StructureDB::GetCoordIdx(const String& id, 
+                                          const String& chain_name) const{
+
+  std::vector<int> return_vec;
+
   for(uint i = 0; i < coord_toc_.size(); ++i){
-    if(coord_toc_[i].pdb_id == id) return i;
+    if(coord_toc_[i].id == id) {
+      if(coord_toc_[i].chain_name == chain_name) {
+        return_vec.push_back(i);
+      }
+    }
   }
-  return -1;
+  return return_vec;
 }
 
-CoordInfo StructureDB::GetCoordInfo(int index) const{
+const CoordInfo& StructureDB::GetCoordInfo(int index) const{
   if(static_cast<uint>(index) >= coord_toc_.size()){
     throw promod3::Error("pdb index exceeds number of coord tocs in database!");
   }
@@ -544,61 +968,28 @@ Real StructureDB::CARMSD(const FragmentInfo& info_one,
     core::EMatX3 pos_one = core::EMatX3::Zero(6,3);
     core::EMatX3 pos_two = core::EMatX3::Zero(6,3);
 
-    Peptide start_peptide = coords_[start_one];
-    Peptide end_peptide = coords_[start_one + static_cast<uint>(info_one.length) - 1];
-
-    pos_one(0,0) = start_peptide.coords.n.x * 0.01;
-    pos_one(0,1) = start_peptide.coords.n.y * 0.01;
-    pos_one(0,2) = start_peptide.coords.n.z * 0.01;
-
-    pos_one(1,0) = start_peptide.coords.ca.x * 0.01;
-    pos_one(1,1) = start_peptide.coords.ca.y * 0.01;
-    pos_one(1,2) = start_peptide.coords.ca.z * 0.01;
-
-    pos_one(2,0) = start_peptide.coords.c.x * 0.01;
-    pos_one(2,1) = start_peptide.coords.c.y * 0.01;
-    pos_one(2,2) = start_peptide.coords.c.z * 0.01;
+    PeptideCoords start_coords = coords_[start_one];
+    PeptideCoords end_coords = coords_[start_one + 
+                                       static_cast<uint>(info_one.length) - 1];
 
-    pos_one(3,0) = end_peptide.coords.n.x * 0.01;
-    pos_one(3,1) = end_peptide.coords.n.y * 0.01;
-    pos_one(3,2) = end_peptide.coords.n.z * 0.01;
+    core::EMatFillRow(pos_one, 0, start_coords.n.ToVec3());
+    core::EMatFillRow(pos_one, 1, start_coords.ca.ToVec3());
+    core::EMatFillRow(pos_one, 2, start_coords.c.ToVec3());
+    core::EMatFillRow(pos_one, 3, end_coords.n.ToVec3());
+    core::EMatFillRow(pos_one, 4, end_coords.ca.ToVec3());
+    core::EMatFillRow(pos_one, 5, end_coords.c.ToVec3());
 
-    pos_one(4,0) = end_peptide.coords.ca.x * 0.01;
-    pos_one(4,1) = end_peptide.coords.ca.y * 0.01;
-    pos_one(4,2) = end_peptide.coords.ca.z * 0.01;
+    start_coords = coords_[start_two];
+    end_coords = coords_[start_two + static_cast<uint>(info_two.length) - 1];
 
-    pos_one(5,0) = end_peptide.coords.c.x * 0.01;
-    pos_one(5,1) = end_peptide.coords.c.y * 0.01;
-    pos_one(5,2) = end_peptide.coords.c.z * 0.01;
+    core::EMatFillRow(pos_two, 0, start_coords.n.ToVec3());
+    core::EMatFillRow(pos_two, 1, start_coords.ca.ToVec3());
+    core::EMatFillRow(pos_two, 2, start_coords.c.ToVec3());
+    core::EMatFillRow(pos_two, 3, end_coords.n.ToVec3());
+    core::EMatFillRow(pos_two, 4, end_coords.ca.ToVec3());
+    core::EMatFillRow(pos_two, 5, end_coords.c.ToVec3());
 
-    start_peptide = coords_[start_two];
-    end_peptide = coords_[start_two + static_cast<uint>(info_two.length) - 1];
-
-    pos_two(0,0) = start_peptide.coords.n.x * 0.01;
-    pos_two(0,1) = start_peptide.coords.n.y * 0.01;
-    pos_two(0,2) = start_peptide.coords.n.z * 0.01;
-
-    pos_two(1,0) = start_peptide.coords.ca.x * 0.01;
-    pos_two(1,1) = start_peptide.coords.ca.y * 0.01;
-    pos_two(1,2) = start_peptide.coords.ca.z * 0.01;
-
-    pos_two(2,0) = start_peptide.coords.c.x * 0.01;
-    pos_two(2,1) = start_peptide.coords.c.y * 0.01;
-    pos_two(2,2) = start_peptide.coords.c.z * 0.01;
-
-    pos_two(3,0) = end_peptide.coords.n.x * 0.01;
-    pos_two(3,1) = end_peptide.coords.n.y * 0.01;
-    pos_two(3,2) = end_peptide.coords.n.z * 0.01;
-
-    pos_two(4,0) = end_peptide.coords.ca.x * 0.01;
-    pos_two(4,1) = end_peptide.coords.ca.y * 0.01;
-    pos_two(4,2) = end_peptide.coords.ca.z * 0.01;
-
-    pos_two(5,0) = end_peptide.coords.c.x * 0.01;
-    pos_two(5,1) = end_peptide.coords.c.y * 0.01;
-    pos_two(5,2) = end_peptide.coords.c.z * 0.01;
-
-    geom::Mat4 t = core::MinRMSDSuperposition(pos_one,pos_two);
+    geom::Mat4 t = core::MinRMSDSuperposition(pos_one, pos_two);
 
     Real msd = 0.0;
     Real temp;
@@ -606,39 +997,42 @@ Real StructureDB::CARMSD(const FragmentInfo& info_one,
     geom::Vec3 ca_pos_two;
 
     for(int i = 0; i < info_one.length; ++i){
-      ca_pos_one = coords_[start_one+i].coords.ca.ToVec3();
-      ca_pos_two = coords_[start_two+i].coords.ca.ToVec3();
+      ca_pos_one = coords_[start_one+i].ca.ToVec3();
+      ca_pos_two = coords_[start_two+i].ca.ToVec3();
 
-      temp = t(0,0)*ca_pos_one[0]+t(0,1)*ca_pos_one[1]+t(0,2)*ca_pos_one[2]+t(0,3);
+      temp = t(0,0) * ca_pos_one[0] + 
+             t(0,1) * ca_pos_one[1] + 
+             t(0,2) * ca_pos_one[2] + 
+             t(0,3);
       temp -= ca_pos_two[0];
       msd += temp * temp;
 
-      temp = t(1,0)*ca_pos_one[0]+t(1,1)*ca_pos_one[1]+t(1,2)*ca_pos_one[2]+t(1,3);
+      temp = t(1,0) * ca_pos_one[0] + 
+             t(1,1) * ca_pos_one[1] + 
+             t(1,2) * ca_pos_one[2] + 
+             t(1,3);
       temp -= ca_pos_two[1];
       msd += temp * temp;
 
-      temp = t(2,0)*ca_pos_one[0]+t(2,1)*ca_pos_one[1]+t(2,2)*ca_pos_one[2]+t(2,3);
+      temp = t(2,0) * ca_pos_one[0] + 
+             t(2,1) * ca_pos_one[1] +
+             t(2,2) * ca_pos_one[2] + 
+             t(2,3);
       temp -= ca_pos_two[2];
       msd += temp * temp;
     }
-    return std::sqrt(msd/info_one.length);
+    return std::sqrt(msd / info_one.length);
   }
 
   core::EMatX3 pos_one = core::EMatX3::Zero(info_one.length,3);
   core::EMatX3 pos_two = core::EMatX3::Zero(info_one.length,3);  
   
   for(int i = 0; i < info_one.length; ++i){
-    const Peptide& pep = coords_[start_one+i];
-    pos_one(i,0) = pep.coords.ca.x * 0.01;
-    pos_one(i,1) = pep.coords.ca.y * 0.01;
-    pos_one(i,2) = pep.coords.ca.z * 0.01;
+    core::EMatFillRow(pos_one, i, coords_[start_one + i].ca.ToVec3());
   }
 
   for(int i = 0; i < info_two.length; ++i){
-    const Peptide& pep = coords_[start_two+i];
-    pos_two(i,0) = pep.coords.ca.x * 0.01;
-    pos_two(i,1) = pep.coords.ca.y * 0.01;
-    pos_two(i,2) = pep.coords.ca.z * 0.01;
+    core::EMatFillRow(pos_two, i, coords_[start_two + i].ca.ToVec3());
   }
 
   return core::SuperposedRMSD(pos_one,pos_two);
@@ -656,10 +1050,10 @@ void StructureDB::FillBackbone(BackboneList& bb_list, const FragmentInfo& info,
   uint coord_start = GetStartIndex(info);
   for (uint i = 0; i < info.length; ++i) {
     // NOTE: CB pos. and AA (must be non-XXX) are set in push_back
-    bb_list.push_back(coords_[coord_start+i].coords.n.ToVec3(),
-                      coords_[coord_start+i].coords.ca.ToVec3(),
-                      coords_[coord_start+i].coords.c.ToVec3(),
-                      coords_[coord_start+i].coords.o.ToVec3(),
+    bb_list.push_back(coords_[coord_start+i].n.ToVec3(),
+                      coords_[coord_start+i].ca.ToVec3(),
+                      coords_[coord_start+i].c.ToVec3(),
+                      coords_[coord_start+i].o.ToVec3(),
                       sequence[i]);
   }
 }
@@ -692,10 +1086,9 @@ void StructureDB::FillBackbone(BackboneList& bb_list,
                          "backbone atoms!");
   }
 
-  // note, that GetPos() on an atomhandle gets a reference to the internal pos
-  pos_one.row(0) = core::ERVec3(&(n.GetPos()[0]));
-  pos_one.row(1) = core::ERVec3(&(ca.GetPos()[0]));
-  pos_one.row(2) = core::ERVec3(&(c.GetPos()[0]));  
+  core::EMatFillRow(pos_one, 0, n.GetPos());
+  core::EMatFillRow(pos_one, 1, ca.GetPos());
+  core::EMatFillRow(pos_one, 2, c.GetPos());
 
   n = stem_two.FindAtom("N");  
   ca = stem_two.FindAtom("CA");  
@@ -706,37 +1099,20 @@ void StructureDB::FillBackbone(BackboneList& bb_list,
                          "backbone atoms!");
   }
 
-  pos_one.row(3) = core::ERVec3(&(n.GetPos()[0]));
-  pos_one.row(4) = core::ERVec3(&(ca.GetPos()[0]));
-  pos_one.row(5) = core::ERVec3(&(c.GetPos()[0])); 
+  core::EMatFillRow(pos_one, 3, n.GetPos());
+  core::EMatFillRow(pos_one, 4, ca.GetPos());
+  core::EMatFillRow(pos_one, 5, c.GetPos());
 
   int start = GetStartIndex(info);
-  const Peptide& start_peptide = coords_[start];
-  const Peptide& end_peptide = coords_[start + info.length - 1];
-
-  pos_two(0,0) = start_peptide.coords.n.x * 0.01;
-  pos_two(0,1) = start_peptide.coords.n.y * 0.01;
-  pos_two(0,2) = start_peptide.coords.n.z * 0.01;
+  const PeptideCoords& start_coords = coords_[start];
+  const PeptideCoords& end_coords = coords_[start + info.length - 1];
 
-  pos_two(1,0) = start_peptide.coords.ca.x * 0.01;
-  pos_two(1,1) = start_peptide.coords.ca.y * 0.01;
-  pos_two(1,2) = start_peptide.coords.ca.z * 0.01;
-
-  pos_two(2,0) = start_peptide.coords.c.x * 0.01;
-  pos_two(2,1) = start_peptide.coords.c.y * 0.01;
-  pos_two(2,2) = start_peptide.coords.c.z * 0.01;
-
-  pos_two(3,0) = end_peptide.coords.n.x * 0.01;
-  pos_two(3,1) = end_peptide.coords.n.y * 0.01;
-  pos_two(3,2) = end_peptide.coords.n.z * 0.01;
-
-  pos_two(4,0) = end_peptide.coords.ca.x * 0.01;
-  pos_two(4,1) = end_peptide.coords.ca.y * 0.01;
-  pos_two(4,2) = end_peptide.coords.ca.z * 0.01;
-
-  pos_two(5,0) = end_peptide.coords.c.x * 0.01;
-  pos_two(5,1) = end_peptide.coords.c.y * 0.01;
-  pos_two(5,2) = end_peptide.coords.c.z * 0.01;
+  core::EMatFillRow(pos_two, 0, start_coords.n.ToVec3());
+  core::EMatFillRow(pos_two, 1, start_coords.ca.ToVec3());
+  core::EMatFillRow(pos_two, 2, start_coords.c.ToVec3());
+  core::EMatFillRow(pos_two, 3, end_coords.n.ToVec3());
+  core::EMatFillRow(pos_two, 4, end_coords.ca.ToVec3());
+  core::EMatFillRow(pos_two, 5, end_coords.c.ToVec3());
 
   geom::Mat4 t = core::MinRMSDSuperposition(pos_two,pos_one);
 
@@ -752,13 +1128,17 @@ String StructureDB::GetSequence(const FragmentInfo& info) const{
   int end = start+info.length;
   int pos = 0;
   for (; start < end; ++start, ++pos) {
-    return_sequence[pos] = coords_[start].olc;
+    return_sequence[pos] = seq_[start];
   }
   return return_sequence;
 }
 
 String StructureDB::GetDSSPStates(const FragmentInfo& info) const{
 
+  if(!this->HasData(DSSP)) {
+    throw promod3::Error("StructureDB does not contain dssp assignments!");
+  }
+
   this->CheckFragmentInfo(info);
 
   String return_states(static_cast<uint>(info.length),'C');
@@ -766,12 +1146,17 @@ String StructureDB::GetDSSPStates(const FragmentInfo& info) const{
   int end = start+info.length;
   int pos = 0;
   for (; start < end; ++start, ++pos) {
-    return_states[pos] = coords_[start].dssp_state;
+    return_states[pos] = dssp_[start];
   }
   return return_states;
 }
 
-std::vector<std::pair<Real,Real> > StructureDB::GetDihedralAngles(const FragmentInfo& info) const{
+std::vector<std::pair<Real,Real> > 
+StructureDB::GetDihedralAngles(const FragmentInfo& info) const{
+
+  if(!this->HasData(Dihedrals)) {
+    throw promod3::Error("StructureDB does not contain dihedrals!");
+  }
 
   this->CheckFragmentInfo(info);
 
@@ -780,14 +1165,19 @@ std::vector<std::pair<Real,Real> > StructureDB::GetDihedralAngles(const Fragment
   int end = start+info.length;
   int pos = 0;
   for (; start < end; ++start, ++pos) {
-    return_vec[pos] = std::make_pair(coords_[start].dihedrals.GetPhi(),
-                                     coords_[start].dihedrals.GetPsi());
+    const DihedralInfo& dihedrals = dihedrals_[start];
+    return_vec[pos] = std::make_pair(dihedrals.GetPhi(),
+                                     dihedrals.GetPsi());
   }
   return return_vec;
 }
 
 std::vector<Real> StructureDB::GetResidueDepths(const FragmentInfo& info) const{
 
+  if(!this->HasData(ResidueDepths)) {
+    throw promod3::Error("StructureDB does not contain residue depths!");
+  }
+
   this->CheckFragmentInfo(info);
 
   std::vector<Real> return_depths;
@@ -795,13 +1185,18 @@ std::vector<Real> StructureDB::GetResidueDepths(const FragmentInfo& info) const{
   int start = GetStartIndex(info);
   int end = start+info.length;
   for (; start < end; ++start) {
-    return_depths.push_back(0.1 * coords_[start].res_depth);
+    return_depths.push_back(0.1 * res_depths_[start]);
   }
   return return_depths;
 }
 
 std::vector<int> StructureDB::GetSolventAccessibilities(const FragmentInfo& info) const{
 
+  if(!this->HasData(SolventAccessibilities)) {
+    throw promod3::Error("StructureDB does not contain "
+                         "solvent accessibilities!");
+  }
+
   this->CheckFragmentInfo(info);
 
   std::vector<int> return_accessibilities;
@@ -809,7 +1204,7 @@ std::vector<int> StructureDB::GetSolventAccessibilities(const FragmentInfo& info
   int start = GetStartIndex(info);
   int end = start+info.length;
   for (; start < end; ++start) {
-    return_accessibilities.push_back(coords_[start].solv_acc);
+    return_accessibilities.push_back(solv_acc_[start]);
   }
   return return_accessibilities;
 }
@@ -817,9 +1212,9 @@ std::vector<int> StructureDB::GetSolventAccessibilities(const FragmentInfo& info
 ost::seq::ProfileHandlePtr
 StructureDB::GetSequenceProfile(const FragmentInfo& info) const {
 
-  if (!frequencies_present_) {
-    throw promod3::Error("Cannot access profile information in database "
-                         "loaded with load_frequencies = false!");
+  if(!this->HasData(AAFrequencies)) {
+    throw promod3::Error("StructureDB does not contain amino acid "
+                         "frequencies!");
   }
 
   this->CheckFragmentInfo(info);
@@ -835,7 +1230,7 @@ StructureDB::GetSequenceProfile(const FragmentInfo& info) const {
     for (uint i = 0; i < 20; ++i) {
       col_data[i] = static_cast<Real>(0.0001 * freqs[i]);
     }
-    prof->AddColumn(col, coords_[start].olc);
+    prof->AddColumn(col, seq_[start]);
   }
   return prof;
 }
@@ -843,9 +1238,9 @@ StructureDB::GetSequenceProfile(const FragmentInfo& info) const {
 ost::seq::ProfileHandlePtr
 StructureDB::GetStructureProfile(const FragmentInfo& info) const {
 
-  if (!frequencies_present_) {
-    throw promod3::Error("Cannot access profile information in database "
-                         "loaded with load_frequencies = false!");
+  if(!this->HasData(AAFrequenciesStruct)) {
+    throw promod3::Error("StructureDB does not contain amino acid " 
+                         "frequencies derived from structural information!");
   }
 
   this->CheckFragmentInfo(info);
@@ -861,15 +1256,21 @@ StructureDB::GetStructureProfile(const FragmentInfo& info) const {
     for (uint i = 0; i < 20; ++i) {
       col_data[i] = static_cast<Real>(0.0001 * freqs[i]);
     }
-    prof->AddColumn(col, coords_[start].olc);
+    prof->AddColumn(col, seq_[start]);
   }
   return prof;
 }
 
+int StructureDB::GetStartResnum(const FragmentInfo& info) const {
+  
+  this->CheckFragmentInfo(info);
+
+  return coord_toc_[info.chain_index].start_resnum + info.offset;
+}
+
 StructureDBPtr StructureDB::GetSubDB(const std::vector<uint>& indices) const{
 
-  StructureDBPtr ret_db(new StructureDB);
-  ret_db->frequencies_present_ = frequencies_present_;
+  StructureDBPtr sub_db(new StructureDB(stored_data_));
 
   for(std::vector<uint>::const_iterator i = indices.begin();
       i != indices.end(); ++i){
@@ -878,110 +1279,139 @@ StructureDBPtr StructureDB::GetSubDB(const std::vector<uint>& indices) const{
       throw promod3::Error("Invalid idx observed when creating SubDB!");
     }
 
-    ret_db->coord_toc_.push_back(coord_toc_[*i]);
-    ret_db->coord_toc_.back().offset = ret_db->coords_.size();
+    sub_db->coord_toc_.push_back(coord_toc_[*i]);
+    sub_db->coord_toc_.back().offset = sub_db->coords_.size();
     
     uint start = coord_toc_[*i].offset;
     uint end = start + coord_toc_[*i].size;
 
-    for(uint j = start; j < end; ++j){
-      ret_db->coords_.push_back(coords_[j]);
+    for(uint j = start; j < end; ++j) {
+      sub_db->seq_.push_back(seq_[j]);
+      sub_db->coords_.push_back(coords_[j]);
     }
 
-    if(frequencies_present_){
-      for(uint j = start; j < end; ++j){
-        ret_db->aa_frequencies_.push_back(aa_frequencies_[j]);
-        ret_db->aa_frequencies_struct_.push_back(aa_frequencies_struct_[j]);
-      }      
+    if(this->HasData(Dihedrals)) {
+      for(uint j = start; j < end; ++j) {
+        sub_db->dihedrals_.push_back(dihedrals_[j]);
+      }
+    }
+
+    if(this->HasData(SolventAccessibilities)) {
+      for(uint j = start; j < end; ++j) {
+        sub_db->solv_acc_.push_back(solv_acc_[j]);
+      }
+    }
+
+    if(this->HasData(ResidueDepths)) {
+      for(uint j = start; j < end; ++j) {
+        sub_db->res_depths_.push_back(res_depths_[j]);
+      }
+    }
+
+    if(this->HasData(DSSP)) {
+      for(uint j = start; j < end; ++j) {
+        sub_db->dssp_.push_back(dssp_[j]);
+      }
+    }
+
+    if(this->HasData(AAFrequencies)) {
+      for(uint j = start; j < end; ++j) {
+        sub_db->aa_frequencies_.push_back(aa_frequencies_[j]);
+      }
+    }
+
+    if(this->HasData(AAFrequenciesStruct)) {
+      for(uint j = start; j < end; ++j) {
+        sub_db->aa_frequencies_struct_.push_back(aa_frequencies_struct_[j]);
+      }
     }
   }
 
-  return ret_db;
+  return sub_db;
 }
 
 void StructureDB::PrintStatistics() const{
-  std::cout << "number of pdb chains      : " << coord_toc_.size() << std::endl;
+  std::cout << "number of chains      : " << coord_toc_.size() << std::endl;
   std::cout << "number of backbone coords :"  << coords_.size() << std::endl;
 }
 
 ost::seq::ProfileHandlePtr StructureDB::GenerateStructureProfile(
-                              const StructureDB& other_db,
-                              const FragmentInfo& info) const {
+                              const BackboneList& bb_list,
+                              const std::vector<Real>& residue_depths) const {
 
-  if (info.length == 0) {
-    throw promod3::Error("Cannot generate structural profile from empty input!");
+  if(!this->HasData(ResidueDepths)) {
+    throw promod3::Error("StructureDB does not contain residue depths!");
   }
-  other_db.CheckFragmentInfo(info);
 
-  // get data from other_db
-  std::vector<Real> residue_depths = other_db.GetResidueDepths(info);
-  assert(residue_depths.size() == info.length);
-  std::vector<geom::Vec3> ca_pos;
-  ca_pos.reserve(info.length);
-  uint coord_start = other_db.GetStartIndex(info);
-  for (uint i = 0; i < info.length; ++i) {
-    ca_pos.push_back(other_db.GetPeptide(coord_start+i).coords.ca.ToVec3());
+  if(bb_list.size() != residue_depths.size()) {
+    throw promod3::Error("BackboneList and residue depths must be of same "
+                         "size!");
   }
 
-  uint frag_length = std::min(9, static_cast<int>(info.length));
-  FragmentInfo inf(0,0,frag_length);
+  uint bb_list_size = bb_list.size();
+  uint frag_length = std::min(9, static_cast<int>(bb_list.size()));
+  FragmentInfo inf(0, 0, frag_length);
 
   std::vector<std::vector<char> > close_sequences;
-  close_sequences.assign(info.length, std::vector<char>());
+  close_sequences.assign(bb_list_size, std::vector<char>());
   std::list<std::pair<Real,FragmentInfo> > similar_frags;
 
   // let's create a buffer for the exponential depth terms in the db
+  // as well as the extracted positions
   uint longest_chain = 0;
   for(uint i = 0; i < coord_toc_.size(); ++i){
     longest_chain = std::max(longest_chain,static_cast<uint>(coord_toc_[i].size));
   }
-  std::vector<Real> db_depths(longest_chain);
+  std::vector<Real> db_depths_full_chain(longest_chain);
+  std::vector<geom::Vec3> ca_pos_full_chain(longest_chain);
 
   // the exponential depth values can be precalculated
-  std::vector<Real> depths(info.length);
-  for(uint i = 0; i < info.length; ++i){
+  std::vector<Real> depths(bb_list_size);
+  for(uint i = 0; i < bb_list_size; ++i){
     depths[i] = std::exp(-residue_depths[i] * 0.35714);
   }
 
   // positions for rmsd calculations will be stored in here
-  core::EMatX3 pos = core::EMatX3::Zero(frag_length,3);
-  core::EMatX3 db_pos = core::EMatX3::Zero(frag_length,3);
+  core::EMatX3 pos = core::EMatX3::Zero(frag_length, 3);
+  core::EMatX3 db_pos = core::EMatX3::Zero(frag_length, 3);
   
-  for(uint i = 0; i <= info.length-frag_length; ++i){
+  for(uint i = 0; i <= bb_list_size - frag_length; ++i){
 
     similar_frags.clear();
     Real worst_score = std::numeric_limits<Real>::max();
 
     // set the positions for query fragments
     for (uint j = 0; j < frag_length; ++j) {
-      core::EMatFillRow(pos, j, ca_pos[i+j]);
+      core::EMatFillRow(pos, j, bb_list.GetCA(i+j));
     }
 
     inf.chain_index = 0;
 
     // let's search through all chains of the db
     for(uint j = 0; j < coord_toc_.size(); ++j, ++inf.chain_index){
+
       if(coord_toc_[j].size < frag_length) continue;
+
       inf.offset = 0;
       // the depth exp value of the full chain can be precalculated
+      // at the same time we're extracting the positions here
       uint db_chain_offset = coord_toc_[j].offset;
       for(uint k = 0; k < coord_toc_[j].size; ++k){
-        db_depths[k] = std::exp(-coords_[db_chain_offset + k].res_depth * 0.035714);
+        db_depths_full_chain[k] = std::exp(-res_depths_[db_chain_offset + k] * 0.035714);
+        ca_pos_full_chain[k] = coords_[db_chain_offset + k].ca.ToVec3();
       }
+
       // let's finally iterate over all possible fragments in this chain
-      for(uint k = 0; k <= coord_toc_[j].size-frag_length; ++k, ++inf.offset){
+      for(uint k = 0; k <= coord_toc_[j].size - frag_length; ++k, ++inf.offset){
 
         for(uint l = 0; l < frag_length; ++l){
-          const Peptide& pep = coords_[db_chain_offset + k + l];
-          db_pos(l,0) = pep.coords.ca.x * 0.01;
-          db_pos(l,1) = pep.coords.ca.y * 0.01;
-          db_pos(l,2) = pep.coords.ca.z * 0.01;
+          core::EMatFillRow(db_pos, l, ca_pos_full_chain[k+l]);
         }
 
-        Real rmsd = core::SuperposedRMSD(pos,db_pos);
+        Real rmsd = core::SuperposedRMSD(pos, db_pos);
         Real summed_squared_depth_diff = 0.0;
         for(uint l = 0; l < frag_length; ++l){
-          Real temp = depths[i+l]-db_depths[k+l];
+          Real temp = depths[i+l] - db_depths_full_chain[k+l];
           summed_squared_depth_diff += temp*temp;
         }
 
@@ -1017,30 +1447,36 @@ ost::seq::ProfileHandlePtr StructureDB::GenerateStructureProfile(
   // set profile
   ost::seq::ProfileHandlePtr return_prof(new ost::seq::ProfileHandle);
   return_prof->SetNullModel(ost::seq::ProfileColumn::HHblitsNullModel());
-  String other_sequence = other_db.GetSequence(info);
+  String reference_sequence = bb_list.GetSequence();
   Real frequencies[20];
-  for(uint i = 0; i < info.length; ++i){
+  for(uint i = 0; i < bb_list_size; ++i) {
     // sum up a value of one for every position
     memset(frequencies,0,sizeof(Real)*20);
-    for(uint j = 0; j < close_sequences[i].size(); ++j){
+    for(uint j = 0; j < close_sequences[i].size(); ++j) {
       int idx = ost::seq::ProfileColumn::GetIndex(close_sequences[i][j]);
-      if(idx != -1) frequencies[idx] += 1.0;
+      if(idx != -1) {
+        frequencies[idx] += 1.0;
+      }
     }
     // normalize it
     Real sum = 0.0;
-    for(uint j = 0; j < 20; ++j) sum += frequencies[j];
-      
-    if(sum != 0){
+    for(uint j = 0; j < 20; ++j) {
+      sum += frequencies[j];
+    }
+
+    if(sum != 0) {
       Real factor = 1.0/sum;
-      for(uint j = 0; j < 20; ++j) frequencies[j] *= factor;
+      for(uint j = 0; j < 20; ++j) {
+        frequencies[j] *= factor;
+      }
     }
     // and add it to the profile
     ost::seq::ProfileColumn actual_col;
     Real* prof_col_data = actual_col.freqs_begin();
-    for(uint j = 0; j < 20; ++j){
+    for(uint j = 0; j < 20; ++j) {
       prof_col_data[j] = frequencies[j];
     }
-    return_prof->AddColumn(actual_col, other_sequence[i]);
+    return_prof->AddColumn(actual_col, reference_sequence[i]);
   }
 
   return return_prof;
@@ -1049,9 +1485,9 @@ ost::seq::ProfileHandlePtr StructureDB::GenerateStructureProfile(
 void StructureDB::SetStructureProfile(uint chain_idx,
                                       ost::seq::ProfileHandlePtr prof) {
 
-  if(!frequencies_present_){
-    throw promod3::Error("Cannot set profile information in database "
-                         "loaded with load_frequencies = false!");
+  if(!this->HasData(AAFrequenciesStruct)) {
+    throw promod3::Error("StructureDB does not contain amino acid " 
+                         "frequencies derived from structural information!");
   }
 
   if(chain_idx >= coord_toc_.size()){
diff --git a/loop/src/structure_db.hh b/loop/src/structure_db.hh
index 2068c60624444ac29bc42c1c36890f6006bcef54..a11db69ef12d31a3669ea5c986933ebadd94e640 100644
--- a/loop/src/structure_db.hh
+++ b/loop/src/structure_db.hh
@@ -19,10 +19,10 @@
 #include <ost/mol/surface_handle.hh>
 
 #include <promod3/loop/paged_array.hh>
-#include <promod3/loop/ushort_vec.hh>
 #include <promod3/loop/backbone.hh>
 #include <promod3/core/message.hh>
 #include <promod3/core/superpose.hh>
+#include <promod3/loop/structure_db_custom_types.hh>
 
 #include <promod3/core/portable_binary_serializer.hh>
 
@@ -31,60 +31,57 @@ namespace promod3 { namespace loop {
 class StructureDB;
 typedef boost::shared_ptr<StructureDB> StructureDBPtr;
 
+
 struct CoordInfo {
-  CoordInfo(): offset(0), size(0) {}
+  CoordInfo() { }
   CoordInfo(const String& id, const String& chain_name,
-            uint off=0, uint s=0):
-    pdb_id(id+chain_name), offset(off), size(s)
-  { }
+            uint off, uint s, uint sr, const geom::Vec3 sh): 
+                                                id(id), chain_name(chain_name), 
+                                                offset(off), size(s), 
+                                                start_resnum(sr), shift(sh) { }
+
   /// pdb id plus chain all lowercase letters
-  String GetFullID() const{ 
-    String id = "";
-    for(uint i = 0; i < pdb_id.size(); ++i){
-      id += pdb_id[i];
-    }
-    return id;
+  String GetFullID() const { 
+    return id + "_" + chain_name;
   }
 
   // portable serialization
   // (cleanly element by element with fixed-width base-types)
   template <typename DS>
   void Serialize(DS& ds) {
-    if (ds.IsSource()) {
-      // load ID
-      String id;
-      ds & id;
-      // ensure appropriate length of pdb_id
-      if (id.length() > pdb_id.capacity()) {
-        throw promod3::Error(String("Serialize-load failed for ID ") + id);
-      } else {
-        pdb_id = id;
-      }
-    } else {
-      String id(pdb_id.c_str());
-      ds & id;
-    }
+    core::ConvertBaseType<String> (ds, id);
+    core::ConvertBaseType<String> (ds, chain_name);    
     core::ConvertBaseType<uint32_t>(ds, offset);
     core::ConvertBaseType<uint16_t>(ds, size);
+    core::ConvertBaseType<uint16_t>(ds, start_resnum);
+    core::ConvertBaseType<float>(ds, shift[0]);
+    core::ConvertBaseType<float>(ds, shift[1]);
+    core::ConvertBaseType<float>(ds, shift[2]);
   }
 
   bool operator==(const CoordInfo& rhs) const {
-    return pdb_id == rhs.pdb_id
+    return id == rhs.id
+        && chain_name == rhs.chain_name
         && offset == rhs.offset
-        && size == rhs.size;
+        && size == rhs.size
+        && start_resnum == rhs.start_resnum;
   }
   bool operator!=(const CoordInfo& rhs) const {
     return !this->operator==(rhs);
   }
 
-  ost::FixedString<5>  pdb_id;
+  String               id;
+  String               chain_name;
   uint                 offset;
   unsigned short       size;
+  unsigned short       start_resnum;
+  geom::Vec3           shift;
 };
 
+
 struct FragmentInfo {
   FragmentInfo() { }
-  FragmentInfo(unsigned short c_i,
+  FragmentInfo(unsigned int c_i,
                unsigned short o,
                unsigned short l): chain_index(c_i),
                                   offset(o),
@@ -94,7 +91,7 @@ struct FragmentInfo {
   // (cleanly element by element with fixed-width base-types)
   template <typename DS>
   void Serialize(DS& ds) {
-    core::ConvertBaseType<uint16_t>(ds, chain_index);
+    core::ConvertBaseType<uint32_t>(ds, chain_index);
     core::ConvertBaseType<uint16_t>(ds, offset);
     core::ConvertBaseType<uint16_t>(ds, length);
   }
@@ -108,172 +105,54 @@ struct FragmentInfo {
     return !this->operator==(rhs);
   }
 
-  unsigned short chain_index;
+  unsigned int chain_index;
   unsigned short offset;
   unsigned short length;
 };
 
-struct PeptideCoords {
-  // portable serialization
-  // (cleanly element by element with fixed-width base-types)
-  template <typename DS>
-  void Serialize(DS& ds) {
-    ds & n;
-    ds & ca;
-    ds & c;
-    ds & o;
-  }
-
-  bool operator==(const PeptideCoords& rhs) const {
-    return n == rhs.n
-        && ca == rhs.ca
-        && c == rhs.c
-        && o == rhs.o;
-  }
-  bool operator!=(const PeptideCoords& rhs) const {
-    return !this->operator==(rhs);
-  }
-
-  UShortVec n;
-  UShortVec ca;
-  UShortVec c;
-  UShortVec o;
-};
-
-struct DihedralInfo {
-  DihedralInfo() { }
-  DihedralInfo(Real a, Real b){
-    phi = a * 1000;
-    psi = b * 1000;
-  }
-
-  inline Real GetPhi() const { return static_cast<Real>(phi) * Real(0.001); }
-
-  inline Real GetPsi() const { return static_cast<Real>(psi) * Real(0.001); }
-
-  // portable serialization
-  // (cleanly element by element with fixed-width base-types)
-  template <typename DS>
-  void Serialize(DS& ds) {
-    core::ConvertBaseType<int16_t>(ds, phi);
-    core::ConvertBaseType<int16_t>(ds, psi);
-  }
-
-  bool operator==(const DihedralInfo& rhs) const {
-    return phi == rhs.phi
-        && psi == rhs.psi;
-  }
-  bool operator!=(const DihedralInfo& rhs) const {
-    return !this->operator==(rhs);
-  }
-
-  short phi;
-  short psi;
-};
-
-struct AAFreq {
-
-  AAFreq() {
-    memset(freqs, 0, sizeof(short)*20);
-  }
-
-  void AssignProfileColumn(const ost::seq::ProfileColumn& col);
-  const short* data() const { return freqs; }
-  short* data() { return freqs; }
-
-  // portable serialization
-  // (cleanly element by element with fixed-width base-types)
-  template <typename DS>
-  void Serialize(DS& ds) {
-    for (int i = 0; i < 20; ++i) {
-      core::ConvertBaseType<int16_t>(ds, freqs[i]);
-    }
-  }
-
-  bool operator==(const AAFreq& rhs) const {
-    return !memcmp(freqs, rhs.freqs, sizeof(short)*20);
-  }
-  bool operator!=(const AAFreq& rhs) const {
-    return !this->operator==(rhs);
-  }
-  
-  short freqs[20];
-};
-
-struct Peptide {
-  // portable serialization
-  // (cleanly element by element with fixed-width base-types)
-  template <typename DS>
-  void Serialize(DS& ds) {
-    ds & coords;
-    ds & dihedrals;
-    core::ConvertBaseType<uint16_t>(ds, solv_acc);
-    core::ConvertBaseType<uint16_t>(ds, res_depth);
-    ds & olc;
-    ds & dssp_state;
-  }
-
-  bool operator==(const Peptide& rhs) const {
-    return coords == rhs.coords
-        && dihedrals == rhs.dihedrals
-        && solv_acc == rhs.solv_acc
-        && res_depth == rhs.res_depth
-        && olc == rhs.olc
-        && dssp_state == rhs.dssp_state;
-  }
-  bool operator!=(const Peptide& rhs) const {
-    return !this->operator==(rhs);
-  }
-
-  PeptideCoords  coords;     //contains all backbone coordinates
-  DihedralInfo   dihedrals;  //contains phi and psi dihedral angles
-  unsigned short solv_acc;   //solvent accessibility in A^2 as calculated by dssp
-  unsigned short res_depth;  //average distance of the atoms to closest surface in A
-                             //multiplied by a value of 10 to allow an accuracy of 0.1
-  char           olc;        //the one letter code
-  char           dssp_state; //the dssp state, which should be a member of
-                             // {H,B,E,G,I,T,S} 
-};
 
 class StructureDB {
 public:
 
-  StructureDB(): frequencies_present_(true) { }
+  enum DBDataType {All = -1, Dihedrals = 1, SolventAccessibilities = 2, 
+                   ResidueDepths = 4, DSSP = 8, AAFrequencies = 16,
+                   AAFrequenciesStruct = 32};
 
-  static StructureDBPtr Load(const String& file_name,
-                             bool load_frequencies);
+  StructureDB(int32_t stored_data = -1): stored_data_(stored_data) { }
+
+  static StructureDBPtr Load(const String& file_name);
 
   void Save(const String& filename);
 
-  // only with frequencies (otherwise we cannot use Save)
   static StructureDBPtr LoadPortable(const String& file_name);
 
   void SavePortable(const String& filename);
 
+  bool HasData(DBDataType data_type) const {
+    return (data_type & stored_data_) == data_type;
+  }
+
   bool operator==(const StructureDB& rhs) const;
   bool operator!=(const StructureDB& rhs) const {
     return !this->operator==(rhs);
   }
 
-  bool HasFrequencies() { return frequencies_present_; }
+  std::vector<int> AddCoordinates(const String& id, const String& chain_name,
+                                  ost::mol::EntityView& ent,
+                                  ost::seq::SequenceHandle& seqres,
+                                  ost::seq::ProfileHandlePtr prof = 
+                                  ost::seq::ProfileHandlePtr(),
+                                  bool only_longest_stretch = true);
 
-  int AddCoordinates(const String& pdb_id, const String& chain_name,
-                     const ost::mol::ChainView& chain,
-                     const ost::mol::SurfaceHandle& surf,
-                     ost::seq::ProfileHandlePtr prof,
-                     const String& solvent_accessibilty_string = 
-                     "solvent_accessibility");
+  void RemoveCoordinates(uint coord_idx);
 
-  int GetCoordIndex(const String& pdb_id, const String& chain_name) const;
+  std::vector<int> GetCoordIdx(const String& id, 
+                               const String& chain_name) const;
 
-  CoordInfo GetCoordInfo(int index) const;
+  const CoordInfo& GetCoordInfo(int index) const;
 
   size_t GetNumCoords() const { return coord_toc_.size(); }
 
-  Peptide& GetPeptide(int index) { return coords_[index]; }
-
-  const Peptide& GetPeptide(int index) const { return coords_[index]; }
-
   Real CARMSD(const FragmentInfo& info_one,
               const FragmentInfo& info_two,
               bool superpose_stems = true) const;
@@ -303,36 +182,92 @@ public:
 
   ost::seq::ProfileHandlePtr GetStructureProfile(const FragmentInfo& info) const;
 
+  int GetStartResnum(const FragmentInfo& info) const;
+
   StructureDBPtr GetSubDB(const std::vector<uint>& indices) const;
 
   void PrintStatistics() const;
 
   ost::seq::ProfileHandlePtr GenerateStructureProfile(
-                                const StructureDB& other_db,
-                                const FragmentInfo& info) const;
+                                const BackboneList& other_db,
+                                const std::vector<Real>& residue_depths) const;
 
   void SetStructureProfile(uint chain_idx, ost::seq::ProfileHandlePtr prof);
 
-  //functions to gain direct access to db internals, not intended for python export
+
+  // functions to gain direct access to db internals, not intended for python 
+  // export
+
   const std::vector<CoordInfo>& GetCoordToc() const { return coord_toc_; }
-  const PagedArray<Peptide,4096>& GetCoords() const { return coords_; }
-  const PagedArray<AAFreq, 4096>& GetAAFrequencies() const {
-    if(!frequencies_present_){
-      throw promod3::Error("Cannot access profile information in database "
-                           "loaded with load_frequencies = false!");
-    } 
+
+  const PagedArray<char, 65536>& GetSeq() const { 
+    return seq_; 
+  } 
+
+  const PagedArray<PeptideCoords, 65536>& GetCoords() const { 
+    return coords_; 
+  }
+
+  const PagedArray<DihedralInfo, 65536>& GetDihedrals() const {
+
+    if(!this->HasData(Dihedrals)) {
+      throw promod3::Error("StructureDB does not contain dihedrals!");
+    }
+
+    return dihedrals_; 
+  }
+
+  const PagedArray<unsigned short, 65536>& GetSolvAcc() const {
+
+    if(!this->HasData(SolventAccessibilities)) {
+      throw promod3::Error("StructureDB does not contain "
+                           "solvent accessibilities!");
+    }
+
+    return solv_acc_;
+  }
+
+  const PagedArray<unsigned short, 65536>& GetResDepth() const {
+
+    if(!this->HasData(ResidueDepths)) {
+      throw promod3::Error("StructureDB does not contain residue depths!");
+    }
+
+    return res_depths_;
+  }
+
+  const PagedArray<char, 65536>& GetDSSP() const {
+
+    if(!this->HasData(DSSP)) {
+      throw promod3::Error("StructureDB does not contain dssp assignments!");
+    }
+
+    return dssp_;
+  } 
+
+  const PagedArray<AAFreq, 65536>& GetAAFrequencies() const { 
+
+    if(!this->HasData(AAFrequencies)) {
+      throw promod3::Error("StructureDB does not contain amino acid "
+                           "frequencies!");
+    }
+
     return aa_frequencies_; 
   }
-  const PagedArray<AAFreq, 4096>& GetAAStructFrequencies() const { 
-    if(!frequencies_present_){
-      throw promod3::Error("Cannot access profile information in database "
-                           "loaded with load_frequencies = false!");
+
+  const PagedArray<AAFreq, 65536>& GetAAStructFrequencies() const {
+
+    if(!this->HasData(AAFrequenciesStruct)) {
+      throw promod3::Error("StructureDB does not contain amino acid " 
+                           "frequencies derived from structural information!");
     }
+
     return aa_frequencies_struct_; 
   }
 
 private:
 
+  // just don't allow it...
   StructureDB(const StructureDB& other) { };
 
   // get start index into paged arrays
@@ -341,11 +276,41 @@ private:
   }
   void CheckFragmentInfo(const FragmentInfo& info) const;
 
-  std::vector<CoordInfo>           coord_toc_;
-  PagedArray<Peptide, 4096>        coords_;
-  PagedArray<AAFreq, 4096>         aa_frequencies_;
-  PagedArray<AAFreq, 4096>         aa_frequencies_struct_;
-  bool                             frequencies_present_;
+  ///////////////////
+  // INTERNAL DATA //
+  ///////////////////
+
+  // bitfield that defines what kind of data is stored in the database
+  int32_t stored_data_;
+
+  // stores information about full stretches
+  std::vector<CoordInfo>            coord_toc_;
+
+  // one letter codes
+  PagedArray<char, 65536>           seq_;
+
+  // backbone coordinates
+  PagedArray<PeptideCoords, 65536>  coords_;
+
+  // phi and psi dihedrals
+  PagedArray<DihedralInfo, 65536>   dihedrals_;    
+
+  // solvent accessibility in A^2 as calculated by Lee & Richards implementation 
+  // in ost
+  PagedArray<uint16_t, 65536> solv_acc_;      
+
+  // distance towards closest surface residue in A multiplied by 10 to allow
+  // accuracy of 0.1
+  PagedArray<uint16_t, 65536> res_depths_;   
+                    
+  // dssp state, which is a member of {H,B,E,G,I,T,S}  
+  PagedArray<char, 65536>           dssp_;
+
+  // Amino acid frequencies as given as input profile
+  PagedArray<AAFreq, 65536>         aa_frequencies_;
+
+  // Amino acid frequencies as derived from structural information
+  PagedArray<AAFreq, 65536>         aa_frequencies_struct_;
 };
 
 }}
diff --git a/loop/src/structure_db_custom_types.hh b/loop/src/structure_db_custom_types.hh
new file mode 100644
index 0000000000000000000000000000000000000000..d636c7dbd21edb8a335fb91f51f4d2003a064548
--- /dev/null
+++ b/loop/src/structure_db_custom_types.hh
@@ -0,0 +1,110 @@
+#ifndef PROMOD_LOOP_STRUCTURE_DB_CUSTOM_TYPES
+#define PROMOD_LOOP_STRUCTURE_DB_CUSTOM_TYPES
+
+#include <promod3/loop/ushort_vec.hh>
+#include <promod3/core/portable_binary_serializer.hh>
+
+namespace promod3 { namespace loop {
+
+struct PeptideCoords {
+  // portable serialization
+  // (cleanly element by element with fixed-width base-types)
+  template <typename DS>
+  void Serialize(DS& ds) {
+    ds & n;
+    ds & ca;
+    ds & c;
+    ds & o;
+  }
+
+  bool operator==(const PeptideCoords& rhs) const {
+    return n == rhs.n
+        && ca == rhs.ca
+        && c == rhs.c
+        && o == rhs.o;
+  }
+  bool operator!=(const PeptideCoords& rhs) const {
+    return !this->operator==(rhs);
+  }
+
+  UShortVec n;
+  UShortVec ca;
+  UShortVec c;
+  UShortVec o;
+};
+
+
+struct DihedralInfo {
+  DihedralInfo() { }
+  DihedralInfo(Real a, Real b){
+    phi = a * 1000;
+    psi = b * 1000;
+  }
+
+  inline Real GetPhi() const { return static_cast<Real>(phi) * Real(0.001); }
+
+  inline Real GetPsi() const { return static_cast<Real>(psi) * Real(0.001); }
+
+  // portable serialization
+  // (cleanly element by element with fixed-width base-types)
+  template <typename DS>
+  void Serialize(DS& ds) {
+    core::ConvertBaseType<int16_t>(ds, phi);
+    core::ConvertBaseType<int16_t>(ds, psi);
+  }
+
+  bool operator==(const DihedralInfo& rhs) const {
+    return phi == rhs.phi
+        && psi == rhs.psi;
+  }
+  bool operator!=(const DihedralInfo& rhs) const {
+    return !this->operator==(rhs);
+  }
+
+  short phi;
+  short psi;
+};
+
+
+struct AAFreq {
+
+  AAFreq() {
+    memset(freqs, 0, sizeof(short)*20);
+  }
+
+  void AssignProfileColumn(const ost::seq::ProfileColumn& col) {
+    const Real* col_freq_ptr = col.freqs_begin();
+    short* freq_ptr = &freqs[0];
+    for(uint i = 0; i < 20; ++i){
+      *freq_ptr = (*col_freq_ptr)*10000;
+      ++freq_ptr;
+      ++col_freq_ptr;
+    } 
+  }
+
+  const short* data() const { return freqs; }
+
+  short* data() { return freqs; }
+
+  // portable serialization
+  // (cleanly element by element with fixed-width base-types)
+  template <typename DS>
+  void Serialize(DS& ds) {
+    for (int i = 0; i < 20; ++i) {
+      core::ConvertBaseType<int16_t>(ds, freqs[i]);
+    }
+  }
+
+  bool operator==(const AAFreq& rhs) const {
+    return !memcmp(freqs, rhs.freqs, sizeof(short)*20);
+  }
+  bool operator!=(const AAFreq& rhs) const {
+    return !this->operator==(rhs);
+  }
+  
+  short freqs[20];
+};
+
+}} // ns
+
+#endif
diff --git a/loop/tests/CMakeLists.txt b/loop/tests/CMakeLists.txt
index a1fc21f8cd2bc1724524f7a3b6eec43e6df825fb..04bfa9f35a4b9c0d3f5b37874d4af9ae11963c3d 100644
--- a/loop/tests/CMakeLists.txt
+++ b/loop/tests/CMakeLists.txt
@@ -9,13 +9,15 @@ set(LOOP_UNIT_TESTS
   test_mm_system_creator.cc
   test_psipred_prediction.cc
   test_sidechain_construction.cc
-  test_ss_assignment.cc
   test_torsion_sampler.cc
+  test_structuredb.cc
   tests.cc
 )
 
 set(LOOP_TEST_DATA
   data/1A88A.hhm
+  data/1A88A.pdb
+  data/1A88A_with_gap.pdb
   data/1akyA.horiz
   data/1CRN.pdb
   data/3DEFA.pdb
diff --git a/loop/tests/data/1A88A.pdb b/loop/tests/data/1A88A.pdb
new file mode 100755
index 0000000000000000000000000000000000000000..dd8be93e1726e36315e7300e13e6747c31eb2ef5
--- /dev/null
+++ b/loop/tests/data/1A88A.pdb
@@ -0,0 +1,2107 @@
+ATOM      1  N   GLY A   1      31.764  53.257  -5.145  1.00 21.92           N  
+ATOM      2  CA  GLY A   1      31.661  51.955  -4.451  1.00 20.38           C  
+ATOM      3  C   GLY A   1      30.228  51.594  -4.213  1.00 22.43           C  
+ATOM      4  O   GLY A   1      29.301  52.280  -4.687  1.00 20.07           O  
+ATOM      5  N   THR A   2      29.953  50.447  -3.576  1.00 20.81           N  
+ATOM      6  CA  THR A   2      28.571  50.144  -3.254  1.00 24.30           C  
+ATOM      7  C   THR A   2      28.510  49.528  -1.854  1.00 24.57           C  
+ATOM      8  O   THR A   2      29.507  48.974  -1.349  1.00 24.04           O  
+ATOM      9  CB  THR A   2      27.886  49.192  -4.253  1.00 28.12           C  
+ATOM     10  OG1 THR A   2      28.529  47.925  -4.086  1.00 31.49           O  
+ATOM     11  CG2 THR A   2      27.965  49.541  -5.730  1.00 27.46           C  
+ATOM     12  N   VAL A   3      27.370  49.622  -1.203  1.00 22.42           N  
+ATOM     13  CA  VAL A   3      27.147  49.017   0.095  1.00 24.30           C  
+ATOM     14  C   VAL A   3      25.861  48.228  -0.035  1.00 23.74           C  
+ATOM     15  O   VAL A   3      24.906  48.622  -0.722  1.00 22.67           O  
+ATOM     16  CB  VAL A   3      27.028  49.956   1.302  1.00 25.50           C  
+ATOM     17  CG1 VAL A   3      28.381  50.584   1.663  1.00 27.68           C  
+ATOM     18  CG2 VAL A   3      26.103  51.113   1.034  1.00 27.65           C  
+ATOM     19  N   THR A   4      25.854  47.062   0.574  1.00 23.05           N  
+ATOM     20  CA  THR A   4      24.672  46.202   0.570  1.00 26.31           C  
+ATOM     21  C   THR A   4      23.829  46.421   1.812  1.00 26.75           C  
+ATOM     22  O   THR A   4      24.377  46.407   2.918  1.00 29.12           O  
+ATOM     23  CB  THR A   4      25.103  44.726   0.458  1.00 27.13           C  
+ATOM     24  OG1 THR A   4      25.713  44.592  -0.829  1.00 27.43           O  
+ATOM     25  CG2 THR A   4      23.903  43.814   0.614  1.00 28.43           C  
+ATOM     26  N   THR A   5      22.536  46.692   1.686  1.00 24.64           N  
+ATOM     27  CA  THR A   5      21.727  46.951   2.868  1.00 26.94           C  
+ATOM     28  C   THR A   5      21.173  45.630   3.423  1.00 28.87           C  
+ATOM     29  O   THR A   5      21.359  44.560   2.825  1.00 28.63           O  
+ATOM     30  CB  THR A   5      20.563  47.904   2.493  1.00 25.62           C  
+ATOM     31  OG1 THR A   5      19.773  47.127   1.610  1.00 22.98           O  
+ATOM     32  CG2 THR A   5      21.081  49.182   1.837  1.00 26.21           C  
+ATOM     33  N   SER A   6      20.416  45.706   4.512  1.00 32.07           N  
+ATOM     34  CA  SER A   6      19.914  44.475   5.151  1.00 34.50           C  
+ATOM     35  C   SER A   6      19.034  43.646   4.242  1.00 34.88           C  
+ATOM     36  O   SER A   6      19.264  42.413   4.164  1.00 35.66           O  
+ATOM     37  CB  SER A   6      19.260  44.760   6.491  1.00 36.17           C  
+ATOM     38  OG  SER A   6      18.258  45.742   6.449  1.00 38.37           O  
+ATOM     39  N   ASP A   7      18.170  44.274   3.432  1.00 32.57           N  
+ATOM     40  CA  ASP A   7      17.369  43.488   2.491  1.00 29.56           C  
+ATOM     41  C   ASP A   7      18.127  43.106   1.244  1.00 28.25           C  
+ATOM     42  O   ASP A   7      17.502  42.669   0.288  1.00 27.90           O  
+ATOM     43  CB  ASP A   7      16.076  44.231   2.182  1.00 30.52           C  
+ATOM     44  CG  ASP A   7      16.170  45.511   1.376  1.00 30.30           C  
+ATOM     45  OD1 ASP A   7      17.263  45.876   0.931  1.00 29.25           O  
+ATOM     46  OD2 ASP A   7      15.127  46.180   1.159  1.00 30.59           O  
+ATOM     47  N   GLY A   8      19.443  43.249   1.129  1.00 28.74           N  
+ATOM     48  CA  GLY A   8      20.172  42.928  -0.091  1.00 26.98           C  
+ATOM     49  C   GLY A   8      20.152  44.009  -1.155  1.00 26.24           C  
+ATOM     50  O   GLY A   8      20.644  43.753  -2.272  1.00 27.20           O  
+ATOM     51  N   THR A   9      19.679  45.229  -0.886  1.00 24.00           N  
+ATOM     52  CA  THR A   9      19.710  46.283  -1.920  1.00 21.61           C  
+ATOM     53  C   THR A   9      21.108  46.857  -2.041  1.00 21.67           C  
+ATOM     54  O   THR A   9      21.691  47.226  -0.998  1.00 23.64           O  
+ATOM     55  CB  THR A   9      18.718  47.393  -1.543  1.00 20.75           C  
+ATOM     56  OG1 THR A   9      17.407  46.802  -1.546  1.00 19.41           O  
+ATOM     57  CG2 THR A   9      18.638  48.560  -2.556  1.00 20.13           C  
+ATOM     58  N   ASN A  10      21.661  47.017  -3.238  1.00 20.77           N  
+ATOM     59  CA  ASN A  10      22.961  47.660  -3.391  1.00 19.56           C  
+ATOM     60  C   ASN A  10      22.762  49.172  -3.633  1.00 19.39           C  
+ATOM     61  O   ASN A  10      21.969  49.567  -4.476  1.00 17.13           O  
+ATOM     62  CB  ASN A  10      23.826  47.103  -4.513  1.00 21.53           C  
+ATOM     63  CG  ASN A  10      24.198  45.658  -4.181  1.00 25.77           C  
+ATOM     64  OD1 ASN A  10      24.782  45.354  -3.145  1.00 26.65           O  
+ATOM     65  ND2 ASN A  10      23.789  44.748  -5.050  1.00 27.54           N  
+ATOM     66  N   ILE A  11      23.488  49.953  -2.852  1.00 16.01           N  
+ATOM     67  CA  ILE A  11      23.473  51.404  -2.847  1.00 16.13           C  
+ATOM     68  C   ILE A  11      24.788  51.907  -3.415  1.00 16.10           C  
+ATOM     69  O   ILE A  11      25.885  51.559  -2.908  1.00 16.08           O  
+ATOM     70  CB  ILE A  11      23.303  51.881  -1.391  1.00 17.18           C  
+ATOM     71  CG1 ILE A  11      21.912  51.467  -0.888  1.00 19.25           C  
+ATOM     72  CG2 ILE A  11      23.543  53.372  -1.267  1.00 18.69           C  
+ATOM     73  CD1 ILE A  11      20.760  52.090  -1.647  1.00 20.48           C  
+ATOM     74  N   PHE A  12      24.721  52.715  -4.453  1.00 13.95           N  
+ATOM     75  CA  PHE A  12      25.910  53.287  -5.056  1.00 14.01           C  
+ATOM     76  C   PHE A  12      26.339  54.517  -4.270  1.00 12.98           C  
+ATOM     77  O   PHE A  12      25.429  55.281  -3.898  1.00 13.88           O  
+ATOM     78  CB  PHE A  12      25.591  53.711  -6.492  1.00 15.02           C  
+ATOM     79  CG  PHE A  12      26.707  54.477  -7.135  1.00 14.64           C  
+ATOM     80  CD1 PHE A  12      27.755  53.821  -7.735  1.00 17.30           C  
+ATOM     81  CD2 PHE A  12      26.704  55.871  -7.114  1.00 16.10           C  
+ATOM     82  CE1 PHE A  12      28.803  54.564  -8.314  1.00 19.46           C  
+ATOM     83  CE2 PHE A  12      27.731  56.593  -7.686  1.00 16.45           C  
+ATOM     84  CZ  PHE A  12      28.800  55.939  -8.274  1.00 17.84           C  
+ATOM     85  N   TYR A  13      27.618  54.770  -4.068  1.00 12.68           N  
+ATOM     86  CA  TYR A  13      28.049  56.000  -3.392  1.00 13.94           C  
+ATOM     87  C   TYR A  13      29.396  56.458  -3.960  1.00 14.49           C  
+ATOM     88  O   TYR A  13      30.149  55.633  -4.485  1.00 17.10           O  
+ATOM     89  CB  TYR A  13      28.088  55.911  -1.875  1.00 14.70           C  
+ATOM     90  CG  TYR A  13      29.266  55.041  -1.436  1.00 15.23           C  
+ATOM     91  CD1 TYR A  13      29.092  53.684  -1.286  1.00 18.01           C  
+ATOM     92  CD2 TYR A  13      30.494  55.626  -1.162  1.00 15.71           C  
+ATOM     93  CE1 TYR A  13      30.171  52.871  -0.884  1.00 19.66           C  
+ATOM     94  CE2 TYR A  13      31.567  54.830  -0.767  1.00 18.64           C  
+ATOM     95  CZ  TYR A  13      31.375  53.471  -0.630  1.00 20.23           C  
+ATOM     96  OH  TYR A  13      32.456  52.691  -0.281  1.00 22.12           O  
+ATOM     97  N   LYS A  14      29.691  57.735  -3.805  1.00 12.68           N  
+ATOM     98  CA  LYS A  14      30.973  58.308  -4.186  1.00 13.28           C  
+ATOM     99  C   LYS A  14      31.725  58.680  -2.905  1.00 13.70           C  
+ATOM    100  O   LYS A  14      31.028  59.140  -1.993  1.00 11.22           O  
+ATOM    101  CB  LYS A  14      30.729  59.646  -4.936  1.00 13.56           C  
+ATOM    102  CG  LYS A  14      30.055  59.407  -6.293  1.00 17.04           C  
+ATOM    103  CD  LYS A  14      29.598  60.791  -6.803  1.00 16.95           C  
+ATOM    104  CE  LYS A  14      28.859  60.613  -8.109  1.00 16.88           C  
+ATOM    105  NZ  LYS A  14      29.275  61.643  -9.079  1.00 11.46           N  
+ATOM    106  N   ASP A  15      33.039  58.630  -2.881  1.00 13.17           N  
+ATOM    107  CA  ASP A  15      33.772  58.981  -1.642  1.00 13.31           C  
+ATOM    108  C   ASP A  15      35.071  59.625  -2.089  1.00 11.64           C  
+ATOM    109  O   ASP A  15      35.924  58.884  -2.645  1.00 14.33           O  
+ATOM    110  CB  ASP A  15      33.950  57.676  -0.842  1.00 12.42           C  
+ATOM    111  CG  ASP A  15      34.829  57.878   0.408  1.00 15.23           C  
+ATOM    112  OD1 ASP A  15      35.255  58.979   0.772  1.00 13.01           O  
+ATOM    113  OD2 ASP A  15      35.082  56.850   1.085  1.00 16.31           O  
+ATOM    114  N   TRP A  16      35.150  60.930  -2.143  1.00 10.20           N  
+ATOM    115  CA  TRP A  16      36.325  61.577  -2.730  1.00 12.29           C  
+ATOM    116  C   TRP A  16      37.051  62.386  -1.642  1.00 14.41           C  
+ATOM    117  O   TRP A  16      36.387  62.801  -0.682  1.00 13.69           O  
+ATOM    118  CB  TRP A  16      35.855  62.542  -3.828  1.00 10.66           C  
+ATOM    119  CG  TRP A  16      35.204  61.854  -5.012  1.00 12.83           C  
+ATOM    120  CD1 TRP A  16      35.261  60.566  -5.385  1.00 12.58           C  
+ATOM    121  CD2 TRP A  16      34.300  62.500  -5.933  1.00 11.99           C  
+ATOM    122  NE1 TRP A  16      34.476  60.347  -6.517  1.00 12.31           N  
+ATOM    123  CE2 TRP A  16      33.894  61.529  -6.854  1.00 12.96           C  
+ATOM    124  CE3 TRP A  16      33.863  63.805  -6.096  1.00 12.84           C  
+ATOM    125  CZ2 TRP A  16      33.033  61.840  -7.937  1.00 12.24           C  
+ATOM    126  CZ3 TRP A  16      32.989  64.124  -7.129  1.00 12.81           C  
+ATOM    127  CH2 TRP A  16      32.614  63.126  -8.056  1.00 11.63           C  
+ATOM    128  N   GLY A  17      38.327  62.678  -1.836  1.00 17.50           N  
+ATOM    129  CA  GLY A  17      39.037  63.578  -0.895  1.00 18.73           C  
+ATOM    130  C   GLY A  17      39.896  62.740   0.057  1.00 19.98           C  
+ATOM    131  O   GLY A  17      39.945  61.518   0.012  1.00 19.39           O  
+ATOM    132  N   PRO A  18      40.568  63.427   0.981  1.00 21.84           N  
+ATOM    133  CA  PRO A  18      41.467  62.747   1.912  1.00 24.40           C  
+ATOM    134  C   PRO A  18      40.740  61.715   2.730  1.00 25.93           C  
+ATOM    135  O   PRO A  18      39.695  61.992   3.327  1.00 26.51           O  
+ATOM    136  CB  PRO A  18      41.998  63.853   2.817  1.00 23.82           C  
+ATOM    137  CG  PRO A  18      41.579  65.134   2.222  1.00 24.48           C  
+ATOM    138  CD  PRO A  18      40.595  64.888   1.118  1.00 22.83           C  
+ATOM    139  N   ARG A  19      41.340  60.569   2.940  1.00 29.28           N  
+ATOM    140  CA  ARG A  19      40.778  59.511   3.765  1.00 33.09           C  
+ATOM    141  C   ARG A  19      40.643  59.898   5.228  1.00 34.57           C  
+ATOM    142  O   ARG A  19      39.830  59.339   5.967  1.00 35.74           O  
+ATOM    143  CB  ARG A  19      41.688  58.277   3.594  1.00 34.45           C  
+ATOM    144  CG  ARG A  19      42.010  58.013   2.119  1.00 34.65           C  
+ATOM    145  CD  ARG A  19      40.747  57.360   1.506  1.00 34.26           C  
+ATOM    146  NE  ARG A  19      39.918  58.420   0.927  1.00 33.29           N  
+ATOM    147  CZ  ARG A  19      38.596  58.415   0.770  1.00 31.02           C  
+ATOM    148  NH1 ARG A  19      37.937  57.349   1.196  1.00 29.19           N  
+ATOM    149  NH2 ARG A  19      38.013  59.470   0.217  1.00 26.29           N  
+ATOM    150  N   ASP A  20      41.426  60.851   5.702  1.00 35.79           N  
+ATOM    151  CA  ASP A  20      41.387  61.357   7.068  1.00 37.11           C  
+ATOM    152  C   ASP A  20      40.755  62.737   7.157  1.00 34.73           C  
+ATOM    153  O   ASP A  20      40.793  63.389   8.201  1.00 36.97           O  
+ATOM    154  CB  ASP A  20      42.832  61.443   7.612  1.00 40.20           C  
+ATOM    155  CG  ASP A  20      43.625  62.280   6.614  1.00 44.16           C  
+ATOM    156  OD1 ASP A  20      43.852  61.807   5.473  1.00 46.24           O  
+ATOM    157  OD2 ASP A  20      43.975  63.426   6.958  1.00 46.14           O  
+ATOM    158  N   GLY A  21      40.147  63.261   6.100  1.00 30.99           N  
+ATOM    159  CA  GLY A  21      39.492  64.571   6.194  1.00 26.89           C  
+ATOM    160  C   GLY A  21      38.152  64.415   6.929  1.00 22.01           C  
+ATOM    161  O   GLY A  21      37.607  63.326   7.088  1.00 22.45           O  
+ATOM    162  N   LEU A  22      37.637  65.525   7.423  1.00 20.89           N  
+ATOM    163  CA  LEU A  22      36.318  65.546   8.044  1.00 20.96           C  
+ATOM    164  C   LEU A  22      35.310  65.216   6.920  1.00 18.65           C  
+ATOM    165  O   LEU A  22      35.317  65.884   5.892  1.00 16.52           O  
+ATOM    166  CB  LEU A  22      36.062  66.963   8.579  1.00 23.41           C  
+ATOM    167  CG  LEU A  22      34.860  67.108   9.534  1.00 26.98           C  
+ATOM    168  CD1 LEU A  22      35.133  68.301  10.477  1.00 29.41           C  
+ATOM    169  CD2 LEU A  22      33.525  67.302   8.834  1.00 24.72           C  
+ATOM    170  N   PRO A  23      34.436  64.282   7.178  1.00 19.30           N  
+ATOM    171  CA  PRO A  23      33.458  63.817   6.200  1.00 18.80           C  
+ATOM    172  C   PRO A  23      32.221  64.691   6.196  1.00 18.74           C  
+ATOM    173  O   PRO A  23      31.644  65.078   7.210  1.00 17.64           O  
+ATOM    174  CB  PRO A  23      33.177  62.378   6.574  1.00 18.76           C  
+ATOM    175  CG  PRO A  23      33.526  62.281   8.023  1.00 19.59           C  
+ATOM    176  CD  PRO A  23      34.437  63.395   8.370  1.00 19.10           C  
+ATOM    177  N   VAL A  24      31.857  65.067   4.984  1.00 15.22           N  
+ATOM    178  CA  VAL A  24      30.666  65.851   4.685  1.00 14.77           C  
+ATOM    179  C   VAL A  24      29.880  64.955   3.716  1.00 15.60           C  
+ATOM    180  O   VAL A  24      30.435  64.510   2.703  1.00 12.24           O  
+ATOM    181  CB  VAL A  24      30.995  67.164   3.996  1.00 15.38           C  
+ATOM    182  CG1 VAL A  24      29.745  67.975   3.657  1.00 16.66           C  
+ATOM    183  CG2 VAL A  24      32.014  67.988   4.776  1.00 16.14           C  
+ATOM    184  N   VAL A  25      28.661  64.613   4.100  1.00 11.81           N  
+ATOM    185  CA  VAL A  25      27.855  63.658   3.382  1.00 13.59           C  
+ATOM    186  C   VAL A  25      26.637  64.372   2.797  1.00 15.07           C  
+ATOM    187  O   VAL A  25      25.956  65.085   3.546  1.00 13.74           O  
+ATOM    188  CB  VAL A  25      27.373  62.567   4.382  1.00 14.11           C  
+ATOM    189  CG1 VAL A  25      26.587  61.507   3.632  1.00 14.74           C  
+ATOM    190  CG2 VAL A  25      28.546  61.944   5.155  1.00 15.09           C  
+ATOM    191  N   PHE A  26      26.376  64.183   1.506  1.00 13.58           N  
+ATOM    192  CA  PHE A  26      25.329  64.934   0.801  1.00 11.26           C  
+ATOM    193  C   PHE A  26      24.176  64.016   0.412  1.00 12.76           C  
+ATOM    194  O   PHE A  26      24.410  62.857  -0.004  1.00 11.00           O  
+ATOM    195  CB  PHE A  26      25.949  65.535  -0.478  1.00 14.11           C  
+ATOM    196  CG  PHE A  26      26.984  66.586  -0.199  1.00 15.39           C  
+ATOM    197  CD1 PHE A  26      26.593  67.910  -0.023  1.00 15.42           C  
+ATOM    198  CD2 PHE A  26      28.326  66.268  -0.162  1.00 16.48           C  
+ATOM    199  CE1 PHE A  26      27.545  68.903   0.193  1.00 16.22           C  
+ATOM    200  CE2 PHE A  26      29.256  67.257   0.076  1.00 17.18           C  
+ATOM    201  CZ  PHE A  26      28.879  68.565   0.233  1.00 15.49           C  
+ATOM    202  N   HIS A  27      22.953  64.479   0.700  1.00 10.40           N  
+ATOM    203  CA  HIS A  27      21.741  63.695   0.513  1.00 10.97           C  
+ATOM    204  C   HIS A  27      20.861  64.399  -0.532  1.00 10.19           C  
+ATOM    205  O   HIS A  27      20.268  65.444  -0.288  1.00 10.60           O  
+ATOM    206  CB  HIS A  27      20.928  63.555   1.820  1.00 12.16           C  
+ATOM    207  CG  HIS A  27      21.690  62.862   2.925  1.00 13.43           C  
+ATOM    208  ND1 HIS A  27      21.303  61.629   3.408  1.00 11.63           N  
+ATOM    209  CD2 HIS A  27      22.799  63.260   3.606  1.00 13.24           C  
+ATOM    210  CE1 HIS A  27      22.178  61.292   4.370  1.00 13.22           C  
+ATOM    211  NE2 HIS A  27      23.080  62.246   4.517  1.00 14.11           N  
+ATOM    212  N   HIS A  28      20.768  63.845  -1.739  1.00 11.74           N  
+ATOM    213  CA  HIS A  28      20.054  64.500  -2.869  1.00  8.78           C  
+ATOM    214  C   HIS A  28      18.543  64.493  -2.752  1.00  8.92           C  
+ATOM    215  O   HIS A  28      17.962  63.740  -1.978  1.00  9.63           O  
+ATOM    216  CB  HIS A  28      20.461  63.767  -4.174  1.00  8.31           C  
+ATOM    217  CG  HIS A  28      19.935  62.361  -4.287  1.00  8.02           C  
+ATOM    218  ND1 HIS A  28      18.647  62.097  -4.703  1.00  9.36           N  
+ATOM    219  CD2 HIS A  28      20.522  61.136  -4.096  1.00  8.03           C  
+ATOM    220  CE1 HIS A  28      18.444  60.776  -4.717  1.00  8.99           C  
+ATOM    221  NE2 HIS A  28      19.585  60.178  -4.340  1.00  8.20           N  
+ATOM    222  N   GLY A  29      17.882  65.397  -3.499  1.00  8.82           N  
+ATOM    223  CA  GLY A  29      16.399  65.383  -3.410  1.00 11.02           C  
+ATOM    224  C   GLY A  29      15.779  64.461  -4.433  1.00 13.10           C  
+ATOM    225  O   GLY A  29      16.456  63.745  -5.198  1.00 12.97           O  
+ATOM    226  N   TRP A  30      14.453  64.507  -4.480  1.00 11.76           N  
+ATOM    227  CA  TRP A  30      13.667  63.723  -5.426  1.00 11.49           C  
+ATOM    228  C   TRP A  30      13.596  64.520  -6.749  1.00 12.32           C  
+ATOM    229  O   TRP A  30      13.446  65.735  -6.728  1.00 10.33           O  
+ATOM    230  CB  TRP A  30      12.257  63.685  -4.834  1.00 12.65           C  
+ATOM    231  CG  TRP A  30      11.208  63.037  -5.713  1.00 13.04           C  
+ATOM    232  CD1 TRP A  30      10.897  61.720  -5.802  1.00 11.74           C  
+ATOM    233  CD2 TRP A  30      10.368  63.738  -6.638  1.00 13.91           C  
+ATOM    234  NE1 TRP A  30       9.873  61.558  -6.709  1.00 14.39           N  
+ATOM    235  CE2 TRP A  30       9.548  62.789  -7.242  1.00 14.52           C  
+ATOM    236  CE3 TRP A  30      10.229  65.091  -6.973  1.00 16.58           C  
+ATOM    237  CZ2 TRP A  30       8.570  63.121  -8.189  1.00 15.85           C  
+ATOM    238  CZ3 TRP A  30       9.282  65.445  -7.944  1.00 18.55           C  
+ATOM    239  CH2 TRP A  30       8.470  64.454  -8.512  1.00 17.00           C  
+ATOM    240  N   PRO A  31      13.619  63.836  -7.877  1.00 11.13           N  
+ATOM    241  CA  PRO A  31      13.850  62.395  -8.042  1.00 10.21           C  
+ATOM    242  C   PRO A  31      15.280  62.256  -8.606  1.00 12.56           C  
+ATOM    243  O   PRO A  31      15.545  61.719  -9.664  1.00 10.78           O  
+ATOM    244  CB  PRO A  31      12.805  62.060  -9.113  1.00  9.67           C  
+ATOM    245  CG  PRO A  31      12.619  63.311  -9.931  1.00 12.03           C  
+ATOM    246  CD  PRO A  31      13.339  64.463  -9.208  1.00 10.61           C  
+ATOM    247  N   LEU A  32      16.312  62.805  -7.940  1.00 11.12           N  
+ATOM    248  CA  LEU A  32      17.635  62.897  -8.514  1.00 12.32           C  
+ATOM    249  C   LEU A  32      18.632  61.817  -8.119  1.00 11.18           C  
+ATOM    250  O   LEU A  32      18.288  60.643  -8.044  1.00 10.82           O  
+ATOM    251  CB  LEU A  32      18.163  64.345  -8.223  1.00  9.98           C  
+ATOM    252  CG  LEU A  32      17.094  65.384  -8.657  1.00 11.19           C  
+ATOM    253  CD1 LEU A  32      17.453  66.788  -8.236  1.00 13.84           C  
+ATOM    254  CD2 LEU A  32      16.988  65.391 -10.195  1.00 14.00           C  
+ATOM    255  N   SER A  33      19.906  62.179  -7.957  1.00 11.30           N  
+ATOM    256  CA  SER A  33      20.965  61.240  -7.666  1.00  9.67           C  
+ATOM    257  C   SER A  33      22.110  61.972  -6.953  1.00  8.43           C  
+ATOM    258  O   SER A  33      22.070  63.215  -6.846  1.00  7.20           O  
+ATOM    259  CB  SER A  33      21.403  60.628  -9.007  1.00 10.41           C  
+ATOM    260  OG  SER A  33      22.293  61.521  -9.675  1.00 10.51           O  
+ATOM    261  N   ALA A  34      23.177  61.302  -6.599  1.00  9.22           N  
+ATOM    262  CA  ALA A  34      24.351  61.885  -6.019  1.00  9.62           C  
+ATOM    263  C   ALA A  34      25.020  62.837  -7.012  1.00 10.11           C  
+ATOM    264  O   ALA A  34      25.658  63.792  -6.552  1.00  8.62           O  
+ATOM    265  CB  ALA A  34      25.363  60.804  -5.587  1.00 10.36           C  
+ATOM    266  N   ASP A  35      24.741  62.725  -8.306  1.00 10.17           N  
+ATOM    267  CA  ASP A  35      25.338  63.652  -9.285  1.00 10.79           C  
+ATOM    268  C   ASP A  35      24.786  65.055  -9.195  1.00 10.13           C  
+ATOM    269  O   ASP A  35      25.395  65.975  -9.752  1.00 10.35           O  
+ATOM    270  CB  ASP A  35      25.128  63.125 -10.716  1.00 10.95           C  
+ATOM    271  CG  ASP A  35      26.036  61.950 -10.989  1.00 13.32           C  
+ATOM    272  OD1 ASP A  35      26.762  61.509 -10.074  1.00 13.54           O  
+ATOM    273  OD2 ASP A  35      25.999  61.432 -12.143  1.00 15.25           O  
+ATOM    274  N   ASP A  36      23.653  65.296  -8.506  1.00  8.36           N  
+ATOM    275  CA  ASP A  36      23.147  66.659  -8.307  1.00  8.03           C  
+ATOM    276  C   ASP A  36      24.109  67.504  -7.475  1.00  9.21           C  
+ATOM    277  O   ASP A  36      23.956  68.727  -7.446  1.00 11.05           O  
+ATOM    278  CB  ASP A  36      21.751  66.553  -7.614  1.00 10.47           C  
+ATOM    279  CG  ASP A  36      20.924  67.813  -7.861  1.00 16.13           C  
+ATOM    280  OD1 ASP A  36      20.773  68.227  -9.024  1.00 17.12           O  
+ATOM    281  OD2 ASP A  36      20.439  68.471  -6.912  1.00 15.32           O  
+ATOM    282  N   TRP A  37      25.079  66.931  -6.753  1.00 10.46           N  
+ATOM    283  CA  TRP A  37      25.984  67.664  -5.858  1.00  7.76           C  
+ATOM    284  C   TRP A  37      27.297  68.042  -6.484  1.00  9.56           C  
+ATOM    285  O   TRP A  37      28.193  68.574  -5.791  1.00 11.85           O  
+ATOM    286  CB  TRP A  37      26.253  66.742  -4.622  1.00  7.60           C  
+ATOM    287  CG  TRP A  37      25.001  66.543  -3.784  1.00  9.11           C  
+ATOM    288  CD1 TRP A  37      24.267  65.410  -3.597  1.00  8.67           C  
+ATOM    289  CD2 TRP A  37      24.403  67.551  -2.961  1.00  8.08           C  
+ATOM    290  NE1 TRP A  37      23.223  65.663  -2.717  1.00 10.07           N  
+ATOM    291  CE2 TRP A  37      23.291  66.972  -2.332  1.00 10.35           C  
+ATOM    292  CE3 TRP A  37      24.710  68.902  -2.760  1.00  7.63           C  
+ATOM    293  CZ2 TRP A  37      22.447  67.674  -1.470  1.00  8.35           C  
+ATOM    294  CZ3 TRP A  37      23.891  69.609  -1.890  1.00 11.31           C  
+ATOM    295  CH2 TRP A  37      22.793  68.985  -1.258  1.00 10.30           C  
+ATOM    296  N   ASP A  38      27.525  67.787  -7.774  1.00  9.33           N  
+ATOM    297  CA  ASP A  38      28.799  68.073  -8.410  1.00 11.16           C  
+ATOM    298  C   ASP A  38      29.467  69.360  -7.886  1.00 12.35           C  
+ATOM    299  O   ASP A  38      30.620  69.352  -7.489  1.00 12.36           O  
+ATOM    300  CB  ASP A  38      28.729  68.134  -9.915  1.00 11.22           C  
+ATOM    301  CG  ASP A  38      28.618  66.748 -10.584  1.00 14.58           C  
+ATOM    302  OD1 ASP A  38      28.801  65.679  -9.939  1.00 11.78           O  
+ATOM    303  OD2 ASP A  38      28.316  66.810 -11.796  1.00 14.06           O  
+ATOM    304  N   ASN A  39      28.773  70.486  -7.986  1.00 11.87           N  
+ATOM    305  CA  ASN A  39      29.347  71.774  -7.620  1.00 13.12           C  
+ATOM    306  C   ASN A  39      29.858  71.808  -6.175  1.00 12.64           C  
+ATOM    307  O   ASN A  39      30.969  72.304  -5.934  1.00 12.56           O  
+ATOM    308  CB  ASN A  39      28.246  72.828  -7.881  1.00 12.86           C  
+ATOM    309  CG  ASN A  39      28.735  74.207  -7.488  1.00 16.95           C  
+ATOM    310  OD1 ASN A  39      28.991  74.427  -6.302  1.00 17.51           O  
+ATOM    311  ND2 ASN A  39      28.936  75.144  -8.422  1.00 13.94           N  
+ATOM    312  N   GLN A  40      29.005  71.401  -5.228  1.00 10.79           N  
+ATOM    313  CA  GLN A  40      29.310  71.388  -3.802  1.00 12.37           C  
+ATOM    314  C   GLN A  40      30.359  70.336  -3.532  1.00 13.56           C  
+ATOM    315  O   GLN A  40      31.222  70.596  -2.672  1.00 14.85           O  
+ATOM    316  CB  GLN A  40      28.073  71.098  -2.903  1.00 10.94           C  
+ATOM    317  CG  GLN A  40      27.177  72.304  -2.752  1.00 12.64           C  
+ATOM    318  CD  GLN A  40      26.363  72.654  -3.968  1.00 13.95           C  
+ATOM    319  OE1 GLN A  40      25.892  71.692  -4.634  1.00 12.38           O  
+ATOM    320  NE2 GLN A  40      26.198  73.969  -4.228  1.00 11.57           N  
+ATOM    321  N   MET A  41      30.361  69.216  -4.265  1.00  9.82           N  
+ATOM    322  CA  MET A  41      31.420  68.252  -3.999  1.00 12.73           C  
+ATOM    323  C   MET A  41      32.790  68.783  -4.357  1.00 14.38           C  
+ATOM    324  O   MET A  41      33.713  68.665  -3.538  1.00 15.37           O  
+ATOM    325  CB  MET A  41      31.096  66.887  -4.643  1.00 15.27           C  
+ATOM    326  CG  MET A  41      30.171  66.198  -3.570  1.00 19.95           C  
+ATOM    327  SD  MET A  41      29.527  64.729  -4.235  1.00 30.23           S  
+ATOM    328  CE  MET A  41      30.795  63.508  -3.872  1.00 20.16           C  
+ATOM    329  N   LEU A  42      32.919  69.481  -5.499  1.00 13.84           N  
+ATOM    330  CA  LEU A  42      34.198  70.049  -5.851  1.00 13.52           C  
+ATOM    331  C   LEU A  42      34.587  71.209  -4.916  1.00 14.94           C  
+ATOM    332  O   LEU A  42      35.767  71.348  -4.584  1.00 14.55           O  
+ATOM    333  CB  LEU A  42      34.098  70.552  -7.285  1.00 13.38           C  
+ATOM    334  CG  LEU A  42      33.957  69.466  -8.388  1.00 15.26           C  
+ATOM    335  CD1 LEU A  42      34.392  70.007  -9.736  1.00 15.85           C  
+ATOM    336  CD2 LEU A  42      34.821  68.241  -8.130  1.00 15.96           C  
+ATOM    337  N   PHE A  43      33.602  71.998  -4.533  1.00 13.32           N  
+ATOM    338  CA  PHE A  43      33.891  73.166  -3.644  1.00 15.81           C  
+ATOM    339  C   PHE A  43      34.440  72.729  -2.294  1.00 16.66           C  
+ATOM    340  O   PHE A  43      35.503  73.159  -1.864  1.00 17.10           O  
+ATOM    341  CB  PHE A  43      32.595  73.964  -3.487  1.00 15.51           C  
+ATOM    342  CG  PHE A  43      32.710  75.058  -2.429  1.00 17.53           C  
+ATOM    343  CD1 PHE A  43      33.261  76.274  -2.776  1.00 19.11           C  
+ATOM    344  CD2 PHE A  43      32.234  74.829  -1.149  1.00 19.38           C  
+ATOM    345  CE1 PHE A  43      33.370  77.294  -1.822  1.00 20.88           C  
+ATOM    346  CE2 PHE A  43      32.326  75.840  -0.194  1.00 18.55           C  
+ATOM    347  CZ  PHE A  43      32.873  77.056  -0.549  1.00 17.92           C  
+ATOM    348  N   PHE A  44      33.809  71.736  -1.660  1.00 15.71           N  
+ATOM    349  CA  PHE A  44      34.273  71.205  -0.385  1.00 15.06           C  
+ATOM    350  C   PHE A  44      35.601  70.485  -0.464  1.00 17.32           C  
+ATOM    351  O   PHE A  44      36.489  70.536   0.432  1.00 18.03           O  
+ATOM    352  CB  PHE A  44      33.145  70.346   0.225  1.00 14.43           C  
+ATOM    353  CG  PHE A  44      32.209  71.241   1.023  1.00 15.08           C  
+ATOM    354  CD1 PHE A  44      32.585  71.597   2.326  1.00 16.70           C  
+ATOM    355  CD2 PHE A  44      31.065  71.730   0.481  1.00 14.94           C  
+ATOM    356  CE1 PHE A  44      31.741  72.407   3.075  1.00 17.78           C  
+ATOM    357  CE2 PHE A  44      30.214  72.551   1.232  1.00 17.65           C  
+ATOM    358  CZ  PHE A  44      30.566  72.898   2.530  1.00 18.75           C  
+ATOM    359  N   LEU A  45      35.814  69.714  -1.516  1.00 14.91           N  
+ATOM    360  CA  LEU A  45      37.072  69.069  -1.820  1.00 18.79           C  
+ATOM    361  C   LEU A  45      38.202  70.104  -1.871  1.00 18.00           C  
+ATOM    362  O   LEU A  45      39.295  69.831  -1.389  1.00 19.90           O  
+ATOM    363  CB  LEU A  45      37.067  68.428  -3.221  1.00 17.38           C  
+ATOM    364  CG  LEU A  45      36.611  66.991  -3.302  1.00 19.50           C  
+ATOM    365  CD1 LEU A  45      36.562  66.566  -4.776  1.00 17.84           C  
+ATOM    366  CD2 LEU A  45      37.585  66.165  -2.472  1.00 21.51           C  
+ATOM    367  N   SER A  46      37.947  71.227  -2.524  1.00 19.84           N  
+ATOM    368  CA  SER A  46      38.955  72.267  -2.609  1.00 22.20           C  
+ATOM    369  C   SER A  46      39.293  72.862  -1.231  1.00 24.61           C  
+ATOM    370  O   SER A  46      40.319  73.529  -1.110  1.00 23.74           O  
+ATOM    371  CB  SER A  46      38.529  73.380  -3.552  1.00 22.83           C  
+ATOM    372  OG  SER A  46      37.650  74.268  -2.896  1.00 29.36           O  
+ATOM    373  N   HIS A  47      38.435  72.677  -0.217  1.00 22.29           N  
+ATOM    374  CA  HIS A  47      38.714  73.191   1.106  1.00 22.20           C  
+ATOM    375  C   HIS A  47      39.197  72.068   2.028  1.00 22.23           C  
+ATOM    376  O   HIS A  47      39.283  72.314   3.240  1.00 22.21           O  
+ATOM    377  CB  HIS A  47      37.510  73.910   1.714  1.00 19.45           C  
+ATOM    378  CG  HIS A  47      37.353  75.211   1.008  1.00 21.06           C  
+ATOM    379  ND1 HIS A  47      38.075  76.309   1.399  1.00 21.99           N  
+ATOM    380  CD2 HIS A  47      36.571  75.599  -0.040  1.00 21.66           C  
+ATOM    381  CE1 HIS A  47      37.783  77.329   0.616  1.00 22.57           C  
+ATOM    382  NE2 HIS A  47      36.881  76.923  -0.265  1.00 22.90           N  
+ATOM    383  N   GLY A  48      39.580  70.947   1.422  1.00 21.01           N  
+ATOM    384  CA  GLY A  48      40.180  69.832   2.096  1.00 20.70           C  
+ATOM    385  C   GLY A  48      39.247  68.872   2.804  1.00 21.71           C  
+ATOM    386  O   GLY A  48      39.735  68.092   3.647  1.00 22.39           O  
+ATOM    387  N   TYR A  49      37.965  68.836   2.460  1.00 19.45           N  
+ATOM    388  CA  TYR A  49      37.060  67.879   3.116  1.00 18.69           C  
+ATOM    389  C   TYR A  49      36.949  66.587   2.335  1.00 18.08           C  
+ATOM    390  O   TYR A  49      37.309  66.479   1.169  1.00 19.13           O  
+ATOM    391  CB  TYR A  49      35.657  68.503   3.299  1.00 18.85           C  
+ATOM    392  CG  TYR A  49      35.695  69.660   4.286  1.00 20.92           C  
+ATOM    393  CD1 TYR A  49      35.571  69.406   5.649  1.00 22.05           C  
+ATOM    394  CD2 TYR A  49      35.870  70.964   3.868  1.00 21.65           C  
+ATOM    395  CE1 TYR A  49      35.623  70.443   6.578  1.00 23.11           C  
+ATOM    396  CE2 TYR A  49      35.939  72.011   4.774  1.00 22.46           C  
+ATOM    397  CZ  TYR A  49      35.802  71.725   6.127  1.00 23.54           C  
+ATOM    398  OH  TYR A  49      35.844  72.792   7.013  1.00 24.88           O  
+ATOM    399  N   ARG A  50      36.557  65.521   3.016  1.00 16.04           N  
+ATOM    400  CA  ARG A  50      36.229  64.239   2.430  1.00 16.01           C  
+ATOM    401  C   ARG A  50      34.742  64.366   2.059  1.00 15.33           C  
+ATOM    402  O   ARG A  50      33.974  64.921   2.866  1.00 14.61           O  
+ATOM    403  CB  ARG A  50      36.459  63.081   3.351  1.00 14.64           C  
+ATOM    404  CG  ARG A  50      36.198  61.698   2.748  1.00 14.58           C  
+ATOM    405  CD  ARG A  50      36.284  60.686   3.911  1.00 14.44           C  
+ATOM    406  NE  ARG A  50      35.910  59.347   3.508  1.00 13.80           N  
+ATOM    407  CZ  ARG A  50      35.864  58.283   4.280  1.00 16.31           C  
+ATOM    408  NH1 ARG A  50      36.284  58.411   5.553  1.00 18.83           N  
+ATOM    409  NH2 ARG A  50      35.431  57.118   3.862  1.00 15.18           N  
+ATOM    410  N   VAL A  51      34.388  64.016   0.811  1.00 14.78           N  
+ATOM    411  CA  VAL A  51      33.006  64.310   0.374  1.00 13.11           C  
+ATOM    412  C   VAL A  51      32.385  63.009  -0.096  1.00 14.09           C  
+ATOM    413  O   VAL A  51      33.049  62.179  -0.759  1.00 12.81           O  
+ATOM    414  CB  VAL A  51      32.915  65.397  -0.724  1.00 14.40           C  
+ATOM    415  CG1 VAL A  51      33.250  66.769  -0.120  1.00 12.81           C  
+ATOM    416  CG2 VAL A  51      33.876  65.101  -1.892  1.00 12.06           C  
+ATOM    417  N   ILE A  52      31.222  62.741   0.547  1.00 13.24           N  
+ATOM    418  CA  ILE A  52      30.505  61.490   0.279  1.00 12.71           C  
+ATOM    419  C   ILE A  52      29.086  61.792  -0.194  1.00 12.59           C  
+ATOM    420  O   ILE A  52      28.398  62.678   0.330  1.00 12.28           O  
+ATOM    421  CB  ILE A  52      30.463  60.671   1.600  1.00 13.98           C  
+ATOM    422  CG1 ILE A  52      31.922  60.262   1.942  1.00 16.07           C  
+ATOM    423  CG2 ILE A  52      29.585  59.445   1.464  1.00 13.36           C  
+ATOM    424  CD1 ILE A  52      32.153  60.127   3.447  1.00 17.69           C  
+ATOM    425  N   ALA A  53      28.601  60.985  -1.147  1.00 10.28           N  
+ATOM    426  CA  ALA A  53      27.216  61.184  -1.632  1.00  8.98           C  
+ATOM    427  C   ALA A  53      26.727  59.861  -2.201  1.00 10.37           C  
+ATOM    428  O   ALA A  53      27.502  59.254  -2.974  1.00 10.18           O  
+ATOM    429  CB  ALA A  53      27.159  62.271  -2.691  1.00  9.23           C  
+ATOM    430  N   HIS A  54      25.538  59.424  -1.835  1.00  9.75           N  
+ATOM    431  CA  HIS A  54      25.032  58.180  -2.300  1.00 10.49           C  
+ATOM    432  C   HIS A  54      23.820  58.433  -3.213  1.00 10.00           C  
+ATOM    433  O   HIS A  54      23.120  59.451  -3.072  1.00 12.24           O  
+ATOM    434  CB  HIS A  54      24.611  57.227  -1.152  1.00 10.17           C  
+ATOM    435  CG  HIS A  54      23.445  57.748  -0.360  1.00 15.03           C  
+ATOM    436  ND1 HIS A  54      23.518  58.948   0.309  1.00 16.75           N  
+ATOM    437  CD2 HIS A  54      22.190  57.271  -0.134  1.00 17.52           C  
+ATOM    438  CE1 HIS A  54      22.394  59.226   0.914  1.00 17.95           C  
+ATOM    439  NE2 HIS A  54      21.572  58.229   0.645  1.00 18.90           N  
+ATOM    440  N   ASP A  55      23.496  57.437  -4.036  1.00  9.81           N  
+ATOM    441  CA  ASP A  55      22.204  57.427  -4.751  1.00  8.89           C  
+ATOM    442  C   ASP A  55      21.190  56.723  -3.863  1.00 10.25           C  
+ATOM    443  O   ASP A  55      21.345  55.518  -3.493  1.00  9.90           O  
+ATOM    444  CB  ASP A  55      22.333  56.595  -6.057  1.00  9.35           C  
+ATOM    445  CG  ASP A  55      23.176  57.300  -7.110  1.00 10.41           C  
+ATOM    446  OD1 ASP A  55      23.432  58.516  -7.031  1.00 11.07           O  
+ATOM    447  OD2 ASP A  55      23.583  56.640  -8.101  1.00 13.40           O  
+ATOM    448  N   ARG A  56      20.081  57.388  -3.549  1.00  9.91           N  
+ATOM    449  CA  ARG A  56      18.999  56.735  -2.828  1.00 11.19           C  
+ATOM    450  C   ARG A  56      18.509  55.507  -3.574  1.00 12.76           C  
+ATOM    451  O   ARG A  56      18.561  55.394  -4.806  1.00 11.30           O  
+ATOM    452  CB  ARG A  56      17.870  57.727  -2.625  1.00 11.77           C  
+ATOM    453  CG  ARG A  56      16.705  57.275  -1.749  1.00 14.73           C  
+ATOM    454  CD  ARG A  56      15.812  58.475  -1.410  1.00 11.41           C  
+ATOM    455  NE  ARG A  56      16.636  59.407  -0.677  1.00 11.61           N  
+ATOM    456  CZ  ARG A  56      16.963  60.632  -1.020  1.00 12.74           C  
+ATOM    457  NH1 ARG A  56      16.422  61.207  -2.128  1.00 11.30           N  
+ATOM    458  NH2 ARG A  56      17.817  61.305  -0.288  1.00  9.77           N  
+ATOM    459  N   ARG A  57      18.034  54.489  -2.841  1.00 11.59           N  
+ATOM    460  CA  ARG A  57      17.554  53.270  -3.462  1.00 11.95           C  
+ATOM    461  C   ARG A  57      16.476  53.640  -4.511  1.00 11.10           C  
+ATOM    462  O   ARG A  57      15.688  54.546  -4.275  1.00 11.20           O  
+ATOM    463  CB  ARG A  57      16.901  52.256  -2.513  1.00 13.57           C  
+ATOM    464  CG  ARG A  57      15.752  52.707  -1.643  1.00 16.84           C  
+ATOM    465  CD  ARG A  57      15.027  51.450  -1.048  1.00 15.52           C  
+ATOM    466  NE  ARG A  57      15.916  50.739  -0.135  1.00 16.36           N  
+ATOM    467  CZ  ARG A  57      15.871  49.511   0.349  1.00 18.20           C  
+ATOM    468  NH1 ARG A  57      14.931  48.652  -0.033  1.00 16.83           N  
+ATOM    469  NH2 ARG A  57      16.809  49.053   1.218  1.00 14.46           N  
+ATOM    470  N   GLY A  58      16.570  52.946  -5.635  1.00 10.12           N  
+ATOM    471  CA  GLY A  58      15.677  53.236  -6.739  1.00 10.60           C  
+ATOM    472  C   GLY A  58      16.030  54.514  -7.501  1.00 12.64           C  
+ATOM    473  O   GLY A  58      15.229  55.037  -8.289  1.00 10.99           O  
+ATOM    474  N   HIS A  59      17.210  55.088  -7.279  1.00 10.50           N  
+ATOM    475  CA  HIS A  59      17.596  56.321  -7.908  1.00 12.35           C  
+ATOM    476  C   HIS A  59      19.013  56.112  -8.483  1.00 11.51           C  
+ATOM    477  O   HIS A  59      19.823  55.335  -7.953  1.00 12.39           O  
+ATOM    478  CB  HIS A  59      17.703  57.517  -6.933  1.00 10.93           C  
+ATOM    479  CG  HIS A  59      16.404  57.959  -6.334  1.00 11.57           C  
+ATOM    480  ND1 HIS A  59      15.663  57.055  -5.561  1.00 11.08           N  
+ATOM    481  CD2 HIS A  59      15.722  59.144  -6.363  1.00 10.20           C  
+ATOM    482  CE1 HIS A  59      14.557  57.704  -5.174  1.00 10.17           C  
+ATOM    483  NE2 HIS A  59      14.592  58.946  -5.616  1.00  9.32           N  
+ATOM    484  N   GLY A  60      19.320  56.942  -9.479  1.00 10.42           N  
+ATOM    485  CA  GLY A  60      20.652  56.902 -10.083  1.00 10.86           C  
+ATOM    486  C   GLY A  60      21.107  55.513 -10.457  1.00 12.19           C  
+ATOM    487  O   GLY A  60      20.488  54.778 -11.237  1.00 12.14           O  
+ATOM    488  N   ARG A  61      22.260  55.118  -9.880  1.00 11.29           N  
+ATOM    489  CA  ARG A  61      22.891  53.831 -10.138  1.00 11.62           C  
+ATOM    490  C   ARG A  61      22.610  52.796  -9.048  1.00 13.15           C  
+ATOM    491  O   ARG A  61      23.199  51.709  -9.085  1.00 13.99           O  
+ATOM    492  CB  ARG A  61      24.424  54.022 -10.215  1.00 13.31           C  
+ATOM    493  CG  ARG A  61      24.869  54.879 -11.400  1.00 14.55           C  
+ATOM    494  CD  ARG A  61      26.024  55.827 -11.120  1.00 17.01           C  
+ATOM    495  NE  ARG A  61      25.549  56.911 -10.209  1.00 17.03           N  
+ATOM    496  CZ  ARG A  61      25.917  58.162 -10.189  1.00 16.70           C  
+ATOM    497  NH1 ARG A  61      26.861  58.590 -11.048  1.00 15.95           N  
+ATOM    498  NH2 ARG A  61      25.412  59.028  -9.296  1.00 14.51           N  
+ATOM    499  N   SER A  62      21.828  53.136  -8.030  1.00 12.83           N  
+ATOM    500  CA  SER A  62      21.476  52.138  -7.014  1.00 11.39           C  
+ATOM    501  C   SER A  62      20.502  51.121  -7.582  1.00 14.15           C  
+ATOM    502  O   SER A  62      19.868  51.367  -8.630  1.00 15.29           O  
+ATOM    503  CB  SER A  62      20.891  52.847  -5.765  1.00  7.46           C  
+ATOM    504  OG  SER A  62      21.998  53.564  -5.200  1.00 10.03           O  
+ATOM    505  N   ASP A  63      20.282  50.006  -6.905  1.00 13.37           N  
+ATOM    506  CA  ASP A  63      19.352  48.989  -7.346  1.00 13.66           C  
+ATOM    507  C   ASP A  63      17.945  49.568  -7.386  1.00 13.82           C  
+ATOM    508  O   ASP A  63      17.725  50.578  -6.697  1.00 14.80           O  
+ATOM    509  CB  ASP A  63      19.307  47.844  -6.333  1.00 14.50           C  
+ATOM    510  CG  ASP A  63      20.470  46.874  -6.460  1.00 20.41           C  
+ATOM    511  OD1 ASP A  63      21.342  47.019  -7.311  1.00 19.01           O  
+ATOM    512  OD2 ASP A  63      20.551  45.974  -5.600  1.00 21.85           O  
+ATOM    513  N   GLN A  64      17.002  48.902  -8.037  1.00 10.61           N  
+ATOM    514  CA  GLN A  64      15.623  49.389  -8.075  1.00 14.00           C  
+ATOM    515  C   GLN A  64      14.743  48.255  -7.487  1.00 15.71           C  
+ATOM    516  O   GLN A  64      14.178  47.458  -8.232  1.00 14.95           O  
+ATOM    517  CB  GLN A  64      15.189  49.636  -9.520  1.00 15.19           C  
+ATOM    518  CG  GLN A  64      16.210  50.338 -10.413  1.00 16.24           C  
+ATOM    519  CD  GLN A  64      15.614  50.878 -11.703  1.00 16.57           C  
+ATOM    520  OE1 GLN A  64      14.652  50.305 -12.262  1.00 14.89           O  
+ATOM    521  NE2 GLN A  64      16.176  52.005 -12.176  1.00 13.26           N  
+ATOM    522  N   PRO A  65      14.705  48.137  -6.173  1.00 15.24           N  
+ATOM    523  CA  PRO A  65      13.975  47.093  -5.494  1.00 15.11           C  
+ATOM    524  C   PRO A  65      12.494  47.338  -5.537  1.00 14.85           C  
+ATOM    525  O   PRO A  65      12.042  48.417  -5.865  1.00 15.52           O  
+ATOM    526  CB  PRO A  65      14.471  47.185  -4.047  1.00 14.78           C  
+ATOM    527  CG  PRO A  65      14.822  48.628  -3.868  1.00 16.59           C  
+ATOM    528  CD  PRO A  65      15.331  49.113  -5.221  1.00 15.09           C  
+ATOM    529  N   SER A  66      11.713  46.308  -5.209  1.00 15.98           N  
+ATOM    530  CA  SER A  66      10.274  46.407  -5.248  1.00 18.01           C  
+ATOM    531  C   SER A  66       9.716  47.229  -4.103  1.00 17.99           C  
+ATOM    532  O   SER A  66       8.650  47.851  -4.183  1.00 18.04           O  
+ATOM    533  CB  SER A  66       9.746  44.948  -4.997  1.00 19.08           C  
+ATOM    534  OG  SER A  66       8.331  45.114  -5.016  1.00 24.82           O  
+ATOM    535  N   THR A  67      10.422  47.149  -2.963  1.00 17.08           N  
+ATOM    536  CA  THR A  67       9.934  47.775  -1.740  1.00 19.31           C  
+ATOM    537  C   THR A  67      10.996  48.608  -1.030  1.00 18.68           C  
+ATOM    538  O   THR A  67      12.126  48.750  -1.492  1.00 18.47           O  
+ATOM    539  CB  THR A  67       9.470  46.694  -0.712  1.00 22.72           C  
+ATOM    540  OG1 THR A  67      10.568  45.822  -0.383  1.00 25.78           O  
+ATOM    541  CG2 THR A  67       8.418  45.758  -1.272  1.00 24.64           C  
+ATOM    542  N   GLY A  68      10.544  49.264   0.050  1.00 18.44           N  
+ATOM    543  CA  GLY A  68      11.410  50.070   0.881  1.00 18.48           C  
+ATOM    544  C   GLY A  68      11.430  51.513   0.425  1.00 18.03           C  
+ATOM    545  O   GLY A  68      12.341  52.225   0.869  1.00 17.43           O  
+ATOM    546  N   HIS A  69      10.386  51.958  -0.298  1.00 15.63           N  
+ATOM    547  CA  HIS A  69      10.355  53.371  -0.688  1.00 14.93           C  
+ATOM    548  C   HIS A  69       9.757  54.226   0.416  1.00 17.11           C  
+ATOM    549  O   HIS A  69       8.638  54.710   0.233  1.00 17.45           O  
+ATOM    550  CB  HIS A  69       9.572  53.474  -2.035  1.00 15.52           C  
+ATOM    551  CG  HIS A  69      10.239  52.528  -2.995  1.00 17.07           C  
+ATOM    552  ND1 HIS A  69      11.567  52.724  -3.352  1.00 16.36           N  
+ATOM    553  CD2 HIS A  69       9.833  51.360  -3.537  1.00 17.57           C  
+ATOM    554  CE1 HIS A  69      11.915  51.713  -4.163  1.00 17.29           C  
+ATOM    555  NE2 HIS A  69      10.894  50.860  -4.272  1.00 15.49           N  
+ATOM    556  N   ASP A  70      10.401  54.382   1.579  1.00 17.34           N  
+ATOM    557  CA  ASP A  70       9.849  55.101   2.717  1.00 18.16           C  
+ATOM    558  C   ASP A  70      11.016  55.692   3.544  1.00 16.30           C  
+ATOM    559  O   ASP A  70      12.116  55.163   3.410  1.00 13.01           O  
+ATOM    560  CB  ASP A  70       8.928  54.178   3.541  1.00 20.28           C  
+ATOM    561  CG  ASP A  70       9.746  53.058   4.173  1.00 23.91           C  
+ATOM    562  OD1 ASP A  70      10.450  53.230   5.194  1.00 24.82           O  
+ATOM    563  OD2 ASP A  70       9.798  51.942   3.629  1.00 27.21           O  
+ATOM    564  N   MET A  71      10.727  56.674   4.374  1.00 16.04           N  
+ATOM    565  CA  MET A  71      11.751  57.382   5.138  1.00 17.42           C  
+ATOM    566  C   MET A  71      12.489  56.507   6.126  1.00 18.97           C  
+ATOM    567  O   MET A  71      13.668  56.733   6.391  1.00 19.57           O  
+ATOM    568  CB  MET A  71      11.113  58.595   5.817  1.00 17.57           C  
+ATOM    569  CG  MET A  71      10.799  59.737   4.828  1.00 19.70           C  
+ATOM    570  SD  MET A  71      12.346  60.497   4.262  1.00 23.19           S  
+ATOM    571  CE  MET A  71      11.642  61.291   2.798  1.00 21.28           C  
+ATOM    572  N   ASP A  72      11.775  55.560   6.792  1.00 18.86           N  
+ATOM    573  CA  ASP A  72      12.473  54.698   7.726  1.00 20.01           C  
+ATOM    574  C   ASP A  72      13.515  53.867   6.990  1.00 17.50           C  
+ATOM    575  O   ASP A  72      14.636  53.699   7.436  1.00 17.67           O  
+ATOM    576  CB  ASP A  72      11.540  53.702   8.440  1.00 21.15           C  
+ATOM    577  CG  ASP A  72      10.651  54.414   9.426  1.00 23.56           C  
+ATOM    578  OD1 ASP A  72      11.007  55.456   9.999  1.00 25.29           O  
+ATOM    579  OD2 ASP A  72       9.544  53.929   9.677  1.00 26.30           O  
+ATOM    580  N   THR A  73      13.175  53.274   5.861  1.00 17.67           N  
+ATOM    581  CA  THR A  73      14.185  52.520   5.103  1.00 16.73           C  
+ATOM    582  C   THR A  73      15.262  53.441   4.560  1.00 16.33           C  
+ATOM    583  O   THR A  73      16.445  53.092   4.560  1.00 15.98           O  
+ATOM    584  CB  THR A  73      13.467  51.793   3.952  1.00 19.40           C  
+ATOM    585  OG1 THR A  73      12.385  51.035   4.527  1.00 19.44           O  
+ATOM    586  CG2 THR A  73      14.438  50.906   3.183  1.00 20.03           C  
+ATOM    587  N   TYR A  74      14.901  54.643   4.086  1.00 14.43           N  
+ATOM    588  CA  TYR A  74      15.942  55.537   3.560  1.00 14.73           C  
+ATOM    589  C   TYR A  74      16.957  55.842   4.662  1.00 15.63           C  
+ATOM    590  O   TYR A  74      18.142  55.858   4.393  1.00 13.39           O  
+ATOM    591  CB  TYR A  74      15.344  56.863   3.076  1.00 12.85           C  
+ATOM    592  CG  TYR A  74      14.417  56.781   1.865  1.00 13.05           C  
+ATOM    593  CD1 TYR A  74      14.461  55.725   0.994  1.00 13.06           C  
+ATOM    594  CD2 TYR A  74      13.504  57.830   1.665  1.00 11.61           C  
+ATOM    595  CE1 TYR A  74      13.591  55.676  -0.092  1.00 13.74           C  
+ATOM    596  CE2 TYR A  74      12.613  57.756   0.570  1.00 13.06           C  
+ATOM    597  CZ  TYR A  74      12.688  56.699  -0.283  1.00 12.46           C  
+ATOM    598  OH  TYR A  74      11.843  56.599  -1.381  1.00 15.66           O  
+ATOM    599  N   ALA A  75      16.454  56.130   5.890  1.00 14.81           N  
+ATOM    600  CA  ALA A  75      17.414  56.440   6.971  1.00 15.93           C  
+ATOM    601  C   ALA A  75      18.205  55.188   7.368  1.00 17.41           C  
+ATOM    602  O   ALA A  75      19.366  55.333   7.761  1.00 19.66           O  
+ATOM    603  CB  ALA A  75      16.636  56.997   8.152  1.00 17.42           C  
+ATOM    604  N   ALA A  76      17.653  53.997   7.255  1.00 16.77           N  
+ATOM    605  CA  ALA A  76      18.407  52.784   7.602  1.00 18.34           C  
+ATOM    606  C   ALA A  76      19.466  52.475   6.548  1.00 17.45           C  
+ATOM    607  O   ALA A  76      20.572  51.981   6.804  1.00 15.95           O  
+ATOM    608  CB  ALA A  76      17.468  51.599   7.773  1.00 18.78           C  
+ATOM    609  N   ASP A  77      19.139  52.844   5.291  1.00 15.37           N  
+ATOM    610  CA  ASP A  77      20.136  52.652   4.211  1.00 13.81           C  
+ATOM    611  C   ASP A  77      21.277  53.630   4.498  1.00 13.34           C  
+ATOM    612  O   ASP A  77      22.424  53.249   4.306  1.00 16.53           O  
+ATOM    613  CB  ASP A  77      19.494  52.994   2.858  1.00 13.74           C  
+ATOM    614  CG  ASP A  77      18.513  51.988   2.327  1.00 17.10           C  
+ATOM    615  OD1 ASP A  77      18.425  50.849   2.881  1.00 16.29           O  
+ATOM    616  OD2 ASP A  77      17.788  52.307   1.343  1.00 15.78           O  
+ATOM    617  N   VAL A  78      21.051  54.844   4.975  1.00 13.30           N  
+ATOM    618  CA  VAL A  78      22.112  55.774   5.317  1.00 13.87           C  
+ATOM    619  C   VAL A  78      22.995  55.177   6.445  1.00 15.32           C  
+ATOM    620  O   VAL A  78      24.221  55.230   6.400  1.00 14.19           O  
+ATOM    621  CB  VAL A  78      21.571  57.143   5.763  1.00 14.43           C  
+ATOM    622  CG1 VAL A  78      22.714  57.985   6.298  1.00 15.65           C  
+ATOM    623  CG2 VAL A  78      20.904  57.852   4.554  1.00 14.95           C  
+ATOM    624  N   ALA A  79      22.342  54.591   7.449  1.00 14.95           N  
+ATOM    625  CA  ALA A  79      23.102  53.964   8.557  1.00 15.95           C  
+ATOM    626  C   ALA A  79      23.934  52.847   8.022  1.00 15.19           C  
+ATOM    627  O   ALA A  79      25.079  52.715   8.472  1.00 17.54           O  
+ATOM    628  CB  ALA A  79      22.124  53.500   9.656  1.00 16.85           C  
+ATOM    629  N   ALA A  80      23.456  52.027   7.093  1.00 14.80           N  
+ATOM    630  CA  ALA A  80      24.236  50.967   6.501  1.00 17.47           C  
+ATOM    631  C   ALA A  80      25.499  51.562   5.868  1.00 17.32           C  
+ATOM    632  O   ALA A  80      26.583  50.993   6.093  1.00 19.66           O  
+ATOM    633  CB  ALA A  80      23.454  50.067   5.575  1.00 17.72           C  
+ATOM    634  N   LEU A  81      25.450  52.649   5.130  1.00 15.51           N  
+ATOM    635  CA  LEU A  81      26.623  53.274   4.528  1.00 15.62           C  
+ATOM    636  C   LEU A  81      27.582  53.880   5.552  1.00 16.94           C  
+ATOM    637  O   LEU A  81      28.808  53.700   5.418  1.00 18.22           O  
+ATOM    638  CB  LEU A  81      26.102  54.456   3.671  1.00 16.49           C  
+ATOM    639  CG  LEU A  81      27.157  55.396   3.066  1.00 19.29           C  
+ATOM    640  CD1 LEU A  81      27.932  54.622   2.007  1.00 21.95           C  
+ATOM    641  CD2 LEU A  81      26.473  56.621   2.490  1.00 22.69           C  
+ATOM    642  N   THR A  82      27.065  54.575   6.550  1.00 14.71           N  
+ATOM    643  CA  THR A  82      27.980  55.227   7.505  1.00 18.33           C  
+ATOM    644  C   THR A  82      28.678  54.214   8.422  1.00 19.91           C  
+ATOM    645  O   THR A  82      29.841  54.412   8.805  1.00 19.40           O  
+ATOM    646  CB  THR A  82      27.335  56.325   8.359  1.00 16.68           C  
+ATOM    647  OG1 THR A  82      26.292  55.847   9.185  1.00 18.54           O  
+ATOM    648  CG2 THR A  82      26.849  57.480   7.498  1.00 16.27           C  
+ATOM    649  N   GLU A  83      28.048  53.063   8.588  1.00 21.58           N  
+ATOM    650  CA  GLU A  83      28.658  51.958   9.340  1.00 25.23           C  
+ATOM    651  C   GLU A  83      29.713  51.272   8.482  1.00 24.69           C  
+ATOM    652  O   GLU A  83      30.819  51.012   8.961  1.00 23.50           O  
+ATOM    653  CB  GLU A  83      27.568  50.963   9.751  1.00 27.95           C  
+ATOM    654  CG  GLU A  83      28.084  49.713  10.444  1.00 33.90           C  
+ATOM    655  CD  GLU A  83      26.905  48.776  10.709  1.00 38.78           C  
+ATOM    656  OE1 GLU A  83      26.519  48.018   9.785  1.00 40.54           O  
+ATOM    657  OE2 GLU A  83      26.371  48.884  11.836  1.00 41.13           O  
+ATOM    658  N   ALA A  84      29.419  50.976   7.208  1.00 20.78           N  
+ATOM    659  CA  ALA A  84      30.450  50.419   6.330  1.00 19.99           C  
+ATOM    660  C   ALA A  84      31.664  51.318   6.205  1.00 20.70           C  
+ATOM    661  O   ALA A  84      32.793  50.773   6.143  1.00 22.41           O  
+ATOM    662  CB  ALA A  84      29.839  50.024   4.963  1.00 18.65           C  
+ATOM    663  N   LEU A  85      31.571  52.650   6.272  1.00 18.54           N  
+ATOM    664  CA  LEU A  85      32.699  53.528   6.145  1.00 19.39           C  
+ATOM    665  C   LEU A  85      33.261  53.914   7.518  1.00 19.27           C  
+ATOM    666  O   LEU A  85      34.291  54.579   7.531  1.00 21.45           O  
+ATOM    667  CB  LEU A  85      32.306  54.856   5.426  1.00 20.66           C  
+ATOM    668  CG  LEU A  85      31.663  54.697   4.046  1.00 23.58           C  
+ATOM    669  CD1 LEU A  85      31.411  56.053   3.395  1.00 24.14           C  
+ATOM    670  CD2 LEU A  85      32.588  53.894   3.145  1.00 23.29           C  
+ATOM    671  N   ASP A  86      32.514  53.615   8.539  1.00 20.86           N  
+ATOM    672  CA  ASP A  86      32.806  53.988   9.929  1.00 23.39           C  
+ATOM    673  C   ASP A  86      33.019  55.472  10.098  1.00 22.50           C  
+ATOM    674  O   ASP A  86      34.055  55.964  10.581  1.00 20.76           O  
+ATOM    675  CB  ASP A  86      34.038  53.213  10.432  1.00 26.61           C  
+ATOM    676  CG  ASP A  86      34.220  53.280  11.931  1.00 31.20           C  
+ATOM    677  OD1 ASP A  86      33.267  53.429  12.719  1.00 29.69           O  
+ATOM    678  OD2 ASP A  86      35.409  53.170  12.353  1.00 33.56           O  
+ATOM    679  N   LEU A  87      32.008  56.260   9.689  1.00 19.97           N  
+ATOM    680  CA  LEU A  87      32.208  57.705   9.781  1.00 19.09           C  
+ATOM    681  C   LEU A  87      31.999  58.169  11.221  1.00 19.84           C  
+ATOM    682  O   LEU A  87      31.084  57.671  11.897  1.00 19.74           O  
+ATOM    683  CB  LEU A  87      31.177  58.411   8.887  1.00 18.71           C  
+ATOM    684  CG  LEU A  87      31.249  58.071   7.387  1.00 19.32           C  
+ATOM    685  CD1 LEU A  87      30.308  59.050   6.653  1.00 19.65           C  
+ATOM    686  CD2 LEU A  87      32.639  58.230   6.800  1.00 19.00           C  
+ATOM    687  N   ARG A  88      32.733  59.164  11.620  1.00 19.63           N  
+ATOM    688  CA  ARG A  88      32.583  59.767  12.939  1.00 23.48           C  
+ATOM    689  C   ARG A  88      32.615  61.266  12.788  1.00 20.52           C  
+ATOM    690  O   ARG A  88      33.367  61.762  11.941  1.00 21.55           O  
+ATOM    691  CB  ARG A  88      33.748  59.318  13.859  1.00 25.09           C  
+ATOM    692  CG  ARG A  88      33.681  57.870  14.334  1.00 30.33           C  
+ATOM    693  CD  ARG A  88      32.394  57.510  15.074  1.00 34.04           C  
+ATOM    694  NE  ARG A  88      32.267  56.084  15.232  1.00 38.78           N  
+ATOM    695  CZ  ARG A  88      31.458  55.214  15.805  1.00 40.77           C  
+ATOM    696  NH1 ARG A  88      30.364  55.549  16.484  1.00 40.44           N  
+ATOM    697  NH2 ARG A  88      31.729  53.897  15.680  1.00 42.08           N  
+ATOM    698  N   GLY A  89      31.834  62.045  13.514  1.00 20.15           N  
+ATOM    699  CA  GLY A  89      31.858  63.465  13.455  1.00 17.54           C  
+ATOM    700  C   GLY A  89      31.500  64.049  12.081  1.00 18.79           C  
+ATOM    701  O   GLY A  89      32.003  65.107  11.684  1.00 16.87           O  
+ATOM    702  N   ALA A  90      30.643  63.348  11.355  1.00 17.83           N  
+ATOM    703  CA  ALA A  90      30.297  63.763  10.001  1.00 15.52           C  
+ATOM    704  C   ALA A  90      29.336  64.899   9.940  1.00 16.33           C  
+ATOM    705  O   ALA A  90      28.558  65.115  10.883  1.00 16.82           O  
+ATOM    706  CB  ALA A  90      29.561  62.547   9.393  1.00 17.00           C  
+ATOM    707  N   VAL A  91      29.393  65.720   8.871  1.00 13.67           N  
+ATOM    708  CA  VAL A  91      28.366  66.742   8.683  1.00 13.22           C  
+ATOM    709  C   VAL A  91      27.402  66.248   7.590  1.00 15.06           C  
+ATOM    710  O   VAL A  91      27.920  65.809   6.536  1.00 16.66           O  
+ATOM    711  CB  VAL A  91      28.974  68.075   8.297  1.00 16.04           C  
+ATOM    712  CG1 VAL A  91      27.865  69.095   8.026  1.00 17.56           C  
+ATOM    713  CG2 VAL A  91      29.861  68.570   9.447  1.00 16.48           C  
+ATOM    714  N   HIS A  92      26.113  66.229   7.807  1.00 11.63           N  
+ATOM    715  CA  HIS A  92      25.144  65.719   6.845  1.00 12.18           C  
+ATOM    716  C   HIS A  92      24.390  66.886   6.224  1.00 14.67           C  
+ATOM    717  O   HIS A  92      23.679  67.641   6.923  1.00 16.35           O  
+ATOM    718  CB  HIS A  92      24.212  64.719   7.527  1.00 12.33           C  
+ATOM    719  CG  HIS A  92      24.897  63.407   7.758  1.00 12.93           C  
+ATOM    720  ND1 HIS A  92      24.708  62.309   6.964  1.00 12.24           N  
+ATOM    721  CD2 HIS A  92      25.856  63.057   8.714  1.00 12.63           C  
+ATOM    722  CE1 HIS A  92      25.485  61.284   7.376  1.00 13.63           C  
+ATOM    723  NE2 HIS A  92      26.187  61.759   8.423  1.00 13.06           N  
+ATOM    724  N   ILE A  93      24.414  66.994   4.881  1.00 11.18           N  
+ATOM    725  CA  ILE A  93      23.709  68.114   4.203  1.00  9.98           C  
+ATOM    726  C   ILE A  93      22.616  67.515   3.326  1.00 11.23           C  
+ATOM    727  O   ILE A  93      22.892  66.634   2.469  1.00 10.49           O  
+ATOM    728  CB  ILE A  93      24.745  68.932   3.406  1.00 13.14           C  
+ATOM    729  CG1 ILE A  93      25.852  69.482   4.320  1.00 14.06           C  
+ATOM    730  CG2 ILE A  93      24.042  70.097   2.677  1.00 14.50           C  
+ATOM    731  CD1 ILE A  93      26.903  70.365   3.678  1.00 15.40           C  
+ATOM    732  N   GLY A  94      21.366  67.912   3.536  1.00 10.62           N  
+ATOM    733  CA  GLY A  94      20.292  67.240   2.765  1.00 12.88           C  
+ATOM    734  C   GLY A  94      19.501  68.350   2.052  1.00 16.16           C  
+ATOM    735  O   GLY A  94      19.190  69.361   2.686  1.00 15.14           O  
+ATOM    736  N   HIS A  95      19.136  68.044   0.795  1.00 13.09           N  
+ATOM    737  CA  HIS A  95      18.354  69.000   0.020  1.00 13.32           C  
+ATOM    738  C   HIS A  95      17.014  68.337  -0.282  1.00 12.35           C  
+ATOM    739  O   HIS A  95      16.868  67.134  -0.584  1.00 11.34           O  
+ATOM    740  CB  HIS A  95      19.055  69.391  -1.297  1.00 15.02           C  
+ATOM    741  CG  HIS A  95      18.167  70.144  -2.238  1.00 16.82           C  
+ATOM    742  ND1 HIS A  95      17.703  69.564  -3.414  1.00 17.88           N  
+ATOM    743  CD2 HIS A  95      17.651  71.394  -2.174  1.00 14.59           C  
+ATOM    744  CE1 HIS A  95      16.917  70.432  -4.040  1.00 18.81           C  
+ATOM    745  NE2 HIS A  95      16.871  71.550  -3.318  1.00 17.88           N  
+ATOM    746  N   SER A  96      15.998  69.172  -0.067  1.00 14.04           N  
+ATOM    747  CA  SER A  96      14.618  68.802  -0.390  1.00 15.68           C  
+ATOM    748  C   SER A  96      14.201  67.538   0.301  1.00 14.88           C  
+ATOM    749  O   SER A  96      14.305  67.430   1.548  1.00 15.16           O  
+ATOM    750  CB  SER A  96      14.612  68.763  -1.957  1.00 15.50           C  
+ATOM    751  OG  SER A  96      13.280  68.544  -2.353  1.00 18.71           O  
+ATOM    752  N   THR A  97      13.778  66.487  -0.386  1.00 15.07           N  
+ATOM    753  CA  THR A  97      13.509  65.168   0.216  1.00 14.67           C  
+ATOM    754  C   THR A  97      14.711  64.635   0.982  1.00 15.48           C  
+ATOM    755  O   THR A  97      14.515  63.911   1.974  1.00 13.67           O  
+ATOM    756  CB  THR A  97      13.245  64.127  -0.904  1.00 15.45           C  
+ATOM    757  OG1 THR A  97      11.997  64.541  -1.527  1.00 18.38           O  
+ATOM    758  CG2 THR A  97      13.111  62.695  -0.449  1.00 15.51           C  
+ATOM    759  N   GLY A  98      15.948  64.972   0.540  1.00 12.55           N  
+ATOM    760  CA  GLY A  98      17.127  64.504   1.268  1.00 13.01           C  
+ATOM    761  C   GLY A  98      17.175  65.171   2.668  1.00 13.48           C  
+ATOM    762  O   GLY A  98      17.769  64.575   3.564  1.00 13.47           O  
+ATOM    763  N   GLY A  99      16.551  66.331   2.823  1.00 11.31           N  
+ATOM    764  CA  GLY A  99      16.509  66.993   4.126  1.00 12.15           C  
+ATOM    765  C   GLY A  99      15.628  66.175   5.084  1.00 14.00           C  
+ATOM    766  O   GLY A  99      16.046  66.003   6.243  1.00 17.52           O  
+ATOM    767  N   GLY A 100      14.603  65.494   4.591  1.00 12.96           N  
+ATOM    768  CA  GLY A 100      13.783  64.630   5.428  1.00 13.74           C  
+ATOM    769  C   GLY A 100      14.562  63.397   5.850  1.00 16.67           C  
+ATOM    770  O   GLY A 100      14.514  62.950   7.015  1.00 12.89           O  
+ATOM    771  N   GLU A 101      15.294  62.790   4.888  1.00 11.79           N  
+ATOM    772  CA  GLU A 101      16.136  61.641   5.177  1.00 12.41           C  
+ATOM    773  C   GLU A 101      17.190  62.010   6.223  1.00 11.59           C  
+ATOM    774  O   GLU A 101      17.465  61.163   7.080  1.00 13.66           O  
+ATOM    775  CB  GLU A 101      16.845  61.224   3.872  1.00 11.32           C  
+ATOM    776  CG  GLU A 101      17.903  60.135   3.989  1.00 12.29           C  
+ATOM    777  CD  GLU A 101      18.353  59.709   2.596  1.00 11.09           C  
+ATOM    778  OE1 GLU A 101      17.684  58.906   1.932  1.00 12.25           O  
+ATOM    779  OE2 GLU A 101      19.368  60.280   2.164  1.00 11.73           O  
+ATOM    780  N   VAL A 102      17.798  63.183   6.104  1.00 12.63           N  
+ATOM    781  CA  VAL A 102      18.799  63.629   7.065  1.00 14.35           C  
+ATOM    782  C   VAL A 102      18.122  63.741   8.461  1.00 16.40           C  
+ATOM    783  O   VAL A 102      18.707  63.289   9.448  1.00 17.06           O  
+ATOM    784  CB  VAL A 102      19.464  64.953   6.700  1.00 13.42           C  
+ATOM    785  CG1 VAL A 102      20.226  65.622   7.859  1.00 14.21           C  
+ATOM    786  CG2 VAL A 102      20.515  64.672   5.568  1.00 13.88           C  
+ATOM    787  N   ALA A 103      16.983  64.407   8.540  1.00 14.66           N  
+ATOM    788  CA  ALA A 103      16.350  64.567   9.878  1.00 16.92           C  
+ATOM    789  C   ALA A 103      16.100  63.217  10.552  1.00 18.96           C  
+ATOM    790  O   ALA A 103      16.526  63.086  11.728  1.00 19.92           O  
+ATOM    791  CB  ALA A 103      15.035  65.312   9.745  1.00 13.74           C  
+ATOM    792  N   ARG A 104      15.546  62.223   9.872  1.00 16.46           N  
+ATOM    793  CA  ARG A 104      15.300  60.914  10.427  1.00 18.30           C  
+ATOM    794  C   ARG A 104      16.570  60.126  10.722  1.00 20.67           C  
+ATOM    795  O   ARG A 104      16.637  59.523  11.812  1.00 21.85           O  
+ATOM    796  CB  ARG A 104      14.374  60.048   9.567  1.00 18.66           C  
+ATOM    797  CG  ARG A 104      14.049  58.698  10.193  1.00 20.98           C  
+ATOM    798  CD  ARG A 104      12.603  58.316  10.017  1.00 21.99           C  
+ATOM    799  NE  ARG A 104      11.671  59.387  10.338  1.00 22.40           N  
+ATOM    800  CZ  ARG A 104      10.379  59.279  10.084  1.00 22.61           C  
+ATOM    801  NH1 ARG A 104       9.932  58.170   9.524  1.00 24.41           N  
+ATOM    802  NH2 ARG A 104       9.556  60.253  10.423  1.00 21.87           N  
+ATOM    803  N   TYR A 105      17.603  60.158   9.873  1.00 16.74           N  
+ATOM    804  CA  TYR A 105      18.826  59.467  10.174  1.00 17.07           C  
+ATOM    805  C   TYR A 105      19.526  60.064  11.388  1.00 17.78           C  
+ATOM    806  O   TYR A 105      20.034  59.322  12.264  1.00 19.08           O  
+ATOM    807  CB  TYR A 105      19.799  59.508   8.959  1.00 15.36           C  
+ATOM    808  CG  TYR A 105      21.215  59.137   9.390  1.00 15.12           C  
+ATOM    809  CD1 TYR A 105      21.508  57.825   9.719  1.00 16.22           C  
+ATOM    810  CD2 TYR A 105      22.214  60.067   9.473  1.00 15.78           C  
+ATOM    811  CE1 TYR A 105      22.791  57.475  10.150  1.00 16.69           C  
+ATOM    812  CE2 TYR A 105      23.511  59.756   9.850  1.00 13.42           C  
+ATOM    813  CZ  TYR A 105      23.779  58.438  10.170  1.00 16.63           C  
+ATOM    814  OH  TYR A 105      25.049  58.067  10.566  1.00 17.46           O  
+ATOM    815  N   VAL A 106      19.649  61.371  11.449  1.00 18.18           N  
+ATOM    816  CA  VAL A 106      20.361  62.081  12.506  1.00 20.66           C  
+ATOM    817  C   VAL A 106      19.665  61.827  13.838  1.00 22.94           C  
+ATOM    818  O   VAL A 106      20.336  61.536  14.817  1.00 23.69           O  
+ATOM    819  CB  VAL A 106      20.542  63.579  12.280  1.00 20.43           C  
+ATOM    820  CG1 VAL A 106      21.154  64.247  13.510  1.00 21.56           C  
+ATOM    821  CG2 VAL A 106      21.526  63.775  11.094  1.00 19.15           C  
+ATOM    822  N   ALA A 107      18.351  61.806  13.873  1.00 22.13           N  
+ATOM    823  CA  ALA A 107      17.619  61.540  15.127  1.00 24.16           C  
+ATOM    824  C   ALA A 107      17.904  60.150  15.661  1.00 24.09           C  
+ATOM    825  O   ALA A 107      17.879  59.949  16.878  1.00 26.11           O  
+ATOM    826  CB  ALA A 107      16.135  61.723  14.786  1.00 21.13           C  
+ATOM    827  N   ARG A 108      18.181  59.164  14.827  1.00 24.23           N  
+ATOM    828  CA  ARG A 108      18.403  57.793  15.229  1.00 27.39           C  
+ATOM    829  C   ARG A 108      19.857  57.319  15.183  1.00 24.90           C  
+ATOM    830  O   ARG A 108      20.095  56.113  15.363  1.00 23.81           O  
+ATOM    831  CB  ARG A 108      17.652  56.917  14.189  1.00 30.03           C  
+ATOM    832  CG  ARG A 108      16.143  56.892  14.376  1.00 35.83           C  
+ATOM    833  CD  ARG A 108      15.500  56.000  13.299  1.00 38.87           C  
+ATOM    834  NE  ARG A 108      14.064  56.229  13.238  1.00 41.87           N  
+ATOM    835  CZ  ARG A 108      13.112  55.774  12.436  1.00 43.22           C  
+ATOM    836  NH1 ARG A 108      13.256  54.906  11.437  1.00 42.75           N  
+ATOM    837  NH2 ARG A 108      11.866  56.217  12.661  1.00 44.61           N  
+ATOM    838  N   ALA A 109      20.781  58.196  14.821  1.00 21.52           N  
+ATOM    839  CA  ALA A 109      22.128  57.736  14.551  1.00 24.73           C  
+ATOM    840  C   ALA A 109      22.839  57.349  15.856  1.00 25.69           C  
+ATOM    841  O   ALA A 109      22.528  57.924  16.900  1.00 23.47           O  
+ATOM    842  CB  ALA A 109      22.905  58.824  13.831  1.00 23.45           C  
+ATOM    843  N   GLU A 110      23.769  56.423  15.755  1.00 28.23           N  
+ATOM    844  CA  GLU A 110      24.601  56.048  16.899  1.00 31.70           C  
+ATOM    845  C   GLU A 110      25.324  57.316  17.323  1.00 32.18           C  
+ATOM    846  O   GLU A 110      25.861  58.036  16.463  1.00 33.02           O  
+ATOM    847  CB  GLU A 110      25.691  55.061  16.459  1.00 35.35           C  
+ATOM    848  CG  GLU A 110      25.247  53.732  15.905  1.00 40.99           C  
+ATOM    849  CD  GLU A 110      26.474  52.906  15.518  1.00 45.41           C  
+ATOM    850  OE1 GLU A 110      27.453  52.903  16.311  1.00 46.51           O  
+ATOM    851  OE2 GLU A 110      26.437  52.312  14.415  1.00 47.09           O  
+ATOM    852  N   PRO A 111      25.385  57.628  18.593  1.00 32.76           N  
+ATOM    853  CA  PRO A 111      26.064  58.859  19.029  1.00 32.92           C  
+ATOM    854  C   PRO A 111      27.525  58.863  18.572  1.00 30.57           C  
+ATOM    855  O   PRO A 111      28.177  57.817  18.417  1.00 28.47           O  
+ATOM    856  CB  PRO A 111      25.832  58.843  20.542  1.00 35.07           C  
+ATOM    857  CG  PRO A 111      24.629  57.971  20.767  1.00 34.07           C  
+ATOM    858  CD  PRO A 111      24.754  56.872  19.718  1.00 33.77           C  
+ATOM    859  N   GLY A 112      28.067  60.009  18.191  1.00 30.19           N  
+ATOM    860  CA  GLY A 112      29.431  60.163  17.673  1.00 29.60           C  
+ATOM    861  C   GLY A 112      29.555  60.103  16.144  1.00 29.16           C  
+ATOM    862  O   GLY A 112      30.480  60.685  15.553  1.00 27.81           O  
+ATOM    863  N   ARG A 113      28.565  59.512  15.468  1.00 26.41           N  
+ATOM    864  CA  ARG A 113      28.576  59.431  14.025  1.00 26.06           C  
+ATOM    865  C   ARG A 113      28.300  60.801  13.383  1.00 23.47           C  
+ATOM    866  O   ARG A 113      28.790  61.008  12.289  1.00 21.34           O  
+ATOM    867  CB  ARG A 113      27.486  58.469  13.573  1.00 28.07           C  
+ATOM    868  CG  ARG A 113      27.700  57.000  13.894  1.00 28.06           C  
+ATOM    869  CD  ARG A 113      28.098  56.271  12.609  1.00 29.02           C  
+ATOM    870  NE  ARG A 113      28.332  54.847  12.862  1.00 30.94           N  
+ATOM    871  CZ  ARG A 113      29.542  54.292  12.942  1.00 31.35           C  
+ATOM    872  NH1 ARG A 113      30.693  54.940  12.771  1.00 29.03           N  
+ATOM    873  NH2 ARG A 113      29.575  52.980  13.180  1.00 31.95           N  
+ATOM    874  N   VAL A 114      27.489  61.652  14.010  1.00 19.46           N  
+ATOM    875  CA  VAL A 114      27.141  62.931  13.415  1.00 17.53           C  
+ATOM    876  C   VAL A 114      27.562  64.113  14.273  1.00 19.91           C  
+ATOM    877  O   VAL A 114      27.231  64.194  15.452  1.00 19.40           O  
+ATOM    878  CB  VAL A 114      25.604  63.059  13.247  1.00 15.39           C  
+ATOM    879  CG1 VAL A 114      25.198  64.377  12.593  1.00 13.59           C  
+ATOM    880  CG2 VAL A 114      25.068  61.889  12.413  1.00 14.34           C  
+ATOM    881  N   ALA A 115      28.163  65.123  13.644  1.00 16.23           N  
+ATOM    882  CA  ALA A 115      28.538  66.316  14.352  1.00 19.35           C  
+ATOM    883  C   ALA A 115      27.535  67.438  14.137  1.00 19.13           C  
+ATOM    884  O   ALA A 115      27.319  68.240  15.040  1.00 18.48           O  
+ATOM    885  CB  ALA A 115      29.903  66.879  13.936  1.00 19.47           C  
+ATOM    886  N   LYS A 116      27.083  67.657  12.889  1.00 19.00           N  
+ATOM    887  CA  LYS A 116      26.223  68.787  12.568  1.00 16.04           C  
+ATOM    888  C   LYS A 116      25.330  68.354  11.382  1.00 16.14           C  
+ATOM    889  O   LYS A 116      25.719  67.411  10.678  1.00 16.69           O  
+ATOM    890  CB  LYS A 116      27.043  69.958  12.040  1.00 20.65           C  
+ATOM    891  CG  LYS A 116      28.035  70.656  12.936  1.00 22.85           C  
+ATOM    892  CD  LYS A 116      28.758  71.804  12.264  1.00 25.09           C  
+ATOM    893  CE  LYS A 116      29.914  72.284  13.163  1.00 28.02           C  
+ATOM    894  NZ  LYS A 116      29.929  73.775  13.090  1.00 31.95           N  
+ATOM    895  N   ALA A 117      24.262  69.074  11.152  1.00 16.05           N  
+ATOM    896  CA  ALA A 117      23.399  68.717  10.002  1.00 15.76           C  
+ATOM    897  C   ALA A 117      22.900  69.977   9.336  1.00 16.26           C  
+ATOM    898  O   ALA A 117      22.890  71.045   9.959  1.00 15.86           O  
+ATOM    899  CB  ALA A 117      22.293  67.767  10.424  1.00 16.07           C  
+ATOM    900  N   VAL A 118      22.578  69.919   8.026  1.00 15.13           N  
+ATOM    901  CA  VAL A 118      22.140  71.108   7.298  1.00 13.37           C  
+ATOM    902  C   VAL A 118      20.890  70.657   6.530  1.00 15.18           C  
+ATOM    903  O   VAL A 118      20.919  69.584   5.885  1.00 15.17           O  
+ATOM    904  CB  VAL A 118      23.178  71.662   6.304  1.00 15.05           C  
+ATOM    905  CG1 VAL A 118      22.614  72.842   5.495  1.00 14.19           C  
+ATOM    906  CG2 VAL A 118      24.502  72.078   6.932  1.00 13.64           C  
+ATOM    907  N   LEU A 119      19.783  71.328   6.638  1.00 14.09           N  
+ATOM    908  CA  LEU A 119      18.560  71.101   5.910  1.00 15.14           C  
+ATOM    909  C   LEU A 119      18.329  72.253   4.919  1.00 15.74           C  
+ATOM    910  O   LEU A 119      18.074  73.387   5.312  1.00 19.06           O  
+ATOM    911  CB  LEU A 119      17.300  71.025   6.790  1.00 17.15           C  
+ATOM    912  CG  LEU A 119      17.423  70.088   8.009  1.00 21.07           C  
+ATOM    913  CD1 LEU A 119      16.113  70.093   8.796  1.00 23.48           C  
+ATOM    914  CD2 LEU A 119      17.921  68.706   7.682  1.00 19.76           C  
+ATOM    915  N   VAL A 120      18.545  71.997   3.640  1.00 16.09           N  
+ATOM    916  CA  VAL A 120      18.399  73.007   2.601  1.00 13.95           C  
+ATOM    917  C   VAL A 120      17.109  72.766   1.821  1.00 14.28           C  
+ATOM    918  O   VAL A 120      16.913  71.663   1.282  1.00 12.45           O  
+ATOM    919  CB  VAL A 120      19.578  72.966   1.595  1.00 16.45           C  
+ATOM    920  CG1 VAL A 120      19.431  74.146   0.623  1.00 14.13           C  
+ATOM    921  CG2 VAL A 120      20.958  72.961   2.231  1.00 14.24           C  
+ATOM    922  N   SER A 121      16.233  73.785   1.746  1.00 13.51           N  
+ATOM    923  CA  SER A 121      14.986  73.663   1.007  1.00 16.25           C  
+ATOM    924  C   SER A 121      14.283  72.381   1.389  1.00 15.98           C  
+ATOM    925  O   SER A 121      13.751  71.670   0.532  1.00 16.42           O  
+ATOM    926  CB  SER A 121      15.274  73.688  -0.529  1.00 15.59           C  
+ATOM    927  OG  SER A 121      16.228  74.729  -0.787  1.00 17.82           O  
+ATOM    928  N   ALA A 122      14.306  71.993   2.677  1.00 15.58           N  
+ATOM    929  CA  ALA A 122      13.901  70.673   3.083  1.00 13.61           C  
+ATOM    930  C   ALA A 122      12.438  70.544   3.422  1.00 15.75           C  
+ATOM    931  O   ALA A 122      11.781  71.492   3.836  1.00 15.81           O  
+ATOM    932  CB  ALA A 122      14.791  70.273   4.278  1.00 14.14           C  
+ATOM    933  N   VAL A 123      11.924  69.312   3.284  1.00 15.36           N  
+ATOM    934  CA  VAL A 123      10.527  69.027   3.512  1.00 18.14           C  
+ATOM    935  C   VAL A 123       9.974  69.164   4.923  1.00 19.99           C  
+ATOM    936  O   VAL A 123       8.776  69.479   5.035  1.00 21.14           O  
+ATOM    937  CB  VAL A 123      10.062  67.644   2.940  1.00 18.42           C  
+ATOM    938  CG1 VAL A 123      10.238  67.646   1.421  1.00 19.16           C  
+ATOM    939  CG2 VAL A 123      10.861  66.474   3.520  1.00 18.69           C  
+ATOM    940  N   PRO A 124      10.721  68.892   5.987  1.00 19.16           N  
+ATOM    941  CA  PRO A 124      10.182  69.032   7.342  1.00 20.59           C  
+ATOM    942  C   PRO A 124       9.628  70.397   7.654  1.00 20.01           C  
+ATOM    943  O   PRO A 124      10.109  71.434   7.171  1.00 22.48           O  
+ATOM    944  CB  PRO A 124      11.392  68.800   8.286  1.00 19.48           C  
+ATOM    945  CG  PRO A 124      12.323  67.936   7.435  1.00 19.07           C  
+ATOM    946  CD  PRO A 124      12.128  68.471   6.025  1.00 18.32           C  
+ATOM    947  N   PRO A 125       8.721  70.443   8.644  1.00 21.76           N  
+ATOM    948  CA  PRO A 125       8.219  69.310   9.380  1.00 20.46           C  
+ATOM    949  C   PRO A 125       7.308  68.302   8.697  1.00 20.38           C  
+ATOM    950  O   PRO A 125       7.375  67.082   8.880  1.00 18.46           O  
+ATOM    951  CB  PRO A 125       7.324  69.985  10.466  1.00 20.66           C  
+ATOM    952  CG  PRO A 125       7.877  71.352  10.605  1.00 22.04           C  
+ATOM    953  CD  PRO A 125       8.255  71.757   9.197  1.00 20.22           C  
+ATOM    954  N   VAL A 126       6.316  68.801   7.967  1.00 19.98           N  
+ATOM    955  CA  VAL A 126       5.353  68.009   7.227  1.00 21.55           C  
+ATOM    956  C   VAL A 126       4.727  68.878   6.123  1.00 22.41           C  
+ATOM    957  O   VAL A 126       4.335  70.045   6.330  1.00 22.55           O  
+ATOM    958  CB  VAL A 126       4.230  67.380   8.073  1.00 24.15           C  
+ATOM    959  CG1 VAL A 126       3.540  68.441   8.942  1.00 24.05           C  
+ATOM    960  CG2 VAL A 126       3.210  66.654   7.208  1.00 24.22           C  
+ATOM    961  N   MET A 127       4.625  68.324   4.915  1.00 20.38           N  
+ATOM    962  CA  MET A 127       4.112  69.139   3.815  1.00 21.43           C  
+ATOM    963  C   MET A 127       2.597  69.118   3.663  1.00 23.72           C  
+ATOM    964  O   MET A 127       2.009  70.163   3.364  1.00 25.21           O  
+ATOM    965  CB  MET A 127       4.718  68.684   2.467  1.00 22.06           C  
+ATOM    966  CG  MET A 127       6.210  69.033   2.339  1.00 23.44           C  
+ATOM    967  SD  MET A 127       6.785  68.631   0.633  1.00 23.31           S  
+ATOM    968  CE  MET A 127       6.062  69.979  -0.273  1.00 22.99           C  
+ATOM    969  N   VAL A 128       2.000  67.948   3.707  1.00 24.76           N  
+ATOM    970  CA  VAL A 128       0.589  67.847   3.367  1.00 26.65           C  
+ATOM    971  C   VAL A 128      -0.316  68.452   4.443  1.00 30.56           C  
+ATOM    972  O   VAL A 128      -0.016  68.420   5.630  1.00 28.24           O  
+ATOM    973  CB  VAL A 128       0.229  66.380   3.125  1.00 26.19           C  
+ATOM    974  CG1 VAL A 128       0.157  65.553   4.402  1.00 25.58           C  
+ATOM    975  CG2 VAL A 128      -1.079  66.284   2.332  1.00 26.20           C  
+ATOM    976  N   LYS A 129      -1.455  68.930   3.955  1.00 33.75           N  
+ATOM    977  CA  LYS A 129      -2.528  69.410   4.811  1.00 37.76           C  
+ATOM    978  C   LYS A 129      -3.114  68.230   5.578  1.00 38.61           C  
+ATOM    979  O   LYS A 129      -3.401  67.151   5.056  1.00 39.57           O  
+ATOM    980  CB  LYS A 129      -3.606  70.087   3.961  1.00 39.66           C  
+ATOM    981  CG  LYS A 129      -4.822  70.488   4.789  1.00 42.50           C  
+ATOM    982  CD  LYS A 129      -5.900  71.086   3.899  1.00 43.45           C  
+ATOM    983  CE  LYS A 129      -5.819  72.598   3.876  1.00 44.88           C  
+ATOM    984  NZ  LYS A 129      -5.178  73.126   2.641  1.00 45.64           N  
+ATOM    985  N   SER A 130      -3.283  68.410   6.883  1.00 38.84           N  
+ATOM    986  CA  SER A 130      -3.854  67.425   7.778  1.00 38.69           C  
+ATOM    987  C   SER A 130      -4.493  68.142   8.982  1.00 39.55           C  
+ATOM    988  O   SER A 130      -4.423  69.362   9.058  1.00 38.38           O  
+ATOM    989  CB  SER A 130      -2.760  66.504   8.347  1.00 37.38           C  
+ATOM    990  OG  SER A 130      -1.819  67.347   9.027  1.00 37.20           O  
+ATOM    991  N   ASP A 131      -4.953  67.365   9.948  1.00 43.09           N  
+ATOM    992  CA  ASP A 131      -5.550  67.875  11.165  1.00 47.90           C  
+ATOM    993  C   ASP A 131      -4.518  68.671  11.989  1.00 48.15           C  
+ATOM    994  O   ASP A 131      -4.889  69.577  12.705  1.00 47.07           O  
+ATOM    995  CB  ASP A 131      -6.077  66.856  12.146  1.00 49.76           C  
+ATOM    996  CG  ASP A 131      -6.898  65.680  11.761  1.00 53.37           C  
+ATOM    997  OD1 ASP A 131      -8.018  65.812  11.202  1.00 54.42           O  
+ATOM    998  OD2 ASP A 131      -6.379  64.566  12.083  1.00 55.34           O  
+ATOM    999  N   THR A 132      -3.268  68.235  11.891  1.00 50.01           N  
+ATOM   1000  CA  THR A 132      -2.186  68.888  12.615  1.00 50.68           C  
+ATOM   1001  C   THR A 132      -1.449  69.908  11.776  1.00 50.61           C  
+ATOM   1002  O   THR A 132      -0.586  70.594  12.349  1.00 52.20           O  
+ATOM   1003  CB  THR A 132      -1.238  67.812  13.162  1.00 52.11           C  
+ATOM   1004  OG1 THR A 132      -0.694  67.033  12.076  1.00 54.39           O  
+ATOM   1005  CG2 THR A 132      -1.995  66.843  14.062  1.00 52.04           C  
+ATOM   1006  N   ASN A 133      -1.786  70.083  10.503  1.00 48.26           N  
+ATOM   1007  CA  ASN A 133      -1.122  71.040   9.629  1.00 47.55           C  
+ATOM   1008  C   ASN A 133      -2.042  71.671   8.597  1.00 49.07           C  
+ATOM   1009  O   ASN A 133      -2.045  71.329   7.408  1.00 48.16           O  
+ATOM   1010  CB  ASN A 133       0.037  70.296   8.925  1.00 45.68           C  
+ATOM   1011  CG  ASN A 133       0.818  71.178   7.974  1.00 44.93           C  
+ATOM   1012  OD1 ASN A 133       1.060  72.351   8.252  1.00 44.22           O  
+ATOM   1013  ND2 ASN A 133       1.215  70.634   6.821  1.00 43.36           N  
+ATOM   1014  N   PRO A 134      -2.842  72.662   8.992  1.00 50.69           N  
+ATOM   1015  CA  PRO A 134      -3.792  73.363   8.147  1.00 50.45           C  
+ATOM   1016  C   PRO A 134      -3.214  74.285   7.093  1.00 50.20           C  
+ATOM   1017  O   PRO A 134      -3.880  74.595   6.098  1.00 50.56           O  
+ATOM   1018  CB  PRO A 134      -4.600  74.225   9.144  1.00 51.82           C  
+ATOM   1019  CG  PRO A 134      -3.567  74.517  10.205  1.00 52.01           C  
+ATOM   1020  CD  PRO A 134      -2.897  73.167  10.405  1.00 51.50           C  
+ATOM   1021  N   ASP A 135      -1.986  74.767   7.250  1.00 49.38           N  
+ATOM   1022  CA  ASP A 135      -1.376  75.621   6.231  1.00 49.28           C  
+ATOM   1023  C   ASP A 135      -0.669  74.792   5.163  1.00 46.05           C  
+ATOM   1024  O   ASP A 135      -0.143  75.332   4.189  1.00 46.07           O  
+ATOM   1025  CB  ASP A 135      -0.421  76.614   6.892  1.00 52.19           C  
+ATOM   1026  CG  ASP A 135      -1.096  77.685   7.735  1.00 55.03           C  
+ATOM   1027  OD1 ASP A 135      -2.344  77.641   7.906  1.00 56.45           O  
+ATOM   1028  OD2 ASP A 135      -0.377  78.592   8.231  1.00 55.00           O  
+ATOM   1029  N   GLY A 136      -0.638  73.472   5.304  1.00 43.89           N  
+ATOM   1030  CA  GLY A 136       0.011  72.587   4.340  1.00 40.79           C  
+ATOM   1031  C   GLY A 136      -0.607  72.638   2.949  1.00 39.43           C  
+ATOM   1032  O   GLY A 136      -1.544  73.385   2.650  1.00 39.15           O  
+ATOM   1033  N   LEU A 137      -0.041  71.877   2.008  1.00 35.97           N  
+ATOM   1034  CA  LEU A 137      -0.546  71.797   0.644  1.00 32.66           C  
+ATOM   1035  C   LEU A 137      -1.582  70.678   0.590  1.00 29.24           C  
+ATOM   1036  O   LEU A 137      -1.435  69.663   1.243  1.00 26.74           O  
+ATOM   1037  CB  LEU A 137       0.577  71.474  -0.348  1.00 32.81           C  
+ATOM   1038  CG  LEU A 137       1.599  72.592  -0.555  1.00 35.09           C  
+ATOM   1039  CD1 LEU A 137       2.843  72.066  -1.253  1.00 34.97           C  
+ATOM   1040  CD2 LEU A 137       0.972  73.766  -1.309  1.00 35.67           C  
+ATOM   1041  N   PRO A 138      -2.652  70.861  -0.170  1.00 29.45           N  
+ATOM   1042  CA  PRO A 138      -3.675  69.844  -0.304  1.00 30.23           C  
+ATOM   1043  C   PRO A 138      -3.107  68.606  -0.990  1.00 31.36           C  
+ATOM   1044  O   PRO A 138      -2.182  68.693  -1.822  1.00 32.13           O  
+ATOM   1045  CB  PRO A 138      -4.783  70.503  -1.102  1.00 29.06           C  
+ATOM   1046  CG  PRO A 138      -4.217  71.741  -1.663  1.00 30.42           C  
+ATOM   1047  CD  PRO A 138      -2.923  72.077  -0.982  1.00 29.28           C  
+ATOM   1048  N   LEU A 139      -3.672  67.458  -0.684  1.00 31.51           N  
+ATOM   1049  CA  LEU A 139      -3.265  66.176  -1.216  1.00 32.88           C  
+ATOM   1050  C   LEU A 139      -3.340  66.131  -2.741  1.00 31.99           C  
+ATOM   1051  O   LEU A 139      -2.504  65.504  -3.406  1.00 28.55           O  
+ATOM   1052  CB  LEU A 139      -4.092  65.037  -0.623  1.00 33.94           C  
+ATOM   1053  CG  LEU A 139      -3.372  63.699  -0.466  1.00 37.35           C  
+ATOM   1054  CD1 LEU A 139      -3.117  63.063  -1.822  1.00 39.86           C  
+ATOM   1055  CD2 LEU A 139      -2.017  63.789   0.231  1.00 37.96           C  
+ATOM   1056  N   GLU A 140      -4.318  66.831  -3.302  1.00 31.28           N  
+ATOM   1057  CA  GLU A 140      -4.527  66.920  -4.732  1.00 34.12           C  
+ATOM   1058  C   GLU A 140      -3.313  67.462  -5.475  1.00 31.45           C  
+ATOM   1059  O   GLU A 140      -3.031  67.028  -6.610  1.00 30.08           O  
+ATOM   1060  CB  GLU A 140      -5.794  67.732  -5.049  1.00 37.68           C  
+ATOM   1061  CG  GLU A 140      -6.040  68.878  -4.111  1.00 43.67           C  
+ATOM   1062  CD  GLU A 140      -7.019  68.713  -2.958  1.00 45.80           C  
+ATOM   1063  OE1 GLU A 140      -7.115  67.641  -2.311  1.00 45.98           O  
+ATOM   1064  OE2 GLU A 140      -7.718  69.740  -2.683  1.00 47.17           O  
+ATOM   1065  N   VAL A 141      -2.523  68.339  -4.866  1.00 28.37           N  
+ATOM   1066  CA  VAL A 141      -1.286  68.790  -5.493  1.00 27.33           C  
+ATOM   1067  C   VAL A 141      -0.410  67.546  -5.757  1.00 25.57           C  
+ATOM   1068  O   VAL A 141       0.194  67.413  -6.827  1.00 25.43           O  
+ATOM   1069  CB  VAL A 141      -0.540  69.789  -4.610  1.00 29.32           C  
+ATOM   1070  CG1 VAL A 141       0.888  70.082  -5.057  1.00 29.44           C  
+ATOM   1071  CG2 VAL A 141      -1.302  71.127  -4.543  1.00 31.16           C  
+ATOM   1072  N   PHE A 142      -0.337  66.631  -4.805  1.00 21.76           N  
+ATOM   1073  CA  PHE A 142       0.516  65.463  -4.882  1.00 21.71           C  
+ATOM   1074  C   PHE A 142      -0.097  64.394  -5.767  1.00 20.83           C  
+ATOM   1075  O   PHE A 142       0.623  63.660  -6.423  1.00 19.11           O  
+ATOM   1076  CB  PHE A 142       0.877  64.900  -3.471  1.00 20.89           C  
+ATOM   1077  CG  PHE A 142       1.543  66.015  -2.693  1.00 20.73           C  
+ATOM   1078  CD1 PHE A 142       2.757  66.537  -3.093  1.00 20.49           C  
+ATOM   1079  CD2 PHE A 142       0.877  66.575  -1.607  1.00 20.60           C  
+ATOM   1080  CE1 PHE A 142       3.325  67.590  -2.410  1.00 22.14           C  
+ATOM   1081  CE2 PHE A 142       1.453  67.642  -0.942  1.00 22.34           C  
+ATOM   1082  CZ  PHE A 142       2.686  68.155  -1.324  1.00 20.93           C  
+ATOM   1083  N   ASP A 143      -1.417  64.311  -5.833  1.00 22.05           N  
+ATOM   1084  CA  ASP A 143      -2.112  63.389  -6.697  1.00 22.94           C  
+ATOM   1085  C   ASP A 143      -1.835  63.782  -8.163  1.00 22.41           C  
+ATOM   1086  O   ASP A 143      -1.703  62.840  -8.927  1.00 23.26           O  
+ATOM   1087  CB  ASP A 143      -3.619  63.441  -6.447  1.00 27.10           C  
+ATOM   1088  CG  ASP A 143      -4.051  62.727  -5.176  1.00 29.44           C  
+ATOM   1089  OD1 ASP A 143      -3.371  61.870  -4.594  1.00 29.15           O  
+ATOM   1090  OD2 ASP A 143      -5.176  63.078  -4.763  1.00 31.30           O  
+ATOM   1091  N   GLU A 144      -1.766  65.045  -8.493  1.00 21.73           N  
+ATOM   1092  CA  GLU A 144      -1.374  65.485  -9.837  1.00 25.52           C  
+ATOM   1093  C   GLU A 144       0.040  65.073 -10.232  1.00 24.13           C  
+ATOM   1094  O   GLU A 144       0.208  64.690 -11.388  1.00 22.40           O  
+ATOM   1095  CB  GLU A 144      -1.421  67.006 -10.030  1.00 28.14           C  
+ATOM   1096  CG  GLU A 144      -2.869  67.480 -10.020  1.00 36.33           C  
+ATOM   1097  CD  GLU A 144      -3.033  68.985 -10.091  1.00 40.88           C  
+ATOM   1098  OE1 GLU A 144      -2.047  69.768  -9.974  1.00 42.24           O  
+ATOM   1099  OE2 GLU A 144      -4.217  69.376 -10.273  1.00 44.88           O  
+ATOM   1100  N   PHE A 145       1.036  65.242  -9.360  1.00 22.28           N  
+ATOM   1101  CA  PHE A 145       2.390  64.743  -9.629  1.00 20.58           C  
+ATOM   1102  C   PHE A 145       2.385  63.240  -9.889  1.00 18.51           C  
+ATOM   1103  O   PHE A 145       2.992  62.744 -10.867  1.00 19.78           O  
+ATOM   1104  CB  PHE A 145       3.316  64.959  -8.436  1.00 22.71           C  
+ATOM   1105  CG  PHE A 145       3.666  66.343  -8.007  1.00 26.44           C  
+ATOM   1106  CD1 PHE A 145       3.575  67.430  -8.857  1.00 27.94           C  
+ATOM   1107  CD2 PHE A 145       4.064  66.546  -6.686  1.00 28.67           C  
+ATOM   1108  CE1 PHE A 145       3.895  68.699  -8.438  1.00 30.51           C  
+ATOM   1109  CE2 PHE A 145       4.391  67.832  -6.253  1.00 31.78           C  
+ATOM   1110  CZ  PHE A 145       4.318  68.909  -7.123  1.00 31.64           C  
+ATOM   1111  N   ARG A 146       1.749  62.471  -8.993  1.00 14.95           N  
+ATOM   1112  CA  ARG A 146       1.594  61.053  -9.210  1.00 16.50           C  
+ATOM   1113  C   ARG A 146       1.000  60.747 -10.594  1.00 16.19           C  
+ATOM   1114  O   ARG A 146       1.537  59.853 -11.263  1.00 16.94           O  
+ATOM   1115  CB  ARG A 146       0.712  60.363  -8.159  1.00 15.44           C  
+ATOM   1116  CG  ARG A 146       1.448  59.903  -6.913  1.00 18.49           C  
+ATOM   1117  CD  ARG A 146       0.522  59.214  -5.904  1.00 19.25           C  
+ATOM   1118  NE  ARG A 146      -0.263  60.147  -5.116  1.00 18.99           N  
+ATOM   1119  CZ  ARG A 146       0.162  60.845  -4.055  1.00 22.00           C  
+ATOM   1120  NH1 ARG A 146       1.417  60.708  -3.589  1.00 20.74           N  
+ATOM   1121  NH2 ARG A 146      -0.666  61.682  -3.424  1.00 19.74           N  
+ATOM   1122  N   ALA A 147      -0.108  61.405 -10.930  1.00 15.41           N  
+ATOM   1123  CA  ALA A 147      -0.742  61.068 -12.224  1.00 16.02           C  
+ATOM   1124  C   ALA A 147       0.098  61.494 -13.424  1.00 15.60           C  
+ATOM   1125  O   ALA A 147       0.205  60.731 -14.389  1.00 15.55           O  
+ATOM   1126  CB  ALA A 147      -2.112  61.756 -12.317  1.00 17.78           C  
+ATOM   1127  N   ALA A 148       0.745  62.663 -13.374  1.00 13.66           N  
+ATOM   1128  CA  ALA A 148       1.608  63.038 -14.492  1.00 13.34           C  
+ATOM   1129  C   ALA A 148       2.797  62.104 -14.625  1.00 15.15           C  
+ATOM   1130  O   ALA A 148       3.231  61.756 -15.756  1.00 14.91           O  
+ATOM   1131  CB  ALA A 148       2.058  64.486 -14.318  1.00 14.20           C  
+ATOM   1132  N   LEU A 149       3.391  61.691 -13.481  1.00 14.37           N  
+ATOM   1133  CA  LEU A 149       4.554  60.815 -13.474  1.00 15.07           C  
+ATOM   1134  C   LEU A 149       4.182  59.482 -14.107  1.00 16.23           C  
+ATOM   1135  O   LEU A 149       4.885  58.970 -14.955  1.00 15.81           O  
+ATOM   1136  CB  LEU A 149       5.075  60.558 -12.059  1.00 16.20           C  
+ATOM   1137  CG  LEU A 149       6.412  59.846 -11.889  1.00 18.76           C  
+ATOM   1138  CD1 LEU A 149       7.086  60.354 -10.615  1.00 17.72           C  
+ATOM   1139  CD2 LEU A 149       6.246  58.348 -11.940  1.00 17.67           C  
+ATOM   1140  N   ALA A 150       3.075  58.893 -13.651  1.00 15.42           N  
+ATOM   1141  CA  ALA A 150       2.615  57.620 -14.189  1.00 15.16           C  
+ATOM   1142  C   ALA A 150       2.230  57.738 -15.673  1.00 13.78           C  
+ATOM   1143  O   ALA A 150       2.514  56.789 -16.397  1.00 19.26           O  
+ATOM   1144  CB  ALA A 150       1.364  57.251 -13.386  1.00 16.42           C  
+ATOM   1145  N   ALA A 151       1.636  58.823 -16.125  1.00 13.40           N  
+ATOM   1146  CA  ALA A 151       1.186  58.908 -17.525  1.00 15.13           C  
+ATOM   1147  C   ALA A 151       2.360  59.061 -18.521  1.00 15.01           C  
+ATOM   1148  O   ALA A 151       2.327  58.380 -19.543  1.00 17.01           O  
+ATOM   1149  CB  ALA A 151       0.202  60.066 -17.659  1.00 16.40           C  
+ATOM   1150  N   ASN A 152       3.331  59.915 -18.248  1.00 12.29           N  
+ATOM   1151  CA  ASN A 152       4.439  60.148 -19.182  1.00 13.18           C  
+ATOM   1152  C   ASN A 152       5.573  60.722 -18.357  1.00 10.57           C  
+ATOM   1153  O   ASN A 152       5.726  61.921 -18.232  1.00 11.29           O  
+ATOM   1154  CB  ASN A 152       3.982  61.130 -20.277  1.00 14.78           C  
+ATOM   1155  CG  ASN A 152       5.036  61.288 -21.358  1.00 16.16           C  
+ATOM   1156  OD1 ASN A 152       6.178  60.853 -21.145  1.00 12.66           O  
+ATOM   1157  ND2 ASN A 152       4.588  61.815 -22.497  1.00 15.63           N  
+ATOM   1158  N   ARG A 153       6.332  59.814 -17.706  1.00  9.65           N  
+ATOM   1159  CA  ARG A 153       7.398  60.294 -16.812  1.00  9.45           C  
+ATOM   1160  C   ARG A 153       8.406  61.123 -17.576  1.00 10.07           C  
+ATOM   1161  O   ARG A 153       8.902  62.130 -17.059  1.00  9.84           O  
+ATOM   1162  CB  ARG A 153       8.047  59.062 -16.122  1.00  9.95           C  
+ATOM   1163  CG  ARG A 153       9.129  59.432 -15.113  1.00 11.95           C  
+ATOM   1164  CD  ARG A 153       9.551  58.224 -14.256  1.00 13.02           C  
+ATOM   1165  NE  ARG A 153      10.347  57.245 -14.983  1.00 10.42           N  
+ATOM   1166  CZ  ARG A 153      11.605  56.976 -14.698  1.00 12.00           C  
+ATOM   1167  NH1 ARG A 153      12.210  57.583 -13.658  1.00 11.11           N  
+ATOM   1168  NH2 ARG A 153      12.259  56.076 -15.418  1.00 11.45           N  
+ATOM   1169  N   ALA A 154       8.807  60.640 -18.788  1.00  9.44           N  
+ATOM   1170  CA  ALA A 154       9.789  61.415 -19.576  1.00  9.28           C  
+ATOM   1171  C   ALA A 154       9.390  62.843 -19.851  1.00  8.79           C  
+ATOM   1172  O   ALA A 154      10.271  63.686 -19.920  1.00  9.13           O  
+ATOM   1173  CB  ALA A 154      10.040  60.700 -20.903  1.00  9.50           C  
+ATOM   1174  N   GLN A 155       8.137  63.191 -20.063  1.00  9.37           N  
+ATOM   1175  CA  GLN A 155       7.712  64.565 -20.311  1.00 10.37           C  
+ATOM   1176  C   GLN A 155       7.519  65.339 -19.000  1.00  9.78           C  
+ATOM   1177  O   GLN A 155       7.921  66.483 -18.873  1.00 11.62           O  
+ATOM   1178  CB  GLN A 155       6.341  64.590 -21.027  1.00 10.74           C  
+ATOM   1179  CG  GLN A 155       5.909  66.003 -21.439  1.00  9.94           C  
+ATOM   1180  CD  GLN A 155       6.902  66.609 -22.400  1.00 11.90           C  
+ATOM   1181  OE1 GLN A 155       7.337  65.974 -23.381  1.00 14.39           O  
+ATOM   1182  NE2 GLN A 155       7.351  67.806 -22.090  1.00 12.98           N  
+ATOM   1183  N   PHE A 156       7.013  64.634 -17.972  1.00 10.53           N  
+ATOM   1184  CA  PHE A 156       6.839  65.277 -16.659  1.00 11.74           C  
+ATOM   1185  C   PHE A 156       8.203  65.727 -16.154  1.00  9.48           C  
+ATOM   1186  O   PHE A 156       8.397  66.768 -15.554  1.00 10.94           O  
+ATOM   1187  CB  PHE A 156       6.256  64.245 -15.646  1.00 12.12           C  
+ATOM   1188  CG  PHE A 156       6.000  64.794 -14.241  1.00 13.48           C  
+ATOM   1189  CD1 PHE A 156       5.211  65.908 -14.082  1.00 13.11           C  
+ATOM   1190  CD2 PHE A 156       6.477  64.155 -13.111  1.00 15.50           C  
+ATOM   1191  CE1 PHE A 156       4.970  66.445 -12.813  1.00 15.16           C  
+ATOM   1192  CE2 PHE A 156       6.204  64.647 -11.834  1.00 13.39           C  
+ATOM   1193  CZ  PHE A 156       5.465  65.796 -11.690  1.00 13.21           C  
+ATOM   1194  N   TYR A 157       9.294  64.964 -16.487  1.00  9.39           N  
+ATOM   1195  CA  TYR A 157      10.626  65.323 -15.969  1.00  8.62           C  
+ATOM   1196  C   TYR A 157      11.296  66.373 -16.831  1.00 10.81           C  
+ATOM   1197  O   TYR A 157      12.368  66.844 -16.467  1.00  9.98           O  
+ATOM   1198  CB  TYR A 157      11.523  64.093 -15.831  1.00  8.88           C  
+ATOM   1199  CG  TYR A 157      11.170  63.193 -14.660  1.00 10.44           C  
+ATOM   1200  CD1 TYR A 157      10.110  63.418 -13.807  1.00 11.47           C  
+ATOM   1201  CD2 TYR A 157      12.026  62.108 -14.415  1.00 11.17           C  
+ATOM   1202  CE1 TYR A 157       9.883  62.572 -12.727  1.00 12.14           C  
+ATOM   1203  CE2 TYR A 157      11.781  61.252 -13.378  1.00 12.49           C  
+ATOM   1204  CZ  TYR A 157      10.724  61.517 -12.513  1.00 13.38           C  
+ATOM   1205  OH  TYR A 157      10.501  60.602 -11.501  1.00 13.61           O  
+ATOM   1206  N   ILE A 158      10.671  66.837 -17.923  1.00 11.10           N  
+ATOM   1207  CA  ILE A 158      11.089  68.071 -18.598  1.00 12.31           C  
+ATOM   1208  C   ILE A 158      10.292  69.254 -17.938  1.00 11.59           C  
+ATOM   1209  O   ILE A 158      10.835  70.306 -17.575  1.00 11.49           O  
+ATOM   1210  CB  ILE A 158      10.750  68.081 -20.098  1.00 14.66           C  
+ATOM   1211  CG1 ILE A 158      11.572  66.972 -20.802  1.00 15.74           C  
+ATOM   1212  CG2 ILE A 158      10.961  69.479 -20.712  1.00 14.05           C  
+ATOM   1213  CD1 ILE A 158      11.294  66.947 -22.300  1.00 13.62           C  
+ATOM   1214  N   ASP A 159       9.015  69.001 -17.726  1.00 11.12           N  
+ATOM   1215  CA  ASP A 159       8.133  70.029 -17.174  1.00 14.77           C  
+ATOM   1216  C   ASP A 159       8.546  70.562 -15.812  1.00 14.63           C  
+ATOM   1217  O   ASP A 159       8.522  71.789 -15.625  1.00 14.25           O  
+ATOM   1218  CB  ASP A 159       6.680  69.568 -17.124  1.00 16.02           C  
+ATOM   1219  CG  ASP A 159       6.089  69.272 -18.514  1.00 18.51           C  
+ATOM   1220  OD1 ASP A 159       6.635  69.648 -19.554  1.00 16.93           O  
+ATOM   1221  OD2 ASP A 159       5.053  68.602 -18.482  1.00 21.22           O  
+ATOM   1222  N   VAL A 160       8.925  69.692 -14.850  1.00 12.85           N  
+ATOM   1223  CA  VAL A 160       9.310  70.214 -13.540  1.00 11.22           C  
+ATOM   1224  C   VAL A 160      10.503  71.122 -13.472  1.00 12.66           C  
+ATOM   1225  O   VAL A 160      10.469  72.246 -12.937  1.00 13.19           O  
+ATOM   1226  CB  VAL A 160       9.428  68.997 -12.593  1.00 11.11           C  
+ATOM   1227  CG1 VAL A 160       9.929  69.425 -11.226  1.00 11.13           C  
+ATOM   1228  CG2 VAL A 160       8.091  68.302 -12.477  1.00 11.30           C  
+ATOM   1229  N   PRO A 161      11.685  70.742 -14.006  1.00 12.43           N  
+ATOM   1230  CA  PRO A 161      12.865  71.568 -14.015  1.00  9.91           C  
+ATOM   1231  C   PRO A 161      12.738  72.752 -14.967  1.00 11.78           C  
+ATOM   1232  O   PRO A 161      13.416  73.744 -14.772  1.00 12.50           O  
+ATOM   1233  CB  PRO A 161      13.986  70.622 -14.404  1.00 11.67           C  
+ATOM   1234  CG  PRO A 161      13.286  69.625 -15.276  1.00 11.08           C  
+ATOM   1235  CD  PRO A 161      11.920  69.391 -14.600  1.00 11.57           C  
+ATOM   1236  N   SER A 162      11.928  72.722 -16.013  1.00 14.47           N  
+ATOM   1237  CA  SER A 162      11.728  73.853 -16.910  1.00 15.87           C  
+ATOM   1238  C   SER A 162      10.859  74.906 -16.214  1.00 16.10           C  
+ATOM   1239  O   SER A 162      10.962  76.062 -16.524  1.00 17.75           O  
+ATOM   1240  CB  SER A 162      10.907  73.440 -18.163  1.00 15.71           C  
+ATOM   1241  OG  SER A 162      11.778  72.620 -18.953  1.00 17.94           O  
+ATOM   1242  N   GLY A 163      10.051  74.517 -15.251  1.00 16.08           N  
+ATOM   1243  CA  GLY A 163       9.114  75.422 -14.610  1.00 15.70           C  
+ATOM   1244  C   GLY A 163       9.439  75.796 -13.184  1.00 13.60           C  
+ATOM   1245  O   GLY A 163      10.290  76.646 -12.907  1.00 17.17           O  
+ATOM   1246  N   PRO A 164       8.868  75.092 -12.239  1.00 13.87           N  
+ATOM   1247  CA  PRO A 164       9.008  75.470 -10.837  1.00 16.88           C  
+ATOM   1248  C   PRO A 164      10.303  75.134 -10.124  1.00 15.68           C  
+ATOM   1249  O   PRO A 164      10.732  75.912  -9.280  1.00 18.25           O  
+ATOM   1250  CB  PRO A 164       7.861  74.726 -10.159  1.00 15.51           C  
+ATOM   1251  CG  PRO A 164       7.482  73.607 -11.078  1.00 16.56           C  
+ATOM   1252  CD  PRO A 164       7.838  74.033 -12.470  1.00 13.98           C  
+ATOM   1253  N   PHE A 165      10.976  74.030 -10.462  1.00 12.34           N  
+ATOM   1254  CA  PHE A 165      12.148  73.659  -9.622  1.00 10.59           C  
+ATOM   1255  C   PHE A 165      13.198  74.691  -9.452  1.00 12.15           C  
+ATOM   1256  O   PHE A 165      13.771  74.818  -8.345  1.00 11.34           O  
+ATOM   1257  CB  PHE A 165      12.687  72.322 -10.141  1.00 10.42           C  
+ATOM   1258  CG  PHE A 165      13.442  71.439  -9.175  1.00 11.90           C  
+ATOM   1259  CD1 PHE A 165      14.778  71.695  -8.921  1.00 10.94           C  
+ATOM   1260  CD2 PHE A 165      12.765  70.417  -8.530  1.00 10.90           C  
+ATOM   1261  CE1 PHE A 165      15.483  70.894  -8.028  1.00 10.77           C  
+ATOM   1262  CE2 PHE A 165      13.485  69.589  -7.619  1.00 11.84           C  
+ATOM   1263  CZ  PHE A 165      14.809  69.854  -7.408  1.00 10.14           C  
+ATOM   1264  N   TYR A 166      13.663  75.363 -10.531  1.00 10.46           N  
+ATOM   1265  CA  TYR A 166      14.773  76.252 -10.531  1.00 10.78           C  
+ATOM   1266  C   TYR A 166      14.304  77.687 -10.721  1.00 12.77           C  
+ATOM   1267  O   TYR A 166      15.122  78.569 -10.885  1.00 12.36           O  
+ATOM   1268  CB  TYR A 166      15.787  75.939 -11.692  1.00 11.17           C  
+ATOM   1269  CG  TYR A 166      16.528  74.625 -11.458  1.00 11.96           C  
+ATOM   1270  CD1 TYR A 166      17.380  74.452 -10.368  1.00  9.60           C  
+ATOM   1271  CD2 TYR A 166      16.345  73.558 -12.345  1.00 11.53           C  
+ATOM   1272  CE1 TYR A 166      18.063  73.266 -10.197  1.00 11.76           C  
+ATOM   1273  CE2 TYR A 166      17.009  72.369 -12.141  1.00 10.68           C  
+ATOM   1274  CZ  TYR A 166      17.843  72.214 -11.080  1.00 12.29           C  
+ATOM   1275  OH  TYR A 166      18.480  71.014 -10.899  1.00 12.68           O  
+ATOM   1276  N   GLY A 167      12.999  77.909 -10.657  1.00 15.04           N  
+ATOM   1277  CA  GLY A 167      12.464  79.276 -10.833  1.00 15.35           C  
+ATOM   1278  C   GLY A 167      12.686  79.797 -12.233  1.00 18.42           C  
+ATOM   1279  O   GLY A 167      12.609  81.029 -12.452  1.00 18.56           O  
+ATOM   1280  N   PHE A 168      12.913  78.946 -13.257  1.00 16.77           N  
+ATOM   1281  CA  PHE A 168      13.139  79.499 -14.597  1.00 17.30           C  
+ATOM   1282  C   PHE A 168      11.827  80.019 -15.198  1.00 18.88           C  
+ATOM   1283  O   PHE A 168      11.829  80.544 -16.321  1.00 20.43           O  
+ATOM   1284  CB  PHE A 168      13.741  78.420 -15.516  1.00 13.57           C  
+ATOM   1285  CG  PHE A 168      15.090  77.911 -15.125  1.00 12.80           C  
+ATOM   1286  CD1 PHE A 168      15.968  78.689 -14.402  1.00 12.39           C  
+ATOM   1287  CD2 PHE A 168      15.496  76.641 -15.519  1.00 13.54           C  
+ATOM   1288  CE1 PHE A 168      17.235  78.262 -14.064  1.00 13.46           C  
+ATOM   1289  CE2 PHE A 168      16.756  76.190 -15.161  1.00 13.74           C  
+ATOM   1290  CZ  PHE A 168      17.634  77.005 -14.447  1.00 15.04           C  
+ATOM   1291  N   ASN A 169      10.683  79.833 -14.579  1.00 19.48           N  
+ATOM   1292  CA  ASN A 169       9.430  80.400 -15.026  1.00 19.75           C  
+ATOM   1293  C   ASN A 169       9.268  81.820 -14.475  1.00 22.95           C  
+ATOM   1294  O   ASN A 169       8.198  82.390 -14.727  1.00 25.06           O  
+ATOM   1295  CB  ASN A 169       8.225  79.540 -14.653  1.00 18.97           C  
+ATOM   1296  CG  ASN A 169       8.138  79.306 -13.144  1.00 19.69           C  
+ATOM   1297  OD1 ASN A 169       8.983  79.792 -12.369  1.00 19.38           O  
+ATOM   1298  ND2 ASN A 169       7.139  78.551 -12.712  1.00 20.25           N  
+ATOM   1299  N   ARG A 170      10.204  82.385 -13.737  1.00 23.31           N  
+ATOM   1300  CA  ARG A 170      10.128  83.741 -13.239  1.00 26.22           C  
+ATOM   1301  C   ARG A 170      10.757  84.695 -14.256  1.00 29.13           C  
+ATOM   1302  O   ARG A 170      11.840  84.460 -14.818  1.00 28.21           O  
+ATOM   1303  CB  ARG A 170      10.945  83.901 -11.942  1.00 26.41           C  
+ATOM   1304  CG  ARG A 170      10.421  83.225 -10.688  1.00 26.12           C  
+ATOM   1305  CD  ARG A 170       8.948  83.458 -10.439  1.00 27.65           C  
+ATOM   1306  NE  ARG A 170       8.461  82.948  -9.166  1.00 28.05           N  
+ATOM   1307  CZ  ARG A 170       7.304  82.334  -8.992  1.00 26.76           C  
+ATOM   1308  NH1 ARG A 170       6.476  82.167 -10.018  1.00 28.15           N  
+ATOM   1309  NH2 ARG A 170       6.945  81.890  -7.789  1.00 28.29           N  
+ATOM   1310  N   GLU A 171      10.145  85.866 -14.406  1.00 31.67           N  
+ATOM   1311  CA  GLU A 171      10.681  86.880 -15.319  1.00 34.31           C  
+ATOM   1312  C   GLU A 171      12.058  87.315 -14.869  1.00 32.61           C  
+ATOM   1313  O   GLU A 171      12.327  87.492 -13.675  1.00 32.62           O  
+ATOM   1314  CB  GLU A 171       9.723  88.065 -15.395  1.00 38.74           C  
+ATOM   1315  CG  GLU A 171       9.948  88.980 -16.605  1.00 44.51           C  
+ATOM   1316  CD  GLU A 171       9.069  90.213 -16.402  1.00 48.11           C  
+ATOM   1317  OE1 GLU A 171       7.851  90.025 -16.152  1.00 49.29           O  
+ATOM   1318  OE2 GLU A 171       9.609  91.345 -16.463  1.00 50.71           O  
+ATOM   1319  N   GLY A 172      12.982  87.400 -15.819  1.00 32.49           N  
+ATOM   1320  CA  GLY A 172      14.336  87.855 -15.516  1.00 32.07           C  
+ATOM   1321  C   GLY A 172      15.282  86.815 -14.974  1.00 31.91           C  
+ATOM   1322  O   GLY A 172      16.459  87.097 -14.734  1.00 33.27           O  
+ATOM   1323  N   ALA A 173      14.828  85.556 -14.816  1.00 30.17           N  
+ATOM   1324  CA  ALA A 173      15.752  84.549 -14.292  1.00 27.07           C  
+ATOM   1325  C   ALA A 173      16.775  84.203 -15.361  1.00 24.53           C  
+ATOM   1326  O   ALA A 173      16.487  84.219 -16.546  1.00 25.51           O  
+ATOM   1327  CB  ALA A 173      15.000  83.283 -13.904  1.00 25.63           C  
+ATOM   1328  N   THR A 174      17.932  83.752 -14.951  1.00 22.90           N  
+ATOM   1329  CA  THR A 174      18.928  83.202 -15.841  1.00 22.99           C  
+ATOM   1330  C   THR A 174      18.583  81.726 -16.073  1.00 23.99           C  
+ATOM   1331  O   THR A 174      18.592  80.919 -15.125  1.00 24.96           O  
+ATOM   1332  CB  THR A 174      20.312  83.282 -15.204  1.00 25.97           C  
+ATOM   1333  OG1 THR A 174      20.521  84.676 -14.873  1.00 30.01           O  
+ATOM   1334  CG2 THR A 174      21.319  82.728 -16.197  1.00 25.88           C  
+ATOM   1335  N   VAL A 175      18.273  81.328 -17.286  1.00 21.03           N  
+ATOM   1336  CA  VAL A 175      17.909  79.949 -17.552  1.00 20.73           C  
+ATOM   1337  C   VAL A 175      19.121  79.152 -18.014  1.00 22.27           C  
+ATOM   1338  O   VAL A 175      19.899  79.639 -18.845  1.00 24.88           O  
+ATOM   1339  CB  VAL A 175      16.759  79.908 -18.532  1.00 21.57           C  
+ATOM   1340  CG1 VAL A 175      16.286  78.467 -18.747  1.00 22.84           C  
+ATOM   1341  CG2 VAL A 175      15.576  80.732 -17.996  1.00 21.51           C  
+ATOM   1342  N   SER A 176      19.350  77.969 -17.430  1.00 18.64           N  
+ATOM   1343  CA  SER A 176      20.483  77.183 -17.964  1.00 16.78           C  
+ATOM   1344  C   SER A 176      19.890  75.925 -18.536  1.00 16.00           C  
+ATOM   1345  O   SER A 176      19.319  75.128 -17.780  1.00 14.12           O  
+ATOM   1346  CB  SER A 176      21.452  76.900 -16.810  1.00 19.20           C  
+ATOM   1347  OG  SER A 176      22.314  75.823 -17.131  1.00 21.14           O  
+ATOM   1348  N   GLN A 177      19.977  75.667 -19.843  1.00 14.92           N  
+ATOM   1349  CA  GLN A 177      19.442  74.434 -20.420  1.00 14.44           C  
+ATOM   1350  C   GLN A 177      20.191  73.241 -19.783  1.00 13.19           C  
+ATOM   1351  O   GLN A 177      19.582  72.186 -19.653  1.00 13.85           O  
+ATOM   1352  CB  GLN A 177      19.757  74.419 -21.930  1.00 16.12           C  
+ATOM   1353  CG  GLN A 177      19.085  73.308 -22.712  1.00 20.11           C  
+ATOM   1354  CD  GLN A 177      17.574  73.256 -22.528  1.00 22.45           C  
+ATOM   1355  OE1 GLN A 177      16.935  74.312 -22.627  1.00 22.84           O  
+ATOM   1356  NE2 GLN A 177      16.981  72.095 -22.254  1.00 20.44           N  
+ATOM   1357  N   GLY A 178      21.459  73.432 -19.453  1.00 10.51           N  
+ATOM   1358  CA  GLY A 178      22.223  72.341 -18.829  1.00 11.89           C  
+ATOM   1359  C   GLY A 178      21.577  71.808 -17.560  1.00 12.67           C  
+ATOM   1360  O   GLY A 178      21.528  70.599 -17.310  1.00 11.81           O  
+ATOM   1361  N   LEU A 179      21.088  72.738 -16.710  1.00 10.92           N  
+ATOM   1362  CA  LEU A 179      20.479  72.322 -15.433  1.00 13.02           C  
+ATOM   1363  C   LEU A 179      19.204  71.553 -15.733  1.00 11.34           C  
+ATOM   1364  O   LEU A 179      18.899  70.575 -15.080  1.00 11.30           O  
+ATOM   1365  CB  LEU A 179      20.235  73.531 -14.526  1.00 12.08           C  
+ATOM   1366  CG  LEU A 179      21.538  74.187 -13.986  1.00 12.17           C  
+ATOM   1367  CD1 LEU A 179      21.116  75.288 -12.986  1.00 13.45           C  
+ATOM   1368  CD2 LEU A 179      22.423  73.181 -13.302  1.00 12.26           C  
+ATOM   1369  N   ILE A 180      18.407  72.020 -16.673  1.00  9.92           N  
+ATOM   1370  CA  ILE A 180      17.211  71.274 -17.084  1.00 10.91           C  
+ATOM   1371  C   ILE A 180      17.512  69.852 -17.555  1.00  9.25           C  
+ATOM   1372  O   ILE A 180      16.937  68.845 -17.076  1.00 11.55           O  
+ATOM   1373  CB  ILE A 180      16.452  72.015 -18.204  1.00 12.44           C  
+ATOM   1374  CG1 ILE A 180      16.020  73.421 -17.682  1.00 12.77           C  
+ATOM   1375  CG2 ILE A 180      15.240  71.187 -18.595  1.00 12.48           C  
+ATOM   1376  CD1 ILE A 180      15.408  74.297 -18.803  1.00 13.61           C  
+ATOM   1377  N   ASP A 181      18.442  69.744 -18.506  1.00  7.41           N  
+ATOM   1378  CA  ASP A 181      18.764  68.454 -19.090  1.00  8.73           C  
+ATOM   1379  C   ASP A 181      19.405  67.513 -18.048  1.00  8.90           C  
+ATOM   1380  O   ASP A 181      19.099  66.331 -18.061  1.00  9.63           O  
+ATOM   1381  CB  ASP A 181      19.726  68.557 -20.286  1.00  9.91           C  
+ATOM   1382  CG  ASP A 181      19.132  69.371 -21.466  1.00 14.59           C  
+ATOM   1383  OD1 ASP A 181      17.919  69.647 -21.490  1.00 12.65           O  
+ATOM   1384  OD2 ASP A 181      20.013  69.724 -22.304  1.00 15.86           O  
+ATOM   1385  N   HIS A 182      20.242  68.041 -17.182  1.00  9.27           N  
+ATOM   1386  CA  HIS A 182      20.826  67.163 -16.146  1.00  7.11           C  
+ATOM   1387  C   HIS A 182      19.775  66.675 -15.167  1.00  8.04           C  
+ATOM   1388  O   HIS A 182      19.841  65.538 -14.689  1.00 11.75           O  
+ATOM   1389  CB  HIS A 182      21.940  67.904 -15.391  1.00  6.65           C  
+ATOM   1390  CG  HIS A 182      22.826  66.915 -14.649  1.00 10.34           C  
+ATOM   1391  ND1 HIS A 182      23.573  67.304 -13.582  1.00 10.88           N  
+ATOM   1392  CD2 HIS A 182      23.079  65.590 -14.829  1.00 10.02           C  
+ATOM   1393  CE1 HIS A 182      24.287  66.280 -13.134  1.00 10.72           C  
+ATOM   1394  NE2 HIS A 182      23.991  65.223 -13.875  1.00 10.31           N  
+ATOM   1395  N   TRP A 183      18.799  67.492 -14.818  1.00  8.64           N  
+ATOM   1396  CA  TRP A 183      17.742  67.036 -13.890  1.00  9.94           C  
+ATOM   1397  C   TRP A 183      17.008  65.867 -14.517  1.00  9.97           C  
+ATOM   1398  O   TRP A 183      16.703  64.790 -13.960  1.00  8.51           O  
+ATOM   1399  CB  TRP A 183      16.859  68.266 -13.597  1.00  7.17           C  
+ATOM   1400  CG  TRP A 183      15.831  68.172 -12.524  1.00  8.96           C  
+ATOM   1401  CD1 TRP A 183      15.894  68.916 -11.364  1.00  9.78           C  
+ATOM   1402  CD2 TRP A 183      14.606  67.449 -12.427  1.00  9.64           C  
+ATOM   1403  NE1 TRP A 183      14.791  68.653 -10.573  1.00 10.40           N  
+ATOM   1404  CE2 TRP A 183      13.982  67.779 -11.201  1.00  9.11           C  
+ATOM   1405  CE3 TRP A 183      13.925  66.582 -13.292  1.00  8.09           C  
+ATOM   1406  CZ2 TRP A 183      12.738  67.272 -10.808  1.00 11.24           C  
+ATOM   1407  CZ3 TRP A 183      12.737  66.018 -12.906  1.00  9.24           C  
+ATOM   1408  CH2 TRP A 183      12.120  66.372 -11.665  1.00 12.29           C  
+ATOM   1409  N   TRP A 184      16.643  66.082 -15.783  1.00  8.52           N  
+ATOM   1410  CA  TRP A 184      15.920  65.065 -16.562  1.00  9.38           C  
+ATOM   1411  C   TRP A 184      16.713  63.754 -16.614  1.00  7.61           C  
+ATOM   1412  O   TRP A 184      16.143  62.696 -16.479  1.00  8.91           O  
+ATOM   1413  CB  TRP A 184      15.701  65.630 -18.008  1.00  9.25           C  
+ATOM   1414  CG  TRP A 184      14.886  64.663 -18.857  1.00 11.21           C  
+ATOM   1415  CD1 TRP A 184      13.529  64.560 -18.972  1.00 11.89           C  
+ATOM   1416  CD2 TRP A 184      15.424  63.658 -19.739  1.00 10.38           C  
+ATOM   1417  NE1 TRP A 184      13.195  63.524 -19.839  1.00  9.26           N  
+ATOM   1418  CE2 TRP A 184      14.352  62.989 -20.326  1.00  9.95           C  
+ATOM   1419  CE3 TRP A 184      16.757  63.294 -20.054  1.00 12.74           C  
+ATOM   1420  CZ2 TRP A 184      14.525  61.932 -21.241  1.00 11.15           C  
+ATOM   1421  CZ3 TRP A 184      16.946  62.252 -20.973  1.00 11.45           C  
+ATOM   1422  CH2 TRP A 184      15.819  61.608 -21.567  1.00 12.34           C  
+ATOM   1423  N   LEU A 185      17.999  63.833 -16.876  1.00  6.27           N  
+ATOM   1424  CA  LEU A 185      18.793  62.596 -17.049  1.00 10.24           C  
+ATOM   1425  C   LEU A 185      18.837  61.838 -15.719  1.00 10.43           C  
+ATOM   1426  O   LEU A 185      18.628  60.635 -15.698  1.00 10.91           O  
+ATOM   1427  CB  LEU A 185      20.218  62.983 -17.434  1.00 10.32           C  
+ATOM   1428  CG  LEU A 185      21.262  61.854 -17.427  1.00 11.18           C  
+ATOM   1429  CD1 LEU A 185      20.894  60.860 -18.551  1.00 12.36           C  
+ATOM   1430  CD2 LEU A 185      22.685  62.375 -17.666  1.00 10.10           C  
+ATOM   1431  N   GLN A 186      19.103  62.572 -14.626  1.00  8.89           N  
+ATOM   1432  CA  GLN A 186      19.199  61.907 -13.327  1.00  9.70           C  
+ATOM   1433  C   GLN A 186      17.846  61.266 -12.990  1.00  8.06           C  
+ATOM   1434  O   GLN A 186      17.798  60.153 -12.448  1.00  9.13           O  
+ATOM   1435  CB  GLN A 186      19.560  62.896 -12.199  1.00  9.42           C  
+ATOM   1436  CG  GLN A 186      20.957  63.535 -12.355  1.00  9.12           C  
+ATOM   1437  CD  GLN A 186      21.146  64.513 -11.195  1.00 11.83           C  
+ATOM   1438  OE1 GLN A 186      21.292  64.093 -10.032  1.00 11.79           O  
+ATOM   1439  NE2 GLN A 186      21.012  65.788 -11.535  1.00 10.13           N  
+ATOM   1440  N   GLY A 187      16.772  61.955 -13.267  1.00  8.35           N  
+ATOM   1441  CA  GLY A 187      15.461  61.414 -13.026  1.00  8.49           C  
+ATOM   1442  C   GLY A 187      15.194  60.162 -13.852  1.00  8.16           C  
+ATOM   1443  O   GLY A 187      14.716  59.112 -13.356  1.00  8.16           O  
+ATOM   1444  N   MET A 188      15.512  60.205 -15.135  1.00  9.94           N  
+ATOM   1445  CA  MET A 188      15.162  59.076 -16.026  1.00 12.01           C  
+ATOM   1446  C   MET A 188      16.050  57.871 -15.686  1.00 10.90           C  
+ATOM   1447  O   MET A 188      15.635  56.733 -15.965  1.00 13.40           O  
+ATOM   1448  CB  MET A 188      15.294  59.472 -17.494  1.00 12.71           C  
+ATOM   1449  CG  MET A 188      14.215  60.423 -18.048  1.00 13.39           C  
+ATOM   1450  SD  MET A 188      12.566  60.130 -17.425  1.00 15.53           S  
+ATOM   1451  CE  MET A 188      12.044  58.633 -18.268  1.00 14.29           C  
+ATOM   1452  N   MET A 189      17.237  58.080 -15.096  1.00 11.10           N  
+ATOM   1453  CA  MET A 189      18.030  56.919 -14.654  1.00 14.24           C  
+ATOM   1454  C   MET A 189      17.366  56.122 -13.534  1.00 12.37           C  
+ATOM   1455  O   MET A 189      17.601  54.901 -13.419  1.00 11.72           O  
+ATOM   1456  CB  MET A 189      19.440  57.310 -14.176  1.00 16.66           C  
+ATOM   1457  CG  MET A 189      20.245  58.044 -15.255  1.00 28.15           C  
+ATOM   1458  SD  MET A 189      21.010  56.974 -16.498  1.00 40.58           S  
+ATOM   1459  CE  MET A 189      19.638  56.414 -17.489  1.00 38.46           C  
+ATOM   1460  N   GLY A 190      16.678  56.814 -12.625  1.00 10.17           N  
+ATOM   1461  CA  GLY A 190      16.046  56.099 -11.531  1.00  9.20           C  
+ATOM   1462  C   GLY A 190      14.771  55.361 -11.921  1.00 11.93           C  
+ATOM   1463  O   GLY A 190      14.229  55.469 -13.014  1.00 10.60           O  
+ATOM   1464  N   ALA A 191      14.226  54.617 -10.962  1.00 11.31           N  
+ATOM   1465  CA  ALA A 191      13.091  53.725 -11.178  1.00 10.61           C  
+ATOM   1466  C   ALA A 191      11.760  54.417 -11.063  1.00 11.13           C  
+ATOM   1467  O   ALA A 191      11.487  55.155 -10.092  1.00 11.13           O  
+ATOM   1468  CB  ALA A 191      13.107  52.641 -10.089  1.00 11.42           C  
+ATOM   1469  N   ALA A 192      10.862  54.066 -11.979  1.00  9.45           N  
+ATOM   1470  CA  ALA A 192       9.531  54.735 -11.912  1.00 11.53           C  
+ATOM   1471  C   ALA A 192       8.732  54.395 -10.649  1.00 10.83           C  
+ATOM   1472  O   ALA A 192       8.132  55.314 -10.072  1.00 11.89           O  
+ATOM   1473  CB  ALA A 192       8.751  54.335 -13.177  1.00  9.77           C  
+ATOM   1474  N   ASN A 193       8.846  53.171 -10.144  1.00 10.66           N  
+ATOM   1475  CA  ASN A 193       8.076  52.841  -8.909  1.00 12.75           C  
+ATOM   1476  C   ASN A 193       8.661  53.572  -7.696  1.00 12.52           C  
+ATOM   1477  O   ASN A 193       7.890  54.174  -6.932  1.00 13.42           O  
+ATOM   1478  CB  ASN A 193       7.997  51.329  -8.712  1.00 11.36           C  
+ATOM   1479  CG  ASN A 193       9.355  50.722  -8.356  1.00 13.45           C  
+ATOM   1480  OD1 ASN A 193      10.445  51.187  -8.706  1.00 11.68           O  
+ATOM   1481  ND2 ASN A 193       9.298  49.706  -7.493  1.00 13.73           N  
+ATOM   1482  N   ALA A 194       9.985  53.589  -7.572  1.00 11.34           N  
+ATOM   1483  CA  ALA A 194      10.570  54.387  -6.453  1.00 13.24           C  
+ATOM   1484  C   ALA A 194      10.158  55.839  -6.484  1.00 13.82           C  
+ATOM   1485  O   ALA A 194       9.705  56.487  -5.504  1.00 13.38           O  
+ATOM   1486  CB  ALA A 194      12.096  54.295  -6.576  1.00 12.18           C  
+ATOM   1487  N   HIS A 195      10.275  56.465  -7.701  1.00 12.12           N  
+ATOM   1488  CA  HIS A 195       9.908  57.885  -7.768  1.00 10.89           C  
+ATOM   1489  C   HIS A 195       8.427  58.074  -7.444  1.00 12.44           C  
+ATOM   1490  O   HIS A 195       8.081  59.125  -6.923  1.00 12.87           O  
+ATOM   1491  CB  HIS A 195      10.263  58.461  -9.162  1.00 12.63           C  
+ATOM   1492  CG  HIS A 195      11.732  58.465  -9.437  1.00 11.63           C  
+ATOM   1493  ND1 HIS A 195      12.300  58.796 -10.665  1.00 13.18           N  
+ATOM   1494  CD2 HIS A 195      12.763  58.213  -8.578  1.00 12.01           C  
+ATOM   1495  CE1 HIS A 195      13.608  58.700 -10.553  1.00 12.63           C  
+ATOM   1496  NE2 HIS A 195      13.938  58.358  -9.290  1.00 11.68           N  
+ATOM   1497  N   TYR A 196       7.570  57.204  -7.923  1.00 11.14           N  
+ATOM   1498  CA  TYR A 196       6.138  57.326  -7.676  1.00 14.97           C  
+ATOM   1499  C   TYR A 196       5.817  57.247  -6.167  1.00 15.63           C  
+ATOM   1500  O   TYR A 196       5.234  58.169  -5.604  1.00 14.86           O  
+ATOM   1501  CB  TYR A 196       5.430  56.248  -8.482  1.00 15.46           C  
+ATOM   1502  CG  TYR A 196       3.910  56.330  -8.437  1.00 19.96           C  
+ATOM   1503  CD1 TYR A 196       3.199  55.719  -7.404  1.00 21.21           C  
+ATOM   1504  CD2 TYR A 196       3.208  57.050  -9.393  1.00 20.06           C  
+ATOM   1505  CE1 TYR A 196       1.809  55.792  -7.362  1.00 21.13           C  
+ATOM   1506  CE2 TYR A 196       1.824  57.104  -9.380  1.00 22.27           C  
+ATOM   1507  CZ  TYR A 196       1.145  56.479  -8.349  1.00 21.98           C  
+ATOM   1508  OH  TYR A 196      -0.227  56.565  -8.320  1.00 23.99           O  
+ATOM   1509  N   GLU A 197       6.325  56.205  -5.494  1.00 17.04           N  
+ATOM   1510  CA  GLU A 197       6.104  55.965  -4.078  1.00 19.99           C  
+ATOM   1511  C   GLU A 197       6.719  57.005  -3.172  1.00 19.94           C  
+ATOM   1512  O   GLU A 197       6.137  57.375  -2.153  1.00 19.19           O  
+ATOM   1513  CB  GLU A 197       6.646  54.576  -3.734  1.00 23.97           C  
+ATOM   1514  CG  GLU A 197       5.943  53.559  -4.658  1.00 31.50           C  
+ATOM   1515  CD  GLU A 197       5.869  52.224  -3.953  1.00 38.58           C  
+ATOM   1516  OE1 GLU A 197       5.731  52.243  -2.689  1.00 41.22           O  
+ATOM   1517  OE2 GLU A 197       5.981  51.193  -4.678  1.00 42.93           O  
+ATOM   1518  N   CYS A 198       7.855  57.575  -3.585  1.00 15.64           N  
+ATOM   1519  CA  CYS A 198       8.530  58.598  -2.852  1.00 14.07           C  
+ATOM   1520  C   CYS A 198       7.701  59.847  -2.670  1.00 15.20           C  
+ATOM   1521  O   CYS A 198       7.983  60.665  -1.779  1.00 15.38           O  
+ATOM   1522  CB  CYS A 198       9.915  58.926  -3.486  1.00 14.77           C  
+ATOM   1523  SG  CYS A 198      10.965  59.847  -2.309  1.00 17.95           S  
+ATOM   1524  N   ILE A 199       6.788  60.118  -3.601  1.00 14.16           N  
+ATOM   1525  CA  ILE A 199       6.000  61.354  -3.458  1.00 15.06           C  
+ATOM   1526  C   ILE A 199       5.212  61.263  -2.133  1.00 15.89           C  
+ATOM   1527  O   ILE A 199       5.246  62.248  -1.393  1.00 17.25           O  
+ATOM   1528  CB  ILE A 199       5.058  61.589  -4.646  1.00 14.31           C  
+ATOM   1529  CG1 ILE A 199       5.919  61.773  -5.926  1.00 13.62           C  
+ATOM   1530  CG2 ILE A 199       4.225  62.869  -4.453  1.00 16.62           C  
+ATOM   1531  CD1 ILE A 199       5.116  61.665  -7.217  1.00 15.90           C  
+ATOM   1532  N   ALA A 200       4.605  60.103  -1.867  1.00 16.81           N  
+ATOM   1533  CA  ALA A 200       3.911  60.065  -0.551  1.00 18.97           C  
+ATOM   1534  C   ALA A 200       4.919  60.148   0.604  1.00 20.23           C  
+ATOM   1535  O   ALA A 200       4.620  60.781   1.655  1.00 19.90           O  
+ATOM   1536  CB  ALA A 200       2.986  58.884  -0.446  1.00 15.52           C  
+ATOM   1537  N   ALA A 201       6.089  59.528   0.449  1.00 18.68           N  
+ATOM   1538  CA  ALA A 201       7.069  59.520   1.538  1.00 18.65           C  
+ATOM   1539  C   ALA A 201       7.542  60.914   1.842  1.00 17.85           C  
+ATOM   1540  O   ALA A 201       7.725  61.253   2.998  1.00 19.21           O  
+ATOM   1541  CB  ALA A 201       8.328  58.714   1.156  1.00 17.95           C  
+ATOM   1542  N   PHE A 202       7.837  61.775   0.840  1.00 16.49           N  
+ATOM   1543  CA  PHE A 202       8.342  63.085   1.191  1.00 16.50           C  
+ATOM   1544  C   PHE A 202       7.212  64.031   1.627  1.00 18.56           C  
+ATOM   1545  O   PHE A 202       7.519  65.003   2.339  1.00 17.49           O  
+ATOM   1546  CB  PHE A 202       9.217  63.700   0.113  1.00 16.52           C  
+ATOM   1547  CG  PHE A 202       8.613  64.267  -1.135  1.00 18.72           C  
+ATOM   1548  CD1 PHE A 202       7.809  65.387  -1.130  1.00 19.52           C  
+ATOM   1549  CD2 PHE A 202       8.916  63.675  -2.378  1.00 18.96           C  
+ATOM   1550  CE1 PHE A 202       7.287  65.924  -2.309  1.00 20.55           C  
+ATOM   1551  CE2 PHE A 202       8.361  64.171  -3.545  1.00 19.53           C  
+ATOM   1552  CZ  PHE A 202       7.551  65.294  -3.514  1.00 20.22           C  
+ATOM   1553  N   SER A 203       5.995  63.867   1.125  1.00 16.75           N  
+ATOM   1554  CA  SER A 203       4.977  64.881   1.393  1.00 17.39           C  
+ATOM   1555  C   SER A 203       4.041  64.542   2.557  1.00 19.14           C  
+ATOM   1556  O   SER A 203       3.414  65.490   3.079  1.00 21.16           O  
+ATOM   1557  CB  SER A 203       4.115  65.074   0.111  1.00 16.63           C  
+ATOM   1558  OG  SER A 203       3.448  63.857  -0.213  1.00 15.32           O  
+ATOM   1559  N   GLU A 204       3.866  63.303   2.951  1.00 17.78           N  
+ATOM   1560  CA  GLU A 204       3.010  62.913   4.038  1.00 20.17           C  
+ATOM   1561  C   GLU A 204       3.746  62.459   5.301  1.00 22.47           C  
+ATOM   1562  O   GLU A 204       3.081  62.265   6.313  1.00 24.51           O  
+ATOM   1563  CB  GLU A 204       2.106  61.750   3.610  1.00 21.28           C  
+ATOM   1564  CG  GLU A 204       1.217  62.227   2.443  1.00 23.76           C  
+ATOM   1565  CD  GLU A 204       0.472  61.046   1.858  1.00 28.74           C  
+ATOM   1566  OE1 GLU A 204       0.197  60.125   2.643  1.00 32.02           O  
+ATOM   1567  OE2 GLU A 204       0.188  60.952   0.650  1.00 29.09           O  
+ATOM   1568  N   THR A 205       5.045  62.199   5.255  1.00 20.01           N  
+ATOM   1569  CA  THR A 205       5.714  61.810   6.487  1.00 20.70           C  
+ATOM   1570  C   THR A 205       5.803  63.033   7.398  1.00 19.77           C  
+ATOM   1571  O   THR A 205       6.177  64.112   6.971  1.00 18.85           O  
+ATOM   1572  CB  THR A 205       7.119  61.252   6.191  1.00 20.73           C  
+ATOM   1573  OG1 THR A 205       6.899  60.206   5.265  1.00 19.14           O  
+ATOM   1574  CG2 THR A 205       7.746  60.699   7.483  1.00 20.93           C  
+ATOM   1575  N   ASP A 206       5.485  62.849   8.673  1.00 20.72           N  
+ATOM   1576  CA  ASP A 206       5.619  63.949   9.636  1.00 22.29           C  
+ATOM   1577  C   ASP A 206       6.961  63.824  10.331  1.00 19.79           C  
+ATOM   1578  O   ASP A 206       7.212  62.782  10.929  1.00 21.12           O  
+ATOM   1579  CB  ASP A 206       4.480  63.899  10.659  1.00 23.33           C  
+ATOM   1580  CG  ASP A 206       4.416  65.167  11.478  1.00 24.70           C  
+ATOM   1581  OD1 ASP A 206       5.392  65.891  11.719  1.00 24.33           O  
+ATOM   1582  OD2 ASP A 206       3.282  65.485  11.893  1.00 26.52           O  
+ATOM   1583  N   PHE A 207       7.851  64.807  10.225  1.00 19.16           N  
+ATOM   1584  CA  PHE A 207       9.167  64.664  10.842  1.00 17.15           C  
+ATOM   1585  C   PHE A 207       9.212  65.387  12.191  1.00 20.05           C  
+ATOM   1586  O   PHE A 207      10.278  65.633  12.760  1.00 18.32           O  
+ATOM   1587  CB  PHE A 207      10.223  65.340   9.892  1.00 18.67           C  
+ATOM   1588  CG  PHE A 207      10.313  64.565   8.587  1.00 18.91           C  
+ATOM   1589  CD1 PHE A 207      11.097  63.443   8.484  1.00 17.68           C  
+ATOM   1590  CD2 PHE A 207       9.585  65.002   7.473  1.00 18.47           C  
+ATOM   1591  CE1 PHE A 207      11.199  62.735   7.297  1.00 18.48           C  
+ATOM   1592  CE2 PHE A 207       9.685  64.289   6.277  1.00 16.55           C  
+ATOM   1593  CZ  PHE A 207      10.461  63.151   6.192  1.00 16.53           C  
+ATOM   1594  N   THR A 208       8.087  65.900  12.677  1.00 19.62           N  
+ATOM   1595  CA  THR A 208       8.056  66.672  13.920  1.00 22.75           C  
+ATOM   1596  C   THR A 208       8.816  66.008  15.047  1.00 22.23           C  
+ATOM   1597  O   THR A 208       9.692  66.602  15.680  1.00 20.08           O  
+ATOM   1598  CB  THR A 208       6.586  66.962  14.258  1.00 23.60           C  
+ATOM   1599  OG1 THR A 208       6.151  67.888  13.207  1.00 23.98           O  
+ATOM   1600  CG2 THR A 208       6.477  67.664  15.627  1.00 23.88           C  
+ATOM   1601  N   ASP A 209       8.565  64.731  15.297  1.00 24.26           N  
+ATOM   1602  CA  ASP A 209       9.232  63.981  16.348  1.00 25.53           C  
+ATOM   1603  C   ASP A 209      10.725  63.806  16.139  1.00 26.38           C  
+ATOM   1604  O   ASP A 209      11.527  63.827  17.113  1.00 26.69           O  
+ATOM   1605  CB  ASP A 209       8.544  62.629  16.529  1.00 27.20           C  
+ATOM   1606  CG  ASP A 209       7.183  62.737  17.206  1.00 30.81           C  
+ATOM   1607  OD1 ASP A 209       6.811  63.836  17.684  1.00 32.11           O  
+ATOM   1608  OD2 ASP A 209       6.451  61.720  17.257  1.00 31.40           O  
+ATOM   1609  N   ASP A 210      11.146  63.603  14.882  1.00 23.96           N  
+ATOM   1610  CA  ASP A 210      12.577  63.470  14.618  1.00 23.14           C  
+ATOM   1611  C   ASP A 210      13.291  64.772  15.006  1.00 22.91           C  
+ATOM   1612  O   ASP A 210      14.370  64.794  15.623  1.00 21.36           O  
+ATOM   1613  CB  ASP A 210      12.858  63.222  13.139  1.00 22.22           C  
+ATOM   1614  CG  ASP A 210      12.268  61.954  12.618  1.00 25.56           C  
+ATOM   1615  OD1 ASP A 210      12.476  60.862  13.164  1.00 26.63           O  
+ATOM   1616  OD2 ASP A 210      11.498  61.961  11.641  1.00 28.94           O  
+ATOM   1617  N   LEU A 211      12.707  65.883  14.528  1.00 19.62           N  
+ATOM   1618  CA  LEU A 211      13.282  67.186  14.785  1.00 20.91           C  
+ATOM   1619  C   LEU A 211      13.461  67.510  16.262  1.00 23.01           C  
+ATOM   1620  O   LEU A 211      14.404  68.220  16.657  1.00 23.21           O  
+ATOM   1621  CB  LEU A 211      12.413  68.269  14.135  1.00 21.39           C  
+ATOM   1622  CG  LEU A 211      12.443  68.358  12.605  1.00 22.37           C  
+ATOM   1623  CD1 LEU A 211      11.574  69.523  12.148  1.00 22.52           C  
+ATOM   1624  CD2 LEU A 211      13.851  68.493  12.035  1.00 20.52           C  
+ATOM   1625  N   LYS A 212      12.524  67.051  17.099  1.00 23.93           N  
+ATOM   1626  CA  LYS A 212      12.613  67.267  18.539  1.00 27.10           C  
+ATOM   1627  C   LYS A 212      13.701  66.420  19.158  1.00 26.94           C  
+ATOM   1628  O   LYS A 212      14.160  66.700  20.264  1.00 28.31           O  
+ATOM   1629  CB  LYS A 212      11.233  66.948  19.160  1.00 28.04           C  
+ATOM   1630  CG  LYS A 212      10.321  68.136  18.854  1.00 31.50           C  
+ATOM   1631  CD  LYS A 212       8.855  67.798  18.978  1.00 35.44           C  
+ATOM   1632  CE  LYS A 212       8.312  68.047  20.379  1.00 37.51           C  
+ATOM   1633  NZ  LYS A 212       6.847  67.714  20.444  1.00 39.24           N  
+ATOM   1634  N   ARG A 213      14.109  65.349  18.509  1.00 26.06           N  
+ATOM   1635  CA  ARG A 213      15.149  64.474  18.985  1.00 28.52           C  
+ATOM   1636  C   ARG A 213      16.556  64.907  18.603  1.00 27.90           C  
+ATOM   1637  O   ARG A 213      17.500  64.329  19.120  1.00 27.40           O  
+ATOM   1638  CB  ARG A 213      14.945  63.046  18.442  1.00 31.62           C  
+ATOM   1639  CG  ARG A 213      13.654  62.428  18.982  1.00 36.82           C  
+ATOM   1640  CD  ARG A 213      13.496  61.001  18.446  1.00 38.77           C  
+ATOM   1641  NE  ARG A 213      14.651  60.228  18.815  1.00 42.52           N  
+ATOM   1642  CZ  ARG A 213      15.115  59.056  18.444  1.00 45.13           C  
+ATOM   1643  NH1 ARG A 213      14.517  58.275  17.549  1.00 46.98           N  
+ATOM   1644  NH2 ARG A 213      16.243  58.629  19.024  1.00 46.27           N  
+ATOM   1645  N   ILE A 214      16.726  65.834  17.666  1.00 26.80           N  
+ATOM   1646  CA  ILE A 214      18.081  66.162  17.254  1.00 26.11           C  
+ATOM   1647  C   ILE A 214      18.776  67.087  18.237  1.00 26.77           C  
+ATOM   1648  O   ILE A 214      18.273  68.191  18.442  1.00 28.67           O  
+ATOM   1649  CB  ILE A 214      18.013  66.777  15.827  1.00 23.81           C  
+ATOM   1650  CG1 ILE A 214      17.546  65.680  14.869  1.00 23.81           C  
+ATOM   1651  CG2 ILE A 214      19.367  67.329  15.454  1.00 23.71           C  
+ATOM   1652  CD1 ILE A 214      17.282  66.138  13.453  1.00 22.80           C  
+ATOM   1653  N   ASP A 215      19.967  66.753  18.704  1.00 28.08           N  
+ATOM   1654  CA  ASP A 215      20.649  67.692  19.592  1.00 34.14           C  
+ATOM   1655  C   ASP A 215      21.857  68.372  18.962  1.00 32.68           C  
+ATOM   1656  O   ASP A 215      22.214  69.432  19.497  1.00 34.56           O  
+ATOM   1657  CB  ASP A 215      21.048  67.039  20.910  1.00 39.14           C  
+ATOM   1658  CG  ASP A 215      21.559  65.631  20.746  1.00 43.79           C  
+ATOM   1659  OD1 ASP A 215      22.287  65.301  19.779  1.00 47.08           O  
+ATOM   1660  OD2 ASP A 215      21.221  64.817  21.638  1.00 47.43           O  
+ATOM   1661  N   VAL A 216      22.436  67.867  17.873  1.00 27.40           N  
+ATOM   1662  CA  VAL A 216      23.567  68.627  17.293  1.00 23.33           C  
+ATOM   1663  C   VAL A 216      23.080  69.924  16.670  1.00 21.01           C  
+ATOM   1664  O   VAL A 216      21.882  70.069  16.381  1.00 21.10           O  
+ATOM   1665  CB  VAL A 216      24.142  67.722  16.184  1.00 25.27           C  
+ATOM   1666  CG1 VAL A 216      24.665  66.398  16.740  1.00 24.58           C  
+ATOM   1667  CG2 VAL A 216      23.061  67.457  15.116  1.00 22.61           C  
+ATOM   1668  N   PRO A 217      23.973  70.851  16.354  1.00 20.43           N  
+ATOM   1669  CA  PRO A 217      23.672  72.070  15.656  1.00 20.74           C  
+ATOM   1670  C   PRO A 217      23.181  71.759  14.217  1.00 20.77           C  
+ATOM   1671  O   PRO A 217      23.725  70.875  13.568  1.00 19.36           O  
+ATOM   1672  CB  PRO A 217      24.924  72.901  15.625  1.00 19.85           C  
+ATOM   1673  CG  PRO A 217      25.907  72.179  16.491  1.00 22.91           C  
+ATOM   1674  CD  PRO A 217      25.431  70.750  16.658  1.00 20.14           C  
+ATOM   1675  N   VAL A 218      22.165  72.504  13.838  1.00 20.18           N  
+ATOM   1676  CA  VAL A 218      21.468  72.332  12.571  1.00 20.06           C  
+ATOM   1677  C   VAL A 218      21.296  73.694  11.916  1.00 20.90           C  
+ATOM   1678  O   VAL A 218      20.879  74.704  12.497  1.00 21.77           O  
+ATOM   1679  CB  VAL A 218      20.110  71.636  12.636  1.00 18.64           C  
+ATOM   1680  CG1 VAL A 218      19.455  71.501  11.244  1.00 19.81           C  
+ATOM   1681  CG2 VAL A 218      20.143  70.267  13.292  1.00 16.52           C  
+ATOM   1682  N   LEU A 219      21.783  73.761  10.678  1.00 17.40           N  
+ATOM   1683  CA  LEU A 219      21.580  74.953   9.843  1.00 16.12           C  
+ATOM   1684  C   LEU A 219      20.366  74.734   8.974  1.00 14.45           C  
+ATOM   1685  O   LEU A 219      20.321  73.694   8.302  1.00 16.29           O  
+ATOM   1686  CB  LEU A 219      22.806  75.277   8.987  1.00 16.77           C  
+ATOM   1687  CG  LEU A 219      22.575  76.259   7.809  1.00 18.95           C  
+ATOM   1688  CD1 LEU A 219      22.229  77.646   8.285  1.00 18.80           C  
+ATOM   1689  CD2 LEU A 219      23.814  76.317   6.895  1.00 19.30           C  
+ATOM   1690  N   VAL A 220      19.356  75.585   8.970  1.00 14.90           N  
+ATOM   1691  CA  VAL A 220      18.137  75.427   8.176  1.00 16.15           C  
+ATOM   1692  C   VAL A 220      18.140  76.521   7.115  1.00 17.44           C  
+ATOM   1693  O   VAL A 220      18.195  77.698   7.480  1.00 19.42           O  
+ATOM   1694  CB  VAL A 220      16.835  75.526   8.989  1.00 15.89           C  
+ATOM   1695  CG1 VAL A 220      15.593  75.365   8.113  1.00 17.38           C  
+ATOM   1696  CG2 VAL A 220      16.838  74.463  10.070  1.00 16.33           C  
+ATOM   1697  N   ALA A 221      18.324  76.183   5.845  1.00 16.87           N  
+ATOM   1698  CA  ALA A 221      18.462  77.213   4.779  1.00 15.60           C  
+ATOM   1699  C   ALA A 221      17.278  77.086   3.838  1.00 16.91           C  
+ATOM   1700  O   ALA A 221      16.898  75.929   3.533  1.00 17.96           O  
+ATOM   1701  CB  ALA A 221      19.803  76.978   4.073  1.00 15.92           C  
+ATOM   1702  N   HIS A 222      16.754  78.167   3.270  1.00 17.41           N  
+ATOM   1703  CA  HIS A 222      15.587  78.015   2.391  1.00 17.26           C  
+ATOM   1704  C   HIS A 222      15.350  79.268   1.565  1.00 17.59           C  
+ATOM   1705  O   HIS A 222      15.612  80.387   2.021  1.00 19.47           O  
+ATOM   1706  CB  HIS A 222      14.387  77.681   3.244  1.00 15.92           C  
+ATOM   1707  CG  HIS A 222      13.331  76.813   2.640  1.00 15.70           C  
+ATOM   1708  ND1 HIS A 222      13.013  75.584   3.175  1.00 13.82           N  
+ATOM   1709  CD2 HIS A 222      12.483  77.019   1.588  1.00 13.84           C  
+ATOM   1710  CE1 HIS A 222      12.021  75.044   2.500  1.00 13.64           C  
+ATOM   1711  NE2 HIS A 222      11.686  75.892   1.528  1.00 14.68           N  
+ATOM   1712  N   GLY A 223      14.955  79.085   0.312  1.00 17.02           N  
+ATOM   1713  CA  GLY A 223      14.750  80.290  -0.538  1.00 17.05           C  
+ATOM   1714  C   GLY A 223      13.318  80.748  -0.316  1.00 18.82           C  
+ATOM   1715  O   GLY A 223      12.430  79.913  -0.190  1.00 18.60           O  
+ATOM   1716  N   THR A 224      13.092  82.064  -0.281  1.00 22.61           N  
+ATOM   1717  CA  THR A 224      11.712  82.541  -0.038  1.00 22.98           C  
+ATOM   1718  C   THR A 224      10.868  82.456  -1.297  1.00 24.29           C  
+ATOM   1719  O   THR A 224       9.629  82.546  -1.130  1.00 26.26           O  
+ATOM   1720  CB  THR A 224      11.687  83.980   0.522  1.00 22.43           C  
+ATOM   1721  OG1 THR A 224      12.117  84.891  -0.469  1.00 21.09           O  
+ATOM   1722  CG2 THR A 224      12.670  84.100   1.695  1.00 21.74           C  
+ATOM   1723  N   ASP A 225      11.419  82.183  -2.496  1.00 20.64           N  
+ATOM   1724  CA  ASP A 225      10.481  82.007  -3.621  1.00 22.70           C  
+ATOM   1725  C   ASP A 225      10.459  80.542  -4.053  1.00 22.61           C  
+ATOM   1726  O   ASP A 225      10.432  80.190  -5.232  1.00 22.64           O  
+ATOM   1727  CB  ASP A 225      10.839  82.992  -4.744  1.00 23.76           C  
+ATOM   1728  CG  ASP A 225       9.896  82.985  -5.926  1.00 26.05           C  
+ATOM   1729  OD1 ASP A 225       8.713  82.638  -5.765  1.00 26.68           O  
+ATOM   1730  OD2 ASP A 225      10.289  83.242  -7.083  1.00 27.90           O  
+ATOM   1731  N   ASP A 226      10.516  79.616  -3.099  1.00 21.34           N  
+ATOM   1732  CA  ASP A 226      10.518  78.186  -3.310  1.00 20.81           C  
+ATOM   1733  C   ASP A 226       9.157  77.729  -3.782  1.00 20.97           C  
+ATOM   1734  O   ASP A 226       8.183  77.809  -3.007  1.00 19.82           O  
+ATOM   1735  CB  ASP A 226      10.911  77.417  -2.032  1.00 17.80           C  
+ATOM   1736  CG  ASP A 226      11.235  75.974  -2.382  1.00 16.53           C  
+ATOM   1737  OD1 ASP A 226      10.518  75.353  -3.189  1.00 16.31           O  
+ATOM   1738  OD2 ASP A 226      12.232  75.442  -1.848  1.00 17.08           O  
+ATOM   1739  N   GLN A 227       9.075  77.263  -5.030  1.00 19.72           N  
+ATOM   1740  CA  GLN A 227       7.785  76.850  -5.564  1.00 17.43           C  
+ATOM   1741  C   GLN A 227       7.505  75.380  -5.385  1.00 19.38           C  
+ATOM   1742  O   GLN A 227       6.431  74.932  -5.805  1.00 21.65           O  
+ATOM   1743  CB  GLN A 227       7.668  77.195  -7.047  1.00 18.59           C  
+ATOM   1744  CG  GLN A 227       7.836  78.671  -7.388  1.00 20.16           C  
+ATOM   1745  CD  GLN A 227       7.893  78.869  -8.911  1.00 20.26           C  
+ATOM   1746  OE1 GLN A 227       6.994  78.356  -9.582  1.00 23.64           O  
+ATOM   1747  NE2 GLN A 227       8.911  79.538  -9.409  1.00 18.19           N  
+ATOM   1748  N   VAL A 228       8.395  74.601  -4.748  1.00 17.76           N  
+ATOM   1749  CA  VAL A 228       8.167  73.180  -4.567  1.00 17.48           C  
+ATOM   1750  C   VAL A 228       7.865  72.850  -3.117  1.00 19.55           C  
+ATOM   1751  O   VAL A 228       6.905  72.159  -2.817  1.00 21.20           O  
+ATOM   1752  CB  VAL A 228       9.446  72.393  -5.009  1.00 18.09           C  
+ATOM   1753  CG1 VAL A 228       9.275  70.900  -4.720  1.00 17.92           C  
+ATOM   1754  CG2 VAL A 228       9.678  72.682  -6.492  1.00 19.09           C  
+ATOM   1755  N   VAL A 229       8.722  73.353  -2.202  1.00 20.35           N  
+ATOM   1756  CA  VAL A 229       8.526  73.211  -0.766  1.00 19.77           C  
+ATOM   1757  C   VAL A 229       8.364  74.614  -0.207  1.00 19.13           C  
+ATOM   1758  O   VAL A 229       9.286  75.422  -0.083  1.00 16.92           O  
+ATOM   1759  CB  VAL A 229       9.679  72.480  -0.061  1.00 22.29           C  
+ATOM   1760  CG1 VAL A 229       9.441  72.421   1.457  1.00 22.21           C  
+ATOM   1761  CG2 VAL A 229       9.800  71.058  -0.573  1.00 21.99           C  
+ATOM   1762  N   PRO A 230       7.100  74.997   0.009  1.00 21.14           N  
+ATOM   1763  CA  PRO A 230       6.756  76.361   0.405  1.00 20.29           C  
+ATOM   1764  C   PRO A 230       7.479  76.816   1.653  1.00 22.08           C  
+ATOM   1765  O   PRO A 230       7.510  76.087   2.666  1.00 22.87           O  
+ATOM   1766  CB  PRO A 230       5.237  76.341   0.552  1.00 21.98           C  
+ATOM   1767  CG  PRO A 230       4.818  75.235  -0.360  1.00 21.77           C  
+ATOM   1768  CD  PRO A 230       5.889  74.148  -0.143  1.00 20.68           C  
+ATOM   1769  N   TYR A 231       8.106  77.969   1.560  1.00 21.53           N  
+ATOM   1770  CA  TYR A 231       8.970  78.480   2.591  1.00 23.86           C  
+ATOM   1771  C   TYR A 231       8.346  78.584   3.990  1.00 25.63           C  
+ATOM   1772  O   TYR A 231       8.976  78.174   4.966  1.00 23.52           O  
+ATOM   1773  CB  TYR A 231       9.527  79.834   2.156  1.00 25.37           C  
+ATOM   1774  CG  TYR A 231      10.300  80.493   3.290  1.00 27.01           C  
+ATOM   1775  CD1 TYR A 231      11.633  80.262   3.478  1.00 26.19           C  
+ATOM   1776  CD2 TYR A 231       9.634  81.343   4.191  1.00 28.75           C  
+ATOM   1777  CE1 TYR A 231      12.331  80.823   4.524  1.00 27.73           C  
+ATOM   1778  CE2 TYR A 231      10.312  81.938   5.239  1.00 28.59           C  
+ATOM   1779  CZ  TYR A 231      11.656  81.663   5.404  1.00 29.48           C  
+ATOM   1780  OH  TYR A 231      12.368  82.236   6.428  1.00 27.33           O  
+ATOM   1781  N   ALA A 232       7.177  79.208   4.086  1.00 26.31           N  
+ATOM   1782  CA  ALA A 232       6.561  79.498   5.381  1.00 27.61           C  
+ATOM   1783  C   ALA A 232       6.117  78.272   6.150  1.00 28.15           C  
+ATOM   1784  O   ALA A 232       6.191  78.309   7.380  1.00 29.95           O  
+ATOM   1785  CB  ALA A 232       5.453  80.529   5.171  1.00 25.94           C  
+ATOM   1786  N   ASP A 233       5.737  77.169   5.571  1.00 27.74           N  
+ATOM   1787  CA  ASP A 233       5.364  75.918   6.194  1.00 27.18           C  
+ATOM   1788  C   ASP A 233       6.568  75.006   6.432  1.00 23.34           C  
+ATOM   1789  O   ASP A 233       6.367  73.902   6.944  1.00 23.91           O  
+ATOM   1790  CB  ASP A 233       4.375  75.149   5.313  1.00 32.20           C  
+ATOM   1791  CG  ASP A 233       3.469  74.115   5.938  1.00 36.48           C  
+ATOM   1792  OD1 ASP A 233       2.840  74.379   7.012  1.00 39.35           O  
+ATOM   1793  OD2 ASP A 233       3.271  72.985   5.390  1.00 35.48           O  
+ATOM   1794  N   ALA A 234       7.783  75.418   6.056  1.00 20.43           N  
+ATOM   1795  CA  ALA A 234       8.892  74.518   6.269  1.00 20.37           C  
+ATOM   1796  C   ALA A 234       9.945  75.097   7.206  1.00 20.01           C  
+ATOM   1797  O   ALA A 234       9.884  74.815   8.408  1.00 22.38           O  
+ATOM   1798  CB  ALA A 234       9.489  74.028   4.954  1.00 18.32           C  
+ATOM   1799  N   ALA A 235      10.784  75.971   6.739  1.00 19.94           N  
+ATOM   1800  CA  ALA A 235      11.981  76.454   7.358  1.00 20.45           C  
+ATOM   1801  C   ALA A 235      11.815  77.097   8.726  1.00 22.59           C  
+ATOM   1802  O   ALA A 235      12.446  76.666   9.671  1.00 21.74           O  
+ATOM   1803  CB  ALA A 235      12.772  77.317   6.381  1.00 18.56           C  
+ATOM   1804  N   PRO A 236      10.991  78.124   8.872  1.00 25.79           N  
+ATOM   1805  CA  PRO A 236      10.774  78.725  10.197  1.00 26.29           C  
+ATOM   1806  C   PRO A 236      10.154  77.698  11.127  1.00 25.86           C  
+ATOM   1807  O   PRO A 236      10.560  77.668  12.294  1.00 27.68           O  
+ATOM   1808  CB  PRO A 236       9.968  79.968   9.867  1.00 26.42           C  
+ATOM   1809  CG  PRO A 236       9.187  79.572   8.664  1.00 27.90           C  
+ATOM   1810  CD  PRO A 236      10.167  78.759   7.825  1.00 25.69           C  
+ATOM   1811  N   LYS A 237       9.305  76.781  10.710  1.00 25.66           N  
+ATOM   1812  CA  LYS A 237       8.752  75.776  11.616  1.00 28.08           C  
+ATOM   1813  C   LYS A 237       9.768  74.746  12.073  1.00 28.23           C  
+ATOM   1814  O   LYS A 237       9.786  74.279  13.216  1.00 28.93           O  
+ATOM   1815  CB  LYS A 237       7.560  75.056  10.981  1.00 29.41           C  
+ATOM   1816  CG  LYS A 237       6.466  76.080  10.627  1.00 32.45           C  
+ATOM   1817  CD  LYS A 237       5.347  75.394   9.862  1.00 35.79           C  
+ATOM   1818  CE  LYS A 237       3.979  75.773  10.406  1.00 39.66           C  
+ATOM   1819  NZ  LYS A 237       3.130  76.428   9.378  1.00 42.19           N  
+ATOM   1820  N   SER A 238      10.634  74.344  11.128  1.00 26.02           N  
+ATOM   1821  CA  SER A 238      11.696  73.423  11.495  1.00 25.28           C  
+ATOM   1822  C   SER A 238      12.590  74.049  12.553  1.00 24.86           C  
+ATOM   1823  O   SER A 238      12.950  73.380  13.527  1.00 26.05           O  
+ATOM   1824  CB  SER A 238      12.539  73.182  10.214  1.00 23.43           C  
+ATOM   1825  OG  SER A 238      11.722  72.238   9.514  1.00 25.88           O  
+ATOM   1826  N   ALA A 239      13.000  75.289  12.296  1.00 24.46           N  
+ATOM   1827  CA  ALA A 239      13.920  75.973  13.201  1.00 26.21           C  
+ATOM   1828  C   ALA A 239      13.348  76.141  14.620  1.00 28.34           C  
+ATOM   1829  O   ALA A 239      14.106  76.104  15.585  1.00 29.57           O  
+ATOM   1830  CB  ALA A 239      14.251  77.333  12.615  1.00 24.77           C  
+ATOM   1831  N   GLU A 240      12.040  76.346  14.744  1.00 29.85           N  
+ATOM   1832  CA  GLU A 240      11.423  76.478  16.055  1.00 33.55           C  
+ATOM   1833  C   GLU A 240      11.382  75.163  16.800  1.00 31.62           C  
+ATOM   1834  O   GLU A 240      11.478  75.200  18.033  1.00 32.58           O  
+ATOM   1835  CB  GLU A 240       9.994  77.027  15.941  1.00 37.55           C  
+ATOM   1836  CG  GLU A 240      10.071  78.411  15.290  1.00 44.40           C  
+ATOM   1837  CD  GLU A 240       8.681  78.951  14.996  1.00 48.88           C  
+ATOM   1838  OE1 GLU A 240       7.726  78.534  15.707  1.00 51.76           O  
+ATOM   1839  OE2 GLU A 240       8.590  79.779  14.061  1.00 51.05           O  
+ATOM   1840  N   LEU A 241      11.307  74.030  16.123  1.00 29.85           N  
+ATOM   1841  CA  LEU A 241      11.293  72.736  16.794  1.00 27.12           C  
+ATOM   1842  C   LEU A 241      12.664  72.197  17.170  1.00 26.32           C  
+ATOM   1843  O   LEU A 241      12.793  71.336  18.043  1.00 26.70           O  
+ATOM   1844  CB  LEU A 241      10.623  71.704  15.872  1.00 27.11           C  
+ATOM   1845  CG  LEU A 241       9.154  71.997  15.538  1.00 28.57           C  
+ATOM   1846  CD1 LEU A 241       8.699  71.181  14.356  1.00 27.01           C  
+ATOM   1847  CD2 LEU A 241       8.301  71.633  16.763  1.00 29.28           C  
+ATOM   1848  N   LEU A 242      13.728  72.610  16.505  1.00 25.02           N  
+ATOM   1849  CA  LEU A 242      15.072  72.115  16.741  1.00 25.16           C  
+ATOM   1850  C   LEU A 242      15.682  72.868  17.923  1.00 25.16           C  
+ATOM   1851  O   LEU A 242      15.564  74.081  18.002  1.00 25.47           O  
+ATOM   1852  CB  LEU A 242      15.975  72.336  15.503  1.00 23.76           C  
+ATOM   1853  CG  LEU A 242      15.680  71.383  14.324  1.00 22.60           C  
+ATOM   1854  CD1 LEU A 242      16.075  72.060  13.028  1.00 22.79           C  
+ATOM   1855  CD2 LEU A 242      16.458  70.080  14.491  1.00 23.27           C  
+ATOM   1856  N   ALA A 243      16.354  72.138  18.778  1.00 26.16           N  
+ATOM   1857  CA  ALA A 243      17.012  72.689  19.958  1.00 27.21           C  
+ATOM   1858  C   ALA A 243      18.095  73.671  19.605  1.00 28.66           C  
+ATOM   1859  O   ALA A 243      18.093  74.829  20.062  1.00 29.92           O  
+ATOM   1860  CB  ALA A 243      17.585  71.499  20.730  1.00 28.40           C  
+ATOM   1861  N   ASN A 244      19.031  73.308  18.738  1.00 27.94           N  
+ATOM   1862  CA  ASN A 244      20.100  74.236  18.336  1.00 28.85           C  
+ATOM   1863  C   ASN A 244      20.052  74.542  16.846  1.00 28.46           C  
+ATOM   1864  O   ASN A 244      20.878  73.998  16.089  1.00 29.05           O  
+ATOM   1865  CB  ASN A 244      21.424  73.581  18.753  1.00 31.44           C  
+ATOM   1866  CG  ASN A 244      22.640  74.463  18.612  1.00 35.35           C  
+ATOM   1867  OD1 ASN A 244      22.605  75.645  18.228  1.00 36.23           O  
+ATOM   1868  ND2 ASN A 244      23.809  73.896  18.949  1.00 37.56           N  
+ATOM   1869  N   ALA A 245      19.116  75.361  16.359  1.00 27.26           N  
+ATOM   1870  CA  ALA A 245      19.108  75.601  14.914  1.00 26.46           C  
+ATOM   1871  C   ALA A 245      19.525  77.010  14.554  1.00 26.33           C  
+ATOM   1872  O   ALA A 245      19.373  77.925  15.365  1.00 27.04           O  
+ATOM   1873  CB  ALA A 245      17.716  75.331  14.367  1.00 28.39           C  
+ATOM   1874  N   THR A 246      20.056  77.231  13.378  1.00 23.76           N  
+ATOM   1875  CA  THR A 246      20.350  78.548  12.815  1.00 24.23           C  
+ATOM   1876  C   THR A 246      19.524  78.650  11.517  1.00 25.52           C  
+ATOM   1877  O   THR A 246      19.521  77.708  10.675  1.00 24.33           O  
+ATOM   1878  CB  THR A 246      21.835  78.733  12.507  1.00 24.82           C  
+ATOM   1879  OG1 THR A 246      22.629  78.586  13.716  1.00 26.36           O  
+ATOM   1880  CG2 THR A 246      22.118  80.075  11.868  1.00 22.82           C  
+ATOM   1881  N   LEU A 247      18.752  79.692  11.359  1.00 25.04           N  
+ATOM   1882  CA  LEU A 247      17.856  79.853  10.218  1.00 26.55           C  
+ATOM   1883  C   LEU A 247      18.430  80.853   9.231  1.00 28.97           C  
+ATOM   1884  O   LEU A 247      18.684  82.007   9.614  1.00 27.62           O  
+ATOM   1885  CB  LEU A 247      16.472  80.337  10.659  1.00 27.65           C  
+ATOM   1886  CG  LEU A 247      15.395  80.538   9.618  1.00 30.51           C  
+ATOM   1887  CD1 LEU A 247      15.056  79.219   8.944  1.00 29.55           C  
+ATOM   1888  CD2 LEU A 247      14.078  81.117  10.172  1.00 30.17           C  
+ATOM   1889  N   LYS A 248      18.620  80.426   7.981  1.00 25.07           N  
+ATOM   1890  CA  LYS A 248      19.107  81.324   6.944  1.00 26.55           C  
+ATOM   1891  C   LYS A 248      18.056  81.357   5.835  1.00 26.74           C  
+ATOM   1892  O   LYS A 248      17.672  80.324   5.277  1.00 22.68           O  
+ATOM   1893  CB  LYS A 248      20.474  80.925   6.404  1.00 28.26           C  
+ATOM   1894  CG  LYS A 248      21.616  81.357   7.307  1.00 33.64           C  
+ATOM   1895  CD  LYS A 248      22.960  81.381   6.603  1.00 36.94           C  
+ATOM   1896  CE  LYS A 248      23.573  82.783   6.755  1.00 39.86           C  
+ATOM   1897  NZ  LYS A 248      23.723  83.031   8.233  1.00 42.16           N  
+ATOM   1898  N   SER A 249      17.600  82.556   5.535  1.00 24.84           N  
+ATOM   1899  CA  SER A 249      16.586  82.837   4.546  1.00 24.86           C  
+ATOM   1900  C   SER A 249      17.204  83.500   3.310  1.00 23.82           C  
+ATOM   1901  O   SER A 249      18.019  84.403   3.566  1.00 21.16           O  
+ATOM   1902  CB  SER A 249      15.691  83.977   5.146  1.00 26.60           C  
+ATOM   1903  OG  SER A 249      14.521  83.315   5.573  1.00 31.36           O  
+ATOM   1904  N   TYR A 250      16.859  83.057   2.099  1.00 19.26           N  
+ATOM   1905  CA  TYR A 250      17.531  83.687   0.935  1.00 21.04           C  
+ATOM   1906  C   TYR A 250      16.448  84.307   0.075  1.00 21.32           C  
+ATOM   1907  O   TYR A 250      15.632  83.593  -0.538  1.00 19.98           O  
+ATOM   1908  CB  TYR A 250      18.336  82.649   0.129  1.00 19.11           C  
+ATOM   1909  CG  TYR A 250      19.527  82.131   0.907  1.00 19.35           C  
+ATOM   1910  CD1 TYR A 250      19.341  81.030   1.729  1.00 19.89           C  
+ATOM   1911  CD2 TYR A 250      20.775  82.733   0.882  1.00 20.02           C  
+ATOM   1912  CE1 TYR A 250      20.384  80.505   2.480  1.00 19.18           C  
+ATOM   1913  CE2 TYR A 250      21.816  82.237   1.641  1.00 20.59           C  
+ATOM   1914  CZ  TYR A 250      21.603  81.116   2.425  1.00 20.45           C  
+ATOM   1915  OH  TYR A 250      22.620  80.577   3.198  1.00 21.79           O  
+ATOM   1916  N   GLU A 251      16.357  85.626   0.123  1.00 23.34           N  
+ATOM   1917  CA  GLU A 251      15.334  86.351  -0.583  1.00 25.33           C  
+ATOM   1918  C   GLU A 251      15.278  86.023  -2.080  1.00 24.07           C  
+ATOM   1919  O   GLU A 251      16.288  86.165  -2.754  1.00 23.97           O  
+ATOM   1920  CB  GLU A 251      15.540  87.890  -0.477  1.00 29.45           C  
+ATOM   1921  CG  GLU A 251      14.167  88.574  -0.563  1.00 36.84           C  
+ATOM   1922  CD  GLU A 251      13.311  88.131   0.630  1.00 41.39           C  
+ATOM   1923  OE1 GLU A 251      13.936  88.024   1.723  1.00 43.88           O  
+ATOM   1924  OE2 GLU A 251      12.092  87.869   0.480  1.00 43.37           O  
+ATOM   1925  N   GLY A 252      14.103  85.637  -2.533  1.00 23.71           N  
+ATOM   1926  CA  GLY A 252      13.797  85.384  -3.929  1.00 22.29           C  
+ATOM   1927  C   GLY A 252      14.442  84.138  -4.539  1.00 22.08           C  
+ATOM   1928  O   GLY A 252      14.311  84.005  -5.774  1.00 17.92           O  
+ATOM   1929  N   LEU A 253      15.113  83.276  -3.746  1.00 18.87           N  
+ATOM   1930  CA  LEU A 253      15.782  82.129  -4.429  1.00 16.86           C  
+ATOM   1931  C   LEU A 253      14.840  80.969  -4.577  1.00 15.26           C  
+ATOM   1932  O   LEU A 253      13.916  80.801  -3.793  1.00 13.98           O  
+ATOM   1933  CB  LEU A 253      17.073  81.807  -3.678  1.00 17.62           C  
+ATOM   1934  CG  LEU A 253      18.170  82.874  -3.713  1.00 18.37           C  
+ATOM   1935  CD1 LEU A 253      19.495  82.262  -3.294  1.00 17.40           C  
+ATOM   1936  CD2 LEU A 253      18.181  83.594  -5.069  1.00 18.65           C  
+ATOM   1937  N   PRO A 254      15.091  80.055  -5.527  1.00 14.37           N  
+ATOM   1938  CA  PRO A 254      14.214  78.972  -5.827  1.00 13.57           C  
+ATOM   1939  C   PRO A 254      14.480  77.679  -5.056  1.00 13.95           C  
+ATOM   1940  O   PRO A 254      15.412  77.616  -4.256  1.00 13.92           O  
+ATOM   1941  CB  PRO A 254      14.532  78.682  -7.310  1.00 12.53           C  
+ATOM   1942  CG  PRO A 254      15.982  78.940  -7.381  1.00 13.12           C  
+ATOM   1943  CD  PRO A 254      16.215  80.175  -6.505  1.00 13.32           C  
+ATOM   1944  N   HIS A 255      13.705  76.654  -5.425  1.00 11.11           N  
+ATOM   1945  CA  HIS A 255      13.911  75.361  -4.770  1.00 14.52           C  
+ATOM   1946  C   HIS A 255      15.279  74.772  -5.064  1.00 13.83           C  
+ATOM   1947  O   HIS A 255      15.953  74.248  -4.166  1.00 13.63           O  
+ATOM   1948  CB  HIS A 255      12.793  74.411  -5.215  1.00 14.63           C  
+ATOM   1949  CG  HIS A 255      12.841  73.123  -4.440  1.00 15.65           C  
+ATOM   1950  ND1 HIS A 255      12.661  73.118  -3.063  1.00 14.47           N  
+ATOM   1951  CD2 HIS A 255      12.982  71.841  -4.821  1.00 14.90           C  
+ATOM   1952  CE1 HIS A 255      12.728  71.871  -2.635  1.00 16.38           C  
+ATOM   1953  NE2 HIS A 255      12.914  71.059  -3.672  1.00 16.38           N  
+ATOM   1954  N   GLY A 256      15.738  74.913  -6.317  1.00 12.47           N  
+ATOM   1955  CA  GLY A 256      17.052  74.301  -6.642  1.00 12.60           C  
+ATOM   1956  C   GLY A 256      18.140  75.335  -6.530  1.00 13.71           C  
+ATOM   1957  O   GLY A 256      19.067  75.356  -7.331  1.00 12.53           O  
+ATOM   1958  N   MET A 257      18.102  76.205  -5.467  1.00 11.47           N  
+ATOM   1959  CA  MET A 257      19.094  77.264  -5.378  1.00 11.88           C  
+ATOM   1960  C   MET A 257      20.504  76.798  -5.196  1.00 10.29           C  
+ATOM   1961  O   MET A 257      21.404  77.594  -5.462  1.00 11.06           O  
+ATOM   1962  CB  MET A 257      18.801  78.260  -4.206  1.00 14.18           C  
+ATOM   1963  CG  MET A 257      18.670  77.500  -2.869  1.00 15.11           C  
+ATOM   1964  SD  MET A 257      18.139  78.639  -1.535  1.00 15.54           S  
+ATOM   1965  CE  MET A 257      18.290  77.519  -0.105  1.00 15.63           C  
+ATOM   1966  N   LEU A 258      20.784  75.563  -4.755  1.00 11.32           N  
+ATOM   1967  CA  LEU A 258      22.186  75.150  -4.629  1.00 13.70           C  
+ATOM   1968  C   LEU A 258      22.841  75.027  -6.032  1.00 14.34           C  
+ATOM   1969  O   LEU A 258      24.087  74.955  -6.072  1.00 12.79           O  
+ATOM   1970  CB  LEU A 258      22.253  73.770  -3.966  1.00 14.69           C  
+ATOM   1971  CG  LEU A 258      21.924  73.823  -2.455  1.00 15.37           C  
+ATOM   1972  CD1 LEU A 258      21.534  72.409  -2.065  1.00 16.20           C  
+ATOM   1973  CD2 LEU A 258      23.103  74.332  -1.659  1.00 13.34           C  
+ATOM   1974  N   SER A 259      22.008  74.873  -7.055  1.00 12.71           N  
+ATOM   1975  CA  SER A 259      22.566  74.797  -8.418  1.00 14.13           C  
+ATOM   1976  C   SER A 259      22.454  76.123  -9.176  1.00 13.04           C  
+ATOM   1977  O   SER A 259      23.329  76.391 -10.009  1.00 13.89           O  
+ATOM   1978  CB  SER A 259      21.768  73.704  -9.173  1.00 14.12           C  
+ATOM   1979  OG  SER A 259      22.209  72.459  -8.637  1.00 15.46           O  
+ATOM   1980  N   THR A 260      21.486  76.988  -8.825  1.00 12.37           N  
+ATOM   1981  CA  THR A 260      21.375  78.240  -9.592  1.00 14.17           C  
+ATOM   1982  C   THR A 260      22.195  79.340  -8.927  1.00 16.88           C  
+ATOM   1983  O   THR A 260      22.782  80.222  -9.554  1.00 14.34           O  
+ATOM   1984  CB  THR A 260      19.914  78.694  -9.696  1.00 15.13           C  
+ATOM   1985  OG1 THR A 260      19.341  78.786  -8.389  1.00 12.51           O  
+ATOM   1986  CG2 THR A 260      19.047  77.700 -10.495  1.00 15.43           C  
+ATOM   1987  N   HIS A 261      22.357  79.243  -7.588  1.00 14.37           N  
+ATOM   1988  CA  HIS A 261      23.126  80.290  -6.900  1.00 14.38           C  
+ATOM   1989  C   HIS A 261      24.158  79.717  -5.953  1.00 14.70           C  
+ATOM   1990  O   HIS A 261      24.202  80.098  -4.757  1.00 14.22           O  
+ATOM   1991  CB  HIS A 261      22.090  81.091  -6.044  1.00 12.97           C  
+ATOM   1992  CG  HIS A 261      21.129  81.840  -6.895  1.00 14.62           C  
+ATOM   1993  ND1 HIS A 261      19.997  81.283  -7.428  1.00 13.83           N  
+ATOM   1994  CD2 HIS A 261      21.196  83.114  -7.399  1.00 16.52           C  
+ATOM   1995  CE1 HIS A 261      19.356  82.163  -8.187  1.00 16.22           C  
+ATOM   1996  NE2 HIS A 261      20.075  83.273  -8.173  1.00 16.57           N  
+ATOM   1997  N   PRO A 262      25.021  78.803  -6.384  1.00 12.56           N  
+ATOM   1998  CA  PRO A 262      26.010  78.176  -5.529  1.00 12.94           C  
+ATOM   1999  C   PRO A 262      26.982  79.194  -4.950  1.00 14.51           C  
+ATOM   2000  O   PRO A 262      27.566  79.026  -3.890  1.00 14.12           O  
+ATOM   2001  CB  PRO A 262      26.774  77.198  -6.471  1.00 11.50           C  
+ATOM   2002  CG  PRO A 262      26.644  77.927  -7.814  1.00 13.49           C  
+ATOM   2003  CD  PRO A 262      25.174  78.297  -7.767  1.00 13.60           C  
+ATOM   2004  N   GLU A 263      27.333  80.261  -5.684  1.00 14.87           N  
+ATOM   2005  CA  GLU A 263      28.260  81.269  -5.183  1.00 17.68           C  
+ATOM   2006  C   GLU A 263      27.686  81.975  -3.936  1.00 18.93           C  
+ATOM   2007  O   GLU A 263      28.471  82.408  -3.044  1.00 19.21           O  
+ATOM   2008  CB  GLU A 263      28.615  82.273  -6.296  1.00 17.10           C  
+ATOM   2009  CG  GLU A 263      27.452  83.187  -6.605  1.00 22.08           C  
+ATOM   2010  CD  GLU A 263      26.362  82.535  -7.472  1.00 26.54           C  
+ATOM   2011  OE1 GLU A 263      26.613  81.423  -8.032  1.00 27.63           O  
+ATOM   2012  OE2 GLU A 263      25.257  83.132  -7.613  1.00 27.42           O  
+ATOM   2013  N   VAL A 264      26.380  82.049  -3.779  1.00 17.24           N  
+ATOM   2014  CA  VAL A 264      25.798  82.618  -2.556  1.00 18.73           C  
+ATOM   2015  C   VAL A 264      25.769  81.586  -1.433  1.00 20.06           C  
+ATOM   2016  O   VAL A 264      26.226  81.820  -0.309  1.00 17.96           O  
+ATOM   2017  CB  VAL A 264      24.345  83.086  -2.827  1.00 19.60           C  
+ATOM   2018  CG1 VAL A 264      23.656  83.555  -1.540  1.00 20.68           C  
+ATOM   2019  CG2 VAL A 264      24.328  84.231  -3.829  1.00 20.42           C  
+ATOM   2020  N   LEU A 265      25.302  80.367  -1.716  1.00 17.50           N  
+ATOM   2021  CA  LEU A 265      25.102  79.334  -0.718  1.00 17.19           C  
+ATOM   2022  C   LEU A 265      26.328  78.624  -0.173  1.00 16.22           C  
+ATOM   2023  O   LEU A 265      26.385  78.374   1.046  1.00 16.14           O  
+ATOM   2024  CB  LEU A 265      24.179  78.257  -1.345  1.00 17.49           C  
+ATOM   2025  CG  LEU A 265      22.683  78.258  -1.058  1.00 21.30           C  
+ATOM   2026  CD1 LEU A 265      22.400  78.031   0.427  1.00 23.41           C  
+ATOM   2027  CD2 LEU A 265      22.010  79.539  -1.517  1.00 21.84           C  
+ATOM   2028  N   ASN A 266      27.319  78.338  -1.027  1.00 14.29           N  
+ATOM   2029  CA  ASN A 266      28.483  77.567  -0.680  1.00 14.50           C  
+ATOM   2030  C   ASN A 266      29.285  78.175   0.477  1.00 15.93           C  
+ATOM   2031  O   ASN A 266      29.642  77.462   1.405  1.00 13.70           O  
+ATOM   2032  CB  ASN A 266      29.387  77.283  -1.882  1.00 15.15           C  
+ATOM   2033  CG  ASN A 266      28.839  76.233  -2.856  1.00 16.40           C  
+ATOM   2034  OD1 ASN A 266      27.768  75.674  -2.595  1.00 16.53           O  
+ATOM   2035  ND2 ASN A 266      29.496  76.035  -3.987  1.00 17.41           N  
+ATOM   2036  N   PRO A 267      29.535  79.477   0.435  1.00 16.09           N  
+ATOM   2037  CA  PRO A 267      30.301  80.112   1.521  1.00 17.58           C  
+ATOM   2038  C   PRO A 267      29.577  79.998   2.862  1.00 16.92           C  
+ATOM   2039  O   PRO A 267      30.183  79.818   3.928  1.00 18.06           O  
+ATOM   2040  CB  PRO A 267      30.362  81.581   1.073  1.00 18.07           C  
+ATOM   2041  CG  PRO A 267      30.253  81.514  -0.437  1.00 17.37           C  
+ATOM   2042  CD  PRO A 267      29.220  80.411  -0.664  1.00 16.05           C  
+ATOM   2043  N   ASP A 268      28.261  80.080   2.895  1.00 16.99           N  
+ATOM   2044  CA  ASP A 268      27.429  79.945   4.080  1.00 17.51           C  
+ATOM   2045  C   ASP A 268      27.431  78.498   4.566  1.00 19.19           C  
+ATOM   2046  O   ASP A 268      27.490  78.286   5.791  1.00 18.17           O  
+ATOM   2047  CB  ASP A 268      25.958  80.324   3.878  1.00 18.39           C  
+ATOM   2048  CG  ASP A 268      25.819  81.826   3.658  1.00 21.89           C  
+ATOM   2049  OD1 ASP A 268      26.795  82.562   3.864  1.00 23.14           O  
+ATOM   2050  OD2 ASP A 268      24.732  82.256   3.232  1.00 22.88           O  
+ATOM   2051  N   LEU A 269      27.413  77.519   3.602  1.00 15.58           N  
+ATOM   2052  CA  LEU A 269      27.545  76.143   4.099  1.00 16.81           C  
+ATOM   2053  C   LEU A 269      28.913  75.931   4.741  1.00 16.08           C  
+ATOM   2054  O   LEU A 269      29.055  75.220   5.747  1.00 15.61           O  
+ATOM   2055  CB  LEU A 269      27.332  75.119   2.960  1.00 15.57           C  
+ATOM   2056  CG  LEU A 269      26.015  75.252   2.182  1.00 17.03           C  
+ATOM   2057  CD1 LEU A 269      25.956  74.223   1.028  1.00 16.82           C  
+ATOM   2058  CD2 LEU A 269      24.860  74.857   3.129  1.00 19.95           C  
+ATOM   2059  N   LEU A 270      29.963  76.462   4.113  1.00 13.05           N  
+ATOM   2060  CA  LEU A 270      31.321  76.362   4.554  1.00 15.60           C  
+ATOM   2061  C   LEU A 270      31.523  76.975   5.951  1.00 16.88           C  
+ATOM   2062  O   LEU A 270      32.149  76.339   6.808  1.00 18.26           O  
+ATOM   2063  CB  LEU A 270      32.313  77.096   3.612  1.00 17.08           C  
+ATOM   2064  CG  LEU A 270      33.794  76.980   3.956  1.00 17.88           C  
+ATOM   2065  CD1 LEU A 270      34.284  75.540   4.059  1.00 17.42           C  
+ATOM   2066  CD2 LEU A 270      34.647  77.758   2.938  1.00 18.93           C  
+ATOM   2067  N   ALA A 271      30.972  78.148   6.154  1.00 16.94           N  
+ATOM   2068  CA  ALA A 271      31.078  78.853   7.444  1.00 18.93           C  
+ATOM   2069  C   ALA A 271      30.507  78.005   8.584  1.00 21.00           C  
+ATOM   2070  O   ALA A 271      31.103  77.781   9.646  1.00 18.11           O  
+ATOM   2071  CB  ALA A 271      30.241  80.146   7.263  1.00 18.68           C  
+ATOM   2072  N   PHE A 272      29.367  77.364   8.278  1.00 20.97           N  
+ATOM   2073  CA  PHE A 272      28.690  76.486   9.230  1.00 21.95           C  
+ATOM   2074  C   PHE A 272      29.514  75.254   9.516  1.00 24.01           C  
+ATOM   2075  O   PHE A 272      29.686  74.851  10.663  1.00 25.21           O  
+ATOM   2076  CB  PHE A 272      27.276  76.155   8.733  1.00 21.93           C  
+ATOM   2077  CG  PHE A 272      26.507  75.280   9.698  1.00 22.54           C  
+ATOM   2078  CD1 PHE A 272      25.909  75.842  10.827  1.00 23.69           C  
+ATOM   2079  CD2 PHE A 272      26.407  73.925   9.494  1.00 21.33           C  
+ATOM   2080  CE1 PHE A 272      25.211  75.033  11.713  1.00 22.50           C  
+ATOM   2081  CE2 PHE A 272      25.695  73.113  10.359  1.00 22.51           C  
+ATOM   2082  CZ  PHE A 272      25.113  73.681  11.487  1.00 22.56           C  
+ATOM   2083  N   VAL A 273      30.092  74.614   8.488  1.00 22.45           N  
+ATOM   2084  CA  VAL A 273      30.925  73.452   8.729  1.00 23.66           C  
+ATOM   2085  C   VAL A 273      32.178  73.821   9.517  1.00 26.23           C  
+ATOM   2086  O   VAL A 273      32.595  72.962  10.320  1.00 25.36           O  
+ATOM   2087  CB  VAL A 273      31.223  72.725   7.427  1.00 21.42           C  
+ATOM   2088  CG1 VAL A 273      32.125  71.532   7.647  1.00 22.68           C  
+ATOM   2089  CG2 VAL A 273      29.877  72.277   6.838  1.00 19.99           C  
+ATOM   2090  N   LYS A 274      32.729  75.022   9.328  1.00 27.59           N  
+ATOM   2091  CA  LYS A 274      33.900  75.418  10.106  1.00 32.61           C  
+ATOM   2092  C   LYS A 274      33.630  75.908  11.526  1.00 35.38           C  
+ATOM   2093  O   LYS A 274      34.520  75.919  12.383  1.00 37.25           O  
+ATOM   2094  CB  LYS A 274      34.529  76.619   9.393  1.00 31.85           C  
+ATOM   2095  CG  LYS A 274      35.297  76.340   8.119  1.00 32.44           C  
+ATOM   2096  CD  LYS A 274      36.012  77.641   7.763  1.00 33.40           C  
+ATOM   2097  CE  LYS A 274      37.391  77.436   7.167  1.00 35.22           C  
+ATOM   2098  NZ  LYS A 274      37.759  78.681   6.408  1.00 36.95           N  
+ATOM   2099  N   SER A 275      32.469  76.450  11.830  1.00 37.38           N  
+ATOM   2100  CA  SER A 275      32.096  76.962  13.128  1.00 39.67           C  
+ATOM   2101  C   SER A 275      32.157  75.977  14.288  1.00 40.91           C  
+ATOM   2102  O   SER A 275      31.980  76.499  15.432  1.00 43.49           O  
+ATOM   2103  CB  SER A 275      30.648  77.488  13.091  1.00 39.47           C  
+ATOM   2104  OG  SER A 275      29.849  76.295  12.959  1.00 41.94           O  
+ATOM   2105  OXT SER A 275      32.192  74.734  14.203  1.00 41.57           O  
+TER    2106      SER A 275                                                      
+END   
diff --git a/loop/tests/data/1A88A_with_gap.pdb b/loop/tests/data/1A88A_with_gap.pdb
new file mode 100644
index 0000000000000000000000000000000000000000..bb1cca6d8cddfc94ef7c43c6fd3b6cb0ffea6480
--- /dev/null
+++ b/loop/tests/data/1A88A_with_gap.pdb
@@ -0,0 +1,2081 @@
+ATOM      1  N   GLY A   1      31.764  53.257  -5.145  1.00 21.92           N  
+ATOM      2  CA  GLY A   1      31.661  51.955  -4.451  1.00 20.38           C  
+ATOM      3  C   GLY A   1      30.228  51.594  -4.213  1.00 22.43           C  
+ATOM      4  O   GLY A   1      29.301  52.280  -4.687  1.00 20.07           O  
+ATOM      5  N   THR A   2      29.953  50.447  -3.576  1.00 20.81           N  
+ATOM      6  CA  THR A   2      28.571  50.144  -3.254  1.00 24.30           C  
+ATOM      7  C   THR A   2      28.510  49.528  -1.854  1.00 24.57           C  
+ATOM      8  O   THR A   2      29.507  48.974  -1.349  1.00 24.04           O  
+ATOM      9  CB  THR A   2      27.886  49.192  -4.253  1.00 28.12           C  
+ATOM     10  OG1 THR A   2      28.529  47.925  -4.086  1.00 31.49           O  
+ATOM     11  CG2 THR A   2      27.965  49.541  -5.730  1.00 27.46           C  
+ATOM     12  N   VAL A   3      27.370  49.622  -1.203  1.00 22.42           N  
+ATOM     13  CA  VAL A   3      27.147  49.017   0.095  1.00 24.30           C  
+ATOM     14  C   VAL A   3      25.861  48.228  -0.035  1.00 23.74           C  
+ATOM     15  O   VAL A   3      24.906  48.622  -0.722  1.00 22.67           O  
+ATOM     16  CB  VAL A   3      27.028  49.956   1.302  1.00 25.50           C  
+ATOM     17  CG1 VAL A   3      28.381  50.584   1.663  1.00 27.68           C  
+ATOM     18  CG2 VAL A   3      26.103  51.113   1.034  1.00 27.65           C  
+ATOM     19  N   THR A   4      25.854  47.062   0.574  1.00 23.05           N  
+ATOM     20  CA  THR A   4      24.672  46.202   0.570  1.00 26.31           C  
+ATOM     21  C   THR A   4      23.829  46.421   1.812  1.00 26.75           C  
+ATOM     22  O   THR A   4      24.377  46.407   2.918  1.00 29.12           O  
+ATOM     23  CB  THR A   4      25.103  44.726   0.458  1.00 27.13           C  
+ATOM     24  OG1 THR A   4      25.713  44.592  -0.829  1.00 27.43           O  
+ATOM     25  CG2 THR A   4      23.903  43.814   0.614  1.00 28.43           C  
+ATOM     26  N   THR A   5      22.536  46.692   1.686  1.00 24.64           N  
+ATOM     27  CA  THR A   5      21.727  46.951   2.868  1.00 26.94           C  
+ATOM     28  C   THR A   5      21.173  45.630   3.423  1.00 28.87           C  
+ATOM     29  O   THR A   5      21.359  44.560   2.825  1.00 28.63           O  
+ATOM     30  CB  THR A   5      20.563  47.904   2.493  1.00 25.62           C  
+ATOM     31  OG1 THR A   5      19.773  47.127   1.610  1.00 22.98           O  
+ATOM     32  CG2 THR A   5      21.081  49.182   1.837  1.00 26.21           C  
+ATOM     33  N   SER A   6      20.416  45.706   4.512  1.00 32.07           N  
+ATOM     34  CA  SER A   6      19.914  44.475   5.151  1.00 34.50           C  
+ATOM     35  C   SER A   6      19.034  43.646   4.242  1.00 34.88           C  
+ATOM     36  O   SER A   6      19.264  42.413   4.164  1.00 35.66           O  
+ATOM     37  CB  SER A   6      19.260  44.760   6.491  1.00 36.17           C  
+ATOM     38  OG  SER A   6      18.258  45.742   6.449  1.00 38.37           O  
+ATOM     39  N   ASP A   7      18.170  44.274   3.432  1.00 32.57           N  
+ATOM     40  CA  ASP A   7      17.369  43.488   2.491  1.00 29.56           C  
+ATOM     41  C   ASP A   7      18.127  43.106   1.244  1.00 28.25           C  
+ATOM     42  O   ASP A   7      17.502  42.669   0.288  1.00 27.90           O  
+ATOM     43  CB  ASP A   7      16.076  44.231   2.182  1.00 30.52           C  
+ATOM     44  CG  ASP A   7      16.170  45.511   1.376  1.00 30.30           C  
+ATOM     45  OD1 ASP A   7      17.263  45.876   0.931  1.00 29.25           O  
+ATOM     46  OD2 ASP A   7      15.127  46.180   1.159  1.00 30.59           O  
+ATOM     47  N   GLY A   8      19.443  43.249   1.129  1.00 28.74           N  
+ATOM     48  CA  GLY A   8      20.172  42.928  -0.091  1.00 26.98           C  
+ATOM     49  C   GLY A   8      20.152  44.009  -1.155  1.00 26.24           C  
+ATOM     50  O   GLY A   8      20.644  43.753  -2.272  1.00 27.20           O  
+ATOM     51  N   THR A   9      19.679  45.229  -0.886  1.00 24.00           N  
+ATOM     52  CA  THR A   9      19.710  46.283  -1.920  1.00 21.61           C  
+ATOM     53  C   THR A   9      21.108  46.857  -2.041  1.00 21.67           C  
+ATOM     54  O   THR A   9      21.691  47.226  -0.998  1.00 23.64           O  
+ATOM     55  CB  THR A   9      18.718  47.393  -1.543  1.00 20.75           C  
+ATOM     56  OG1 THR A   9      17.407  46.802  -1.546  1.00 19.41           O  
+ATOM     57  CG2 THR A   9      18.638  48.560  -2.556  1.00 20.13           C  
+ATOM     58  N   ASN A  10      21.661  47.017  -3.238  1.00 20.77           N  
+ATOM     59  CA  ASN A  10      22.961  47.660  -3.391  1.00 19.56           C  
+ATOM     60  C   ASN A  10      22.762  49.172  -3.633  1.00 19.39           C  
+ATOM     61  O   ASN A  10      21.969  49.567  -4.476  1.00 17.13           O  
+ATOM     62  CB  ASN A  10      23.826  47.103  -4.513  1.00 21.53           C  
+ATOM     63  CG  ASN A  10      24.198  45.658  -4.181  1.00 25.77           C  
+ATOM     64  OD1 ASN A  10      24.782  45.354  -3.145  1.00 26.65           O  
+ATOM     65  ND2 ASN A  10      23.789  44.748  -5.050  1.00 27.54           N  
+ATOM     66  N   ILE A  11      23.488  49.953  -2.852  1.00 16.01           N  
+ATOM     67  CA  ILE A  11      23.473  51.404  -2.847  1.00 16.13           C  
+ATOM     68  C   ILE A  11      24.788  51.907  -3.415  1.00 16.10           C  
+ATOM     69  O   ILE A  11      25.885  51.559  -2.908  1.00 16.08           O  
+ATOM     70  CB  ILE A  11      23.303  51.881  -1.391  1.00 17.18           C  
+ATOM     71  CG1 ILE A  11      21.912  51.467  -0.888  1.00 19.25           C  
+ATOM     72  CG2 ILE A  11      23.543  53.372  -1.267  1.00 18.69           C  
+ATOM     73  CD1 ILE A  11      20.760  52.090  -1.647  1.00 20.48           C  
+ATOM     74  N   PHE A  12      24.721  52.715  -4.453  1.00 13.95           N  
+ATOM     75  CA  PHE A  12      25.910  53.287  -5.056  1.00 14.01           C  
+ATOM     76  C   PHE A  12      26.339  54.517  -4.270  1.00 12.98           C  
+ATOM     77  O   PHE A  12      25.429  55.281  -3.898  1.00 13.88           O  
+ATOM     78  CB  PHE A  12      25.591  53.711  -6.492  1.00 15.02           C  
+ATOM     79  CG  PHE A  12      26.707  54.477  -7.135  1.00 14.64           C  
+ATOM     80  CD1 PHE A  12      27.755  53.821  -7.735  1.00 17.30           C  
+ATOM     81  CD2 PHE A  12      26.704  55.871  -7.114  1.00 16.10           C  
+ATOM     82  CE1 PHE A  12      28.803  54.564  -8.314  1.00 19.46           C  
+ATOM     83  CE2 PHE A  12      27.731  56.593  -7.686  1.00 16.45           C  
+ATOM     84  CZ  PHE A  12      28.800  55.939  -8.274  1.00 17.84           C  
+ATOM     85  N   TYR A  13      27.618  54.770  -4.068  1.00 12.68           N  
+ATOM     86  CA  TYR A  13      28.049  56.000  -3.392  1.00 13.94           C  
+ATOM     87  C   TYR A  13      29.396  56.458  -3.960  1.00 14.49           C  
+ATOM     88  O   TYR A  13      30.149  55.633  -4.485  1.00 17.10           O  
+ATOM     89  CB  TYR A  13      28.088  55.911  -1.875  1.00 14.70           C  
+ATOM     90  CG  TYR A  13      29.266  55.041  -1.436  1.00 15.23           C  
+ATOM     91  CD1 TYR A  13      29.092  53.684  -1.286  1.00 18.01           C  
+ATOM     92  CD2 TYR A  13      30.494  55.626  -1.162  1.00 15.71           C  
+ATOM     93  CE1 TYR A  13      30.171  52.871  -0.884  1.00 19.66           C  
+ATOM     94  CE2 TYR A  13      31.567  54.830  -0.767  1.00 18.64           C  
+ATOM     95  CZ  TYR A  13      31.375  53.471  -0.630  1.00 20.23           C  
+ATOM     96  OH  TYR A  13      32.456  52.691  -0.281  1.00 22.12           O  
+ATOM     97  N   LYS A  14      29.691  57.735  -3.805  1.00 12.68           N  
+ATOM     98  CA  LYS A  14      30.973  58.308  -4.186  1.00 13.28           C  
+ATOM     99  C   LYS A  14      31.725  58.680  -2.905  1.00 13.70           C  
+ATOM    100  O   LYS A  14      31.028  59.140  -1.993  1.00 11.22           O  
+ATOM    101  CB  LYS A  14      30.729  59.646  -4.936  1.00 13.56           C  
+ATOM    102  CG  LYS A  14      30.055  59.407  -6.293  1.00 17.04           C  
+ATOM    103  CD  LYS A  14      29.598  60.791  -6.803  1.00 16.95           C  
+ATOM    104  CE  LYS A  14      28.859  60.613  -8.109  1.00 16.88           C  
+ATOM    105  NZ  LYS A  14      29.275  61.643  -9.079  1.00 11.46           N  
+ATOM    106  N   ASP A  15      33.039  58.630  -2.881  1.00 13.17           N  
+ATOM    107  CA  ASP A  15      33.772  58.981  -1.642  1.00 13.31           C  
+ATOM    108  C   ASP A  15      35.071  59.625  -2.089  1.00 11.64           C  
+ATOM    109  O   ASP A  15      35.924  58.884  -2.645  1.00 14.33           O  
+ATOM    110  CB  ASP A  15      33.950  57.676  -0.842  1.00 12.42           C  
+ATOM    111  CG  ASP A  15      34.829  57.878   0.408  1.00 15.23           C  
+ATOM    112  OD1 ASP A  15      35.255  58.979   0.772  1.00 13.01           O  
+ATOM    113  OD2 ASP A  15      35.082  56.850   1.085  1.00 16.31           O  
+ATOM    114  N   TRP A  16      35.150  60.930  -2.143  1.00 10.20           N  
+ATOM    115  CA  TRP A  16      36.325  61.577  -2.730  1.00 12.29           C  
+ATOM    116  C   TRP A  16      37.051  62.386  -1.642  1.00 14.41           C  
+ATOM    117  O   TRP A  16      36.387  62.801  -0.682  1.00 13.69           O  
+ATOM    118  CB  TRP A  16      35.855  62.542  -3.828  1.00 10.66           C  
+ATOM    119  CG  TRP A  16      35.204  61.854  -5.012  1.00 12.83           C  
+ATOM    120  CD1 TRP A  16      35.261  60.566  -5.385  1.00 12.58           C  
+ATOM    121  CD2 TRP A  16      34.300  62.500  -5.933  1.00 11.99           C  
+ATOM    122  NE1 TRP A  16      34.476  60.347  -6.517  1.00 12.31           N  
+ATOM    123  CE2 TRP A  16      33.894  61.529  -6.854  1.00 12.96           C  
+ATOM    124  CE3 TRP A  16      33.863  63.805  -6.096  1.00 12.84           C  
+ATOM    125  CZ2 TRP A  16      33.033  61.840  -7.937  1.00 12.24           C  
+ATOM    126  CZ3 TRP A  16      32.989  64.124  -7.129  1.00 12.81           C  
+ATOM    127  CH2 TRP A  16      32.614  63.126  -8.056  1.00 11.63           C  
+ATOM    128  N   GLY A  17      38.327  62.678  -1.836  1.00 17.50           N  
+ATOM    129  CA  GLY A  17      39.037  63.578  -0.895  1.00 18.73           C  
+ATOM    130  C   GLY A  17      39.896  62.740   0.057  1.00 19.98           C  
+ATOM    131  O   GLY A  17      39.945  61.518   0.012  1.00 19.39           O  
+ATOM    158  N   GLY A  21      40.147  63.261   6.100  1.00 30.99           N  
+ATOM    159  CA  GLY A  21      39.492  64.571   6.194  1.00 26.89           C  
+ATOM    160  C   GLY A  21      38.152  64.415   6.929  1.00 22.01           C  
+ATOM    161  O   GLY A  21      37.607  63.326   7.088  1.00 22.45           O  
+ATOM    162  N   LEU A  22      37.637  65.525   7.423  1.00 20.89           N  
+ATOM    163  CA  LEU A  22      36.318  65.546   8.044  1.00 20.96           C  
+ATOM    164  C   LEU A  22      35.310  65.216   6.920  1.00 18.65           C  
+ATOM    165  O   LEU A  22      35.317  65.884   5.892  1.00 16.52           O  
+ATOM    166  CB  LEU A  22      36.062  66.963   8.579  1.00 23.41           C  
+ATOM    167  CG  LEU A  22      34.860  67.108   9.534  1.00 26.98           C  
+ATOM    168  CD1 LEU A  22      35.133  68.301  10.477  1.00 29.41           C  
+ATOM    169  CD2 LEU A  22      33.525  67.302   8.834  1.00 24.72           C  
+ATOM    170  N   PRO A  23      34.436  64.282   7.178  1.00 19.30           N  
+ATOM    171  CA  PRO A  23      33.458  63.817   6.200  1.00 18.80           C  
+ATOM    172  C   PRO A  23      32.221  64.691   6.196  1.00 18.74           C  
+ATOM    173  O   PRO A  23      31.644  65.078   7.210  1.00 17.64           O  
+ATOM    174  CB  PRO A  23      33.177  62.378   6.574  1.00 18.76           C  
+ATOM    175  CG  PRO A  23      33.526  62.281   8.023  1.00 19.59           C  
+ATOM    176  CD  PRO A  23      34.437  63.395   8.370  1.00 19.10           C  
+ATOM    177  N   VAL A  24      31.857  65.067   4.984  1.00 15.22           N  
+ATOM    178  CA  VAL A  24      30.666  65.851   4.685  1.00 14.77           C  
+ATOM    179  C   VAL A  24      29.880  64.955   3.716  1.00 15.60           C  
+ATOM    180  O   VAL A  24      30.435  64.510   2.703  1.00 12.24           O  
+ATOM    181  CB  VAL A  24      30.995  67.164   3.996  1.00 15.38           C  
+ATOM    182  CG1 VAL A  24      29.745  67.975   3.657  1.00 16.66           C  
+ATOM    183  CG2 VAL A  24      32.014  67.988   4.776  1.00 16.14           C  
+ATOM    184  N   VAL A  25      28.661  64.613   4.100  1.00 11.81           N  
+ATOM    185  CA  VAL A  25      27.855  63.658   3.382  1.00 13.59           C  
+ATOM    186  C   VAL A  25      26.637  64.372   2.797  1.00 15.07           C  
+ATOM    187  O   VAL A  25      25.956  65.085   3.546  1.00 13.74           O  
+ATOM    188  CB  VAL A  25      27.373  62.567   4.382  1.00 14.11           C  
+ATOM    189  CG1 VAL A  25      26.587  61.507   3.632  1.00 14.74           C  
+ATOM    190  CG2 VAL A  25      28.546  61.944   5.155  1.00 15.09           C  
+ATOM    191  N   PHE A  26      26.376  64.183   1.506  1.00 13.58           N  
+ATOM    192  CA  PHE A  26      25.329  64.934   0.801  1.00 11.26           C  
+ATOM    193  C   PHE A  26      24.176  64.016   0.412  1.00 12.76           C  
+ATOM    194  O   PHE A  26      24.410  62.857  -0.004  1.00 11.00           O  
+ATOM    195  CB  PHE A  26      25.949  65.535  -0.478  1.00 14.11           C  
+ATOM    196  CG  PHE A  26      26.984  66.586  -0.199  1.00 15.39           C  
+ATOM    197  CD1 PHE A  26      26.593  67.910  -0.023  1.00 15.42           C  
+ATOM    198  CD2 PHE A  26      28.326  66.268  -0.162  1.00 16.48           C  
+ATOM    199  CE1 PHE A  26      27.545  68.903   0.193  1.00 16.22           C  
+ATOM    200  CE2 PHE A  26      29.256  67.257   0.076  1.00 17.18           C  
+ATOM    201  CZ  PHE A  26      28.879  68.565   0.233  1.00 15.49           C  
+ATOM    202  N   HIS A  27      22.953  64.479   0.700  1.00 10.40           N  
+ATOM    203  CA  HIS A  27      21.741  63.695   0.513  1.00 10.97           C  
+ATOM    204  C   HIS A  27      20.861  64.399  -0.532  1.00 10.19           C  
+ATOM    205  O   HIS A  27      20.268  65.444  -0.288  1.00 10.60           O  
+ATOM    206  CB  HIS A  27      20.928  63.555   1.820  1.00 12.16           C  
+ATOM    207  CG  HIS A  27      21.690  62.862   2.925  1.00 13.43           C  
+ATOM    208  ND1 HIS A  27      21.303  61.629   3.408  1.00 11.63           N  
+ATOM    209  CD2 HIS A  27      22.799  63.260   3.606  1.00 13.24           C  
+ATOM    210  CE1 HIS A  27      22.178  61.292   4.370  1.00 13.22           C  
+ATOM    211  NE2 HIS A  27      23.080  62.246   4.517  1.00 14.11           N  
+ATOM    212  N   HIS A  28      20.768  63.845  -1.739  1.00 11.74           N  
+ATOM    213  CA  HIS A  28      20.054  64.500  -2.869  1.00  8.78           C  
+ATOM    214  C   HIS A  28      18.543  64.493  -2.752  1.00  8.92           C  
+ATOM    215  O   HIS A  28      17.962  63.740  -1.978  1.00  9.63           O  
+ATOM    216  CB  HIS A  28      20.461  63.767  -4.174  1.00  8.31           C  
+ATOM    217  CG  HIS A  28      19.935  62.361  -4.287  1.00  8.02           C  
+ATOM    218  ND1 HIS A  28      18.647  62.097  -4.703  1.00  9.36           N  
+ATOM    219  CD2 HIS A  28      20.522  61.136  -4.096  1.00  8.03           C  
+ATOM    220  CE1 HIS A  28      18.444  60.776  -4.717  1.00  8.99           C  
+ATOM    221  NE2 HIS A  28      19.585  60.178  -4.340  1.00  8.20           N  
+ATOM    222  N   GLY A  29      17.882  65.397  -3.499  1.00  8.82           N  
+ATOM    223  CA  GLY A  29      16.399  65.383  -3.410  1.00 11.02           C  
+ATOM    224  C   GLY A  29      15.779  64.461  -4.433  1.00 13.10           C  
+ATOM    225  O   GLY A  29      16.456  63.745  -5.198  1.00 12.97           O  
+ATOM    226  N   TRP A  30      14.453  64.507  -4.480  1.00 11.76           N  
+ATOM    227  CA  TRP A  30      13.667  63.723  -5.426  1.00 11.49           C  
+ATOM    228  C   TRP A  30      13.596  64.520  -6.749  1.00 12.32           C  
+ATOM    229  O   TRP A  30      13.446  65.735  -6.728  1.00 10.33           O  
+ATOM    230  CB  TRP A  30      12.257  63.685  -4.834  1.00 12.65           C  
+ATOM    231  CG  TRP A  30      11.208  63.037  -5.713  1.00 13.04           C  
+ATOM    232  CD1 TRP A  30      10.897  61.720  -5.802  1.00 11.74           C  
+ATOM    233  CD2 TRP A  30      10.368  63.738  -6.638  1.00 13.91           C  
+ATOM    234  NE1 TRP A  30       9.873  61.558  -6.709  1.00 14.39           N  
+ATOM    235  CE2 TRP A  30       9.548  62.789  -7.242  1.00 14.52           C  
+ATOM    236  CE3 TRP A  30      10.229  65.091  -6.973  1.00 16.58           C  
+ATOM    237  CZ2 TRP A  30       8.570  63.121  -8.189  1.00 15.85           C  
+ATOM    238  CZ3 TRP A  30       9.282  65.445  -7.944  1.00 18.55           C  
+ATOM    239  CH2 TRP A  30       8.470  64.454  -8.512  1.00 17.00           C  
+ATOM    240  N   PRO A  31      13.619  63.836  -7.877  1.00 11.13           N  
+ATOM    241  CA  PRO A  31      13.850  62.395  -8.042  1.00 10.21           C  
+ATOM    242  C   PRO A  31      15.280  62.256  -8.606  1.00 12.56           C  
+ATOM    243  O   PRO A  31      15.545  61.719  -9.664  1.00 10.78           O  
+ATOM    244  CB  PRO A  31      12.805  62.060  -9.113  1.00  9.67           C  
+ATOM    245  CG  PRO A  31      12.619  63.311  -9.931  1.00 12.03           C  
+ATOM    246  CD  PRO A  31      13.339  64.463  -9.208  1.00 10.61           C  
+ATOM    247  N   LEU A  32      16.312  62.805  -7.940  1.00 11.12           N  
+ATOM    248  CA  LEU A  32      17.635  62.897  -8.514  1.00 12.32           C  
+ATOM    249  C   LEU A  32      18.632  61.817  -8.119  1.00 11.18           C  
+ATOM    250  O   LEU A  32      18.288  60.643  -8.044  1.00 10.82           O  
+ATOM    251  CB  LEU A  32      18.163  64.345  -8.223  1.00  9.98           C  
+ATOM    252  CG  LEU A  32      17.094  65.384  -8.657  1.00 11.19           C  
+ATOM    253  CD1 LEU A  32      17.453  66.788  -8.236  1.00 13.84           C  
+ATOM    254  CD2 LEU A  32      16.988  65.391 -10.195  1.00 14.00           C  
+ATOM    255  N   SER A  33      19.906  62.179  -7.957  1.00 11.30           N  
+ATOM    256  CA  SER A  33      20.965  61.240  -7.666  1.00  9.67           C  
+ATOM    257  C   SER A  33      22.110  61.972  -6.953  1.00  8.43           C  
+ATOM    258  O   SER A  33      22.070  63.215  -6.846  1.00  7.20           O  
+ATOM    259  CB  SER A  33      21.403  60.628  -9.007  1.00 10.41           C  
+ATOM    260  OG  SER A  33      22.293  61.521  -9.675  1.00 10.51           O  
+ATOM    261  N   ALA A  34      23.177  61.302  -6.599  1.00  9.22           N  
+ATOM    262  CA  ALA A  34      24.351  61.885  -6.019  1.00  9.62           C  
+ATOM    263  C   ALA A  34      25.020  62.837  -7.012  1.00 10.11           C  
+ATOM    264  O   ALA A  34      25.658  63.792  -6.552  1.00  8.62           O  
+ATOM    265  CB  ALA A  34      25.363  60.804  -5.587  1.00 10.36           C  
+ATOM    266  N   ASP A  35      24.741  62.725  -8.306  1.00 10.17           N  
+ATOM    267  CA  ASP A  35      25.338  63.652  -9.285  1.00 10.79           C  
+ATOM    268  C   ASP A  35      24.786  65.055  -9.195  1.00 10.13           C  
+ATOM    269  O   ASP A  35      25.395  65.975  -9.752  1.00 10.35           O  
+ATOM    270  CB  ASP A  35      25.128  63.125 -10.716  1.00 10.95           C  
+ATOM    271  CG  ASP A  35      26.036  61.950 -10.989  1.00 13.32           C  
+ATOM    272  OD1 ASP A  35      26.762  61.509 -10.074  1.00 13.54           O  
+ATOM    273  OD2 ASP A  35      25.999  61.432 -12.143  1.00 15.25           O  
+ATOM    274  N   ASP A  36      23.653  65.296  -8.506  1.00  8.36           N  
+ATOM    275  CA  ASP A  36      23.147  66.659  -8.307  1.00  8.03           C  
+ATOM    276  C   ASP A  36      24.109  67.504  -7.475  1.00  9.21           C  
+ATOM    277  O   ASP A  36      23.956  68.727  -7.446  1.00 11.05           O  
+ATOM    278  CB  ASP A  36      21.751  66.553  -7.614  1.00 10.47           C  
+ATOM    279  CG  ASP A  36      20.924  67.813  -7.861  1.00 16.13           C  
+ATOM    280  OD1 ASP A  36      20.773  68.227  -9.024  1.00 17.12           O  
+ATOM    281  OD2 ASP A  36      20.439  68.471  -6.912  1.00 15.32           O  
+ATOM    282  N   TRP A  37      25.079  66.931  -6.753  1.00 10.46           N  
+ATOM    283  CA  TRP A  37      25.984  67.664  -5.858  1.00  7.76           C  
+ATOM    284  C   TRP A  37      27.297  68.042  -6.484  1.00  9.56           C  
+ATOM    285  O   TRP A  37      28.193  68.574  -5.791  1.00 11.85           O  
+ATOM    286  CB  TRP A  37      26.253  66.742  -4.622  1.00  7.60           C  
+ATOM    287  CG  TRP A  37      25.001  66.543  -3.784  1.00  9.11           C  
+ATOM    288  CD1 TRP A  37      24.267  65.410  -3.597  1.00  8.67           C  
+ATOM    289  CD2 TRP A  37      24.403  67.551  -2.961  1.00  8.08           C  
+ATOM    290  NE1 TRP A  37      23.223  65.663  -2.717  1.00 10.07           N  
+ATOM    291  CE2 TRP A  37      23.291  66.972  -2.332  1.00 10.35           C  
+ATOM    292  CE3 TRP A  37      24.710  68.902  -2.760  1.00  7.63           C  
+ATOM    293  CZ2 TRP A  37      22.447  67.674  -1.470  1.00  8.35           C  
+ATOM    294  CZ3 TRP A  37      23.891  69.609  -1.890  1.00 11.31           C  
+ATOM    295  CH2 TRP A  37      22.793  68.985  -1.258  1.00 10.30           C  
+ATOM    296  N   ASP A  38      27.525  67.787  -7.774  1.00  9.33           N  
+ATOM    297  CA  ASP A  38      28.799  68.073  -8.410  1.00 11.16           C  
+ATOM    298  C   ASP A  38      29.467  69.360  -7.886  1.00 12.35           C  
+ATOM    299  O   ASP A  38      30.620  69.352  -7.489  1.00 12.36           O  
+ATOM    300  CB  ASP A  38      28.729  68.134  -9.915  1.00 11.22           C  
+ATOM    301  CG  ASP A  38      28.618  66.748 -10.584  1.00 14.58           C  
+ATOM    302  OD1 ASP A  38      28.801  65.679  -9.939  1.00 11.78           O  
+ATOM    303  OD2 ASP A  38      28.316  66.810 -11.796  1.00 14.06           O  
+ATOM    304  N   ASN A  39      28.773  70.486  -7.986  1.00 11.87           N  
+ATOM    305  CA  ASN A  39      29.347  71.774  -7.620  1.00 13.12           C  
+ATOM    306  C   ASN A  39      29.858  71.808  -6.175  1.00 12.64           C  
+ATOM    307  O   ASN A  39      30.969  72.304  -5.934  1.00 12.56           O  
+ATOM    308  CB  ASN A  39      28.246  72.828  -7.881  1.00 12.86           C  
+ATOM    309  CG  ASN A  39      28.735  74.207  -7.488  1.00 16.95           C  
+ATOM    310  OD1 ASN A  39      28.991  74.427  -6.302  1.00 17.51           O  
+ATOM    311  ND2 ASN A  39      28.936  75.144  -8.422  1.00 13.94           N  
+ATOM    312  N   GLN A  40      29.005  71.401  -5.228  1.00 10.79           N  
+ATOM    313  CA  GLN A  40      29.310  71.388  -3.802  1.00 12.37           C  
+ATOM    314  C   GLN A  40      30.359  70.336  -3.532  1.00 13.56           C  
+ATOM    315  O   GLN A  40      31.222  70.596  -2.672  1.00 14.85           O  
+ATOM    316  CB  GLN A  40      28.073  71.098  -2.903  1.00 10.94           C  
+ATOM    317  CG  GLN A  40      27.177  72.304  -2.752  1.00 12.64           C  
+ATOM    318  CD  GLN A  40      26.363  72.654  -3.968  1.00 13.95           C  
+ATOM    319  OE1 GLN A  40      25.892  71.692  -4.634  1.00 12.38           O  
+ATOM    320  NE2 GLN A  40      26.198  73.969  -4.228  1.00 11.57           N  
+ATOM    321  N   MET A  41      30.361  69.216  -4.265  1.00  9.82           N  
+ATOM    322  CA  MET A  41      31.420  68.252  -3.999  1.00 12.73           C  
+ATOM    323  C   MET A  41      32.790  68.783  -4.357  1.00 14.38           C  
+ATOM    324  O   MET A  41      33.713  68.665  -3.538  1.00 15.37           O  
+ATOM    325  CB  MET A  41      31.096  66.887  -4.643  1.00 15.27           C  
+ATOM    326  CG  MET A  41      30.171  66.198  -3.570  1.00 19.95           C  
+ATOM    327  SD  MET A  41      29.527  64.729  -4.235  1.00 30.23           S  
+ATOM    328  CE  MET A  41      30.795  63.508  -3.872  1.00 20.16           C  
+ATOM    329  N   LEU A  42      32.919  69.481  -5.499  1.00 13.84           N  
+ATOM    330  CA  LEU A  42      34.198  70.049  -5.851  1.00 13.52           C  
+ATOM    331  C   LEU A  42      34.587  71.209  -4.916  1.00 14.94           C  
+ATOM    332  O   LEU A  42      35.767  71.348  -4.584  1.00 14.55           O  
+ATOM    333  CB  LEU A  42      34.098  70.552  -7.285  1.00 13.38           C  
+ATOM    334  CG  LEU A  42      33.957  69.466  -8.388  1.00 15.26           C  
+ATOM    335  CD1 LEU A  42      34.392  70.007  -9.736  1.00 15.85           C  
+ATOM    336  CD2 LEU A  42      34.821  68.241  -8.130  1.00 15.96           C  
+ATOM    337  N   PHE A  43      33.602  71.998  -4.533  1.00 13.32           N  
+ATOM    338  CA  PHE A  43      33.891  73.166  -3.644  1.00 15.81           C  
+ATOM    339  C   PHE A  43      34.440  72.729  -2.294  1.00 16.66           C  
+ATOM    340  O   PHE A  43      35.503  73.159  -1.864  1.00 17.10           O  
+ATOM    341  CB  PHE A  43      32.595  73.964  -3.487  1.00 15.51           C  
+ATOM    342  CG  PHE A  43      32.710  75.058  -2.429  1.00 17.53           C  
+ATOM    343  CD1 PHE A  43      33.261  76.274  -2.776  1.00 19.11           C  
+ATOM    344  CD2 PHE A  43      32.234  74.829  -1.149  1.00 19.38           C  
+ATOM    345  CE1 PHE A  43      33.370  77.294  -1.822  1.00 20.88           C  
+ATOM    346  CE2 PHE A  43      32.326  75.840  -0.194  1.00 18.55           C  
+ATOM    347  CZ  PHE A  43      32.873  77.056  -0.549  1.00 17.92           C  
+ATOM    348  N   PHE A  44      33.809  71.736  -1.660  1.00 15.71           N  
+ATOM    349  CA  PHE A  44      34.273  71.205  -0.385  1.00 15.06           C  
+ATOM    350  C   PHE A  44      35.601  70.485  -0.464  1.00 17.32           C  
+ATOM    351  O   PHE A  44      36.489  70.536   0.432  1.00 18.03           O  
+ATOM    352  CB  PHE A  44      33.145  70.346   0.225  1.00 14.43           C  
+ATOM    353  CG  PHE A  44      32.209  71.241   1.023  1.00 15.08           C  
+ATOM    354  CD1 PHE A  44      32.585  71.597   2.326  1.00 16.70           C  
+ATOM    355  CD2 PHE A  44      31.065  71.730   0.481  1.00 14.94           C  
+ATOM    356  CE1 PHE A  44      31.741  72.407   3.075  1.00 17.78           C  
+ATOM    357  CE2 PHE A  44      30.214  72.551   1.232  1.00 17.65           C  
+ATOM    358  CZ  PHE A  44      30.566  72.898   2.530  1.00 18.75           C  
+ATOM    359  N   LEU A  45      35.814  69.714  -1.516  1.00 14.91           N  
+ATOM    360  CA  LEU A  45      37.072  69.069  -1.820  1.00 18.79           C  
+ATOM    361  C   LEU A  45      38.202  70.104  -1.871  1.00 18.00           C  
+ATOM    362  O   LEU A  45      39.295  69.831  -1.389  1.00 19.90           O  
+ATOM    363  CB  LEU A  45      37.067  68.428  -3.221  1.00 17.38           C  
+ATOM    364  CG  LEU A  45      36.611  66.991  -3.302  1.00 19.50           C  
+ATOM    365  CD1 LEU A  45      36.562  66.566  -4.776  1.00 17.84           C  
+ATOM    366  CD2 LEU A  45      37.585  66.165  -2.472  1.00 21.51           C  
+ATOM    367  N   SER A  46      37.947  71.227  -2.524  1.00 19.84           N  
+ATOM    368  CA  SER A  46      38.955  72.267  -2.609  1.00 22.20           C  
+ATOM    369  C   SER A  46      39.293  72.862  -1.231  1.00 24.61           C  
+ATOM    370  O   SER A  46      40.319  73.529  -1.110  1.00 23.74           O  
+ATOM    371  CB  SER A  46      38.529  73.380  -3.552  1.00 22.83           C  
+ATOM    372  OG  SER A  46      37.650  74.268  -2.896  1.00 29.36           O  
+ATOM    373  N   HIS A  47      38.435  72.677  -0.217  1.00 22.29           N  
+ATOM    374  CA  HIS A  47      38.714  73.191   1.106  1.00 22.20           C  
+ATOM    375  C   HIS A  47      39.197  72.068   2.028  1.00 22.23           C  
+ATOM    376  O   HIS A  47      39.283  72.314   3.240  1.00 22.21           O  
+ATOM    377  CB  HIS A  47      37.510  73.910   1.714  1.00 19.45           C  
+ATOM    378  CG  HIS A  47      37.353  75.211   1.008  1.00 21.06           C  
+ATOM    379  ND1 HIS A  47      38.075  76.309   1.399  1.00 21.99           N  
+ATOM    380  CD2 HIS A  47      36.571  75.599  -0.040  1.00 21.66           C  
+ATOM    381  CE1 HIS A  47      37.783  77.329   0.616  1.00 22.57           C  
+ATOM    382  NE2 HIS A  47      36.881  76.923  -0.265  1.00 22.90           N  
+ATOM    383  N   GLY A  48      39.580  70.947   1.422  1.00 21.01           N  
+ATOM    384  CA  GLY A  48      40.180  69.832   2.096  1.00 20.70           C  
+ATOM    385  C   GLY A  48      39.247  68.872   2.804  1.00 21.71           C  
+ATOM    386  O   GLY A  48      39.735  68.092   3.647  1.00 22.39           O  
+ATOM    387  N   TYR A  49      37.965  68.836   2.460  1.00 19.45           N  
+ATOM    388  CA  TYR A  49      37.060  67.879   3.116  1.00 18.69           C  
+ATOM    389  C   TYR A  49      36.949  66.587   2.335  1.00 18.08           C  
+ATOM    390  O   TYR A  49      37.309  66.479   1.169  1.00 19.13           O  
+ATOM    391  CB  TYR A  49      35.657  68.503   3.299  1.00 18.85           C  
+ATOM    392  CG  TYR A  49      35.695  69.660   4.286  1.00 20.92           C  
+ATOM    393  CD1 TYR A  49      35.571  69.406   5.649  1.00 22.05           C  
+ATOM    394  CD2 TYR A  49      35.870  70.964   3.868  1.00 21.65           C  
+ATOM    395  CE1 TYR A  49      35.623  70.443   6.578  1.00 23.11           C  
+ATOM    396  CE2 TYR A  49      35.939  72.011   4.774  1.00 22.46           C  
+ATOM    397  CZ  TYR A  49      35.802  71.725   6.127  1.00 23.54           C  
+ATOM    398  OH  TYR A  49      35.844  72.792   7.013  1.00 24.88           O  
+ATOM    399  N   ARG A  50      36.557  65.521   3.016  1.00 16.04           N  
+ATOM    400  CA  ARG A  50      36.229  64.239   2.430  1.00 16.01           C  
+ATOM    401  C   ARG A  50      34.742  64.366   2.059  1.00 15.33           C  
+ATOM    402  O   ARG A  50      33.974  64.921   2.866  1.00 14.61           O  
+ATOM    403  CB  ARG A  50      36.459  63.081   3.351  1.00 14.64           C  
+ATOM    404  CG  ARG A  50      36.198  61.698   2.748  1.00 14.58           C  
+ATOM    405  CD  ARG A  50      36.284  60.686   3.911  1.00 14.44           C  
+ATOM    406  NE  ARG A  50      35.910  59.347   3.508  1.00 13.80           N  
+ATOM    407  CZ  ARG A  50      35.864  58.283   4.280  1.00 16.31           C  
+ATOM    408  NH1 ARG A  50      36.284  58.411   5.553  1.00 18.83           N  
+ATOM    409  NH2 ARG A  50      35.431  57.118   3.862  1.00 15.18           N  
+ATOM    410  N   VAL A  51      34.388  64.016   0.811  1.00 14.78           N  
+ATOM    411  CA  VAL A  51      33.006  64.310   0.374  1.00 13.11           C  
+ATOM    412  C   VAL A  51      32.385  63.009  -0.096  1.00 14.09           C  
+ATOM    413  O   VAL A  51      33.049  62.179  -0.759  1.00 12.81           O  
+ATOM    414  CB  VAL A  51      32.915  65.397  -0.724  1.00 14.40           C  
+ATOM    415  CG1 VAL A  51      33.250  66.769  -0.120  1.00 12.81           C  
+ATOM    416  CG2 VAL A  51      33.876  65.101  -1.892  1.00 12.06           C  
+ATOM    417  N   ILE A  52      31.222  62.741   0.547  1.00 13.24           N  
+ATOM    418  CA  ILE A  52      30.505  61.490   0.279  1.00 12.71           C  
+ATOM    419  C   ILE A  52      29.086  61.792  -0.194  1.00 12.59           C  
+ATOM    420  O   ILE A  52      28.398  62.678   0.330  1.00 12.28           O  
+ATOM    421  CB  ILE A  52      30.463  60.671   1.600  1.00 13.98           C  
+ATOM    422  CG1 ILE A  52      31.922  60.262   1.942  1.00 16.07           C  
+ATOM    423  CG2 ILE A  52      29.585  59.445   1.464  1.00 13.36           C  
+ATOM    424  CD1 ILE A  52      32.153  60.127   3.447  1.00 17.69           C  
+ATOM    425  N   ALA A  53      28.601  60.985  -1.147  1.00 10.28           N  
+ATOM    426  CA  ALA A  53      27.216  61.184  -1.632  1.00  8.98           C  
+ATOM    427  C   ALA A  53      26.727  59.861  -2.201  1.00 10.37           C  
+ATOM    428  O   ALA A  53      27.502  59.254  -2.974  1.00 10.18           O  
+ATOM    429  CB  ALA A  53      27.159  62.271  -2.691  1.00  9.23           C  
+ATOM    430  N   HIS A  54      25.538  59.424  -1.835  1.00  9.75           N  
+ATOM    431  CA  HIS A  54      25.032  58.180  -2.300  1.00 10.49           C  
+ATOM    432  C   HIS A  54      23.820  58.433  -3.213  1.00 10.00           C  
+ATOM    433  O   HIS A  54      23.120  59.451  -3.072  1.00 12.24           O  
+ATOM    434  CB  HIS A  54      24.611  57.227  -1.152  1.00 10.17           C  
+ATOM    435  CG  HIS A  54      23.445  57.748  -0.360  1.00 15.03           C  
+ATOM    436  ND1 HIS A  54      23.518  58.948   0.309  1.00 16.75           N  
+ATOM    437  CD2 HIS A  54      22.190  57.271  -0.134  1.00 17.52           C  
+ATOM    438  CE1 HIS A  54      22.394  59.226   0.914  1.00 17.95           C  
+ATOM    439  NE2 HIS A  54      21.572  58.229   0.645  1.00 18.90           N  
+ATOM    440  N   ASP A  55      23.496  57.437  -4.036  1.00  9.81           N  
+ATOM    441  CA  ASP A  55      22.204  57.427  -4.751  1.00  8.89           C  
+ATOM    442  C   ASP A  55      21.190  56.723  -3.863  1.00 10.25           C  
+ATOM    443  O   ASP A  55      21.345  55.518  -3.493  1.00  9.90           O  
+ATOM    444  CB  ASP A  55      22.333  56.595  -6.057  1.00  9.35           C  
+ATOM    445  CG  ASP A  55      23.176  57.300  -7.110  1.00 10.41           C  
+ATOM    446  OD1 ASP A  55      23.432  58.516  -7.031  1.00 11.07           O  
+ATOM    447  OD2 ASP A  55      23.583  56.640  -8.101  1.00 13.40           O  
+ATOM    448  N   ARG A  56      20.081  57.388  -3.549  1.00  9.91           N  
+ATOM    449  CA  ARG A  56      18.999  56.735  -2.828  1.00 11.19           C  
+ATOM    450  C   ARG A  56      18.509  55.507  -3.574  1.00 12.76           C  
+ATOM    451  O   ARG A  56      18.561  55.394  -4.806  1.00 11.30           O  
+ATOM    452  CB  ARG A  56      17.870  57.727  -2.625  1.00 11.77           C  
+ATOM    453  CG  ARG A  56      16.705  57.275  -1.749  1.00 14.73           C  
+ATOM    454  CD  ARG A  56      15.812  58.475  -1.410  1.00 11.41           C  
+ATOM    455  NE  ARG A  56      16.636  59.407  -0.677  1.00 11.61           N  
+ATOM    456  CZ  ARG A  56      16.963  60.632  -1.020  1.00 12.74           C  
+ATOM    457  NH1 ARG A  56      16.422  61.207  -2.128  1.00 11.30           N  
+ATOM    458  NH2 ARG A  56      17.817  61.305  -0.288  1.00  9.77           N  
+ATOM    459  N   ARG A  57      18.034  54.489  -2.841  1.00 11.59           N  
+ATOM    460  CA  ARG A  57      17.554  53.270  -3.462  1.00 11.95           C  
+ATOM    461  C   ARG A  57      16.476  53.640  -4.511  1.00 11.10           C  
+ATOM    462  O   ARG A  57      15.688  54.546  -4.275  1.00 11.20           O  
+ATOM    463  CB  ARG A  57      16.901  52.256  -2.513  1.00 13.57           C  
+ATOM    464  CG  ARG A  57      15.752  52.707  -1.643  1.00 16.84           C  
+ATOM    465  CD  ARG A  57      15.027  51.450  -1.048  1.00 15.52           C  
+ATOM    466  NE  ARG A  57      15.916  50.739  -0.135  1.00 16.36           N  
+ATOM    467  CZ  ARG A  57      15.871  49.511   0.349  1.00 18.20           C  
+ATOM    468  NH1 ARG A  57      14.931  48.652  -0.033  1.00 16.83           N  
+ATOM    469  NH2 ARG A  57      16.809  49.053   1.218  1.00 14.46           N  
+ATOM    470  N   GLY A  58      16.570  52.946  -5.635  1.00 10.12           N  
+ATOM    471  CA  GLY A  58      15.677  53.236  -6.739  1.00 10.60           C  
+ATOM    472  C   GLY A  58      16.030  54.514  -7.501  1.00 12.64           C  
+ATOM    473  O   GLY A  58      15.229  55.037  -8.289  1.00 10.99           O  
+ATOM    474  N   HIS A  59      17.210  55.088  -7.279  1.00 10.50           N  
+ATOM    475  CA  HIS A  59      17.596  56.321  -7.908  1.00 12.35           C  
+ATOM    476  C   HIS A  59      19.013  56.112  -8.483  1.00 11.51           C  
+ATOM    477  O   HIS A  59      19.823  55.335  -7.953  1.00 12.39           O  
+ATOM    478  CB  HIS A  59      17.703  57.517  -6.933  1.00 10.93           C  
+ATOM    479  CG  HIS A  59      16.404  57.959  -6.334  1.00 11.57           C  
+ATOM    480  ND1 HIS A  59      15.663  57.055  -5.561  1.00 11.08           N  
+ATOM    481  CD2 HIS A  59      15.722  59.144  -6.363  1.00 10.20           C  
+ATOM    482  CE1 HIS A  59      14.557  57.704  -5.174  1.00 10.17           C  
+ATOM    483  NE2 HIS A  59      14.592  58.946  -5.616  1.00  9.32           N  
+ATOM    484  N   GLY A  60      19.320  56.942  -9.479  1.00 10.42           N  
+ATOM    485  CA  GLY A  60      20.652  56.902 -10.083  1.00 10.86           C  
+ATOM    486  C   GLY A  60      21.107  55.513 -10.457  1.00 12.19           C  
+ATOM    487  O   GLY A  60      20.488  54.778 -11.237  1.00 12.14           O  
+ATOM    488  N   ARG A  61      22.260  55.118  -9.880  1.00 11.29           N  
+ATOM    489  CA  ARG A  61      22.891  53.831 -10.138  1.00 11.62           C  
+ATOM    490  C   ARG A  61      22.610  52.796  -9.048  1.00 13.15           C  
+ATOM    491  O   ARG A  61      23.199  51.709  -9.085  1.00 13.99           O  
+ATOM    492  CB  ARG A  61      24.424  54.022 -10.215  1.00 13.31           C  
+ATOM    493  CG  ARG A  61      24.869  54.879 -11.400  1.00 14.55           C  
+ATOM    494  CD  ARG A  61      26.024  55.827 -11.120  1.00 17.01           C  
+ATOM    495  NE  ARG A  61      25.549  56.911 -10.209  1.00 17.03           N  
+ATOM    496  CZ  ARG A  61      25.917  58.162 -10.189  1.00 16.70           C  
+ATOM    497  NH1 ARG A  61      26.861  58.590 -11.048  1.00 15.95           N  
+ATOM    498  NH2 ARG A  61      25.412  59.028  -9.296  1.00 14.51           N  
+ATOM    499  N   SER A  62      21.828  53.136  -8.030  1.00 12.83           N  
+ATOM    500  CA  SER A  62      21.476  52.138  -7.014  1.00 11.39           C  
+ATOM    501  C   SER A  62      20.502  51.121  -7.582  1.00 14.15           C  
+ATOM    502  O   SER A  62      19.868  51.367  -8.630  1.00 15.29           O  
+ATOM    503  CB  SER A  62      20.891  52.847  -5.765  1.00  7.46           C  
+ATOM    504  OG  SER A  62      21.998  53.564  -5.200  1.00 10.03           O  
+ATOM    505  N   ASP A  63      20.282  50.006  -6.905  1.00 13.37           N  
+ATOM    506  CA  ASP A  63      19.352  48.989  -7.346  1.00 13.66           C  
+ATOM    507  C   ASP A  63      17.945  49.568  -7.386  1.00 13.82           C  
+ATOM    508  O   ASP A  63      17.725  50.578  -6.697  1.00 14.80           O  
+ATOM    509  CB  ASP A  63      19.307  47.844  -6.333  1.00 14.50           C  
+ATOM    510  CG  ASP A  63      20.470  46.874  -6.460  1.00 20.41           C  
+ATOM    511  OD1 ASP A  63      21.342  47.019  -7.311  1.00 19.01           O  
+ATOM    512  OD2 ASP A  63      20.551  45.974  -5.600  1.00 21.85           O  
+ATOM    513  N   GLN A  64      17.002  48.902  -8.037  1.00 10.61           N  
+ATOM    514  CA  GLN A  64      15.623  49.389  -8.075  1.00 14.00           C  
+ATOM    515  C   GLN A  64      14.743  48.255  -7.487  1.00 15.71           C  
+ATOM    516  O   GLN A  64      14.178  47.458  -8.232  1.00 14.95           O  
+ATOM    517  CB  GLN A  64      15.189  49.636  -9.520  1.00 15.19           C  
+ATOM    518  CG  GLN A  64      16.210  50.338 -10.413  1.00 16.24           C  
+ATOM    519  CD  GLN A  64      15.614  50.878 -11.703  1.00 16.57           C  
+ATOM    520  OE1 GLN A  64      14.652  50.305 -12.262  1.00 14.89           O  
+ATOM    521  NE2 GLN A  64      16.176  52.005 -12.176  1.00 13.26           N  
+ATOM    522  N   PRO A  65      14.705  48.137  -6.173  1.00 15.24           N  
+ATOM    523  CA  PRO A  65      13.975  47.093  -5.494  1.00 15.11           C  
+ATOM    524  C   PRO A  65      12.494  47.338  -5.537  1.00 14.85           C  
+ATOM    525  O   PRO A  65      12.042  48.417  -5.865  1.00 15.52           O  
+ATOM    526  CB  PRO A  65      14.471  47.185  -4.047  1.00 14.78           C  
+ATOM    527  CG  PRO A  65      14.822  48.628  -3.868  1.00 16.59           C  
+ATOM    528  CD  PRO A  65      15.331  49.113  -5.221  1.00 15.09           C  
+ATOM    529  N   SER A  66      11.713  46.308  -5.209  1.00 15.98           N  
+ATOM    530  CA  SER A  66      10.274  46.407  -5.248  1.00 18.01           C  
+ATOM    531  C   SER A  66       9.716  47.229  -4.103  1.00 17.99           C  
+ATOM    532  O   SER A  66       8.650  47.851  -4.183  1.00 18.04           O  
+ATOM    533  CB  SER A  66       9.746  44.948  -4.997  1.00 19.08           C  
+ATOM    534  OG  SER A  66       8.331  45.114  -5.016  1.00 24.82           O  
+ATOM    535  N   THR A  67      10.422  47.149  -2.963  1.00 17.08           N  
+ATOM    536  CA  THR A  67       9.934  47.775  -1.740  1.00 19.31           C  
+ATOM    537  C   THR A  67      10.996  48.608  -1.030  1.00 18.68           C  
+ATOM    538  O   THR A  67      12.126  48.750  -1.492  1.00 18.47           O  
+ATOM    539  CB  THR A  67       9.470  46.694  -0.712  1.00 22.72           C  
+ATOM    540  OG1 THR A  67      10.568  45.822  -0.383  1.00 25.78           O  
+ATOM    541  CG2 THR A  67       8.418  45.758  -1.272  1.00 24.64           C  
+ATOM    542  N   GLY A  68      10.544  49.264   0.050  1.00 18.44           N  
+ATOM    543  CA  GLY A  68      11.410  50.070   0.881  1.00 18.48           C  
+ATOM    544  C   GLY A  68      11.430  51.513   0.425  1.00 18.03           C  
+ATOM    545  O   GLY A  68      12.341  52.225   0.869  1.00 17.43           O  
+ATOM    546  N   HIS A  69      10.386  51.958  -0.298  1.00 15.63           N  
+ATOM    547  CA  HIS A  69      10.355  53.371  -0.688  1.00 14.93           C  
+ATOM    548  C   HIS A  69       9.757  54.226   0.416  1.00 17.11           C  
+ATOM    549  O   HIS A  69       8.638  54.710   0.233  1.00 17.45           O  
+ATOM    550  CB  HIS A  69       9.572  53.474  -2.035  1.00 15.52           C  
+ATOM    551  CG  HIS A  69      10.239  52.528  -2.995  1.00 17.07           C  
+ATOM    552  ND1 HIS A  69      11.567  52.724  -3.352  1.00 16.36           N  
+ATOM    553  CD2 HIS A  69       9.833  51.360  -3.537  1.00 17.57           C  
+ATOM    554  CE1 HIS A  69      11.915  51.713  -4.163  1.00 17.29           C  
+ATOM    555  NE2 HIS A  69      10.894  50.860  -4.272  1.00 15.49           N  
+ATOM    556  N   ASP A  70      10.401  54.382   1.579  1.00 17.34           N  
+ATOM    557  CA  ASP A  70       9.849  55.101   2.717  1.00 18.16           C  
+ATOM    558  C   ASP A  70      11.016  55.692   3.544  1.00 16.30           C  
+ATOM    559  O   ASP A  70      12.116  55.163   3.410  1.00 13.01           O  
+ATOM    560  CB  ASP A  70       8.928  54.178   3.541  1.00 20.28           C  
+ATOM    561  CG  ASP A  70       9.746  53.058   4.173  1.00 23.91           C  
+ATOM    562  OD1 ASP A  70      10.450  53.230   5.194  1.00 24.82           O  
+ATOM    563  OD2 ASP A  70       9.798  51.942   3.629  1.00 27.21           O  
+ATOM    564  N   MET A  71      10.727  56.674   4.374  1.00 16.04           N  
+ATOM    565  CA  MET A  71      11.751  57.382   5.138  1.00 17.42           C  
+ATOM    566  C   MET A  71      12.489  56.507   6.126  1.00 18.97           C  
+ATOM    567  O   MET A  71      13.668  56.733   6.391  1.00 19.57           O  
+ATOM    568  CB  MET A  71      11.113  58.595   5.817  1.00 17.57           C  
+ATOM    569  CG  MET A  71      10.799  59.737   4.828  1.00 19.70           C  
+ATOM    570  SD  MET A  71      12.346  60.497   4.262  1.00 23.19           S  
+ATOM    571  CE  MET A  71      11.642  61.291   2.798  1.00 21.28           C  
+ATOM    572  N   ASP A  72      11.775  55.560   6.792  1.00 18.86           N  
+ATOM    573  CA  ASP A  72      12.473  54.698   7.726  1.00 20.01           C  
+ATOM    574  C   ASP A  72      13.515  53.867   6.990  1.00 17.50           C  
+ATOM    575  O   ASP A  72      14.636  53.699   7.436  1.00 17.67           O  
+ATOM    576  CB  ASP A  72      11.540  53.702   8.440  1.00 21.15           C  
+ATOM    577  CG  ASP A  72      10.651  54.414   9.426  1.00 23.56           C  
+ATOM    578  OD1 ASP A  72      11.007  55.456   9.999  1.00 25.29           O  
+ATOM    579  OD2 ASP A  72       9.544  53.929   9.677  1.00 26.30           O  
+ATOM    580  N   THR A  73      13.175  53.274   5.861  1.00 17.67           N  
+ATOM    581  CA  THR A  73      14.185  52.520   5.103  1.00 16.73           C  
+ATOM    582  C   THR A  73      15.262  53.441   4.560  1.00 16.33           C  
+ATOM    583  O   THR A  73      16.445  53.092   4.560  1.00 15.98           O  
+ATOM    584  CB  THR A  73      13.467  51.793   3.952  1.00 19.40           C  
+ATOM    585  OG1 THR A  73      12.385  51.035   4.527  1.00 19.44           O  
+ATOM    586  CG2 THR A  73      14.438  50.906   3.183  1.00 20.03           C  
+ATOM    587  N   TYR A  74      14.901  54.643   4.086  1.00 14.43           N  
+ATOM    588  CA  TYR A  74      15.942  55.537   3.560  1.00 14.73           C  
+ATOM    589  C   TYR A  74      16.957  55.842   4.662  1.00 15.63           C  
+ATOM    590  O   TYR A  74      18.142  55.858   4.393  1.00 13.39           O  
+ATOM    591  CB  TYR A  74      15.344  56.863   3.076  1.00 12.85           C  
+ATOM    592  CG  TYR A  74      14.417  56.781   1.865  1.00 13.05           C  
+ATOM    593  CD1 TYR A  74      14.461  55.725   0.994  1.00 13.06           C  
+ATOM    594  CD2 TYR A  74      13.504  57.830   1.665  1.00 11.61           C  
+ATOM    595  CE1 TYR A  74      13.591  55.676  -0.092  1.00 13.74           C  
+ATOM    596  CE2 TYR A  74      12.613  57.756   0.570  1.00 13.06           C  
+ATOM    597  CZ  TYR A  74      12.688  56.699  -0.283  1.00 12.46           C  
+ATOM    598  OH  TYR A  74      11.843  56.599  -1.381  1.00 15.66           O  
+ATOM    599  N   ALA A  75      16.454  56.130   5.890  1.00 14.81           N  
+ATOM    600  CA  ALA A  75      17.414  56.440   6.971  1.00 15.93           C  
+ATOM    601  C   ALA A  75      18.205  55.188   7.368  1.00 17.41           C  
+ATOM    602  O   ALA A  75      19.366  55.333   7.761  1.00 19.66           O  
+ATOM    603  CB  ALA A  75      16.636  56.997   8.152  1.00 17.42           C  
+ATOM    604  N   ALA A  76      17.653  53.997   7.255  1.00 16.77           N  
+ATOM    605  CA  ALA A  76      18.407  52.784   7.602  1.00 18.34           C  
+ATOM    606  C   ALA A  76      19.466  52.475   6.548  1.00 17.45           C  
+ATOM    607  O   ALA A  76      20.572  51.981   6.804  1.00 15.95           O  
+ATOM    608  CB  ALA A  76      17.468  51.599   7.773  1.00 18.78           C  
+ATOM    609  N   ASP A  77      19.139  52.844   5.291  1.00 15.37           N  
+ATOM    610  CA  ASP A  77      20.136  52.652   4.211  1.00 13.81           C  
+ATOM    611  C   ASP A  77      21.277  53.630   4.498  1.00 13.34           C  
+ATOM    612  O   ASP A  77      22.424  53.249   4.306  1.00 16.53           O  
+ATOM    613  CB  ASP A  77      19.494  52.994   2.858  1.00 13.74           C  
+ATOM    614  CG  ASP A  77      18.513  51.988   2.327  1.00 17.10           C  
+ATOM    615  OD1 ASP A  77      18.425  50.849   2.881  1.00 16.29           O  
+ATOM    616  OD2 ASP A  77      17.788  52.307   1.343  1.00 15.78           O  
+ATOM    617  N   VAL A  78      21.051  54.844   4.975  1.00 13.30           N  
+ATOM    618  CA  VAL A  78      22.112  55.774   5.317  1.00 13.87           C  
+ATOM    619  C   VAL A  78      22.995  55.177   6.445  1.00 15.32           C  
+ATOM    620  O   VAL A  78      24.221  55.230   6.400  1.00 14.19           O  
+ATOM    621  CB  VAL A  78      21.571  57.143   5.763  1.00 14.43           C  
+ATOM    622  CG1 VAL A  78      22.714  57.985   6.298  1.00 15.65           C  
+ATOM    623  CG2 VAL A  78      20.904  57.852   4.554  1.00 14.95           C  
+ATOM    624  N   ALA A  79      22.342  54.591   7.449  1.00 14.95           N  
+ATOM    625  CA  ALA A  79      23.102  53.964   8.557  1.00 15.95           C  
+ATOM    626  C   ALA A  79      23.934  52.847   8.022  1.00 15.19           C  
+ATOM    627  O   ALA A  79      25.079  52.715   8.472  1.00 17.54           O  
+ATOM    628  CB  ALA A  79      22.124  53.500   9.656  1.00 16.85           C  
+ATOM    629  N   ALA A  80      23.456  52.027   7.093  1.00 14.80           N  
+ATOM    630  CA  ALA A  80      24.236  50.967   6.501  1.00 17.47           C  
+ATOM    631  C   ALA A  80      25.499  51.562   5.868  1.00 17.32           C  
+ATOM    632  O   ALA A  80      26.583  50.993   6.093  1.00 19.66           O  
+ATOM    633  CB  ALA A  80      23.454  50.067   5.575  1.00 17.72           C  
+ATOM    634  N   LEU A  81      25.450  52.649   5.130  1.00 15.51           N  
+ATOM    635  CA  LEU A  81      26.623  53.274   4.528  1.00 15.62           C  
+ATOM    636  C   LEU A  81      27.582  53.880   5.552  1.00 16.94           C  
+ATOM    637  O   LEU A  81      28.808  53.700   5.418  1.00 18.22           O  
+ATOM    638  CB  LEU A  81      26.102  54.456   3.671  1.00 16.49           C  
+ATOM    639  CG  LEU A  81      27.157  55.396   3.066  1.00 19.29           C  
+ATOM    640  CD1 LEU A  81      27.932  54.622   2.007  1.00 21.95           C  
+ATOM    641  CD2 LEU A  81      26.473  56.621   2.490  1.00 22.69           C  
+ATOM    642  N   THR A  82      27.065  54.575   6.550  1.00 14.71           N  
+ATOM    643  CA  THR A  82      27.980  55.227   7.505  1.00 18.33           C  
+ATOM    644  C   THR A  82      28.678  54.214   8.422  1.00 19.91           C  
+ATOM    645  O   THR A  82      29.841  54.412   8.805  1.00 19.40           O  
+ATOM    646  CB  THR A  82      27.335  56.325   8.359  1.00 16.68           C  
+ATOM    647  OG1 THR A  82      26.292  55.847   9.185  1.00 18.54           O  
+ATOM    648  CG2 THR A  82      26.849  57.480   7.498  1.00 16.27           C  
+ATOM    649  N   GLU A  83      28.048  53.063   8.588  1.00 21.58           N  
+ATOM    650  CA  GLU A  83      28.658  51.958   9.340  1.00 25.23           C  
+ATOM    651  C   GLU A  83      29.713  51.272   8.482  1.00 24.69           C  
+ATOM    652  O   GLU A  83      30.819  51.012   8.961  1.00 23.50           O  
+ATOM    653  CB  GLU A  83      27.568  50.963   9.751  1.00 27.95           C  
+ATOM    654  CG  GLU A  83      28.084  49.713  10.444  1.00 33.90           C  
+ATOM    655  CD  GLU A  83      26.905  48.776  10.709  1.00 38.78           C  
+ATOM    656  OE1 GLU A  83      26.519  48.018   9.785  1.00 40.54           O  
+ATOM    657  OE2 GLU A  83      26.371  48.884  11.836  1.00 41.13           O  
+ATOM    658  N   ALA A  84      29.419  50.976   7.208  1.00 20.78           N  
+ATOM    659  CA  ALA A  84      30.450  50.419   6.330  1.00 19.99           C  
+ATOM    660  C   ALA A  84      31.664  51.318   6.205  1.00 20.70           C  
+ATOM    661  O   ALA A  84      32.793  50.773   6.143  1.00 22.41           O  
+ATOM    662  CB  ALA A  84      29.839  50.024   4.963  1.00 18.65           C  
+ATOM    663  N   LEU A  85      31.571  52.650   6.272  1.00 18.54           N  
+ATOM    664  CA  LEU A  85      32.699  53.528   6.145  1.00 19.39           C  
+ATOM    665  C   LEU A  85      33.261  53.914   7.518  1.00 19.27           C  
+ATOM    666  O   LEU A  85      34.291  54.579   7.531  1.00 21.45           O  
+ATOM    667  CB  LEU A  85      32.306  54.856   5.426  1.00 20.66           C  
+ATOM    668  CG  LEU A  85      31.663  54.697   4.046  1.00 23.58           C  
+ATOM    669  CD1 LEU A  85      31.411  56.053   3.395  1.00 24.14           C  
+ATOM    670  CD2 LEU A  85      32.588  53.894   3.145  1.00 23.29           C  
+ATOM    671  N   ASP A  86      32.514  53.615   8.539  1.00 20.86           N  
+ATOM    672  CA  ASP A  86      32.806  53.988   9.929  1.00 23.39           C  
+ATOM    673  C   ASP A  86      33.019  55.472  10.098  1.00 22.50           C  
+ATOM    674  O   ASP A  86      34.055  55.964  10.581  1.00 20.76           O  
+ATOM    675  CB  ASP A  86      34.038  53.213  10.432  1.00 26.61           C  
+ATOM    676  CG  ASP A  86      34.220  53.280  11.931  1.00 31.20           C  
+ATOM    677  OD1 ASP A  86      33.267  53.429  12.719  1.00 29.69           O  
+ATOM    678  OD2 ASP A  86      35.409  53.170  12.353  1.00 33.56           O  
+ATOM    679  N   LEU A  87      32.008  56.260   9.689  1.00 19.97           N  
+ATOM    680  CA  LEU A  87      32.208  57.705   9.781  1.00 19.09           C  
+ATOM    681  C   LEU A  87      31.999  58.169  11.221  1.00 19.84           C  
+ATOM    682  O   LEU A  87      31.084  57.671  11.897  1.00 19.74           O  
+ATOM    683  CB  LEU A  87      31.177  58.411   8.887  1.00 18.71           C  
+ATOM    684  CG  LEU A  87      31.249  58.071   7.387  1.00 19.32           C  
+ATOM    685  CD1 LEU A  87      30.308  59.050   6.653  1.00 19.65           C  
+ATOM    686  CD2 LEU A  87      32.639  58.230   6.800  1.00 19.00           C  
+ATOM    687  N   ARG A  88      32.733  59.164  11.620  1.00 19.63           N  
+ATOM    688  CA  ARG A  88      32.583  59.767  12.939  1.00 23.48           C  
+ATOM    689  C   ARG A  88      32.615  61.266  12.788  1.00 20.52           C  
+ATOM    690  O   ARG A  88      33.367  61.762  11.941  1.00 21.55           O  
+ATOM    691  CB  ARG A  88      33.748  59.318  13.859  1.00 25.09           C  
+ATOM    692  CG  ARG A  88      33.681  57.870  14.334  1.00 30.33           C  
+ATOM    693  CD  ARG A  88      32.394  57.510  15.074  1.00 34.04           C  
+ATOM    694  NE  ARG A  88      32.267  56.084  15.232  1.00 38.78           N  
+ATOM    695  CZ  ARG A  88      31.458  55.214  15.805  1.00 40.77           C  
+ATOM    696  NH1 ARG A  88      30.364  55.549  16.484  1.00 40.44           N  
+ATOM    697  NH2 ARG A  88      31.729  53.897  15.680  1.00 42.08           N  
+ATOM    698  N   GLY A  89      31.834  62.045  13.514  1.00 20.15           N  
+ATOM    699  CA  GLY A  89      31.858  63.465  13.455  1.00 17.54           C  
+ATOM    700  C   GLY A  89      31.500  64.049  12.081  1.00 18.79           C  
+ATOM    701  O   GLY A  89      32.003  65.107  11.684  1.00 16.87           O  
+ATOM    702  N   ALA A  90      30.643  63.348  11.355  1.00 17.83           N  
+ATOM    703  CA  ALA A  90      30.297  63.763  10.001  1.00 15.52           C  
+ATOM    704  C   ALA A  90      29.336  64.899   9.940  1.00 16.33           C  
+ATOM    705  O   ALA A  90      28.558  65.115  10.883  1.00 16.82           O  
+ATOM    706  CB  ALA A  90      29.561  62.547   9.393  1.00 17.00           C  
+ATOM    707  N   VAL A  91      29.393  65.720   8.871  1.00 13.67           N  
+ATOM    708  CA  VAL A  91      28.366  66.742   8.683  1.00 13.22           C  
+ATOM    709  C   VAL A  91      27.402  66.248   7.590  1.00 15.06           C  
+ATOM    710  O   VAL A  91      27.920  65.809   6.536  1.00 16.66           O  
+ATOM    711  CB  VAL A  91      28.974  68.075   8.297  1.00 16.04           C  
+ATOM    712  CG1 VAL A  91      27.865  69.095   8.026  1.00 17.56           C  
+ATOM    713  CG2 VAL A  91      29.861  68.570   9.447  1.00 16.48           C  
+ATOM    714  N   HIS A  92      26.113  66.229   7.807  1.00 11.63           N  
+ATOM    715  CA  HIS A  92      25.144  65.719   6.845  1.00 12.18           C  
+ATOM    716  C   HIS A  92      24.390  66.886   6.224  1.00 14.67           C  
+ATOM    717  O   HIS A  92      23.679  67.641   6.923  1.00 16.35           O  
+ATOM    718  CB  HIS A  92      24.212  64.719   7.527  1.00 12.33           C  
+ATOM    719  CG  HIS A  92      24.897  63.407   7.758  1.00 12.93           C  
+ATOM    720  ND1 HIS A  92      24.708  62.309   6.964  1.00 12.24           N  
+ATOM    721  CD2 HIS A  92      25.856  63.057   8.714  1.00 12.63           C  
+ATOM    722  CE1 HIS A  92      25.485  61.284   7.376  1.00 13.63           C  
+ATOM    723  NE2 HIS A  92      26.187  61.759   8.423  1.00 13.06           N  
+ATOM    724  N   ILE A  93      24.414  66.994   4.881  1.00 11.18           N  
+ATOM    725  CA  ILE A  93      23.709  68.114   4.203  1.00  9.98           C  
+ATOM    726  C   ILE A  93      22.616  67.515   3.326  1.00 11.23           C  
+ATOM    727  O   ILE A  93      22.892  66.634   2.469  1.00 10.49           O  
+ATOM    728  CB  ILE A  93      24.745  68.932   3.406  1.00 13.14           C  
+ATOM    729  CG1 ILE A  93      25.852  69.482   4.320  1.00 14.06           C  
+ATOM    730  CG2 ILE A  93      24.042  70.097   2.677  1.00 14.50           C  
+ATOM    731  CD1 ILE A  93      26.903  70.365   3.678  1.00 15.40           C  
+ATOM    732  N   GLY A  94      21.366  67.912   3.536  1.00 10.62           N  
+ATOM    733  CA  GLY A  94      20.292  67.240   2.765  1.00 12.88           C  
+ATOM    734  C   GLY A  94      19.501  68.350   2.052  1.00 16.16           C  
+ATOM    735  O   GLY A  94      19.190  69.361   2.686  1.00 15.14           O  
+ATOM    736  N   HIS A  95      19.136  68.044   0.795  1.00 13.09           N  
+ATOM    737  CA  HIS A  95      18.354  69.000   0.020  1.00 13.32           C  
+ATOM    738  C   HIS A  95      17.014  68.337  -0.282  1.00 12.35           C  
+ATOM    739  O   HIS A  95      16.868  67.134  -0.584  1.00 11.34           O  
+ATOM    740  CB  HIS A  95      19.055  69.391  -1.297  1.00 15.02           C  
+ATOM    741  CG  HIS A  95      18.167  70.144  -2.238  1.00 16.82           C  
+ATOM    742  ND1 HIS A  95      17.703  69.564  -3.414  1.00 17.88           N  
+ATOM    743  CD2 HIS A  95      17.651  71.394  -2.174  1.00 14.59           C  
+ATOM    744  CE1 HIS A  95      16.917  70.432  -4.040  1.00 18.81           C  
+ATOM    745  NE2 HIS A  95      16.871  71.550  -3.318  1.00 17.88           N  
+ATOM    746  N   SER A  96      15.998  69.172  -0.067  1.00 14.04           N  
+ATOM    747  CA  SER A  96      14.618  68.802  -0.390  1.00 15.68           C  
+ATOM    748  C   SER A  96      14.201  67.538   0.301  1.00 14.88           C  
+ATOM    749  O   SER A  96      14.305  67.430   1.548  1.00 15.16           O  
+ATOM    750  CB  SER A  96      14.612  68.763  -1.957  1.00 15.50           C  
+ATOM    751  OG  SER A  96      13.280  68.544  -2.353  1.00 18.71           O  
+ATOM    752  N   THR A  97      13.778  66.487  -0.386  1.00 15.07           N  
+ATOM    753  CA  THR A  97      13.509  65.168   0.216  1.00 14.67           C  
+ATOM    754  C   THR A  97      14.711  64.635   0.982  1.00 15.48           C  
+ATOM    755  O   THR A  97      14.515  63.911   1.974  1.00 13.67           O  
+ATOM    756  CB  THR A  97      13.245  64.127  -0.904  1.00 15.45           C  
+ATOM    757  OG1 THR A  97      11.997  64.541  -1.527  1.00 18.38           O  
+ATOM    758  CG2 THR A  97      13.111  62.695  -0.449  1.00 15.51           C  
+ATOM    759  N   GLY A  98      15.948  64.972   0.540  1.00 12.55           N  
+ATOM    760  CA  GLY A  98      17.127  64.504   1.268  1.00 13.01           C  
+ATOM    761  C   GLY A  98      17.175  65.171   2.668  1.00 13.48           C  
+ATOM    762  O   GLY A  98      17.769  64.575   3.564  1.00 13.47           O  
+ATOM    763  N   GLY A  99      16.551  66.331   2.823  1.00 11.31           N  
+ATOM    764  CA  GLY A  99      16.509  66.993   4.126  1.00 12.15           C  
+ATOM    765  C   GLY A  99      15.628  66.175   5.084  1.00 14.00           C  
+ATOM    766  O   GLY A  99      16.046  66.003   6.243  1.00 17.52           O  
+ATOM    767  N   GLY A 100      14.603  65.494   4.591  1.00 12.96           N  
+ATOM    768  CA  GLY A 100      13.783  64.630   5.428  1.00 13.74           C  
+ATOM    769  C   GLY A 100      14.562  63.397   5.850  1.00 16.67           C  
+ATOM    770  O   GLY A 100      14.514  62.950   7.015  1.00 12.89           O  
+ATOM    771  N   GLU A 101      15.294  62.790   4.888  1.00 11.79           N  
+ATOM    772  CA  GLU A 101      16.136  61.641   5.177  1.00 12.41           C  
+ATOM    773  C   GLU A 101      17.190  62.010   6.223  1.00 11.59           C  
+ATOM    774  O   GLU A 101      17.465  61.163   7.080  1.00 13.66           O  
+ATOM    775  CB  GLU A 101      16.845  61.224   3.872  1.00 11.32           C  
+ATOM    776  CG  GLU A 101      17.903  60.135   3.989  1.00 12.29           C  
+ATOM    777  CD  GLU A 101      18.353  59.709   2.596  1.00 11.09           C  
+ATOM    778  OE1 GLU A 101      17.684  58.906   1.932  1.00 12.25           O  
+ATOM    779  OE2 GLU A 101      19.368  60.280   2.164  1.00 11.73           O  
+ATOM    780  N   VAL A 102      17.798  63.183   6.104  1.00 12.63           N  
+ATOM    781  CA  VAL A 102      18.799  63.629   7.065  1.00 14.35           C  
+ATOM    782  C   VAL A 102      18.122  63.741   8.461  1.00 16.40           C  
+ATOM    783  O   VAL A 102      18.707  63.289   9.448  1.00 17.06           O  
+ATOM    784  CB  VAL A 102      19.464  64.953   6.700  1.00 13.42           C  
+ATOM    785  CG1 VAL A 102      20.226  65.622   7.859  1.00 14.21           C  
+ATOM    786  CG2 VAL A 102      20.515  64.672   5.568  1.00 13.88           C  
+ATOM    787  N   ALA A 103      16.983  64.407   8.540  1.00 14.66           N  
+ATOM    788  CA  ALA A 103      16.350  64.567   9.878  1.00 16.92           C  
+ATOM    789  C   ALA A 103      16.100  63.217  10.552  1.00 18.96           C  
+ATOM    790  O   ALA A 103      16.526  63.086  11.728  1.00 19.92           O  
+ATOM    791  CB  ALA A 103      15.035  65.312   9.745  1.00 13.74           C  
+ATOM    792  N   ARG A 104      15.546  62.223   9.872  1.00 16.46           N  
+ATOM    793  CA  ARG A 104      15.300  60.914  10.427  1.00 18.30           C  
+ATOM    794  C   ARG A 104      16.570  60.126  10.722  1.00 20.67           C  
+ATOM    795  O   ARG A 104      16.637  59.523  11.812  1.00 21.85           O  
+ATOM    796  CB  ARG A 104      14.374  60.048   9.567  1.00 18.66           C  
+ATOM    797  CG  ARG A 104      14.049  58.698  10.193  1.00 20.98           C  
+ATOM    798  CD  ARG A 104      12.603  58.316  10.017  1.00 21.99           C  
+ATOM    799  NE  ARG A 104      11.671  59.387  10.338  1.00 22.40           N  
+ATOM    800  CZ  ARG A 104      10.379  59.279  10.084  1.00 22.61           C  
+ATOM    801  NH1 ARG A 104       9.932  58.170   9.524  1.00 24.41           N  
+ATOM    802  NH2 ARG A 104       9.556  60.253  10.423  1.00 21.87           N  
+ATOM    803  N   TYR A 105      17.603  60.158   9.873  1.00 16.74           N  
+ATOM    804  CA  TYR A 105      18.826  59.467  10.174  1.00 17.07           C  
+ATOM    805  C   TYR A 105      19.526  60.064  11.388  1.00 17.78           C  
+ATOM    806  O   TYR A 105      20.034  59.322  12.264  1.00 19.08           O  
+ATOM    807  CB  TYR A 105      19.799  59.508   8.959  1.00 15.36           C  
+ATOM    808  CG  TYR A 105      21.215  59.137   9.390  1.00 15.12           C  
+ATOM    809  CD1 TYR A 105      21.508  57.825   9.719  1.00 16.22           C  
+ATOM    810  CD2 TYR A 105      22.214  60.067   9.473  1.00 15.78           C  
+ATOM    811  CE1 TYR A 105      22.791  57.475  10.150  1.00 16.69           C  
+ATOM    812  CE2 TYR A 105      23.511  59.756   9.850  1.00 13.42           C  
+ATOM    813  CZ  TYR A 105      23.779  58.438  10.170  1.00 16.63           C  
+ATOM    814  OH  TYR A 105      25.049  58.067  10.566  1.00 17.46           O  
+ATOM    815  N   VAL A 106      19.649  61.371  11.449  1.00 18.18           N  
+ATOM    816  CA  VAL A 106      20.361  62.081  12.506  1.00 20.66           C  
+ATOM    817  C   VAL A 106      19.665  61.827  13.838  1.00 22.94           C  
+ATOM    818  O   VAL A 106      20.336  61.536  14.817  1.00 23.69           O  
+ATOM    819  CB  VAL A 106      20.542  63.579  12.280  1.00 20.43           C  
+ATOM    820  CG1 VAL A 106      21.154  64.247  13.510  1.00 21.56           C  
+ATOM    821  CG2 VAL A 106      21.526  63.775  11.094  1.00 19.15           C  
+ATOM    822  N   ALA A 107      18.351  61.806  13.873  1.00 22.13           N  
+ATOM    823  CA  ALA A 107      17.619  61.540  15.127  1.00 24.16           C  
+ATOM    824  C   ALA A 107      17.904  60.150  15.661  1.00 24.09           C  
+ATOM    825  O   ALA A 107      17.879  59.949  16.878  1.00 26.11           O  
+ATOM    826  CB  ALA A 107      16.135  61.723  14.786  1.00 21.13           C  
+ATOM    827  N   ARG A 108      18.181  59.164  14.827  1.00 24.23           N  
+ATOM    828  CA  ARG A 108      18.403  57.793  15.229  1.00 27.39           C  
+ATOM    829  C   ARG A 108      19.857  57.319  15.183  1.00 24.90           C  
+ATOM    830  O   ARG A 108      20.095  56.113  15.363  1.00 23.81           O  
+ATOM    831  CB  ARG A 108      17.652  56.917  14.189  1.00 30.03           C  
+ATOM    832  CG  ARG A 108      16.143  56.892  14.376  1.00 35.83           C  
+ATOM    833  CD  ARG A 108      15.500  56.000  13.299  1.00 38.87           C  
+ATOM    834  NE  ARG A 108      14.064  56.229  13.238  1.00 41.87           N  
+ATOM    835  CZ  ARG A 108      13.112  55.774  12.436  1.00 43.22           C  
+ATOM    836  NH1 ARG A 108      13.256  54.906  11.437  1.00 42.75           N  
+ATOM    837  NH2 ARG A 108      11.866  56.217  12.661  1.00 44.61           N  
+ATOM    838  N   ALA A 109      20.781  58.196  14.821  1.00 21.52           N  
+ATOM    839  CA  ALA A 109      22.128  57.736  14.551  1.00 24.73           C  
+ATOM    840  C   ALA A 109      22.839  57.349  15.856  1.00 25.69           C  
+ATOM    841  O   ALA A 109      22.528  57.924  16.900  1.00 23.47           O  
+ATOM    842  CB  ALA A 109      22.905  58.824  13.831  1.00 23.45           C  
+ATOM    843  N   GLU A 110      23.769  56.423  15.755  1.00 28.23           N  
+ATOM    844  CA  GLU A 110      24.601  56.048  16.899  1.00 31.70           C  
+ATOM    845  C   GLU A 110      25.324  57.316  17.323  1.00 32.18           C  
+ATOM    846  O   GLU A 110      25.861  58.036  16.463  1.00 33.02           O  
+ATOM    847  CB  GLU A 110      25.691  55.061  16.459  1.00 35.35           C  
+ATOM    848  CG  GLU A 110      25.247  53.732  15.905  1.00 40.99           C  
+ATOM    849  CD  GLU A 110      26.474  52.906  15.518  1.00 45.41           C  
+ATOM    850  OE1 GLU A 110      27.453  52.903  16.311  1.00 46.51           O  
+ATOM    851  OE2 GLU A 110      26.437  52.312  14.415  1.00 47.09           O  
+ATOM    852  N   PRO A 111      25.385  57.628  18.593  1.00 32.76           N  
+ATOM    853  CA  PRO A 111      26.064  58.859  19.029  1.00 32.92           C  
+ATOM    854  C   PRO A 111      27.525  58.863  18.572  1.00 30.57           C  
+ATOM    855  O   PRO A 111      28.177  57.817  18.417  1.00 28.47           O  
+ATOM    856  CB  PRO A 111      25.832  58.843  20.542  1.00 35.07           C  
+ATOM    857  CG  PRO A 111      24.629  57.971  20.767  1.00 34.07           C  
+ATOM    858  CD  PRO A 111      24.754  56.872  19.718  1.00 33.77           C  
+ATOM    859  N   GLY A 112      28.067  60.009  18.191  1.00 30.19           N  
+ATOM    860  CA  GLY A 112      29.431  60.163  17.673  1.00 29.60           C  
+ATOM    861  C   GLY A 112      29.555  60.103  16.144  1.00 29.16           C  
+ATOM    862  O   GLY A 112      30.480  60.685  15.553  1.00 27.81           O  
+ATOM    863  N   ARG A 113      28.565  59.512  15.468  1.00 26.41           N  
+ATOM    864  CA  ARG A 113      28.576  59.431  14.025  1.00 26.06           C  
+ATOM    865  C   ARG A 113      28.300  60.801  13.383  1.00 23.47           C  
+ATOM    866  O   ARG A 113      28.790  61.008  12.289  1.00 21.34           O  
+ATOM    867  CB  ARG A 113      27.486  58.469  13.573  1.00 28.07           C  
+ATOM    868  CG  ARG A 113      27.700  57.000  13.894  1.00 28.06           C  
+ATOM    869  CD  ARG A 113      28.098  56.271  12.609  1.00 29.02           C  
+ATOM    870  NE  ARG A 113      28.332  54.847  12.862  1.00 30.94           N  
+ATOM    871  CZ  ARG A 113      29.542  54.292  12.942  1.00 31.35           C  
+ATOM    872  NH1 ARG A 113      30.693  54.940  12.771  1.00 29.03           N  
+ATOM    873  NH2 ARG A 113      29.575  52.980  13.180  1.00 31.95           N  
+ATOM    874  N   VAL A 114      27.489  61.652  14.010  1.00 19.46           N  
+ATOM    875  CA  VAL A 114      27.141  62.931  13.415  1.00 17.53           C  
+ATOM    876  C   VAL A 114      27.562  64.113  14.273  1.00 19.91           C  
+ATOM    877  O   VAL A 114      27.231  64.194  15.452  1.00 19.40           O  
+ATOM    878  CB  VAL A 114      25.604  63.059  13.247  1.00 15.39           C  
+ATOM    879  CG1 VAL A 114      25.198  64.377  12.593  1.00 13.59           C  
+ATOM    880  CG2 VAL A 114      25.068  61.889  12.413  1.00 14.34           C  
+ATOM    881  N   ALA A 115      28.163  65.123  13.644  1.00 16.23           N  
+ATOM    882  CA  ALA A 115      28.538  66.316  14.352  1.00 19.35           C  
+ATOM    883  C   ALA A 115      27.535  67.438  14.137  1.00 19.13           C  
+ATOM    884  O   ALA A 115      27.319  68.240  15.040  1.00 18.48           O  
+ATOM    885  CB  ALA A 115      29.903  66.879  13.936  1.00 19.47           C  
+ATOM    886  N   LYS A 116      27.083  67.657  12.889  1.00 19.00           N  
+ATOM    887  CA  LYS A 116      26.223  68.787  12.568  1.00 16.04           C  
+ATOM    888  C   LYS A 116      25.330  68.354  11.382  1.00 16.14           C  
+ATOM    889  O   LYS A 116      25.719  67.411  10.678  1.00 16.69           O  
+ATOM    890  CB  LYS A 116      27.043  69.958  12.040  1.00 20.65           C  
+ATOM    891  CG  LYS A 116      28.035  70.656  12.936  1.00 22.85           C  
+ATOM    892  CD  LYS A 116      28.758  71.804  12.264  1.00 25.09           C  
+ATOM    893  CE  LYS A 116      29.914  72.284  13.163  1.00 28.02           C  
+ATOM    894  NZ  LYS A 116      29.929  73.775  13.090  1.00 31.95           N  
+ATOM    895  N   ALA A 117      24.262  69.074  11.152  1.00 16.05           N  
+ATOM    896  CA  ALA A 117      23.399  68.717  10.002  1.00 15.76           C  
+ATOM    897  C   ALA A 117      22.900  69.977   9.336  1.00 16.26           C  
+ATOM    898  O   ALA A 117      22.890  71.045   9.959  1.00 15.86           O  
+ATOM    899  CB  ALA A 117      22.293  67.767  10.424  1.00 16.07           C  
+ATOM    900  N   VAL A 118      22.578  69.919   8.026  1.00 15.13           N  
+ATOM    901  CA  VAL A 118      22.140  71.108   7.298  1.00 13.37           C  
+ATOM    902  C   VAL A 118      20.890  70.657   6.530  1.00 15.18           C  
+ATOM    903  O   VAL A 118      20.919  69.584   5.885  1.00 15.17           O  
+ATOM    904  CB  VAL A 118      23.178  71.662   6.304  1.00 15.05           C  
+ATOM    905  CG1 VAL A 118      22.614  72.842   5.495  1.00 14.19           C  
+ATOM    906  CG2 VAL A 118      24.502  72.078   6.932  1.00 13.64           C  
+ATOM    907  N   LEU A 119      19.783  71.328   6.638  1.00 14.09           N  
+ATOM    908  CA  LEU A 119      18.560  71.101   5.910  1.00 15.14           C  
+ATOM    909  C   LEU A 119      18.329  72.253   4.919  1.00 15.74           C  
+ATOM    910  O   LEU A 119      18.074  73.387   5.312  1.00 19.06           O  
+ATOM    911  CB  LEU A 119      17.300  71.025   6.790  1.00 17.15           C  
+ATOM    912  CG  LEU A 119      17.423  70.088   8.009  1.00 21.07           C  
+ATOM    913  CD1 LEU A 119      16.113  70.093   8.796  1.00 23.48           C  
+ATOM    914  CD2 LEU A 119      17.921  68.706   7.682  1.00 19.76           C  
+ATOM    915  N   VAL A 120      18.545  71.997   3.640  1.00 16.09           N  
+ATOM    916  CA  VAL A 120      18.399  73.007   2.601  1.00 13.95           C  
+ATOM    917  C   VAL A 120      17.109  72.766   1.821  1.00 14.28           C  
+ATOM    918  O   VAL A 120      16.913  71.663   1.282  1.00 12.45           O  
+ATOM    919  CB  VAL A 120      19.578  72.966   1.595  1.00 16.45           C  
+ATOM    920  CG1 VAL A 120      19.431  74.146   0.623  1.00 14.13           C  
+ATOM    921  CG2 VAL A 120      20.958  72.961   2.231  1.00 14.24           C  
+ATOM    922  N   SER A 121      16.233  73.785   1.746  1.00 13.51           N  
+ATOM    923  CA  SER A 121      14.986  73.663   1.007  1.00 16.25           C  
+ATOM    924  C   SER A 121      14.283  72.381   1.389  1.00 15.98           C  
+ATOM    925  O   SER A 121      13.751  71.670   0.532  1.00 16.42           O  
+ATOM    926  CB  SER A 121      15.274  73.688  -0.529  1.00 15.59           C  
+ATOM    927  OG  SER A 121      16.228  74.729  -0.787  1.00 17.82           O  
+ATOM    928  N   ALA A 122      14.306  71.993   2.677  1.00 15.58           N  
+ATOM    929  CA  ALA A 122      13.901  70.673   3.083  1.00 13.61           C  
+ATOM    930  C   ALA A 122      12.438  70.544   3.422  1.00 15.75           C  
+ATOM    931  O   ALA A 122      11.781  71.492   3.836  1.00 15.81           O  
+ATOM    932  CB  ALA A 122      14.791  70.273   4.278  1.00 14.14           C  
+ATOM    933  N   VAL A 123      11.924  69.312   3.284  1.00 15.36           N  
+ATOM    934  CA  VAL A 123      10.527  69.027   3.512  1.00 18.14           C  
+ATOM    935  C   VAL A 123       9.974  69.164   4.923  1.00 19.99           C  
+ATOM    936  O   VAL A 123       8.776  69.479   5.035  1.00 21.14           O  
+ATOM    937  CB  VAL A 123      10.062  67.644   2.940  1.00 18.42           C  
+ATOM    938  CG1 VAL A 123      10.238  67.646   1.421  1.00 19.16           C  
+ATOM    939  CG2 VAL A 123      10.861  66.474   3.520  1.00 18.69           C  
+ATOM    940  N   PRO A 124      10.721  68.892   5.987  1.00 19.16           N  
+ATOM    941  CA  PRO A 124      10.182  69.032   7.342  1.00 20.59           C  
+ATOM    942  C   PRO A 124       9.628  70.397   7.654  1.00 20.01           C  
+ATOM    943  O   PRO A 124      10.109  71.434   7.171  1.00 22.48           O  
+ATOM    944  CB  PRO A 124      11.392  68.800   8.286  1.00 19.48           C  
+ATOM    945  CG  PRO A 124      12.323  67.936   7.435  1.00 19.07           C  
+ATOM    946  CD  PRO A 124      12.128  68.471   6.025  1.00 18.32           C  
+ATOM    947  N   PRO A 125       8.721  70.443   8.644  1.00 21.76           N  
+ATOM    948  CA  PRO A 125       8.219  69.310   9.380  1.00 20.46           C  
+ATOM    949  C   PRO A 125       7.308  68.302   8.697  1.00 20.38           C  
+ATOM    950  O   PRO A 125       7.375  67.082   8.880  1.00 18.46           O  
+ATOM    951  CB  PRO A 125       7.324  69.985  10.466  1.00 20.66           C  
+ATOM    952  CG  PRO A 125       7.877  71.352  10.605  1.00 22.04           C  
+ATOM    953  CD  PRO A 125       8.255  71.757   9.197  1.00 20.22           C  
+ATOM    954  N   VAL A 126       6.316  68.801   7.967  1.00 19.98           N  
+ATOM    955  CA  VAL A 126       5.353  68.009   7.227  1.00 21.55           C  
+ATOM    956  C   VAL A 126       4.727  68.878   6.123  1.00 22.41           C  
+ATOM    957  O   VAL A 126       4.335  70.045   6.330  1.00 22.55           O  
+ATOM    958  CB  VAL A 126       4.230  67.380   8.073  1.00 24.15           C  
+ATOM    959  CG1 VAL A 126       3.540  68.441   8.942  1.00 24.05           C  
+ATOM    960  CG2 VAL A 126       3.210  66.654   7.208  1.00 24.22           C  
+ATOM    961  N   MET A 127       4.625  68.324   4.915  1.00 20.38           N  
+ATOM    962  CA  MET A 127       4.112  69.139   3.815  1.00 21.43           C  
+ATOM    963  C   MET A 127       2.597  69.118   3.663  1.00 23.72           C  
+ATOM    964  O   MET A 127       2.009  70.163   3.364  1.00 25.21           O  
+ATOM    965  CB  MET A 127       4.718  68.684   2.467  1.00 22.06           C  
+ATOM    966  CG  MET A 127       6.210  69.033   2.339  1.00 23.44           C  
+ATOM    967  SD  MET A 127       6.785  68.631   0.633  1.00 23.31           S  
+ATOM    968  CE  MET A 127       6.062  69.979  -0.273  1.00 22.99           C  
+ATOM    969  N   VAL A 128       2.000  67.948   3.707  1.00 24.76           N  
+ATOM    970  CA  VAL A 128       0.589  67.847   3.367  1.00 26.65           C  
+ATOM    971  C   VAL A 128      -0.316  68.452   4.443  1.00 30.56           C  
+ATOM    972  O   VAL A 128      -0.016  68.420   5.630  1.00 28.24           O  
+ATOM    973  CB  VAL A 128       0.229  66.380   3.125  1.00 26.19           C  
+ATOM    974  CG1 VAL A 128       0.157  65.553   4.402  1.00 25.58           C  
+ATOM    975  CG2 VAL A 128      -1.079  66.284   2.332  1.00 26.20           C  
+ATOM    976  N   LYS A 129      -1.455  68.930   3.955  1.00 33.75           N  
+ATOM    977  CA  LYS A 129      -2.528  69.410   4.811  1.00 37.76           C  
+ATOM    978  C   LYS A 129      -3.114  68.230   5.578  1.00 38.61           C  
+ATOM    979  O   LYS A 129      -3.401  67.151   5.056  1.00 39.57           O  
+ATOM    980  CB  LYS A 129      -3.606  70.087   3.961  1.00 39.66           C  
+ATOM    981  CG  LYS A 129      -4.822  70.488   4.789  1.00 42.50           C  
+ATOM    982  CD  LYS A 129      -5.900  71.086   3.899  1.00 43.45           C  
+ATOM    983  CE  LYS A 129      -5.819  72.598   3.876  1.00 44.88           C  
+ATOM    984  NZ  LYS A 129      -5.178  73.126   2.641  1.00 45.64           N  
+ATOM    985  N   SER A 130      -3.283  68.410   6.883  1.00 38.84           N  
+ATOM    986  CA  SER A 130      -3.854  67.425   7.778  1.00 38.69           C  
+ATOM    987  C   SER A 130      -4.493  68.142   8.982  1.00 39.55           C  
+ATOM    988  O   SER A 130      -4.423  69.362   9.058  1.00 38.38           O  
+ATOM    989  CB  SER A 130      -2.760  66.504   8.347  1.00 37.38           C  
+ATOM    990  OG  SER A 130      -1.819  67.347   9.027  1.00 37.20           O  
+ATOM    991  N   ASP A 131      -4.953  67.365   9.948  1.00 43.09           N  
+ATOM    992  CA  ASP A 131      -5.550  67.875  11.165  1.00 47.90           C  
+ATOM    993  C   ASP A 131      -4.518  68.671  11.989  1.00 48.15           C  
+ATOM    994  O   ASP A 131      -4.889  69.577  12.705  1.00 47.07           O  
+ATOM    995  CB  ASP A 131      -6.077  66.856  12.146  1.00 49.76           C  
+ATOM    996  CG  ASP A 131      -6.898  65.680  11.761  1.00 53.37           C  
+ATOM    997  OD1 ASP A 131      -8.018  65.812  11.202  1.00 54.42           O  
+ATOM    998  OD2 ASP A 131      -6.379  64.566  12.083  1.00 55.34           O  
+ATOM    999  N   THR A 132      -3.268  68.235  11.891  1.00 50.01           N  
+ATOM   1000  CA  THR A 132      -2.186  68.888  12.615  1.00 50.68           C  
+ATOM   1001  C   THR A 132      -1.449  69.908  11.776  1.00 50.61           C  
+ATOM   1002  O   THR A 132      -0.586  70.594  12.349  1.00 52.20           O  
+ATOM   1003  CB  THR A 132      -1.238  67.812  13.162  1.00 52.11           C  
+ATOM   1004  OG1 THR A 132      -0.694  67.033  12.076  1.00 54.39           O  
+ATOM   1005  CG2 THR A 132      -1.995  66.843  14.062  1.00 52.04           C  
+ATOM   1006  N   ASN A 133      -1.786  70.083  10.503  1.00 48.26           N  
+ATOM   1007  CA  ASN A 133      -1.122  71.040   9.629  1.00 47.55           C  
+ATOM   1008  C   ASN A 133      -2.042  71.671   8.597  1.00 49.07           C  
+ATOM   1009  O   ASN A 133      -2.045  71.329   7.408  1.00 48.16           O  
+ATOM   1010  CB  ASN A 133       0.037  70.296   8.925  1.00 45.68           C  
+ATOM   1011  CG  ASN A 133       0.818  71.178   7.974  1.00 44.93           C  
+ATOM   1012  OD1 ASN A 133       1.060  72.351   8.252  1.00 44.22           O  
+ATOM   1013  ND2 ASN A 133       1.215  70.634   6.821  1.00 43.36           N  
+ATOM   1014  N   PRO A 134      -2.842  72.662   8.992  1.00 50.69           N  
+ATOM   1015  CA  PRO A 134      -3.792  73.363   8.147  1.00 50.45           C  
+ATOM   1016  C   PRO A 134      -3.214  74.285   7.093  1.00 50.20           C  
+ATOM   1017  O   PRO A 134      -3.880  74.595   6.098  1.00 50.56           O  
+ATOM   1018  CB  PRO A 134      -4.600  74.225   9.144  1.00 51.82           C  
+ATOM   1019  CG  PRO A 134      -3.567  74.517  10.205  1.00 52.01           C  
+ATOM   1020  CD  PRO A 134      -2.897  73.167  10.405  1.00 51.50           C  
+ATOM   1021  N   ASP A 135      -1.986  74.767   7.250  1.00 49.38           N  
+ATOM   1022  CA  ASP A 135      -1.376  75.621   6.231  1.00 49.28           C  
+ATOM   1023  C   ASP A 135      -0.669  74.792   5.163  1.00 46.05           C  
+ATOM   1024  O   ASP A 135      -0.143  75.332   4.189  1.00 46.07           O  
+ATOM   1025  CB  ASP A 135      -0.421  76.614   6.892  1.00 52.19           C  
+ATOM   1026  CG  ASP A 135      -1.096  77.685   7.735  1.00 55.03           C  
+ATOM   1027  OD1 ASP A 135      -2.344  77.641   7.906  1.00 56.45           O  
+ATOM   1028  OD2 ASP A 135      -0.377  78.592   8.231  1.00 55.00           O  
+ATOM   1029  N   GLY A 136      -0.638  73.472   5.304  1.00 43.89           N  
+ATOM   1030  CA  GLY A 136       0.011  72.587   4.340  1.00 40.79           C  
+ATOM   1031  C   GLY A 136      -0.607  72.638   2.949  1.00 39.43           C  
+ATOM   1032  O   GLY A 136      -1.544  73.385   2.650  1.00 39.15           O  
+ATOM   1033  N   LEU A 137      -0.041  71.877   2.008  1.00 35.97           N  
+ATOM   1034  CA  LEU A 137      -0.546  71.797   0.644  1.00 32.66           C  
+ATOM   1035  C   LEU A 137      -1.582  70.678   0.590  1.00 29.24           C  
+ATOM   1036  O   LEU A 137      -1.435  69.663   1.243  1.00 26.74           O  
+ATOM   1037  CB  LEU A 137       0.577  71.474  -0.348  1.00 32.81           C  
+ATOM   1038  CG  LEU A 137       1.599  72.592  -0.555  1.00 35.09           C  
+ATOM   1039  CD1 LEU A 137       2.843  72.066  -1.253  1.00 34.97           C  
+ATOM   1040  CD2 LEU A 137       0.972  73.766  -1.309  1.00 35.67           C  
+ATOM   1041  N   PRO A 138      -2.652  70.861  -0.170  1.00 29.45           N  
+ATOM   1042  CA  PRO A 138      -3.675  69.844  -0.304  1.00 30.23           C  
+ATOM   1043  C   PRO A 138      -3.107  68.606  -0.990  1.00 31.36           C  
+ATOM   1044  O   PRO A 138      -2.182  68.693  -1.822  1.00 32.13           O  
+ATOM   1045  CB  PRO A 138      -4.783  70.503  -1.102  1.00 29.06           C  
+ATOM   1046  CG  PRO A 138      -4.217  71.741  -1.663  1.00 30.42           C  
+ATOM   1047  CD  PRO A 138      -2.923  72.077  -0.982  1.00 29.28           C  
+ATOM   1048  N   LEU A 139      -3.672  67.458  -0.684  1.00 31.51           N  
+ATOM   1049  CA  LEU A 139      -3.265  66.176  -1.216  1.00 32.88           C  
+ATOM   1050  C   LEU A 139      -3.340  66.131  -2.741  1.00 31.99           C  
+ATOM   1051  O   LEU A 139      -2.504  65.504  -3.406  1.00 28.55           O  
+ATOM   1052  CB  LEU A 139      -4.092  65.037  -0.623  1.00 33.94           C  
+ATOM   1053  CG  LEU A 139      -3.372  63.699  -0.466  1.00 37.35           C  
+ATOM   1054  CD1 LEU A 139      -3.117  63.063  -1.822  1.00 39.86           C  
+ATOM   1055  CD2 LEU A 139      -2.017  63.789   0.231  1.00 37.96           C  
+ATOM   1056  N   GLU A 140      -4.318  66.831  -3.302  1.00 31.28           N  
+ATOM   1057  CA  GLU A 140      -4.527  66.920  -4.732  1.00 34.12           C  
+ATOM   1058  C   GLU A 140      -3.313  67.462  -5.475  1.00 31.45           C  
+ATOM   1059  O   GLU A 140      -3.031  67.028  -6.610  1.00 30.08           O  
+ATOM   1060  CB  GLU A 140      -5.794  67.732  -5.049  1.00 37.68           C  
+ATOM   1061  CG  GLU A 140      -6.040  68.878  -4.111  1.00 43.67           C  
+ATOM   1062  CD  GLU A 140      -7.019  68.713  -2.958  1.00 45.80           C  
+ATOM   1063  OE1 GLU A 140      -7.115  67.641  -2.311  1.00 45.98           O  
+ATOM   1064  OE2 GLU A 140      -7.718  69.740  -2.683  1.00 47.17           O  
+ATOM   1065  N   VAL A 141      -2.523  68.339  -4.866  1.00 28.37           N  
+ATOM   1066  CA  VAL A 141      -1.286  68.790  -5.493  1.00 27.33           C  
+ATOM   1067  C   VAL A 141      -0.410  67.546  -5.757  1.00 25.57           C  
+ATOM   1068  O   VAL A 141       0.194  67.413  -6.827  1.00 25.43           O  
+ATOM   1069  CB  VAL A 141      -0.540  69.789  -4.610  1.00 29.32           C  
+ATOM   1070  CG1 VAL A 141       0.888  70.082  -5.057  1.00 29.44           C  
+ATOM   1071  CG2 VAL A 141      -1.302  71.127  -4.543  1.00 31.16           C  
+ATOM   1072  N   PHE A 142      -0.337  66.631  -4.805  1.00 21.76           N  
+ATOM   1073  CA  PHE A 142       0.516  65.463  -4.882  1.00 21.71           C  
+ATOM   1074  C   PHE A 142      -0.097  64.394  -5.767  1.00 20.83           C  
+ATOM   1075  O   PHE A 142       0.623  63.660  -6.423  1.00 19.11           O  
+ATOM   1076  CB  PHE A 142       0.877  64.900  -3.471  1.00 20.89           C  
+ATOM   1077  CG  PHE A 142       1.543  66.015  -2.693  1.00 20.73           C  
+ATOM   1078  CD1 PHE A 142       2.757  66.537  -3.093  1.00 20.49           C  
+ATOM   1079  CD2 PHE A 142       0.877  66.575  -1.607  1.00 20.60           C  
+ATOM   1080  CE1 PHE A 142       3.325  67.590  -2.410  1.00 22.14           C  
+ATOM   1081  CE2 PHE A 142       1.453  67.642  -0.942  1.00 22.34           C  
+ATOM   1082  CZ  PHE A 142       2.686  68.155  -1.324  1.00 20.93           C  
+ATOM   1083  N   ASP A 143      -1.417  64.311  -5.833  1.00 22.05           N  
+ATOM   1084  CA  ASP A 143      -2.112  63.389  -6.697  1.00 22.94           C  
+ATOM   1085  C   ASP A 143      -1.835  63.782  -8.163  1.00 22.41           C  
+ATOM   1086  O   ASP A 143      -1.703  62.840  -8.927  1.00 23.26           O  
+ATOM   1087  CB  ASP A 143      -3.619  63.441  -6.447  1.00 27.10           C  
+ATOM   1088  CG  ASP A 143      -4.051  62.727  -5.176  1.00 29.44           C  
+ATOM   1089  OD1 ASP A 143      -3.371  61.870  -4.594  1.00 29.15           O  
+ATOM   1090  OD2 ASP A 143      -5.176  63.078  -4.763  1.00 31.30           O  
+ATOM   1091  N   GLU A 144      -1.766  65.045  -8.493  1.00 21.73           N  
+ATOM   1092  CA  GLU A 144      -1.374  65.485  -9.837  1.00 25.52           C  
+ATOM   1093  C   GLU A 144       0.040  65.073 -10.232  1.00 24.13           C  
+ATOM   1094  O   GLU A 144       0.208  64.690 -11.388  1.00 22.40           O  
+ATOM   1095  CB  GLU A 144      -1.421  67.006 -10.030  1.00 28.14           C  
+ATOM   1096  CG  GLU A 144      -2.869  67.480 -10.020  1.00 36.33           C  
+ATOM   1097  CD  GLU A 144      -3.033  68.985 -10.091  1.00 40.88           C  
+ATOM   1098  OE1 GLU A 144      -2.047  69.768  -9.974  1.00 42.24           O  
+ATOM   1099  OE2 GLU A 144      -4.217  69.376 -10.273  1.00 44.88           O  
+ATOM   1100  N   PHE A 145       1.036  65.242  -9.360  1.00 22.28           N  
+ATOM   1101  CA  PHE A 145       2.390  64.743  -9.629  1.00 20.58           C  
+ATOM   1102  C   PHE A 145       2.385  63.240  -9.889  1.00 18.51           C  
+ATOM   1103  O   PHE A 145       2.992  62.744 -10.867  1.00 19.78           O  
+ATOM   1104  CB  PHE A 145       3.316  64.959  -8.436  1.00 22.71           C  
+ATOM   1105  CG  PHE A 145       3.666  66.343  -8.007  1.00 26.44           C  
+ATOM   1106  CD1 PHE A 145       3.575  67.430  -8.857  1.00 27.94           C  
+ATOM   1107  CD2 PHE A 145       4.064  66.546  -6.686  1.00 28.67           C  
+ATOM   1108  CE1 PHE A 145       3.895  68.699  -8.438  1.00 30.51           C  
+ATOM   1109  CE2 PHE A 145       4.391  67.832  -6.253  1.00 31.78           C  
+ATOM   1110  CZ  PHE A 145       4.318  68.909  -7.123  1.00 31.64           C  
+ATOM   1111  N   ARG A 146       1.749  62.471  -8.993  1.00 14.95           N  
+ATOM   1112  CA  ARG A 146       1.594  61.053  -9.210  1.00 16.50           C  
+ATOM   1113  C   ARG A 146       1.000  60.747 -10.594  1.00 16.19           C  
+ATOM   1114  O   ARG A 146       1.537  59.853 -11.263  1.00 16.94           O  
+ATOM   1115  CB  ARG A 146       0.712  60.363  -8.159  1.00 15.44           C  
+ATOM   1116  CG  ARG A 146       1.448  59.903  -6.913  1.00 18.49           C  
+ATOM   1117  CD  ARG A 146       0.522  59.214  -5.904  1.00 19.25           C  
+ATOM   1118  NE  ARG A 146      -0.263  60.147  -5.116  1.00 18.99           N  
+ATOM   1119  CZ  ARG A 146       0.162  60.845  -4.055  1.00 22.00           C  
+ATOM   1120  NH1 ARG A 146       1.417  60.708  -3.589  1.00 20.74           N  
+ATOM   1121  NH2 ARG A 146      -0.666  61.682  -3.424  1.00 19.74           N  
+ATOM   1122  N   ALA A 147      -0.108  61.405 -10.930  1.00 15.41           N  
+ATOM   1123  CA  ALA A 147      -0.742  61.068 -12.224  1.00 16.02           C  
+ATOM   1124  C   ALA A 147       0.098  61.494 -13.424  1.00 15.60           C  
+ATOM   1125  O   ALA A 147       0.205  60.731 -14.389  1.00 15.55           O  
+ATOM   1126  CB  ALA A 147      -2.112  61.756 -12.317  1.00 17.78           C  
+ATOM   1127  N   ALA A 148       0.745  62.663 -13.374  1.00 13.66           N  
+ATOM   1128  CA  ALA A 148       1.608  63.038 -14.492  1.00 13.34           C  
+ATOM   1129  C   ALA A 148       2.797  62.104 -14.625  1.00 15.15           C  
+ATOM   1130  O   ALA A 148       3.231  61.756 -15.756  1.00 14.91           O  
+ATOM   1131  CB  ALA A 148       2.058  64.486 -14.318  1.00 14.20           C  
+ATOM   1132  N   LEU A 149       3.391  61.691 -13.481  1.00 14.37           N  
+ATOM   1133  CA  LEU A 149       4.554  60.815 -13.474  1.00 15.07           C  
+ATOM   1134  C   LEU A 149       4.182  59.482 -14.107  1.00 16.23           C  
+ATOM   1135  O   LEU A 149       4.885  58.970 -14.955  1.00 15.81           O  
+ATOM   1136  CB  LEU A 149       5.075  60.558 -12.059  1.00 16.20           C  
+ATOM   1137  CG  LEU A 149       6.412  59.846 -11.889  1.00 18.76           C  
+ATOM   1138  CD1 LEU A 149       7.086  60.354 -10.615  1.00 17.72           C  
+ATOM   1139  CD2 LEU A 149       6.246  58.348 -11.940  1.00 17.67           C  
+ATOM   1140  N   ALA A 150       3.075  58.893 -13.651  1.00 15.42           N  
+ATOM   1141  CA  ALA A 150       2.615  57.620 -14.189  1.00 15.16           C  
+ATOM   1142  C   ALA A 150       2.230  57.738 -15.673  1.00 13.78           C  
+ATOM   1143  O   ALA A 150       2.514  56.789 -16.397  1.00 19.26           O  
+ATOM   1144  CB  ALA A 150       1.364  57.251 -13.386  1.00 16.42           C  
+ATOM   1145  N   ALA A 151       1.636  58.823 -16.125  1.00 13.40           N  
+ATOM   1146  CA  ALA A 151       1.186  58.908 -17.525  1.00 15.13           C  
+ATOM   1147  C   ALA A 151       2.360  59.061 -18.521  1.00 15.01           C  
+ATOM   1148  O   ALA A 151       2.327  58.380 -19.543  1.00 17.01           O  
+ATOM   1149  CB  ALA A 151       0.202  60.066 -17.659  1.00 16.40           C  
+ATOM   1150  N   ASN A 152       3.331  59.915 -18.248  1.00 12.29           N  
+ATOM   1151  CA  ASN A 152       4.439  60.148 -19.182  1.00 13.18           C  
+ATOM   1152  C   ASN A 152       5.573  60.722 -18.357  1.00 10.57           C  
+ATOM   1153  O   ASN A 152       5.726  61.921 -18.232  1.00 11.29           O  
+ATOM   1154  CB  ASN A 152       3.982  61.130 -20.277  1.00 14.78           C  
+ATOM   1155  CG  ASN A 152       5.036  61.288 -21.358  1.00 16.16           C  
+ATOM   1156  OD1 ASN A 152       6.178  60.853 -21.145  1.00 12.66           O  
+ATOM   1157  ND2 ASN A 152       4.588  61.815 -22.497  1.00 15.63           N  
+ATOM   1158  N   ARG A 153       6.332  59.814 -17.706  1.00  9.65           N  
+ATOM   1159  CA  ARG A 153       7.398  60.294 -16.812  1.00  9.45           C  
+ATOM   1160  C   ARG A 153       8.406  61.123 -17.576  1.00 10.07           C  
+ATOM   1161  O   ARG A 153       8.902  62.130 -17.059  1.00  9.84           O  
+ATOM   1162  CB  ARG A 153       8.047  59.062 -16.122  1.00  9.95           C  
+ATOM   1163  CG  ARG A 153       9.129  59.432 -15.113  1.00 11.95           C  
+ATOM   1164  CD  ARG A 153       9.551  58.224 -14.256  1.00 13.02           C  
+ATOM   1165  NE  ARG A 153      10.347  57.245 -14.983  1.00 10.42           N  
+ATOM   1166  CZ  ARG A 153      11.605  56.976 -14.698  1.00 12.00           C  
+ATOM   1167  NH1 ARG A 153      12.210  57.583 -13.658  1.00 11.11           N  
+ATOM   1168  NH2 ARG A 153      12.259  56.076 -15.418  1.00 11.45           N  
+ATOM   1169  N   ALA A 154       8.807  60.640 -18.788  1.00  9.44           N  
+ATOM   1170  CA  ALA A 154       9.789  61.415 -19.576  1.00  9.28           C  
+ATOM   1171  C   ALA A 154       9.390  62.843 -19.851  1.00  8.79           C  
+ATOM   1172  O   ALA A 154      10.271  63.686 -19.920  1.00  9.13           O  
+ATOM   1173  CB  ALA A 154      10.040  60.700 -20.903  1.00  9.50           C  
+ATOM   1174  N   GLN A 155       8.137  63.191 -20.063  1.00  9.37           N  
+ATOM   1175  CA  GLN A 155       7.712  64.565 -20.311  1.00 10.37           C  
+ATOM   1176  C   GLN A 155       7.519  65.339 -19.000  1.00  9.78           C  
+ATOM   1177  O   GLN A 155       7.921  66.483 -18.873  1.00 11.62           O  
+ATOM   1178  CB  GLN A 155       6.341  64.590 -21.027  1.00 10.74           C  
+ATOM   1179  CG  GLN A 155       5.909  66.003 -21.439  1.00  9.94           C  
+ATOM   1180  CD  GLN A 155       6.902  66.609 -22.400  1.00 11.90           C  
+ATOM   1181  OE1 GLN A 155       7.337  65.974 -23.381  1.00 14.39           O  
+ATOM   1182  NE2 GLN A 155       7.351  67.806 -22.090  1.00 12.98           N  
+ATOM   1183  N   PHE A 156       7.013  64.634 -17.972  1.00 10.53           N  
+ATOM   1184  CA  PHE A 156       6.839  65.277 -16.659  1.00 11.74           C  
+ATOM   1185  C   PHE A 156       8.203  65.727 -16.154  1.00  9.48           C  
+ATOM   1186  O   PHE A 156       8.397  66.768 -15.554  1.00 10.94           O  
+ATOM   1187  CB  PHE A 156       6.256  64.245 -15.646  1.00 12.12           C  
+ATOM   1188  CG  PHE A 156       6.000  64.794 -14.241  1.00 13.48           C  
+ATOM   1189  CD1 PHE A 156       5.211  65.908 -14.082  1.00 13.11           C  
+ATOM   1190  CD2 PHE A 156       6.477  64.155 -13.111  1.00 15.50           C  
+ATOM   1191  CE1 PHE A 156       4.970  66.445 -12.813  1.00 15.16           C  
+ATOM   1192  CE2 PHE A 156       6.204  64.647 -11.834  1.00 13.39           C  
+ATOM   1193  CZ  PHE A 156       5.465  65.796 -11.690  1.00 13.21           C  
+ATOM   1194  N   TYR A 157       9.294  64.964 -16.487  1.00  9.39           N  
+ATOM   1195  CA  TYR A 157      10.626  65.323 -15.969  1.00  8.62           C  
+ATOM   1196  C   TYR A 157      11.296  66.373 -16.831  1.00 10.81           C  
+ATOM   1197  O   TYR A 157      12.368  66.844 -16.467  1.00  9.98           O  
+ATOM   1198  CB  TYR A 157      11.523  64.093 -15.831  1.00  8.88           C  
+ATOM   1199  CG  TYR A 157      11.170  63.193 -14.660  1.00 10.44           C  
+ATOM   1200  CD1 TYR A 157      10.110  63.418 -13.807  1.00 11.47           C  
+ATOM   1201  CD2 TYR A 157      12.026  62.108 -14.415  1.00 11.17           C  
+ATOM   1202  CE1 TYR A 157       9.883  62.572 -12.727  1.00 12.14           C  
+ATOM   1203  CE2 TYR A 157      11.781  61.252 -13.378  1.00 12.49           C  
+ATOM   1204  CZ  TYR A 157      10.724  61.517 -12.513  1.00 13.38           C  
+ATOM   1205  OH  TYR A 157      10.501  60.602 -11.501  1.00 13.61           O  
+ATOM   1206  N   ILE A 158      10.671  66.837 -17.923  1.00 11.10           N  
+ATOM   1207  CA  ILE A 158      11.089  68.071 -18.598  1.00 12.31           C  
+ATOM   1208  C   ILE A 158      10.292  69.254 -17.938  1.00 11.59           C  
+ATOM   1209  O   ILE A 158      10.835  70.306 -17.575  1.00 11.49           O  
+ATOM   1210  CB  ILE A 158      10.750  68.081 -20.098  1.00 14.66           C  
+ATOM   1211  CG1 ILE A 158      11.572  66.972 -20.802  1.00 15.74           C  
+ATOM   1212  CG2 ILE A 158      10.961  69.479 -20.712  1.00 14.05           C  
+ATOM   1213  CD1 ILE A 158      11.294  66.947 -22.300  1.00 13.62           C  
+ATOM   1214  N   ASP A 159       9.015  69.001 -17.726  1.00 11.12           N  
+ATOM   1215  CA  ASP A 159       8.133  70.029 -17.174  1.00 14.77           C  
+ATOM   1216  C   ASP A 159       8.546  70.562 -15.812  1.00 14.63           C  
+ATOM   1217  O   ASP A 159       8.522  71.789 -15.625  1.00 14.25           O  
+ATOM   1218  CB  ASP A 159       6.680  69.568 -17.124  1.00 16.02           C  
+ATOM   1219  CG  ASP A 159       6.089  69.272 -18.514  1.00 18.51           C  
+ATOM   1220  OD1 ASP A 159       6.635  69.648 -19.554  1.00 16.93           O  
+ATOM   1221  OD2 ASP A 159       5.053  68.602 -18.482  1.00 21.22           O  
+ATOM   1222  N   VAL A 160       8.925  69.692 -14.850  1.00 12.85           N  
+ATOM   1223  CA  VAL A 160       9.310  70.214 -13.540  1.00 11.22           C  
+ATOM   1224  C   VAL A 160      10.503  71.122 -13.472  1.00 12.66           C  
+ATOM   1225  O   VAL A 160      10.469  72.246 -12.937  1.00 13.19           O  
+ATOM   1226  CB  VAL A 160       9.428  68.997 -12.593  1.00 11.11           C  
+ATOM   1227  CG1 VAL A 160       9.929  69.425 -11.226  1.00 11.13           C  
+ATOM   1228  CG2 VAL A 160       8.091  68.302 -12.477  1.00 11.30           C  
+ATOM   1229  N   PRO A 161      11.685  70.742 -14.006  1.00 12.43           N  
+ATOM   1230  CA  PRO A 161      12.865  71.568 -14.015  1.00  9.91           C  
+ATOM   1231  C   PRO A 161      12.738  72.752 -14.967  1.00 11.78           C  
+ATOM   1232  O   PRO A 161      13.416  73.744 -14.772  1.00 12.50           O  
+ATOM   1233  CB  PRO A 161      13.986  70.622 -14.404  1.00 11.67           C  
+ATOM   1234  CG  PRO A 161      13.286  69.625 -15.276  1.00 11.08           C  
+ATOM   1235  CD  PRO A 161      11.920  69.391 -14.600  1.00 11.57           C  
+ATOM   1236  N   SER A 162      11.928  72.722 -16.013  1.00 14.47           N  
+ATOM   1237  CA  SER A 162      11.728  73.853 -16.910  1.00 15.87           C  
+ATOM   1238  C   SER A 162      10.859  74.906 -16.214  1.00 16.10           C  
+ATOM   1239  O   SER A 162      10.962  76.062 -16.524  1.00 17.75           O  
+ATOM   1240  CB  SER A 162      10.907  73.440 -18.163  1.00 15.71           C  
+ATOM   1241  OG  SER A 162      11.778  72.620 -18.953  1.00 17.94           O  
+ATOM   1242  N   GLY A 163      10.051  74.517 -15.251  1.00 16.08           N  
+ATOM   1243  CA  GLY A 163       9.114  75.422 -14.610  1.00 15.70           C  
+ATOM   1244  C   GLY A 163       9.439  75.796 -13.184  1.00 13.60           C  
+ATOM   1245  O   GLY A 163      10.290  76.646 -12.907  1.00 17.17           O  
+ATOM   1246  N   PRO A 164       8.868  75.092 -12.239  1.00 13.87           N  
+ATOM   1247  CA  PRO A 164       9.008  75.470 -10.837  1.00 16.88           C  
+ATOM   1248  C   PRO A 164      10.303  75.134 -10.124  1.00 15.68           C  
+ATOM   1249  O   PRO A 164      10.732  75.912  -9.280  1.00 18.25           O  
+ATOM   1250  CB  PRO A 164       7.861  74.726 -10.159  1.00 15.51           C  
+ATOM   1251  CG  PRO A 164       7.482  73.607 -11.078  1.00 16.56           C  
+ATOM   1252  CD  PRO A 164       7.838  74.033 -12.470  1.00 13.98           C  
+ATOM   1253  N   PHE A 165      10.976  74.030 -10.462  1.00 12.34           N  
+ATOM   1254  CA  PHE A 165      12.148  73.659  -9.622  1.00 10.59           C  
+ATOM   1255  C   PHE A 165      13.198  74.691  -9.452  1.00 12.15           C  
+ATOM   1256  O   PHE A 165      13.771  74.818  -8.345  1.00 11.34           O  
+ATOM   1257  CB  PHE A 165      12.687  72.322 -10.141  1.00 10.42           C  
+ATOM   1258  CG  PHE A 165      13.442  71.439  -9.175  1.00 11.90           C  
+ATOM   1259  CD1 PHE A 165      14.778  71.695  -8.921  1.00 10.94           C  
+ATOM   1260  CD2 PHE A 165      12.765  70.417  -8.530  1.00 10.90           C  
+ATOM   1261  CE1 PHE A 165      15.483  70.894  -8.028  1.00 10.77           C  
+ATOM   1262  CE2 PHE A 165      13.485  69.589  -7.619  1.00 11.84           C  
+ATOM   1263  CZ  PHE A 165      14.809  69.854  -7.408  1.00 10.14           C  
+ATOM   1264  N   TYR A 166      13.663  75.363 -10.531  1.00 10.46           N  
+ATOM   1265  CA  TYR A 166      14.773  76.252 -10.531  1.00 10.78           C  
+ATOM   1266  C   TYR A 166      14.304  77.687 -10.721  1.00 12.77           C  
+ATOM   1267  O   TYR A 166      15.122  78.569 -10.885  1.00 12.36           O  
+ATOM   1268  CB  TYR A 166      15.787  75.939 -11.692  1.00 11.17           C  
+ATOM   1269  CG  TYR A 166      16.528  74.625 -11.458  1.00 11.96           C  
+ATOM   1270  CD1 TYR A 166      17.380  74.452 -10.368  1.00  9.60           C  
+ATOM   1271  CD2 TYR A 166      16.345  73.558 -12.345  1.00 11.53           C  
+ATOM   1272  CE1 TYR A 166      18.063  73.266 -10.197  1.00 11.76           C  
+ATOM   1273  CE2 TYR A 166      17.009  72.369 -12.141  1.00 10.68           C  
+ATOM   1274  CZ  TYR A 166      17.843  72.214 -11.080  1.00 12.29           C  
+ATOM   1275  OH  TYR A 166      18.480  71.014 -10.899  1.00 12.68           O  
+ATOM   1276  N   GLY A 167      12.999  77.909 -10.657  1.00 15.04           N  
+ATOM   1277  CA  GLY A 167      12.464  79.276 -10.833  1.00 15.35           C  
+ATOM   1278  C   GLY A 167      12.686  79.797 -12.233  1.00 18.42           C  
+ATOM   1279  O   GLY A 167      12.609  81.029 -12.452  1.00 18.56           O  
+ATOM   1280  N   PHE A 168      12.913  78.946 -13.257  1.00 16.77           N  
+ATOM   1281  CA  PHE A 168      13.139  79.499 -14.597  1.00 17.30           C  
+ATOM   1282  C   PHE A 168      11.827  80.019 -15.198  1.00 18.88           C  
+ATOM   1283  O   PHE A 168      11.829  80.544 -16.321  1.00 20.43           O  
+ATOM   1284  CB  PHE A 168      13.741  78.420 -15.516  1.00 13.57           C  
+ATOM   1285  CG  PHE A 168      15.090  77.911 -15.125  1.00 12.80           C  
+ATOM   1286  CD1 PHE A 168      15.968  78.689 -14.402  1.00 12.39           C  
+ATOM   1287  CD2 PHE A 168      15.496  76.641 -15.519  1.00 13.54           C  
+ATOM   1288  CE1 PHE A 168      17.235  78.262 -14.064  1.00 13.46           C  
+ATOM   1289  CE2 PHE A 168      16.756  76.190 -15.161  1.00 13.74           C  
+ATOM   1290  CZ  PHE A 168      17.634  77.005 -14.447  1.00 15.04           C  
+ATOM   1291  N   ASN A 169      10.683  79.833 -14.579  1.00 19.48           N  
+ATOM   1292  CA  ASN A 169       9.430  80.400 -15.026  1.00 19.75           C  
+ATOM   1293  C   ASN A 169       9.268  81.820 -14.475  1.00 22.95           C  
+ATOM   1294  O   ASN A 169       8.198  82.390 -14.727  1.00 25.06           O  
+ATOM   1295  CB  ASN A 169       8.225  79.540 -14.653  1.00 18.97           C  
+ATOM   1296  CG  ASN A 169       8.138  79.306 -13.144  1.00 19.69           C  
+ATOM   1297  OD1 ASN A 169       8.983  79.792 -12.369  1.00 19.38           O  
+ATOM   1298  ND2 ASN A 169       7.139  78.551 -12.712  1.00 20.25           N  
+ATOM   1299  N   ARG A 170      10.204  82.385 -13.737  1.00 23.31           N  
+ATOM   1300  CA  ARG A 170      10.128  83.741 -13.239  1.00 26.22           C  
+ATOM   1301  C   ARG A 170      10.757  84.695 -14.256  1.00 29.13           C  
+ATOM   1302  O   ARG A 170      11.840  84.460 -14.818  1.00 28.21           O  
+ATOM   1303  CB  ARG A 170      10.945  83.901 -11.942  1.00 26.41           C  
+ATOM   1304  CG  ARG A 170      10.421  83.225 -10.688  1.00 26.12           C  
+ATOM   1305  CD  ARG A 170       8.948  83.458 -10.439  1.00 27.65           C  
+ATOM   1306  NE  ARG A 170       8.461  82.948  -9.166  1.00 28.05           N  
+ATOM   1307  CZ  ARG A 170       7.304  82.334  -8.992  1.00 26.76           C  
+ATOM   1308  NH1 ARG A 170       6.476  82.167 -10.018  1.00 28.15           N  
+ATOM   1309  NH2 ARG A 170       6.945  81.890  -7.789  1.00 28.29           N  
+ATOM   1310  N   GLU A 171      10.145  85.866 -14.406  1.00 31.67           N  
+ATOM   1311  CA  GLU A 171      10.681  86.880 -15.319  1.00 34.31           C  
+ATOM   1312  C   GLU A 171      12.058  87.315 -14.869  1.00 32.61           C  
+ATOM   1313  O   GLU A 171      12.327  87.492 -13.675  1.00 32.62           O  
+ATOM   1314  CB  GLU A 171       9.723  88.065 -15.395  1.00 38.74           C  
+ATOM   1315  CG  GLU A 171       9.948  88.980 -16.605  1.00 44.51           C  
+ATOM   1316  CD  GLU A 171       9.069  90.213 -16.402  1.00 48.11           C  
+ATOM   1317  OE1 GLU A 171       7.851  90.025 -16.152  1.00 49.29           O  
+ATOM   1318  OE2 GLU A 171       9.609  91.345 -16.463  1.00 50.71           O  
+ATOM   1319  N   GLY A 172      12.982  87.400 -15.819  1.00 32.49           N  
+ATOM   1320  CA  GLY A 172      14.336  87.855 -15.516  1.00 32.07           C  
+ATOM   1321  C   GLY A 172      15.282  86.815 -14.974  1.00 31.91           C  
+ATOM   1322  O   GLY A 172      16.459  87.097 -14.734  1.00 33.27           O  
+ATOM   1323  N   ALA A 173      14.828  85.556 -14.816  1.00 30.17           N  
+ATOM   1324  CA  ALA A 173      15.752  84.549 -14.292  1.00 27.07           C  
+ATOM   1325  C   ALA A 173      16.775  84.203 -15.361  1.00 24.53           C  
+ATOM   1326  O   ALA A 173      16.487  84.219 -16.546  1.00 25.51           O  
+ATOM   1327  CB  ALA A 173      15.000  83.283 -13.904  1.00 25.63           C  
+ATOM   1328  N   THR A 174      17.932  83.752 -14.951  1.00 22.90           N  
+ATOM   1329  CA  THR A 174      18.928  83.202 -15.841  1.00 22.99           C  
+ATOM   1330  C   THR A 174      18.583  81.726 -16.073  1.00 23.99           C  
+ATOM   1331  O   THR A 174      18.592  80.919 -15.125  1.00 24.96           O  
+ATOM   1332  CB  THR A 174      20.312  83.282 -15.204  1.00 25.97           C  
+ATOM   1333  OG1 THR A 174      20.521  84.676 -14.873  1.00 30.01           O  
+ATOM   1334  CG2 THR A 174      21.319  82.728 -16.197  1.00 25.88           C  
+ATOM   1335  N   VAL A 175      18.273  81.328 -17.286  1.00 21.03           N  
+ATOM   1336  CA  VAL A 175      17.909  79.949 -17.552  1.00 20.73           C  
+ATOM   1337  C   VAL A 175      19.121  79.152 -18.014  1.00 22.27           C  
+ATOM   1338  O   VAL A 175      19.899  79.639 -18.845  1.00 24.88           O  
+ATOM   1339  CB  VAL A 175      16.759  79.908 -18.532  1.00 21.57           C  
+ATOM   1340  CG1 VAL A 175      16.286  78.467 -18.747  1.00 22.84           C  
+ATOM   1341  CG2 VAL A 175      15.576  80.732 -17.996  1.00 21.51           C  
+ATOM   1342  N   SER A 176      19.350  77.969 -17.430  1.00 18.64           N  
+ATOM   1343  CA  SER A 176      20.483  77.183 -17.964  1.00 16.78           C  
+ATOM   1344  C   SER A 176      19.890  75.925 -18.536  1.00 16.00           C  
+ATOM   1345  O   SER A 176      19.319  75.128 -17.780  1.00 14.12           O  
+ATOM   1346  CB  SER A 176      21.452  76.900 -16.810  1.00 19.20           C  
+ATOM   1347  OG  SER A 176      22.314  75.823 -17.131  1.00 21.14           O  
+ATOM   1348  N   GLN A 177      19.977  75.667 -19.843  1.00 14.92           N  
+ATOM   1349  CA  GLN A 177      19.442  74.434 -20.420  1.00 14.44           C  
+ATOM   1350  C   GLN A 177      20.191  73.241 -19.783  1.00 13.19           C  
+ATOM   1351  O   GLN A 177      19.582  72.186 -19.653  1.00 13.85           O  
+ATOM   1352  CB  GLN A 177      19.757  74.419 -21.930  1.00 16.12           C  
+ATOM   1353  CG  GLN A 177      19.085  73.308 -22.712  1.00 20.11           C  
+ATOM   1354  CD  GLN A 177      17.574  73.256 -22.528  1.00 22.45           C  
+ATOM   1355  OE1 GLN A 177      16.935  74.312 -22.627  1.00 22.84           O  
+ATOM   1356  NE2 GLN A 177      16.981  72.095 -22.254  1.00 20.44           N  
+ATOM   1357  N   GLY A 178      21.459  73.432 -19.453  1.00 10.51           N  
+ATOM   1358  CA  GLY A 178      22.223  72.341 -18.829  1.00 11.89           C  
+ATOM   1359  C   GLY A 178      21.577  71.808 -17.560  1.00 12.67           C  
+ATOM   1360  O   GLY A 178      21.528  70.599 -17.310  1.00 11.81           O  
+ATOM   1361  N   LEU A 179      21.088  72.738 -16.710  1.00 10.92           N  
+ATOM   1362  CA  LEU A 179      20.479  72.322 -15.433  1.00 13.02           C  
+ATOM   1363  C   LEU A 179      19.204  71.553 -15.733  1.00 11.34           C  
+ATOM   1364  O   LEU A 179      18.899  70.575 -15.080  1.00 11.30           O  
+ATOM   1365  CB  LEU A 179      20.235  73.531 -14.526  1.00 12.08           C  
+ATOM   1366  CG  LEU A 179      21.538  74.187 -13.986  1.00 12.17           C  
+ATOM   1367  CD1 LEU A 179      21.116  75.288 -12.986  1.00 13.45           C  
+ATOM   1368  CD2 LEU A 179      22.423  73.181 -13.302  1.00 12.26           C  
+ATOM   1369  N   ILE A 180      18.407  72.020 -16.673  1.00  9.92           N  
+ATOM   1370  CA  ILE A 180      17.211  71.274 -17.084  1.00 10.91           C  
+ATOM   1371  C   ILE A 180      17.512  69.852 -17.555  1.00  9.25           C  
+ATOM   1372  O   ILE A 180      16.937  68.845 -17.076  1.00 11.55           O  
+ATOM   1373  CB  ILE A 180      16.452  72.015 -18.204  1.00 12.44           C  
+ATOM   1374  CG1 ILE A 180      16.020  73.421 -17.682  1.00 12.77           C  
+ATOM   1375  CG2 ILE A 180      15.240  71.187 -18.595  1.00 12.48           C  
+ATOM   1376  CD1 ILE A 180      15.408  74.297 -18.803  1.00 13.61           C  
+ATOM   1377  N   ASP A 181      18.442  69.744 -18.506  1.00  7.41           N  
+ATOM   1378  CA  ASP A 181      18.764  68.454 -19.090  1.00  8.73           C  
+ATOM   1379  C   ASP A 181      19.405  67.513 -18.048  1.00  8.90           C  
+ATOM   1380  O   ASP A 181      19.099  66.331 -18.061  1.00  9.63           O  
+ATOM   1381  CB  ASP A 181      19.726  68.557 -20.286  1.00  9.91           C  
+ATOM   1382  CG  ASP A 181      19.132  69.371 -21.466  1.00 14.59           C  
+ATOM   1383  OD1 ASP A 181      17.919  69.647 -21.490  1.00 12.65           O  
+ATOM   1384  OD2 ASP A 181      20.013  69.724 -22.304  1.00 15.86           O  
+ATOM   1385  N   HIS A 182      20.242  68.041 -17.182  1.00  9.27           N  
+ATOM   1386  CA  HIS A 182      20.826  67.163 -16.146  1.00  7.11           C  
+ATOM   1387  C   HIS A 182      19.775  66.675 -15.167  1.00  8.04           C  
+ATOM   1388  O   HIS A 182      19.841  65.538 -14.689  1.00 11.75           O  
+ATOM   1389  CB  HIS A 182      21.940  67.904 -15.391  1.00  6.65           C  
+ATOM   1390  CG  HIS A 182      22.826  66.915 -14.649  1.00 10.34           C  
+ATOM   1391  ND1 HIS A 182      23.573  67.304 -13.582  1.00 10.88           N  
+ATOM   1392  CD2 HIS A 182      23.079  65.590 -14.829  1.00 10.02           C  
+ATOM   1393  CE1 HIS A 182      24.287  66.280 -13.134  1.00 10.72           C  
+ATOM   1394  NE2 HIS A 182      23.991  65.223 -13.875  1.00 10.31           N  
+ATOM   1395  N   TRP A 183      18.799  67.492 -14.818  1.00  8.64           N  
+ATOM   1396  CA  TRP A 183      17.742  67.036 -13.890  1.00  9.94           C  
+ATOM   1397  C   TRP A 183      17.008  65.867 -14.517  1.00  9.97           C  
+ATOM   1398  O   TRP A 183      16.703  64.790 -13.960  1.00  8.51           O  
+ATOM   1399  CB  TRP A 183      16.859  68.266 -13.597  1.00  7.17           C  
+ATOM   1400  CG  TRP A 183      15.831  68.172 -12.524  1.00  8.96           C  
+ATOM   1401  CD1 TRP A 183      15.894  68.916 -11.364  1.00  9.78           C  
+ATOM   1402  CD2 TRP A 183      14.606  67.449 -12.427  1.00  9.64           C  
+ATOM   1403  NE1 TRP A 183      14.791  68.653 -10.573  1.00 10.40           N  
+ATOM   1404  CE2 TRP A 183      13.982  67.779 -11.201  1.00  9.11           C  
+ATOM   1405  CE3 TRP A 183      13.925  66.582 -13.292  1.00  8.09           C  
+ATOM   1406  CZ2 TRP A 183      12.738  67.272 -10.808  1.00 11.24           C  
+ATOM   1407  CZ3 TRP A 183      12.737  66.018 -12.906  1.00  9.24           C  
+ATOM   1408  CH2 TRP A 183      12.120  66.372 -11.665  1.00 12.29           C  
+ATOM   1409  N   TRP A 184      16.643  66.082 -15.783  1.00  8.52           N  
+ATOM   1410  CA  TRP A 184      15.920  65.065 -16.562  1.00  9.38           C  
+ATOM   1411  C   TRP A 184      16.713  63.754 -16.614  1.00  7.61           C  
+ATOM   1412  O   TRP A 184      16.143  62.696 -16.479  1.00  8.91           O  
+ATOM   1413  CB  TRP A 184      15.701  65.630 -18.008  1.00  9.25           C  
+ATOM   1414  CG  TRP A 184      14.886  64.663 -18.857  1.00 11.21           C  
+ATOM   1415  CD1 TRP A 184      13.529  64.560 -18.972  1.00 11.89           C  
+ATOM   1416  CD2 TRP A 184      15.424  63.658 -19.739  1.00 10.38           C  
+ATOM   1417  NE1 TRP A 184      13.195  63.524 -19.839  1.00  9.26           N  
+ATOM   1418  CE2 TRP A 184      14.352  62.989 -20.326  1.00  9.95           C  
+ATOM   1419  CE3 TRP A 184      16.757  63.294 -20.054  1.00 12.74           C  
+ATOM   1420  CZ2 TRP A 184      14.525  61.932 -21.241  1.00 11.15           C  
+ATOM   1421  CZ3 TRP A 184      16.946  62.252 -20.973  1.00 11.45           C  
+ATOM   1422  CH2 TRP A 184      15.819  61.608 -21.567  1.00 12.34           C  
+ATOM   1423  N   LEU A 185      17.999  63.833 -16.876  1.00  6.27           N  
+ATOM   1424  CA  LEU A 185      18.793  62.596 -17.049  1.00 10.24           C  
+ATOM   1425  C   LEU A 185      18.837  61.838 -15.719  1.00 10.43           C  
+ATOM   1426  O   LEU A 185      18.628  60.635 -15.698  1.00 10.91           O  
+ATOM   1427  CB  LEU A 185      20.218  62.983 -17.434  1.00 10.32           C  
+ATOM   1428  CG  LEU A 185      21.262  61.854 -17.427  1.00 11.18           C  
+ATOM   1429  CD1 LEU A 185      20.894  60.860 -18.551  1.00 12.36           C  
+ATOM   1430  CD2 LEU A 185      22.685  62.375 -17.666  1.00 10.10           C  
+ATOM   1431  N   GLN A 186      19.103  62.572 -14.626  1.00  8.89           N  
+ATOM   1432  CA  GLN A 186      19.199  61.907 -13.327  1.00  9.70           C  
+ATOM   1433  C   GLN A 186      17.846  61.266 -12.990  1.00  8.06           C  
+ATOM   1434  O   GLN A 186      17.798  60.153 -12.448  1.00  9.13           O  
+ATOM   1435  CB  GLN A 186      19.560  62.896 -12.199  1.00  9.42           C  
+ATOM   1436  CG  GLN A 186      20.957  63.535 -12.355  1.00  9.12           C  
+ATOM   1437  CD  GLN A 186      21.146  64.513 -11.195  1.00 11.83           C  
+ATOM   1438  OE1 GLN A 186      21.292  64.093 -10.032  1.00 11.79           O  
+ATOM   1439  NE2 GLN A 186      21.012  65.788 -11.535  1.00 10.13           N  
+ATOM   1440  N   GLY A 187      16.772  61.955 -13.267  1.00  8.35           N  
+ATOM   1441  CA  GLY A 187      15.461  61.414 -13.026  1.00  8.49           C  
+ATOM   1442  C   GLY A 187      15.194  60.162 -13.852  1.00  8.16           C  
+ATOM   1443  O   GLY A 187      14.716  59.112 -13.356  1.00  8.16           O  
+ATOM   1444  N   MET A 188      15.512  60.205 -15.135  1.00  9.94           N  
+ATOM   1445  CA  MET A 188      15.162  59.076 -16.026  1.00 12.01           C  
+ATOM   1446  C   MET A 188      16.050  57.871 -15.686  1.00 10.90           C  
+ATOM   1447  O   MET A 188      15.635  56.733 -15.965  1.00 13.40           O  
+ATOM   1448  CB  MET A 188      15.294  59.472 -17.494  1.00 12.71           C  
+ATOM   1449  CG  MET A 188      14.215  60.423 -18.048  1.00 13.39           C  
+ATOM   1450  SD  MET A 188      12.566  60.130 -17.425  1.00 15.53           S  
+ATOM   1451  CE  MET A 188      12.044  58.633 -18.268  1.00 14.29           C  
+ATOM   1452  N   MET A 189      17.237  58.080 -15.096  1.00 11.10           N  
+ATOM   1453  CA  MET A 189      18.030  56.919 -14.654  1.00 14.24           C  
+ATOM   1454  C   MET A 189      17.366  56.122 -13.534  1.00 12.37           C  
+ATOM   1455  O   MET A 189      17.601  54.901 -13.419  1.00 11.72           O  
+ATOM   1456  CB  MET A 189      19.440  57.310 -14.176  1.00 16.66           C  
+ATOM   1457  CG  MET A 189      20.245  58.044 -15.255  1.00 28.15           C  
+ATOM   1458  SD  MET A 189      21.010  56.974 -16.498  1.00 40.58           S  
+ATOM   1459  CE  MET A 189      19.638  56.414 -17.489  1.00 38.46           C  
+ATOM   1460  N   GLY A 190      16.678  56.814 -12.625  1.00 10.17           N  
+ATOM   1461  CA  GLY A 190      16.046  56.099 -11.531  1.00  9.20           C  
+ATOM   1462  C   GLY A 190      14.771  55.361 -11.921  1.00 11.93           C  
+ATOM   1463  O   GLY A 190      14.229  55.469 -13.014  1.00 10.60           O  
+ATOM   1464  N   ALA A 191      14.226  54.617 -10.962  1.00 11.31           N  
+ATOM   1465  CA  ALA A 191      13.091  53.725 -11.178  1.00 10.61           C  
+ATOM   1466  C   ALA A 191      11.760  54.417 -11.063  1.00 11.13           C  
+ATOM   1467  O   ALA A 191      11.487  55.155 -10.092  1.00 11.13           O  
+ATOM   1468  CB  ALA A 191      13.107  52.641 -10.089  1.00 11.42           C  
+ATOM   1469  N   ALA A 192      10.862  54.066 -11.979  1.00  9.45           N  
+ATOM   1470  CA  ALA A 192       9.531  54.735 -11.912  1.00 11.53           C  
+ATOM   1471  C   ALA A 192       8.732  54.395 -10.649  1.00 10.83           C  
+ATOM   1472  O   ALA A 192       8.132  55.314 -10.072  1.00 11.89           O  
+ATOM   1473  CB  ALA A 192       8.751  54.335 -13.177  1.00  9.77           C  
+ATOM   1474  N   ASN A 193       8.846  53.171 -10.144  1.00 10.66           N  
+ATOM   1475  CA  ASN A 193       8.076  52.841  -8.909  1.00 12.75           C  
+ATOM   1476  C   ASN A 193       8.661  53.572  -7.696  1.00 12.52           C  
+ATOM   1477  O   ASN A 193       7.890  54.174  -6.932  1.00 13.42           O  
+ATOM   1478  CB  ASN A 193       7.997  51.329  -8.712  1.00 11.36           C  
+ATOM   1479  CG  ASN A 193       9.355  50.722  -8.356  1.00 13.45           C  
+ATOM   1480  OD1 ASN A 193      10.445  51.187  -8.706  1.00 11.68           O  
+ATOM   1481  ND2 ASN A 193       9.298  49.706  -7.493  1.00 13.73           N  
+ATOM   1482  N   ALA A 194       9.985  53.589  -7.572  1.00 11.34           N  
+ATOM   1483  CA  ALA A 194      10.570  54.387  -6.453  1.00 13.24           C  
+ATOM   1484  C   ALA A 194      10.158  55.839  -6.484  1.00 13.82           C  
+ATOM   1485  O   ALA A 194       9.705  56.487  -5.504  1.00 13.38           O  
+ATOM   1486  CB  ALA A 194      12.096  54.295  -6.576  1.00 12.18           C  
+ATOM   1487  N   HIS A 195      10.275  56.465  -7.701  1.00 12.12           N  
+ATOM   1488  CA  HIS A 195       9.908  57.885  -7.768  1.00 10.89           C  
+ATOM   1489  C   HIS A 195       8.427  58.074  -7.444  1.00 12.44           C  
+ATOM   1490  O   HIS A 195       8.081  59.125  -6.923  1.00 12.87           O  
+ATOM   1491  CB  HIS A 195      10.263  58.461  -9.162  1.00 12.63           C  
+ATOM   1492  CG  HIS A 195      11.732  58.465  -9.437  1.00 11.63           C  
+ATOM   1493  ND1 HIS A 195      12.300  58.796 -10.665  1.00 13.18           N  
+ATOM   1494  CD2 HIS A 195      12.763  58.213  -8.578  1.00 12.01           C  
+ATOM   1495  CE1 HIS A 195      13.608  58.700 -10.553  1.00 12.63           C  
+ATOM   1496  NE2 HIS A 195      13.938  58.358  -9.290  1.00 11.68           N  
+ATOM   1497  N   TYR A 196       7.570  57.204  -7.923  1.00 11.14           N  
+ATOM   1498  CA  TYR A 196       6.138  57.326  -7.676  1.00 14.97           C  
+ATOM   1499  C   TYR A 196       5.817  57.247  -6.167  1.00 15.63           C  
+ATOM   1500  O   TYR A 196       5.234  58.169  -5.604  1.00 14.86           O  
+ATOM   1501  CB  TYR A 196       5.430  56.248  -8.482  1.00 15.46           C  
+ATOM   1502  CG  TYR A 196       3.910  56.330  -8.437  1.00 19.96           C  
+ATOM   1503  CD1 TYR A 196       3.199  55.719  -7.404  1.00 21.21           C  
+ATOM   1504  CD2 TYR A 196       3.208  57.050  -9.393  1.00 20.06           C  
+ATOM   1505  CE1 TYR A 196       1.809  55.792  -7.362  1.00 21.13           C  
+ATOM   1506  CE2 TYR A 196       1.824  57.104  -9.380  1.00 22.27           C  
+ATOM   1507  CZ  TYR A 196       1.145  56.479  -8.349  1.00 21.98           C  
+ATOM   1508  OH  TYR A 196      -0.227  56.565  -8.320  1.00 23.99           O  
+ATOM   1509  N   GLU A 197       6.325  56.205  -5.494  1.00 17.04           N  
+ATOM   1510  CA  GLU A 197       6.104  55.965  -4.078  1.00 19.99           C  
+ATOM   1511  C   GLU A 197       6.719  57.005  -3.172  1.00 19.94           C  
+ATOM   1512  O   GLU A 197       6.137  57.375  -2.153  1.00 19.19           O  
+ATOM   1513  CB  GLU A 197       6.646  54.576  -3.734  1.00 23.97           C  
+ATOM   1514  CG  GLU A 197       5.943  53.559  -4.658  1.00 31.50           C  
+ATOM   1515  CD  GLU A 197       5.869  52.224  -3.953  1.00 38.58           C  
+ATOM   1516  OE1 GLU A 197       5.731  52.243  -2.689  1.00 41.22           O  
+ATOM   1517  OE2 GLU A 197       5.981  51.193  -4.678  1.00 42.93           O  
+ATOM   1518  N   CYS A 198       7.855  57.575  -3.585  1.00 15.64           N  
+ATOM   1519  CA  CYS A 198       8.530  58.598  -2.852  1.00 14.07           C  
+ATOM   1520  C   CYS A 198       7.701  59.847  -2.670  1.00 15.20           C  
+ATOM   1521  O   CYS A 198       7.983  60.665  -1.779  1.00 15.38           O  
+ATOM   1522  CB  CYS A 198       9.915  58.926  -3.486  1.00 14.77           C  
+ATOM   1523  SG  CYS A 198      10.965  59.847  -2.309  1.00 17.95           S  
+ATOM   1524  N   ILE A 199       6.788  60.118  -3.601  1.00 14.16           N  
+ATOM   1525  CA  ILE A 199       6.000  61.354  -3.458  1.00 15.06           C  
+ATOM   1526  C   ILE A 199       5.212  61.263  -2.133  1.00 15.89           C  
+ATOM   1527  O   ILE A 199       5.246  62.248  -1.393  1.00 17.25           O  
+ATOM   1528  CB  ILE A 199       5.058  61.589  -4.646  1.00 14.31           C  
+ATOM   1529  CG1 ILE A 199       5.919  61.773  -5.926  1.00 13.62           C  
+ATOM   1530  CG2 ILE A 199       4.225  62.869  -4.453  1.00 16.62           C  
+ATOM   1531  CD1 ILE A 199       5.116  61.665  -7.217  1.00 15.90           C  
+ATOM   1532  N   ALA A 200       4.605  60.103  -1.867  1.00 16.81           N  
+ATOM   1533  CA  ALA A 200       3.911  60.065  -0.551  1.00 18.97           C  
+ATOM   1534  C   ALA A 200       4.919  60.148   0.604  1.00 20.23           C  
+ATOM   1535  O   ALA A 200       4.620  60.781   1.655  1.00 19.90           O  
+ATOM   1536  CB  ALA A 200       2.986  58.884  -0.446  1.00 15.52           C  
+ATOM   1537  N   ALA A 201       6.089  59.528   0.449  1.00 18.68           N  
+ATOM   1538  CA  ALA A 201       7.069  59.520   1.538  1.00 18.65           C  
+ATOM   1539  C   ALA A 201       7.542  60.914   1.842  1.00 17.85           C  
+ATOM   1540  O   ALA A 201       7.725  61.253   2.998  1.00 19.21           O  
+ATOM   1541  CB  ALA A 201       8.328  58.714   1.156  1.00 17.95           C  
+ATOM   1542  N   PHE A 202       7.837  61.775   0.840  1.00 16.49           N  
+ATOM   1543  CA  PHE A 202       8.342  63.085   1.191  1.00 16.50           C  
+ATOM   1544  C   PHE A 202       7.212  64.031   1.627  1.00 18.56           C  
+ATOM   1545  O   PHE A 202       7.519  65.003   2.339  1.00 17.49           O  
+ATOM   1546  CB  PHE A 202       9.217  63.700   0.113  1.00 16.52           C  
+ATOM   1547  CG  PHE A 202       8.613  64.267  -1.135  1.00 18.72           C  
+ATOM   1548  CD1 PHE A 202       7.809  65.387  -1.130  1.00 19.52           C  
+ATOM   1549  CD2 PHE A 202       8.916  63.675  -2.378  1.00 18.96           C  
+ATOM   1550  CE1 PHE A 202       7.287  65.924  -2.309  1.00 20.55           C  
+ATOM   1551  CE2 PHE A 202       8.361  64.171  -3.545  1.00 19.53           C  
+ATOM   1552  CZ  PHE A 202       7.551  65.294  -3.514  1.00 20.22           C  
+ATOM   1553  N   SER A 203       5.995  63.867   1.125  1.00 16.75           N  
+ATOM   1554  CA  SER A 203       4.977  64.881   1.393  1.00 17.39           C  
+ATOM   1555  C   SER A 203       4.041  64.542   2.557  1.00 19.14           C  
+ATOM   1556  O   SER A 203       3.414  65.490   3.079  1.00 21.16           O  
+ATOM   1557  CB  SER A 203       4.115  65.074   0.111  1.00 16.63           C  
+ATOM   1558  OG  SER A 203       3.448  63.857  -0.213  1.00 15.32           O  
+ATOM   1559  N   GLU A 204       3.866  63.303   2.951  1.00 17.78           N  
+ATOM   1560  CA  GLU A 204       3.010  62.913   4.038  1.00 20.17           C  
+ATOM   1561  C   GLU A 204       3.746  62.459   5.301  1.00 22.47           C  
+ATOM   1562  O   GLU A 204       3.081  62.265   6.313  1.00 24.51           O  
+ATOM   1563  CB  GLU A 204       2.106  61.750   3.610  1.00 21.28           C  
+ATOM   1564  CG  GLU A 204       1.217  62.227   2.443  1.00 23.76           C  
+ATOM   1565  CD  GLU A 204       0.472  61.046   1.858  1.00 28.74           C  
+ATOM   1566  OE1 GLU A 204       0.197  60.125   2.643  1.00 32.02           O  
+ATOM   1567  OE2 GLU A 204       0.188  60.952   0.650  1.00 29.09           O  
+ATOM   1568  N   THR A 205       5.045  62.199   5.255  1.00 20.01           N  
+ATOM   1569  CA  THR A 205       5.714  61.810   6.487  1.00 20.70           C  
+ATOM   1570  C   THR A 205       5.803  63.033   7.398  1.00 19.77           C  
+ATOM   1571  O   THR A 205       6.177  64.112   6.971  1.00 18.85           O  
+ATOM   1572  CB  THR A 205       7.119  61.252   6.191  1.00 20.73           C  
+ATOM   1573  OG1 THR A 205       6.899  60.206   5.265  1.00 19.14           O  
+ATOM   1574  CG2 THR A 205       7.746  60.699   7.483  1.00 20.93           C  
+ATOM   1575  N   ASP A 206       5.485  62.849   8.673  1.00 20.72           N  
+ATOM   1576  CA  ASP A 206       5.619  63.949   9.636  1.00 22.29           C  
+ATOM   1577  C   ASP A 206       6.961  63.824  10.331  1.00 19.79           C  
+ATOM   1578  O   ASP A 206       7.212  62.782  10.929  1.00 21.12           O  
+ATOM   1579  CB  ASP A 206       4.480  63.899  10.659  1.00 23.33           C  
+ATOM   1580  CG  ASP A 206       4.416  65.167  11.478  1.00 24.70           C  
+ATOM   1581  OD1 ASP A 206       5.392  65.891  11.719  1.00 24.33           O  
+ATOM   1582  OD2 ASP A 206       3.282  65.485  11.893  1.00 26.52           O  
+ATOM   1583  N   PHE A 207       7.851  64.807  10.225  1.00 19.16           N  
+ATOM   1584  CA  PHE A 207       9.167  64.664  10.842  1.00 17.15           C  
+ATOM   1585  C   PHE A 207       9.212  65.387  12.191  1.00 20.05           C  
+ATOM   1586  O   PHE A 207      10.278  65.633  12.760  1.00 18.32           O  
+ATOM   1587  CB  PHE A 207      10.223  65.340   9.892  1.00 18.67           C  
+ATOM   1588  CG  PHE A 207      10.313  64.565   8.587  1.00 18.91           C  
+ATOM   1589  CD1 PHE A 207      11.097  63.443   8.484  1.00 17.68           C  
+ATOM   1590  CD2 PHE A 207       9.585  65.002   7.473  1.00 18.47           C  
+ATOM   1591  CE1 PHE A 207      11.199  62.735   7.297  1.00 18.48           C  
+ATOM   1592  CE2 PHE A 207       9.685  64.289   6.277  1.00 16.55           C  
+ATOM   1593  CZ  PHE A 207      10.461  63.151   6.192  1.00 16.53           C  
+ATOM   1594  N   THR A 208       8.087  65.900  12.677  1.00 19.62           N  
+ATOM   1595  CA  THR A 208       8.056  66.672  13.920  1.00 22.75           C  
+ATOM   1596  C   THR A 208       8.816  66.008  15.047  1.00 22.23           C  
+ATOM   1597  O   THR A 208       9.692  66.602  15.680  1.00 20.08           O  
+ATOM   1598  CB  THR A 208       6.586  66.962  14.258  1.00 23.60           C  
+ATOM   1599  OG1 THR A 208       6.151  67.888  13.207  1.00 23.98           O  
+ATOM   1600  CG2 THR A 208       6.477  67.664  15.627  1.00 23.88           C  
+ATOM   1601  N   ASP A 209       8.565  64.731  15.297  1.00 24.26           N  
+ATOM   1602  CA  ASP A 209       9.232  63.981  16.348  1.00 25.53           C  
+ATOM   1603  C   ASP A 209      10.725  63.806  16.139  1.00 26.38           C  
+ATOM   1604  O   ASP A 209      11.527  63.827  17.113  1.00 26.69           O  
+ATOM   1605  CB  ASP A 209       8.544  62.629  16.529  1.00 27.20           C  
+ATOM   1606  CG  ASP A 209       7.183  62.737  17.206  1.00 30.81           C  
+ATOM   1607  OD1 ASP A 209       6.811  63.836  17.684  1.00 32.11           O  
+ATOM   1608  OD2 ASP A 209       6.451  61.720  17.257  1.00 31.40           O  
+ATOM   1609  N   ASP A 210      11.146  63.603  14.882  1.00 23.96           N  
+ATOM   1610  CA  ASP A 210      12.577  63.470  14.618  1.00 23.14           C  
+ATOM   1611  C   ASP A 210      13.291  64.772  15.006  1.00 22.91           C  
+ATOM   1612  O   ASP A 210      14.370  64.794  15.623  1.00 21.36           O  
+ATOM   1613  CB  ASP A 210      12.858  63.222  13.139  1.00 22.22           C  
+ATOM   1614  CG  ASP A 210      12.268  61.954  12.618  1.00 25.56           C  
+ATOM   1615  OD1 ASP A 210      12.476  60.862  13.164  1.00 26.63           O  
+ATOM   1616  OD2 ASP A 210      11.498  61.961  11.641  1.00 28.94           O  
+ATOM   1617  N   LEU A 211      12.707  65.883  14.528  1.00 19.62           N  
+ATOM   1618  CA  LEU A 211      13.282  67.186  14.785  1.00 20.91           C  
+ATOM   1619  C   LEU A 211      13.461  67.510  16.262  1.00 23.01           C  
+ATOM   1620  O   LEU A 211      14.404  68.220  16.657  1.00 23.21           O  
+ATOM   1621  CB  LEU A 211      12.413  68.269  14.135  1.00 21.39           C  
+ATOM   1622  CG  LEU A 211      12.443  68.358  12.605  1.00 22.37           C  
+ATOM   1623  CD1 LEU A 211      11.574  69.523  12.148  1.00 22.52           C  
+ATOM   1624  CD2 LEU A 211      13.851  68.493  12.035  1.00 20.52           C  
+ATOM   1625  N   LYS A 212      12.524  67.051  17.099  1.00 23.93           N  
+ATOM   1626  CA  LYS A 212      12.613  67.267  18.539  1.00 27.10           C  
+ATOM   1627  C   LYS A 212      13.701  66.420  19.158  1.00 26.94           C  
+ATOM   1628  O   LYS A 212      14.160  66.700  20.264  1.00 28.31           O  
+ATOM   1629  CB  LYS A 212      11.233  66.948  19.160  1.00 28.04           C  
+ATOM   1630  CG  LYS A 212      10.321  68.136  18.854  1.00 31.50           C  
+ATOM   1631  CD  LYS A 212       8.855  67.798  18.978  1.00 35.44           C  
+ATOM   1632  CE  LYS A 212       8.312  68.047  20.379  1.00 37.51           C  
+ATOM   1633  NZ  LYS A 212       6.847  67.714  20.444  1.00 39.24           N  
+ATOM   1634  N   ARG A 213      14.109  65.349  18.509  1.00 26.06           N  
+ATOM   1635  CA  ARG A 213      15.149  64.474  18.985  1.00 28.52           C  
+ATOM   1636  C   ARG A 213      16.556  64.907  18.603  1.00 27.90           C  
+ATOM   1637  O   ARG A 213      17.500  64.329  19.120  1.00 27.40           O  
+ATOM   1638  CB  ARG A 213      14.945  63.046  18.442  1.00 31.62           C  
+ATOM   1639  CG  ARG A 213      13.654  62.428  18.982  1.00 36.82           C  
+ATOM   1640  CD  ARG A 213      13.496  61.001  18.446  1.00 38.77           C  
+ATOM   1641  NE  ARG A 213      14.651  60.228  18.815  1.00 42.52           N  
+ATOM   1642  CZ  ARG A 213      15.115  59.056  18.444  1.00 45.13           C  
+ATOM   1643  NH1 ARG A 213      14.517  58.275  17.549  1.00 46.98           N  
+ATOM   1644  NH2 ARG A 213      16.243  58.629  19.024  1.00 46.27           N  
+ATOM   1645  N   ILE A 214      16.726  65.834  17.666  1.00 26.80           N  
+ATOM   1646  CA  ILE A 214      18.081  66.162  17.254  1.00 26.11           C  
+ATOM   1647  C   ILE A 214      18.776  67.087  18.237  1.00 26.77           C  
+ATOM   1648  O   ILE A 214      18.273  68.191  18.442  1.00 28.67           O  
+ATOM   1649  CB  ILE A 214      18.013  66.777  15.827  1.00 23.81           C  
+ATOM   1650  CG1 ILE A 214      17.546  65.680  14.869  1.00 23.81           C  
+ATOM   1651  CG2 ILE A 214      19.367  67.329  15.454  1.00 23.71           C  
+ATOM   1652  CD1 ILE A 214      17.282  66.138  13.453  1.00 22.80           C  
+ATOM   1653  N   ASP A 215      19.967  66.753  18.704  1.00 28.08           N  
+ATOM   1654  CA  ASP A 215      20.649  67.692  19.592  1.00 34.14           C  
+ATOM   1655  C   ASP A 215      21.857  68.372  18.962  1.00 32.68           C  
+ATOM   1656  O   ASP A 215      22.214  69.432  19.497  1.00 34.56           O  
+ATOM   1657  CB  ASP A 215      21.048  67.039  20.910  1.00 39.14           C  
+ATOM   1658  CG  ASP A 215      21.559  65.631  20.746  1.00 43.79           C  
+ATOM   1659  OD1 ASP A 215      22.287  65.301  19.779  1.00 47.08           O  
+ATOM   1660  OD2 ASP A 215      21.221  64.817  21.638  1.00 47.43           O  
+ATOM   1661  N   VAL A 216      22.436  67.867  17.873  1.00 27.40           N  
+ATOM   1662  CA  VAL A 216      23.567  68.627  17.293  1.00 23.33           C  
+ATOM   1663  C   VAL A 216      23.080  69.924  16.670  1.00 21.01           C  
+ATOM   1664  O   VAL A 216      21.882  70.069  16.381  1.00 21.10           O  
+ATOM   1665  CB  VAL A 216      24.142  67.722  16.184  1.00 25.27           C  
+ATOM   1666  CG1 VAL A 216      24.665  66.398  16.740  1.00 24.58           C  
+ATOM   1667  CG2 VAL A 216      23.061  67.457  15.116  1.00 22.61           C  
+ATOM   1668  N   PRO A 217      23.973  70.851  16.354  1.00 20.43           N  
+ATOM   1669  CA  PRO A 217      23.672  72.070  15.656  1.00 20.74           C  
+ATOM   1670  C   PRO A 217      23.181  71.759  14.217  1.00 20.77           C  
+ATOM   1671  O   PRO A 217      23.725  70.875  13.568  1.00 19.36           O  
+ATOM   1672  CB  PRO A 217      24.924  72.901  15.625  1.00 19.85           C  
+ATOM   1673  CG  PRO A 217      25.907  72.179  16.491  1.00 22.91           C  
+ATOM   1674  CD  PRO A 217      25.431  70.750  16.658  1.00 20.14           C  
+ATOM   1675  N   VAL A 218      22.165  72.504  13.838  1.00 20.18           N  
+ATOM   1676  CA  VAL A 218      21.468  72.332  12.571  1.00 20.06           C  
+ATOM   1677  C   VAL A 218      21.296  73.694  11.916  1.00 20.90           C  
+ATOM   1678  O   VAL A 218      20.879  74.704  12.497  1.00 21.77           O  
+ATOM   1679  CB  VAL A 218      20.110  71.636  12.636  1.00 18.64           C  
+ATOM   1680  CG1 VAL A 218      19.455  71.501  11.244  1.00 19.81           C  
+ATOM   1681  CG2 VAL A 218      20.143  70.267  13.292  1.00 16.52           C  
+ATOM   1682  N   LEU A 219      21.783  73.761  10.678  1.00 17.40           N  
+ATOM   1683  CA  LEU A 219      21.580  74.953   9.843  1.00 16.12           C  
+ATOM   1684  C   LEU A 219      20.366  74.734   8.974  1.00 14.45           C  
+ATOM   1685  O   LEU A 219      20.321  73.694   8.302  1.00 16.29           O  
+ATOM   1686  CB  LEU A 219      22.806  75.277   8.987  1.00 16.77           C  
+ATOM   1687  CG  LEU A 219      22.575  76.259   7.809  1.00 18.95           C  
+ATOM   1688  CD1 LEU A 219      22.229  77.646   8.285  1.00 18.80           C  
+ATOM   1689  CD2 LEU A 219      23.814  76.317   6.895  1.00 19.30           C  
+ATOM   1690  N   VAL A 220      19.356  75.585   8.970  1.00 14.90           N  
+ATOM   1691  CA  VAL A 220      18.137  75.427   8.176  1.00 16.15           C  
+ATOM   1692  C   VAL A 220      18.140  76.521   7.115  1.00 17.44           C  
+ATOM   1693  O   VAL A 220      18.195  77.698   7.480  1.00 19.42           O  
+ATOM   1694  CB  VAL A 220      16.835  75.526   8.989  1.00 15.89           C  
+ATOM   1695  CG1 VAL A 220      15.593  75.365   8.113  1.00 17.38           C  
+ATOM   1696  CG2 VAL A 220      16.838  74.463  10.070  1.00 16.33           C  
+ATOM   1697  N   ALA A 221      18.324  76.183   5.845  1.00 16.87           N  
+ATOM   1698  CA  ALA A 221      18.462  77.213   4.779  1.00 15.60           C  
+ATOM   1699  C   ALA A 221      17.278  77.086   3.838  1.00 16.91           C  
+ATOM   1700  O   ALA A 221      16.898  75.929   3.533  1.00 17.96           O  
+ATOM   1701  CB  ALA A 221      19.803  76.978   4.073  1.00 15.92           C  
+ATOM   1702  N   HIS A 222      16.754  78.167   3.270  1.00 17.41           N  
+ATOM   1703  CA  HIS A 222      15.587  78.015   2.391  1.00 17.26           C  
+ATOM   1704  C   HIS A 222      15.350  79.268   1.565  1.00 17.59           C  
+ATOM   1705  O   HIS A 222      15.612  80.387   2.021  1.00 19.47           O  
+ATOM   1706  CB  HIS A 222      14.387  77.681   3.244  1.00 15.92           C  
+ATOM   1707  CG  HIS A 222      13.331  76.813   2.640  1.00 15.70           C  
+ATOM   1708  ND1 HIS A 222      13.013  75.584   3.175  1.00 13.82           N  
+ATOM   1709  CD2 HIS A 222      12.483  77.019   1.588  1.00 13.84           C  
+ATOM   1710  CE1 HIS A 222      12.021  75.044   2.500  1.00 13.64           C  
+ATOM   1711  NE2 HIS A 222      11.686  75.892   1.528  1.00 14.68           N  
+ATOM   1712  N   GLY A 223      14.955  79.085   0.312  1.00 17.02           N  
+ATOM   1713  CA  GLY A 223      14.750  80.290  -0.538  1.00 17.05           C  
+ATOM   1714  C   GLY A 223      13.318  80.748  -0.316  1.00 18.82           C  
+ATOM   1715  O   GLY A 223      12.430  79.913  -0.190  1.00 18.60           O  
+ATOM   1716  N   THR A 224      13.092  82.064  -0.281  1.00 22.61           N  
+ATOM   1717  CA  THR A 224      11.712  82.541  -0.038  1.00 22.98           C  
+ATOM   1718  C   THR A 224      10.868  82.456  -1.297  1.00 24.29           C  
+ATOM   1719  O   THR A 224       9.629  82.546  -1.130  1.00 26.26           O  
+ATOM   1720  CB  THR A 224      11.687  83.980   0.522  1.00 22.43           C  
+ATOM   1721  OG1 THR A 224      12.117  84.891  -0.469  1.00 21.09           O  
+ATOM   1722  CG2 THR A 224      12.670  84.100   1.695  1.00 21.74           C  
+ATOM   1723  N   ASP A 225      11.419  82.183  -2.496  1.00 20.64           N  
+ATOM   1724  CA  ASP A 225      10.481  82.007  -3.621  1.00 22.70           C  
+ATOM   1725  C   ASP A 225      10.459  80.542  -4.053  1.00 22.61           C  
+ATOM   1726  O   ASP A 225      10.432  80.190  -5.232  1.00 22.64           O  
+ATOM   1727  CB  ASP A 225      10.839  82.992  -4.744  1.00 23.76           C  
+ATOM   1728  CG  ASP A 225       9.896  82.985  -5.926  1.00 26.05           C  
+ATOM   1729  OD1 ASP A 225       8.713  82.638  -5.765  1.00 26.68           O  
+ATOM   1730  OD2 ASP A 225      10.289  83.242  -7.083  1.00 27.90           O  
+ATOM   1731  N   ASP A 226      10.516  79.616  -3.099  1.00 21.34           N  
+ATOM   1732  CA  ASP A 226      10.518  78.186  -3.310  1.00 20.81           C  
+ATOM   1733  C   ASP A 226       9.157  77.729  -3.782  1.00 20.97           C  
+ATOM   1734  O   ASP A 226       8.183  77.809  -3.007  1.00 19.82           O  
+ATOM   1735  CB  ASP A 226      10.911  77.417  -2.032  1.00 17.80           C  
+ATOM   1736  CG  ASP A 226      11.235  75.974  -2.382  1.00 16.53           C  
+ATOM   1737  OD1 ASP A 226      10.518  75.353  -3.189  1.00 16.31           O  
+ATOM   1738  OD2 ASP A 226      12.232  75.442  -1.848  1.00 17.08           O  
+ATOM   1739  N   GLN A 227       9.075  77.263  -5.030  1.00 19.72           N  
+ATOM   1740  CA  GLN A 227       7.785  76.850  -5.564  1.00 17.43           C  
+ATOM   1741  C   GLN A 227       7.505  75.380  -5.385  1.00 19.38           C  
+ATOM   1742  O   GLN A 227       6.431  74.932  -5.805  1.00 21.65           O  
+ATOM   1743  CB  GLN A 227       7.668  77.195  -7.047  1.00 18.59           C  
+ATOM   1744  CG  GLN A 227       7.836  78.671  -7.388  1.00 20.16           C  
+ATOM   1745  CD  GLN A 227       7.893  78.869  -8.911  1.00 20.26           C  
+ATOM   1746  OE1 GLN A 227       6.994  78.356  -9.582  1.00 23.64           O  
+ATOM   1747  NE2 GLN A 227       8.911  79.538  -9.409  1.00 18.19           N  
+ATOM   1748  N   VAL A 228       8.395  74.601  -4.748  1.00 17.76           N  
+ATOM   1749  CA  VAL A 228       8.167  73.180  -4.567  1.00 17.48           C  
+ATOM   1750  C   VAL A 228       7.865  72.850  -3.117  1.00 19.55           C  
+ATOM   1751  O   VAL A 228       6.905  72.159  -2.817  1.00 21.20           O  
+ATOM   1752  CB  VAL A 228       9.446  72.393  -5.009  1.00 18.09           C  
+ATOM   1753  CG1 VAL A 228       9.275  70.900  -4.720  1.00 17.92           C  
+ATOM   1754  CG2 VAL A 228       9.678  72.682  -6.492  1.00 19.09           C  
+ATOM   1755  N   VAL A 229       8.722  73.353  -2.202  1.00 20.35           N  
+ATOM   1756  CA  VAL A 229       8.526  73.211  -0.766  1.00 19.77           C  
+ATOM   1757  C   VAL A 229       8.364  74.614  -0.207  1.00 19.13           C  
+ATOM   1758  O   VAL A 229       9.286  75.422  -0.083  1.00 16.92           O  
+ATOM   1759  CB  VAL A 229       9.679  72.480  -0.061  1.00 22.29           C  
+ATOM   1760  CG1 VAL A 229       9.441  72.421   1.457  1.00 22.21           C  
+ATOM   1761  CG2 VAL A 229       9.800  71.058  -0.573  1.00 21.99           C  
+ATOM   1762  N   PRO A 230       7.100  74.997   0.009  1.00 21.14           N  
+ATOM   1763  CA  PRO A 230       6.756  76.361   0.405  1.00 20.29           C  
+ATOM   1764  C   PRO A 230       7.479  76.816   1.653  1.00 22.08           C  
+ATOM   1765  O   PRO A 230       7.510  76.087   2.666  1.00 22.87           O  
+ATOM   1766  CB  PRO A 230       5.237  76.341   0.552  1.00 21.98           C  
+ATOM   1767  CG  PRO A 230       4.818  75.235  -0.360  1.00 21.77           C  
+ATOM   1768  CD  PRO A 230       5.889  74.148  -0.143  1.00 20.68           C  
+ATOM   1769  N   TYR A 231       8.106  77.969   1.560  1.00 21.53           N  
+ATOM   1770  CA  TYR A 231       8.970  78.480   2.591  1.00 23.86           C  
+ATOM   1771  C   TYR A 231       8.346  78.584   3.990  1.00 25.63           C  
+ATOM   1772  O   TYR A 231       8.976  78.174   4.966  1.00 23.52           O  
+ATOM   1773  CB  TYR A 231       9.527  79.834   2.156  1.00 25.37           C  
+ATOM   1774  CG  TYR A 231      10.300  80.493   3.290  1.00 27.01           C  
+ATOM   1775  CD1 TYR A 231      11.633  80.262   3.478  1.00 26.19           C  
+ATOM   1776  CD2 TYR A 231       9.634  81.343   4.191  1.00 28.75           C  
+ATOM   1777  CE1 TYR A 231      12.331  80.823   4.524  1.00 27.73           C  
+ATOM   1778  CE2 TYR A 231      10.312  81.938   5.239  1.00 28.59           C  
+ATOM   1779  CZ  TYR A 231      11.656  81.663   5.404  1.00 29.48           C  
+ATOM   1780  OH  TYR A 231      12.368  82.236   6.428  1.00 27.33           O  
+ATOM   1781  N   ALA A 232       7.177  79.208   4.086  1.00 26.31           N  
+ATOM   1782  CA  ALA A 232       6.561  79.498   5.381  1.00 27.61           C  
+ATOM   1783  C   ALA A 232       6.117  78.272   6.150  1.00 28.15           C  
+ATOM   1784  O   ALA A 232       6.191  78.309   7.380  1.00 29.95           O  
+ATOM   1785  CB  ALA A 232       5.453  80.529   5.171  1.00 25.94           C  
+ATOM   1786  N   ASP A 233       5.737  77.169   5.571  1.00 27.74           N  
+ATOM   1787  CA  ASP A 233       5.364  75.918   6.194  1.00 27.18           C  
+ATOM   1788  C   ASP A 233       6.568  75.006   6.432  1.00 23.34           C  
+ATOM   1789  O   ASP A 233       6.367  73.902   6.944  1.00 23.91           O  
+ATOM   1790  CB  ASP A 233       4.375  75.149   5.313  1.00 32.20           C  
+ATOM   1791  CG  ASP A 233       3.469  74.115   5.938  1.00 36.48           C  
+ATOM   1792  OD1 ASP A 233       2.840  74.379   7.012  1.00 39.35           O  
+ATOM   1793  OD2 ASP A 233       3.271  72.985   5.390  1.00 35.48           O  
+ATOM   1794  N   ALA A 234       7.783  75.418   6.056  1.00 20.43           N  
+ATOM   1795  CA  ALA A 234       8.892  74.518   6.269  1.00 20.37           C  
+ATOM   1796  C   ALA A 234       9.945  75.097   7.206  1.00 20.01           C  
+ATOM   1797  O   ALA A 234       9.884  74.815   8.408  1.00 22.38           O  
+ATOM   1798  CB  ALA A 234       9.489  74.028   4.954  1.00 18.32           C  
+ATOM   1799  N   ALA A 235      10.784  75.971   6.739  1.00 19.94           N  
+ATOM   1800  CA  ALA A 235      11.981  76.454   7.358  1.00 20.45           C  
+ATOM   1801  C   ALA A 235      11.815  77.097   8.726  1.00 22.59           C  
+ATOM   1802  O   ALA A 235      12.446  76.666   9.671  1.00 21.74           O  
+ATOM   1803  CB  ALA A 235      12.772  77.317   6.381  1.00 18.56           C  
+ATOM   1804  N   PRO A 236      10.991  78.124   8.872  1.00 25.79           N  
+ATOM   1805  CA  PRO A 236      10.774  78.725  10.197  1.00 26.29           C  
+ATOM   1806  C   PRO A 236      10.154  77.698  11.127  1.00 25.86           C  
+ATOM   1807  O   PRO A 236      10.560  77.668  12.294  1.00 27.68           O  
+ATOM   1808  CB  PRO A 236       9.968  79.968   9.867  1.00 26.42           C  
+ATOM   1809  CG  PRO A 236       9.187  79.572   8.664  1.00 27.90           C  
+ATOM   1810  CD  PRO A 236      10.167  78.759   7.825  1.00 25.69           C  
+ATOM   1811  N   LYS A 237       9.305  76.781  10.710  1.00 25.66           N  
+ATOM   1812  CA  LYS A 237       8.752  75.776  11.616  1.00 28.08           C  
+ATOM   1813  C   LYS A 237       9.768  74.746  12.073  1.00 28.23           C  
+ATOM   1814  O   LYS A 237       9.786  74.279  13.216  1.00 28.93           O  
+ATOM   1815  CB  LYS A 237       7.560  75.056  10.981  1.00 29.41           C  
+ATOM   1816  CG  LYS A 237       6.466  76.080  10.627  1.00 32.45           C  
+ATOM   1817  CD  LYS A 237       5.347  75.394   9.862  1.00 35.79           C  
+ATOM   1818  CE  LYS A 237       3.979  75.773  10.406  1.00 39.66           C  
+ATOM   1819  NZ  LYS A 237       3.130  76.428   9.378  1.00 42.19           N  
+ATOM   1820  N   SER A 238      10.634  74.344  11.128  1.00 26.02           N  
+ATOM   1821  CA  SER A 238      11.696  73.423  11.495  1.00 25.28           C  
+ATOM   1822  C   SER A 238      12.590  74.049  12.553  1.00 24.86           C  
+ATOM   1823  O   SER A 238      12.950  73.380  13.527  1.00 26.05           O  
+ATOM   1824  CB  SER A 238      12.539  73.182  10.214  1.00 23.43           C  
+ATOM   1825  OG  SER A 238      11.722  72.238   9.514  1.00 25.88           O  
+ATOM   1826  N   ALA A 239      13.000  75.289  12.296  1.00 24.46           N  
+ATOM   1827  CA  ALA A 239      13.920  75.973  13.201  1.00 26.21           C  
+ATOM   1828  C   ALA A 239      13.348  76.141  14.620  1.00 28.34           C  
+ATOM   1829  O   ALA A 239      14.106  76.104  15.585  1.00 29.57           O  
+ATOM   1830  CB  ALA A 239      14.251  77.333  12.615  1.00 24.77           C  
+ATOM   1831  N   GLU A 240      12.040  76.346  14.744  1.00 29.85           N  
+ATOM   1832  CA  GLU A 240      11.423  76.478  16.055  1.00 33.55           C  
+ATOM   1833  C   GLU A 240      11.382  75.163  16.800  1.00 31.62           C  
+ATOM   1834  O   GLU A 240      11.478  75.200  18.033  1.00 32.58           O  
+ATOM   1835  CB  GLU A 240       9.994  77.027  15.941  1.00 37.55           C  
+ATOM   1836  CG  GLU A 240      10.071  78.411  15.290  1.00 44.40           C  
+ATOM   1837  CD  GLU A 240       8.681  78.951  14.996  1.00 48.88           C  
+ATOM   1838  OE1 GLU A 240       7.726  78.534  15.707  1.00 51.76           O  
+ATOM   1839  OE2 GLU A 240       8.590  79.779  14.061  1.00 51.05           O  
+ATOM   1840  N   LEU A 241      11.307  74.030  16.123  1.00 29.85           N  
+ATOM   1841  CA  LEU A 241      11.293  72.736  16.794  1.00 27.12           C  
+ATOM   1842  C   LEU A 241      12.664  72.197  17.170  1.00 26.32           C  
+ATOM   1843  O   LEU A 241      12.793  71.336  18.043  1.00 26.70           O  
+ATOM   1844  CB  LEU A 241      10.623  71.704  15.872  1.00 27.11           C  
+ATOM   1845  CG  LEU A 241       9.154  71.997  15.538  1.00 28.57           C  
+ATOM   1846  CD1 LEU A 241       8.699  71.181  14.356  1.00 27.01           C  
+ATOM   1847  CD2 LEU A 241       8.301  71.633  16.763  1.00 29.28           C  
+ATOM   1848  N   LEU A 242      13.728  72.610  16.505  1.00 25.02           N  
+ATOM   1849  CA  LEU A 242      15.072  72.115  16.741  1.00 25.16           C  
+ATOM   1850  C   LEU A 242      15.682  72.868  17.923  1.00 25.16           C  
+ATOM   1851  O   LEU A 242      15.564  74.081  18.002  1.00 25.47           O  
+ATOM   1852  CB  LEU A 242      15.975  72.336  15.503  1.00 23.76           C  
+ATOM   1853  CG  LEU A 242      15.680  71.383  14.324  1.00 22.60           C  
+ATOM   1854  CD1 LEU A 242      16.075  72.060  13.028  1.00 22.79           C  
+ATOM   1855  CD2 LEU A 242      16.458  70.080  14.491  1.00 23.27           C  
+ATOM   1856  N   ALA A 243      16.354  72.138  18.778  1.00 26.16           N  
+ATOM   1857  CA  ALA A 243      17.012  72.689  19.958  1.00 27.21           C  
+ATOM   1858  C   ALA A 243      18.095  73.671  19.605  1.00 28.66           C  
+ATOM   1859  O   ALA A 243      18.093  74.829  20.062  1.00 29.92           O  
+ATOM   1860  CB  ALA A 243      17.585  71.499  20.730  1.00 28.40           C  
+ATOM   1861  N   ASN A 244      19.031  73.308  18.738  1.00 27.94           N  
+ATOM   1862  CA  ASN A 244      20.100  74.236  18.336  1.00 28.85           C  
+ATOM   1863  C   ASN A 244      20.052  74.542  16.846  1.00 28.46           C  
+ATOM   1864  O   ASN A 244      20.878  73.998  16.089  1.00 29.05           O  
+ATOM   1865  CB  ASN A 244      21.424  73.581  18.753  1.00 31.44           C  
+ATOM   1866  CG  ASN A 244      22.640  74.463  18.612  1.00 35.35           C  
+ATOM   1867  OD1 ASN A 244      22.605  75.645  18.228  1.00 36.23           O  
+ATOM   1868  ND2 ASN A 244      23.809  73.896  18.949  1.00 37.56           N  
+ATOM   1869  N   ALA A 245      19.116  75.361  16.359  1.00 27.26           N  
+ATOM   1870  CA  ALA A 245      19.108  75.601  14.914  1.00 26.46           C  
+ATOM   1871  C   ALA A 245      19.525  77.010  14.554  1.00 26.33           C  
+ATOM   1872  O   ALA A 245      19.373  77.925  15.365  1.00 27.04           O  
+ATOM   1873  CB  ALA A 245      17.716  75.331  14.367  1.00 28.39           C  
+ATOM   1874  N   THR A 246      20.056  77.231  13.378  1.00 23.76           N  
+ATOM   1875  CA  THR A 246      20.350  78.548  12.815  1.00 24.23           C  
+ATOM   1876  C   THR A 246      19.524  78.650  11.517  1.00 25.52           C  
+ATOM   1877  O   THR A 246      19.521  77.708  10.675  1.00 24.33           O  
+ATOM   1878  CB  THR A 246      21.835  78.733  12.507  1.00 24.82           C  
+ATOM   1879  OG1 THR A 246      22.629  78.586  13.716  1.00 26.36           O  
+ATOM   1880  CG2 THR A 246      22.118  80.075  11.868  1.00 22.82           C  
+ATOM   1881  N   LEU A 247      18.752  79.692  11.359  1.00 25.04           N  
+ATOM   1882  CA  LEU A 247      17.856  79.853  10.218  1.00 26.55           C  
+ATOM   1883  C   LEU A 247      18.430  80.853   9.231  1.00 28.97           C  
+ATOM   1884  O   LEU A 247      18.684  82.007   9.614  1.00 27.62           O  
+ATOM   1885  CB  LEU A 247      16.472  80.337  10.659  1.00 27.65           C  
+ATOM   1886  CG  LEU A 247      15.395  80.538   9.618  1.00 30.51           C  
+ATOM   1887  CD1 LEU A 247      15.056  79.219   8.944  1.00 29.55           C  
+ATOM   1888  CD2 LEU A 247      14.078  81.117  10.172  1.00 30.17           C  
+ATOM   1889  N   LYS A 248      18.620  80.426   7.981  1.00 25.07           N  
+ATOM   1890  CA  LYS A 248      19.107  81.324   6.944  1.00 26.55           C  
+ATOM   1891  C   LYS A 248      18.056  81.357   5.835  1.00 26.74           C  
+ATOM   1892  O   LYS A 248      17.672  80.324   5.277  1.00 22.68           O  
+ATOM   1893  CB  LYS A 248      20.474  80.925   6.404  1.00 28.26           C  
+ATOM   1894  CG  LYS A 248      21.616  81.357   7.307  1.00 33.64           C  
+ATOM   1895  CD  LYS A 248      22.960  81.381   6.603  1.00 36.94           C  
+ATOM   1896  CE  LYS A 248      23.573  82.783   6.755  1.00 39.86           C  
+ATOM   1897  NZ  LYS A 248      23.723  83.031   8.233  1.00 42.16           N  
+ATOM   1898  N   SER A 249      17.600  82.556   5.535  1.00 24.84           N  
+ATOM   1899  CA  SER A 249      16.586  82.837   4.546  1.00 24.86           C  
+ATOM   1900  C   SER A 249      17.204  83.500   3.310  1.00 23.82           C  
+ATOM   1901  O   SER A 249      18.019  84.403   3.566  1.00 21.16           O  
+ATOM   1902  CB  SER A 249      15.691  83.977   5.146  1.00 26.60           C  
+ATOM   1903  OG  SER A 249      14.521  83.315   5.573  1.00 31.36           O  
+ATOM   1904  N   TYR A 250      16.859  83.057   2.099  1.00 19.26           N  
+ATOM   1905  CA  TYR A 250      17.531  83.687   0.935  1.00 21.04           C  
+ATOM   1906  C   TYR A 250      16.448  84.307   0.075  1.00 21.32           C  
+ATOM   1907  O   TYR A 250      15.632  83.593  -0.538  1.00 19.98           O  
+ATOM   1908  CB  TYR A 250      18.336  82.649   0.129  1.00 19.11           C  
+ATOM   1909  CG  TYR A 250      19.527  82.131   0.907  1.00 19.35           C  
+ATOM   1910  CD1 TYR A 250      19.341  81.030   1.729  1.00 19.89           C  
+ATOM   1911  CD2 TYR A 250      20.775  82.733   0.882  1.00 20.02           C  
+ATOM   1912  CE1 TYR A 250      20.384  80.505   2.480  1.00 19.18           C  
+ATOM   1913  CE2 TYR A 250      21.816  82.237   1.641  1.00 20.59           C  
+ATOM   1914  CZ  TYR A 250      21.603  81.116   2.425  1.00 20.45           C  
+ATOM   1915  OH  TYR A 250      22.620  80.577   3.198  1.00 21.79           O  
+ATOM   1916  N   GLU A 251      16.357  85.626   0.123  1.00 23.34           N  
+ATOM   1917  CA  GLU A 251      15.334  86.351  -0.583  1.00 25.33           C  
+ATOM   1918  C   GLU A 251      15.278  86.023  -2.080  1.00 24.07           C  
+ATOM   1919  O   GLU A 251      16.288  86.165  -2.754  1.00 23.97           O  
+ATOM   1920  CB  GLU A 251      15.540  87.890  -0.477  1.00 29.45           C  
+ATOM   1921  CG  GLU A 251      14.167  88.574  -0.563  1.00 36.84           C  
+ATOM   1922  CD  GLU A 251      13.311  88.131   0.630  1.00 41.39           C  
+ATOM   1923  OE1 GLU A 251      13.936  88.024   1.723  1.00 43.88           O  
+ATOM   1924  OE2 GLU A 251      12.092  87.869   0.480  1.00 43.37           O  
+ATOM   1925  N   GLY A 252      14.103  85.637  -2.533  1.00 23.71           N  
+ATOM   1926  CA  GLY A 252      13.797  85.384  -3.929  1.00 22.29           C  
+ATOM   1927  C   GLY A 252      14.442  84.138  -4.539  1.00 22.08           C  
+ATOM   1928  O   GLY A 252      14.311  84.005  -5.774  1.00 17.92           O  
+ATOM   1929  N   LEU A 253      15.113  83.276  -3.746  1.00 18.87           N  
+ATOM   1930  CA  LEU A 253      15.782  82.129  -4.429  1.00 16.86           C  
+ATOM   1931  C   LEU A 253      14.840  80.969  -4.577  1.00 15.26           C  
+ATOM   1932  O   LEU A 253      13.916  80.801  -3.793  1.00 13.98           O  
+ATOM   1933  CB  LEU A 253      17.073  81.807  -3.678  1.00 17.62           C  
+ATOM   1934  CG  LEU A 253      18.170  82.874  -3.713  1.00 18.37           C  
+ATOM   1935  CD1 LEU A 253      19.495  82.262  -3.294  1.00 17.40           C  
+ATOM   1936  CD2 LEU A 253      18.181  83.594  -5.069  1.00 18.65           C  
+ATOM   1937  N   PRO A 254      15.091  80.055  -5.527  1.00 14.37           N  
+ATOM   1938  CA  PRO A 254      14.214  78.972  -5.827  1.00 13.57           C  
+ATOM   1939  C   PRO A 254      14.480  77.679  -5.056  1.00 13.95           C  
+ATOM   1940  O   PRO A 254      15.412  77.616  -4.256  1.00 13.92           O  
+ATOM   1941  CB  PRO A 254      14.532  78.682  -7.310  1.00 12.53           C  
+ATOM   1942  CG  PRO A 254      15.982  78.940  -7.381  1.00 13.12           C  
+ATOM   1943  CD  PRO A 254      16.215  80.175  -6.505  1.00 13.32           C  
+ATOM   1944  N   HIS A 255      13.705  76.654  -5.425  1.00 11.11           N  
+ATOM   1945  CA  HIS A 255      13.911  75.361  -4.770  1.00 14.52           C  
+ATOM   1946  C   HIS A 255      15.279  74.772  -5.064  1.00 13.83           C  
+ATOM   1947  O   HIS A 255      15.953  74.248  -4.166  1.00 13.63           O  
+ATOM   1948  CB  HIS A 255      12.793  74.411  -5.215  1.00 14.63           C  
+ATOM   1949  CG  HIS A 255      12.841  73.123  -4.440  1.00 15.65           C  
+ATOM   1950  ND1 HIS A 255      12.661  73.118  -3.063  1.00 14.47           N  
+ATOM   1951  CD2 HIS A 255      12.982  71.841  -4.821  1.00 14.90           C  
+ATOM   1952  CE1 HIS A 255      12.728  71.871  -2.635  1.00 16.38           C  
+ATOM   1953  NE2 HIS A 255      12.914  71.059  -3.672  1.00 16.38           N  
+ATOM   1954  N   GLY A 256      15.738  74.913  -6.317  1.00 12.47           N  
+ATOM   1955  CA  GLY A 256      17.052  74.301  -6.642  1.00 12.60           C  
+ATOM   1956  C   GLY A 256      18.140  75.335  -6.530  1.00 13.71           C  
+ATOM   1957  O   GLY A 256      19.067  75.356  -7.331  1.00 12.53           O  
+ATOM   1958  N   MET A 257      18.102  76.205  -5.467  1.00 11.47           N  
+ATOM   1959  CA  MET A 257      19.094  77.264  -5.378  1.00 11.88           C  
+ATOM   1960  C   MET A 257      20.504  76.798  -5.196  1.00 10.29           C  
+ATOM   1961  O   MET A 257      21.404  77.594  -5.462  1.00 11.06           O  
+ATOM   1962  CB  MET A 257      18.801  78.260  -4.206  1.00 14.18           C  
+ATOM   1963  CG  MET A 257      18.670  77.500  -2.869  1.00 15.11           C  
+ATOM   1964  SD  MET A 257      18.139  78.639  -1.535  1.00 15.54           S  
+ATOM   1965  CE  MET A 257      18.290  77.519  -0.105  1.00 15.63           C  
+ATOM   1966  N   LEU A 258      20.784  75.563  -4.755  1.00 11.32           N  
+ATOM   1967  CA  LEU A 258      22.186  75.150  -4.629  1.00 13.70           C  
+ATOM   1968  C   LEU A 258      22.841  75.027  -6.032  1.00 14.34           C  
+ATOM   1969  O   LEU A 258      24.087  74.955  -6.072  1.00 12.79           O  
+ATOM   1970  CB  LEU A 258      22.253  73.770  -3.966  1.00 14.69           C  
+ATOM   1971  CG  LEU A 258      21.924  73.823  -2.455  1.00 15.37           C  
+ATOM   1972  CD1 LEU A 258      21.534  72.409  -2.065  1.00 16.20           C  
+ATOM   1973  CD2 LEU A 258      23.103  74.332  -1.659  1.00 13.34           C  
+ATOM   1974  N   SER A 259      22.008  74.873  -7.055  1.00 12.71           N  
+ATOM   1975  CA  SER A 259      22.566  74.797  -8.418  1.00 14.13           C  
+ATOM   1976  C   SER A 259      22.454  76.123  -9.176  1.00 13.04           C  
+ATOM   1977  O   SER A 259      23.329  76.391 -10.009  1.00 13.89           O  
+ATOM   1978  CB  SER A 259      21.768  73.704  -9.173  1.00 14.12           C  
+ATOM   1979  OG  SER A 259      22.209  72.459  -8.637  1.00 15.46           O  
+ATOM   1980  N   THR A 260      21.486  76.988  -8.825  1.00 12.37           N  
+ATOM   1981  CA  THR A 260      21.375  78.240  -9.592  1.00 14.17           C  
+ATOM   1982  C   THR A 260      22.195  79.340  -8.927  1.00 16.88           C  
+ATOM   1983  O   THR A 260      22.782  80.222  -9.554  1.00 14.34           O  
+ATOM   1984  CB  THR A 260      19.914  78.694  -9.696  1.00 15.13           C  
+ATOM   1985  OG1 THR A 260      19.341  78.786  -8.389  1.00 12.51           O  
+ATOM   1986  CG2 THR A 260      19.047  77.700 -10.495  1.00 15.43           C  
+ATOM   1987  N   HIS A 261      22.357  79.243  -7.588  1.00 14.37           N  
+ATOM   1988  CA  HIS A 261      23.126  80.290  -6.900  1.00 14.38           C  
+ATOM   1989  C   HIS A 261      24.158  79.717  -5.953  1.00 14.70           C  
+ATOM   1990  O   HIS A 261      24.202  80.098  -4.757  1.00 14.22           O  
+ATOM   1991  CB  HIS A 261      22.090  81.091  -6.044  1.00 12.97           C  
+ATOM   1992  CG  HIS A 261      21.129  81.840  -6.895  1.00 14.62           C  
+ATOM   1993  ND1 HIS A 261      19.997  81.283  -7.428  1.00 13.83           N  
+ATOM   1994  CD2 HIS A 261      21.196  83.114  -7.399  1.00 16.52           C  
+ATOM   1995  CE1 HIS A 261      19.356  82.163  -8.187  1.00 16.22           C  
+ATOM   1996  NE2 HIS A 261      20.075  83.273  -8.173  1.00 16.57           N  
+ATOM   1997  N   PRO A 262      25.021  78.803  -6.384  1.00 12.56           N  
+ATOM   1998  CA  PRO A 262      26.010  78.176  -5.529  1.00 12.94           C  
+ATOM   1999  C   PRO A 262      26.982  79.194  -4.950  1.00 14.51           C  
+ATOM   2000  O   PRO A 262      27.566  79.026  -3.890  1.00 14.12           O  
+ATOM   2001  CB  PRO A 262      26.774  77.198  -6.471  1.00 11.50           C  
+ATOM   2002  CG  PRO A 262      26.644  77.927  -7.814  1.00 13.49           C  
+ATOM   2003  CD  PRO A 262      25.174  78.297  -7.767  1.00 13.60           C  
+ATOM   2004  N   GLU A 263      27.333  80.261  -5.684  1.00 14.87           N  
+ATOM   2005  CA  GLU A 263      28.260  81.269  -5.183  1.00 17.68           C  
+ATOM   2006  C   GLU A 263      27.686  81.975  -3.936  1.00 18.93           C  
+ATOM   2007  O   GLU A 263      28.471  82.408  -3.044  1.00 19.21           O  
+ATOM   2008  CB  GLU A 263      28.615  82.273  -6.296  1.00 17.10           C  
+ATOM   2009  CG  GLU A 263      27.452  83.187  -6.605  1.00 22.08           C  
+ATOM   2010  CD  GLU A 263      26.362  82.535  -7.472  1.00 26.54           C  
+ATOM   2011  OE1 GLU A 263      26.613  81.423  -8.032  1.00 27.63           O  
+ATOM   2012  OE2 GLU A 263      25.257  83.132  -7.613  1.00 27.42           O  
+ATOM   2013  N   VAL A 264      26.380  82.049  -3.779  1.00 17.24           N  
+ATOM   2014  CA  VAL A 264      25.798  82.618  -2.556  1.00 18.73           C  
+ATOM   2015  C   VAL A 264      25.769  81.586  -1.433  1.00 20.06           C  
+ATOM   2016  O   VAL A 264      26.226  81.820  -0.309  1.00 17.96           O  
+ATOM   2017  CB  VAL A 264      24.345  83.086  -2.827  1.00 19.60           C  
+ATOM   2018  CG1 VAL A 264      23.656  83.555  -1.540  1.00 20.68           C  
+ATOM   2019  CG2 VAL A 264      24.328  84.231  -3.829  1.00 20.42           C  
+ATOM   2020  N   LEU A 265      25.302  80.367  -1.716  1.00 17.50           N  
+ATOM   2021  CA  LEU A 265      25.102  79.334  -0.718  1.00 17.19           C  
+ATOM   2022  C   LEU A 265      26.328  78.624  -0.173  1.00 16.22           C  
+ATOM   2023  O   LEU A 265      26.385  78.374   1.046  1.00 16.14           O  
+ATOM   2024  CB  LEU A 265      24.179  78.257  -1.345  1.00 17.49           C  
+ATOM   2025  CG  LEU A 265      22.683  78.258  -1.058  1.00 21.30           C  
+ATOM   2026  CD1 LEU A 265      22.400  78.031   0.427  1.00 23.41           C  
+ATOM   2027  CD2 LEU A 265      22.010  79.539  -1.517  1.00 21.84           C  
+ATOM   2028  N   ASN A 266      27.319  78.338  -1.027  1.00 14.29           N  
+ATOM   2029  CA  ASN A 266      28.483  77.567  -0.680  1.00 14.50           C  
+ATOM   2030  C   ASN A 266      29.285  78.175   0.477  1.00 15.93           C  
+ATOM   2031  O   ASN A 266      29.642  77.462   1.405  1.00 13.70           O  
+ATOM   2032  CB  ASN A 266      29.387  77.283  -1.882  1.00 15.15           C  
+ATOM   2033  CG  ASN A 266      28.839  76.233  -2.856  1.00 16.40           C  
+ATOM   2034  OD1 ASN A 266      27.768  75.674  -2.595  1.00 16.53           O  
+ATOM   2035  ND2 ASN A 266      29.496  76.035  -3.987  1.00 17.41           N  
+ATOM   2036  N   PRO A 267      29.535  79.477   0.435  1.00 16.09           N  
+ATOM   2037  CA  PRO A 267      30.301  80.112   1.521  1.00 17.58           C  
+ATOM   2038  C   PRO A 267      29.577  79.998   2.862  1.00 16.92           C  
+ATOM   2039  O   PRO A 267      30.183  79.818   3.928  1.00 18.06           O  
+ATOM   2040  CB  PRO A 267      30.362  81.581   1.073  1.00 18.07           C  
+ATOM   2041  CG  PRO A 267      30.253  81.514  -0.437  1.00 17.37           C  
+ATOM   2042  CD  PRO A 267      29.220  80.411  -0.664  1.00 16.05           C  
+ATOM   2043  N   ASP A 268      28.261  80.080   2.895  1.00 16.99           N  
+ATOM   2044  CA  ASP A 268      27.429  79.945   4.080  1.00 17.51           C  
+ATOM   2045  C   ASP A 268      27.431  78.498   4.566  1.00 19.19           C  
+ATOM   2046  O   ASP A 268      27.490  78.286   5.791  1.00 18.17           O  
+ATOM   2047  CB  ASP A 268      25.958  80.324   3.878  1.00 18.39           C  
+ATOM   2048  CG  ASP A 268      25.819  81.826   3.658  1.00 21.89           C  
+ATOM   2049  OD1 ASP A 268      26.795  82.562   3.864  1.00 23.14           O  
+ATOM   2050  OD2 ASP A 268      24.732  82.256   3.232  1.00 22.88           O  
+ATOM   2051  N   LEU A 269      27.413  77.519   3.602  1.00 15.58           N  
+ATOM   2052  CA  LEU A 269      27.545  76.143   4.099  1.00 16.81           C  
+ATOM   2053  C   LEU A 269      28.913  75.931   4.741  1.00 16.08           C  
+ATOM   2054  O   LEU A 269      29.055  75.220   5.747  1.00 15.61           O  
+ATOM   2055  CB  LEU A 269      27.332  75.119   2.960  1.00 15.57           C  
+ATOM   2056  CG  LEU A 269      26.015  75.252   2.182  1.00 17.03           C  
+ATOM   2057  CD1 LEU A 269      25.956  74.223   1.028  1.00 16.82           C  
+ATOM   2058  CD2 LEU A 269      24.860  74.857   3.129  1.00 19.95           C  
+ATOM   2059  N   LEU A 270      29.963  76.462   4.113  1.00 13.05           N  
+ATOM   2060  CA  LEU A 270      31.321  76.362   4.554  1.00 15.60           C  
+ATOM   2061  C   LEU A 270      31.523  76.975   5.951  1.00 16.88           C  
+ATOM   2062  O   LEU A 270      32.149  76.339   6.808  1.00 18.26           O  
+ATOM   2063  CB  LEU A 270      32.313  77.096   3.612  1.00 17.08           C  
+ATOM   2064  CG  LEU A 270      33.794  76.980   3.956  1.00 17.88           C  
+ATOM   2065  CD1 LEU A 270      34.284  75.540   4.059  1.00 17.42           C  
+ATOM   2066  CD2 LEU A 270      34.647  77.758   2.938  1.00 18.93           C  
+ATOM   2067  N   ALA A 271      30.972  78.148   6.154  1.00 16.94           N  
+ATOM   2068  CA  ALA A 271      31.078  78.853   7.444  1.00 18.93           C  
+ATOM   2069  C   ALA A 271      30.507  78.005   8.584  1.00 21.00           C  
+ATOM   2070  O   ALA A 271      31.103  77.781   9.646  1.00 18.11           O  
+ATOM   2071  CB  ALA A 271      30.241  80.146   7.263  1.00 18.68           C  
+ATOM   2072  N   PHE A 272      29.367  77.364   8.278  1.00 20.97           N  
+ATOM   2073  CA  PHE A 272      28.690  76.486   9.230  1.00 21.95           C  
+ATOM   2074  C   PHE A 272      29.514  75.254   9.516  1.00 24.01           C  
+ATOM   2075  O   PHE A 272      29.686  74.851  10.663  1.00 25.21           O  
+ATOM   2076  CB  PHE A 272      27.276  76.155   8.733  1.00 21.93           C  
+ATOM   2077  CG  PHE A 272      26.507  75.280   9.698  1.00 22.54           C  
+ATOM   2078  CD1 PHE A 272      25.909  75.842  10.827  1.00 23.69           C  
+ATOM   2079  CD2 PHE A 272      26.407  73.925   9.494  1.00 21.33           C  
+ATOM   2080  CE1 PHE A 272      25.211  75.033  11.713  1.00 22.50           C  
+ATOM   2081  CE2 PHE A 272      25.695  73.113  10.359  1.00 22.51           C  
+ATOM   2082  CZ  PHE A 272      25.113  73.681  11.487  1.00 22.56           C  
+ATOM   2083  N   VAL A 273      30.092  74.614   8.488  1.00 22.45           N  
+ATOM   2084  CA  VAL A 273      30.925  73.452   8.729  1.00 23.66           C  
+ATOM   2085  C   VAL A 273      32.178  73.821   9.517  1.00 26.23           C  
+ATOM   2086  O   VAL A 273      32.595  72.962  10.320  1.00 25.36           O  
+ATOM   2087  CB  VAL A 273      31.223  72.725   7.427  1.00 21.42           C  
+ATOM   2088  CG1 VAL A 273      32.125  71.532   7.647  1.00 22.68           C  
+ATOM   2089  CG2 VAL A 273      29.877  72.277   6.838  1.00 19.99           C  
+ATOM   2090  N   LYS A 274      32.729  75.022   9.328  1.00 27.59           N  
+ATOM   2091  CA  LYS A 274      33.900  75.418  10.106  1.00 32.61           C  
+ATOM   2092  C   LYS A 274      33.630  75.908  11.526  1.00 35.38           C  
+ATOM   2093  O   LYS A 274      34.520  75.919  12.383  1.00 37.25           O  
+ATOM   2094  CB  LYS A 274      34.529  76.619   9.393  1.00 31.85           C  
+ATOM   2095  CG  LYS A 274      35.297  76.340   8.119  1.00 32.44           C  
+ATOM   2096  CD  LYS A 274      36.012  77.641   7.763  1.00 33.40           C  
+ATOM   2097  CE  LYS A 274      37.391  77.436   7.167  1.00 35.22           C  
+ATOM   2098  NZ  LYS A 274      37.759  78.681   6.408  1.00 36.95           N  
+ATOM   2099  N   SER A 275      32.469  76.450  11.830  1.00 37.38           N  
+ATOM   2100  CA  SER A 275      32.096  76.962  13.128  1.00 39.67           C  
+ATOM   2101  C   SER A 275      32.157  75.977  14.288  1.00 40.91           C  
+ATOM   2102  O   SER A 275      31.980  76.499  15.432  1.00 43.49           O  
+ATOM   2103  CB  SER A 275      30.648  77.488  13.091  1.00 39.47           C  
+ATOM   2104  OG  SER A 275      29.849  76.295  12.959  1.00 41.94           O  
+ATOM   2105  OXT SER A 275      32.192  74.734  14.203  1.00 41.57           O  
+TER    2106      SER A 275                                                      
+END   
diff --git a/loop/tests/test_all_atom_positions.cc b/loop/tests/test_all_atom_positions.cc
index bdecca598bd2d86da16db22ec0d2c440f6c818a8..14a21edaf8b21eb69c372bec36a20722c8880a6a 100644
--- a/loop/tests/test_all_atom_positions.cc
+++ b/loop/tests/test_all_atom_positions.cc
@@ -224,7 +224,7 @@ BOOST_AUTO_TEST_CASE(test_aap_indexing) {
   BOOST_CHECK_THROW(atoms.GetIndex(1, "XX"), promod3::Error);
   BOOST_CHECK_THROW(atoms.GetIndex(2, "BA"), promod3::Error);
   BOOST_CHECK_THROW(atoms.GetIndex(3, "ND1"), promod3::Error);
-  BOOST_CHECK_THROW(atoms.GetIndex(4, "NE2"), promod3::Error)
+  BOOST_CHECK_THROW(atoms.GetIndex(4, "NE2"), promod3::Error);
   BOOST_CHECK_THROW(atoms.GetIndex(6, "CG"), promod3::Error);
 }
 
diff --git a/loop/tests/test_ss_assignment.cc b/loop/tests/test_ss_assignment.cc
deleted file mode 100644
index 3a922811e06e00d5342c43759646cfdc1c717d1c..0000000000000000000000000000000000000000
--- a/loop/tests/test_ss_assignment.cc
+++ /dev/null
@@ -1,50 +0,0 @@
-#include <promod3/loop/sec_struct.hh>
-#include <promod3/core/message.hh>
-#define BOOST_TEST_DYN_LINK
-#include <boost/test/unit_test.hpp>
-#include <boost/test/auto_unit_test.hpp>
-
-#include <ost/io/mol/pdb_reader.hh>
-#include <ost/conop/heuristic.hh>
-#include <ost/mol/builder.hh>
-
-BOOST_AUTO_TEST_SUITE( loop );
-
-using namespace promod3::loop;
-
-BOOST_AUTO_TEST_CASE(test_ss_assignment){
-
-  //load an entity to test...
-  String pdb_name = "data/3DEFA.pdb";
-
-  ost::io::PDBReader reader(pdb_name, ost::io::IOProfile());
-  ost::mol::EntityHandle test_ent = ost::mol::CreateEntity();
-  reader.Import(test_ent);
-
-  ost::conop::ProcessorPtr processor(new ost::conop::HeuristicProcessor(false,true,true,true,ost::conop::CONOP_SILENT));
-  processor->Process(test_ent);
-
-  ost::mol::ResidueHandleList res_list = test_ent.GetResidueList();
-
-  String sequence(res_list.size(),'X');
-
-  for(uint i = 0; i < res_list.size(); ++i){
-    sequence[i] = res_list[i].GetOneLetterCode();
-  }
-
-  BackboneList bb_list(sequence,res_list);
-
-  String ss_estimate;
-  EstimateSS(bb_list,ss_estimate);
-
-  String expected_output = "CBCHHHHTSCHHHHHHHHHHHHHHHHTTCCEEEEEEEECTTSSHHHHHHH";
-  expected_output += "HHTSCCSCCCSSCCSCCCEEEEEBETTEEEEEEECCCSEETTEECHHHHHHHHHHT";
-  expected_output += "TTCEECEEEEEEESSCSCCCHHHHHHHHHHHHHHCGGGGGGEEEEEECTTCCCSTT";
-  expected_output += "CCHHHHHHHHHHHHHHHHHHHHTCCHHHHHHHCCEEEECCCCTTCCBCTTSCEECT";
-  expected_output += "TSCBHHHHHHHHHHHHHTSCSCCEEC";
-
-  BOOST_CHECK(ss_estimate == expected_output);
-}
-
-
-BOOST_AUTO_TEST_SUITE_END();
diff --git a/loop/tests/test_structuredb.cc b/loop/tests/test_structuredb.cc
new file mode 100644
index 0000000000000000000000000000000000000000..01cf26055402ab8a89363d2426287329d48a3dff
--- /dev/null
+++ b/loop/tests/test_structuredb.cc
@@ -0,0 +1,423 @@
+
+#include <promod3/loop/structure_db.hh>
+#include <promod3/core/message.hh>
+#define BOOST_TEST_DYN_LINK
+#include <boost/test/unit_test.hpp>
+#include <boost/test/auto_unit_test.hpp>
+
+#include <ost/io/mol/pdb_reader.hh>
+#include <ost/conop/heuristic.hh>
+#include <ost/io/seq/load.hh>
+#include <ost/mol/entity_view.hh>
+#include <ost/mol/alg/accessibility.hh>
+#include <ost/mol/alg/sec_struct.hh>
+
+BOOST_AUTO_TEST_SUITE( loop );
+
+namespace {
+
+ost::mol::EntityView LoadTestStructure(const String& path) {
+  ost::io::PDBReader reader(path, ost::io::IOProfile());
+  ost::mol::EntityHandle test_ent = ost::mol::CreateEntity();
+  reader.Import(test_ent);
+  ost::conop::HeuristicProcessor heu_proc;
+  heu_proc.Process(test_ent);
+  return test_ent.CreateFullView();
+}
+
+ost::seq::ProfileHandlePtr LoadTestProfile(const String& path) {
+  return ost::io::LoadSequenceProfile(path);
+}
+
+}
+
+using namespace promod3::loop;
+
+BOOST_AUTO_TEST_CASE(test_structuredb_initialization) {
+
+  // default initialization is supposed to contain all data
+  StructureDB db_one;
+
+  BOOST_CHECK(db_one.HasData(StructureDB::Dihedrals));
+  BOOST_CHECK(db_one.HasData(StructureDB::SolventAccessibilities));
+  BOOST_CHECK(db_one.HasData(StructureDB::ResidueDepths));
+  BOOST_CHECK(db_one.HasData(StructureDB::DSSP));
+  BOOST_CHECK(db_one.HasData(StructureDB::AAFrequencies));
+  BOOST_CHECK(db_one.HasData(StructureDB::AAFrequenciesStruct));
+
+
+  // test of bitwise or operation 
+  StructureDB db_two(StructureDB::Dihedrals | StructureDB::DSSP);
+
+  BOOST_CHECK(db_two.HasData(StructureDB::Dihedrals));
+  BOOST_CHECK(!db_two.HasData(StructureDB::SolventAccessibilities));
+  BOOST_CHECK(!db_two.HasData(StructureDB::ResidueDepths));
+  BOOST_CHECK(db_two.HasData(StructureDB::DSSP));
+  BOOST_CHECK(!db_two.HasData(StructureDB::AAFrequencies));
+  BOOST_CHECK(!db_two.HasData(StructureDB::AAFrequenciesStruct));
+}
+
+
+BOOST_AUTO_TEST_CASE(test_structuredb_errors_when_adding_coordinates) {
+
+  ost::mol::EntityView test_ent = 
+  LoadTestStructure("data/1A88A.pdb");
+  
+  ost::seq::ProfileHandlePtr profile = LoadTestProfile("data/1A88A.hhm");
+  ost::seq::ProfileHandlePtr fake_profile = LoadTestProfile("data/1A88A.hhm");
+
+  String raw_seqres = profile->GetSequence();
+  String raw_seqres_fake = raw_seqres;
+  raw_seqres_fake[5] = 'Q';
+  fake_profile->SetSequence(raw_seqres_fake);
+
+  ost::seq::SequenceHandle seqres = ost::seq::CreateSequence("seqres", 
+                                                             raw_seqres);
+  ost::seq::SequenceHandle fake_seqres = ost::seq::CreateSequence("fake_seqres", 
+                                                              raw_seqres_fake);
+
+  // some StructureDBs to play around with
+  StructureDB db_full;
+  StructureDB db_no_aa_frequencies(StructureDB::Dihedrals | 
+                                   StructureDB::SolventAccessibilities |
+                                   StructureDB::ResidueDepths |
+                                   StructureDB::DSSP);
+
+  // try to add chain that is not present
+  BOOST_CHECK_THROW(db_full.AddCoordinates("1a88", "X", test_ent, 
+                                            seqres, profile),
+                                            promod3::Error);
+
+  // try to provide no valid profile
+  BOOST_CHECK_THROW(db_full.AddCoordinates("1a88", "A", test_ent, 
+                                            seqres), promod3::Error);
+
+
+  // db_full has AAFrequencies, it therefore checks consistency between 
+  // seqres and profile... lets trigger that error
+  BOOST_CHECK_THROW(db_full.AddCoordinates("1a88", "A", test_ent, 
+                                            seqres, fake_profile),
+                                            promod3::Error);
+
+  // the above should work if we provide the right profile
+  BOOST_CHECK_NO_THROW(db_full.AddCoordinates("1a88", "A", test_ent, 
+                                              seqres, profile));
+
+  // we check, whether we can add coordinates without valid profile
+  // in the DB without AAFrequencies
+  BOOST_CHECK_NO_THROW(db_no_aa_frequencies.AddCoordinates("1a88", "A", 
+                                                           test_ent, seqres));
+
+  // BUT an error is thrown if the seqres does not match with seqres!
+  BOOST_CHECK_THROW(db_no_aa_frequencies.AddCoordinates("1a88", "A", 
+                                                        test_ent, fake_seqres),
+                                                        promod3::Error);
+
+
+  // also check whether size is properly checked when adding structure profile
+  ost::seq::ProfileHandlePtr short_profile = profile->Extract(10, 50);
+  BOOST_CHECK_THROW(db_full.SetStructureProfile(0, short_profile), promod3::Error);
+  BOOST_CHECK_NO_THROW(db_full.SetStructureProfile(0, profile));
+}
+
+BOOST_AUTO_TEST_CASE(test_structuredb_longest_stretch_flag) {
+
+  ost::mol::EntityView test_ent_with_gap = 
+  LoadTestStructure("data/1A88A_with_gap.pdb");
+  ost::seq::ProfileHandlePtr profile = LoadTestProfile("data/1A88A.hhm");
+  String raw_seqres = profile->GetSequence();
+  ost::seq::SequenceHandle seqres = ost::seq::CreateSequence("seqres", 
+                                                             raw_seqres);
+
+
+  StructureDB db;
+
+  // we add coordinates with longest stretch flag set to true
+  db.AddCoordinates("1a88", "A", test_ent_with_gap, 
+                    seqres, profile, true);
+
+  // we expect exactly one entry
+  BOOST_CHECK(db.GetNumCoords() == 1);
+
+  // with length 255
+  BOOST_CHECK(db.GetCoordInfo(0).size == 255); 
+
+  // we add coordinates with longest stretch flag set to false
+  db.AddCoordinates("1a88", "A", test_ent_with_gap, 
+                    seqres, profile, false);
+
+  // we expect two more entries
+  BOOST_CHECK(db.GetNumCoords() == 3);
+
+  // with lengths 17 and 255
+  BOOST_CHECK(db.GetCoordInfo(1).size == 17); 
+  BOOST_CHECK(db.GetCoordInfo(2).size == 255); 
+}
+
+BOOST_AUTO_TEST_CASE(test_fragment_validity) {
+
+  ost::mol::EntityView test_ent = LoadTestStructure("data/1A88A.pdb");
+  ost::seq::ProfileHandlePtr profile = LoadTestProfile("data/1A88A.hhm");
+  String raw_seqres = profile->GetSequence();
+  ost::seq::SequenceHandle seqres = ost::seq::CreateSequence("seqres", 
+                                                             raw_seqres);
+
+  StructureDB db;
+
+  // lets add some stuff
+  db.AddCoordinates("1a88", "A", test_ent, seqres, profile, true);
+
+  FragmentInfo valid_frag_info(0, 5, 12);
+  FragmentInfo invalid_coord_idx(1, 5, 12);
+  FragmentInfo invalid_offset(0, 1000, 12);
+  FragmentInfo invalid_length(0, 5, 1000);
+
+  BOOST_CHECK_NO_THROW(db.GetSequence(valid_frag_info));
+  BOOST_CHECK_THROW(db.GetSequence(invalid_coord_idx), promod3::Error);
+  BOOST_CHECK_THROW(db.GetSequence(invalid_offset), promod3::Error);
+  BOOST_CHECK_THROW(db.GetSequence(invalid_length), promod3::Error);
+}
+
+BOOST_AUTO_TEST_CASE(test_data_extraction) {
+
+  ost::mol::EntityView test_ent = LoadTestStructure("data/1A88A.pdb");
+  ost::seq::ProfileHandlePtr profile = LoadTestProfile("data/1A88A.hhm");
+  String raw_seqres = profile->GetSequence();
+  ost::seq::SequenceHandle seqres = ost::seq::CreateSequence("seqres", 
+                                                             raw_seqres);
+
+  StructureDB db;
+
+  // we add coordinates with longest stretch flag set to true,
+  // the first entry therefore corresponds to residue with resnum 21
+  db.AddCoordinates("1a88", "A", test_ent, seqres, profile, true);
+
+  // we reload an entity in order to forget all generic properties that have 
+  // been set in AddCoordinates
+  test_ent = LoadTestStructure("data/1A88A.pdb");
+
+  // we test the data for the residues in a range 25-50
+  ost::mol::EntityView sel = test_ent.Select("rnum=25:50");
+  ost::mol::ResidueViewList residues = sel.GetResidueList();
+  ost::mol::ResidueHandleList residue_handles;
+  for(ost::mol::ResidueViewList::iterator it = residues.begin();
+      it != residues.end(); ++it) {
+    residue_handles.push_back(it->GetHandle());
+  }
+
+  // lets assign secondary structures and solvent accessibilities
+  ost::mol::alg::AssignSecStruct(test_ent);
+  ost::mol::alg::Accessibility(test_ent);
+
+  // lets extract data directly from the structure
+
+  String expected_sequence(residues.size(), 'X');
+  for(uint i = 0; i < residues.size(); ++i) {
+    expected_sequence[i] = residues[i].GetOneLetterCode();
+  }
+
+  BackboneList expected_bb_list(expected_sequence, residue_handles);
+
+  std::vector<Real> expected_sol_acc;
+  for(ost::mol::ResidueViewList::iterator it = residues.begin();
+      it != residues.end(); ++it) {
+    expected_sol_acc.push_back(it->GetFloatProp("asaAbs"));
+  }
+
+  std::vector<char> expected_sec_struct;
+  for(ost::mol::ResidueViewList::iterator it = residues.begin();
+      it != residues.end(); ++it) {
+    expected_sec_struct.push_back(char(it->GetSecStructure()));
+  }
+
+  std::vector<Real> expected_phi_torsions;
+  std::vector<Real> expected_psi_torsions;
+  for(ost::mol::ResidueViewList::iterator it = residues.begin();
+      it != residues.end(); ++it) {
+    expected_phi_torsions.push_back(it->GetPhiTorsion().GetAngle());
+    expected_psi_torsions.push_back(it->GetPsiTorsion().GetAngle());
+  }
+
+  ost::seq::ProfileHandlePtr expected_prof = profile->Extract(24, 50);
+
+  // and compare it with the data from the StructureDB
+  FragmentInfo frag_info(0, 24, 26);
+
+  String sequence = db.GetSequence(frag_info);
+  BOOST_CHECK(sequence.size() == expected_sequence.size());
+  for(uint i = 0; i < sequence.size(); ++i) {
+    BOOST_CHECK(sequence[i] == expected_sequence[i]);
+  }
+
+  BackboneList bb_list;
+  db.FillBackbone(bb_list, frag_info, sequence);
+  BOOST_CHECK(bb_list.GetSequence() == expected_bb_list.GetSequence());
+  BOOST_CHECK(bb_list.RMSD(expected_bb_list, true) < 0.1);
+
+  // if we reverse the shift that has been applied in AddCoordinates,
+  // the superposition flag in RMSD() should not be necessary anymore
+  geom::Vec3 shift = db.GetCoordInfo(0).shift;
+  geom::Mat4 transform;
+  transform(0,3) = -shift[0];
+  transform(1,3) = -shift[1];
+  transform(2,3) = -shift[2];
+  bb_list.ApplyTransform(transform);
+  BOOST_CHECK(bb_list.RMSD(expected_bb_list, false) < 0.1);
+
+  std::vector<int> sol_acc = db.GetSolventAccessibilities(frag_info);
+  BOOST_CHECK(sol_acc.size() == expected_sol_acc.size());
+  for(uint i = 0; i < sol_acc.size(); ++i) {
+    BOOST_CHECK(static_cast<unsigned short>(expected_sol_acc[i]) == sol_acc[i]);
+  }
+
+  String sec_struct = db.GetDSSPStates(frag_info);
+  BOOST_CHECK(sec_struct.size() == expected_sec_struct.size());
+  for(uint i = 0; i < sec_struct.size(); ++i) {
+    BOOST_CHECK(sec_struct[i] == expected_sec_struct[i]);
+  }
+
+  std::vector<std::pair<Real, Real> > torsion_angles = 
+  db.GetDihedralAngles(frag_info);
+  BOOST_CHECK(torsion_angles.size() == expected_phi_torsions.size());
+  BOOST_CHECK(torsion_angles.size() == expected_psi_torsions.size());
+  for(uint i = 0; i < torsion_angles.size(); ++i) {
+    Real phi_d = std::abs(torsion_angles[i].first - expected_phi_torsions[i]);
+    Real psi_d = std::abs(torsion_angles[i].second - expected_psi_torsions[i]);
+    BOOST_CHECK(phi_d < 0.001);
+    BOOST_CHECK(psi_d < 0.001);
+  }
+
+  ost::seq::ProfileHandlePtr prof = db.GetSequenceProfile(frag_info);
+  BOOST_CHECK(prof->size() == expected_prof->size());
+  BOOST_CHECK(prof->GetSequence() == expected_prof->GetSequence());
+
+  for(uint i = 0; i < prof->size(); ++i) {
+    const ost::seq::ProfileColumn& col = (*prof)[i];
+    const ost::seq::ProfileColumn& expected_col = (*expected_prof)[i];
+
+    const Real* freqs = col.freqs_begin();
+    const Real* expected_freqs = expected_col.freqs_begin();
+
+    for(uint j = 0; j < 20; ++j) {
+      Real diff = std::abs(freqs[j] - expected_freqs[j]);
+      BOOST_CHECK(diff < 0.001);
+    } 
+  }
+
+  // the structure profile is expected to contain only zeros for now  
+  ost::seq::ProfileHandlePtr structure_prof = db.GetStructureProfile(frag_info);
+  for(uint i = 0; i < structure_prof->size(); ++i) {
+    const ost::seq::ProfileColumn& col = (*structure_prof)[i];
+    const Real* freqs = col.freqs_begin();
+    for(uint j = 0; j < 20; ++j) {
+      BOOST_CHECK(freqs[j] == 0.0);
+    } 
+  }
+
+  // we set the sequence profile as structure profile
+  db.SetStructureProfile(0, profile);
+  structure_prof = db.GetStructureProfile(frag_info);
+
+  // now it should be the same as expected_prof...
+  BOOST_CHECK(structure_prof->size() == expected_prof->size());
+  BOOST_CHECK(structure_prof->GetSequence() == expected_prof->GetSequence());
+
+  for(uint i = 0; i < structure_prof->size(); ++i) {
+    const ost::seq::ProfileColumn& col = (*structure_prof)[i];
+    const ost::seq::ProfileColumn& expected_col = (*expected_prof)[i];
+
+    const Real* freqs = col.freqs_begin();
+    const Real* expected_freqs = expected_col.freqs_begin();
+
+    for(uint j = 0; j < 20; ++j) {
+      Real diff = std::abs(freqs[j] - expected_freqs[j]);
+      BOOST_CHECK(diff < 0.001);
+    } 
+  }
+}
+
+BOOST_AUTO_TEST_CASE(test_coordinate_removal) {
+
+  ost::mol::EntityView test_ent_with_gap = 
+  LoadTestStructure("data/1A88A_with_gap.pdb");
+  ost::seq::ProfileHandlePtr profile = LoadTestProfile("data/1A88A.hhm");
+  String raw_seqres = profile->GetSequence();
+  ost::seq::SequenceHandle seqres = ost::seq::CreateSequence("seqres", 
+                                                             raw_seqres);
+
+
+  StructureDB db_one;
+  StructureDB db_two;
+
+  // we add coordinates with longest stretch flag set to false
+  db_one.AddCoordinates("1a88", "A", test_ent_with_gap, 
+                        seqres, profile, false);
+
+  db_two.AddCoordinates("1a88", "A", test_ent_with_gap, 
+                        seqres, profile, false);
+
+  // we're expecting two entries in the database
+  BOOST_CHECK(db_one.GetNumCoords() == 2);
+  BOOST_CHECK(db_two.GetNumCoords() == 2);
+
+  db_two.RemoveCoordinates(0);
+
+  // now its one...
+  BOOST_CHECK(db_two.GetNumCoords() == 1);
+
+  // check the CoordInfoObjects
+  BOOST_CHECK(db_one.GetCoordInfo(1).id == 
+              db_two.GetCoordInfo(0).id);
+  BOOST_CHECK(db_one.GetCoordInfo(1).chain_name == 
+              db_two.GetCoordInfo(0).chain_name);
+  // offset requires some special treatment
+  BOOST_CHECK(db_one.GetCoordInfo(1).offset - db_one.GetCoordInfo(0).size == 
+              db_two.GetCoordInfo(0).offset);
+  BOOST_CHECK(db_one.GetCoordInfo(1).size == 
+              db_two.GetCoordInfo(0).size);
+  BOOST_CHECK(db_one.GetCoordInfo(1).start_resnum == 
+              db_two.GetCoordInfo(0).start_resnum);
+  BOOST_CHECK(db_one.GetCoordInfo(1).shift == 
+              db_two.GetCoordInfo(0).shift);
+
+  // the FragmentInfo objects defined here should point at the same information
+  // in their corresponding databases
+  FragmentInfo frag_info_one(1, 24, 10);
+  FragmentInfo frag_info_two(0, 24, 10);
+
+  BOOST_CHECK(db_one.GetSequence(frag_info_one) == 
+              db_two.GetSequence(frag_info_two));
+
+  BackboneList bb_list_one;
+  db_one.FillBackbone(bb_list_one, frag_info_one, 
+                      db_one.GetSequence(frag_info_one));
+
+  BackboneList bb_list_two;
+  db_two.FillBackbone(bb_list_two, frag_info_two, 
+                      db_two.GetSequence(frag_info_two));
+
+  BOOST_CHECK(bb_list_one.RMSD(bb_list_two) < 0.001);
+
+  BOOST_CHECK(db_one.GetDSSPStates(frag_info_one) == 
+              db_two.GetDSSPStates(frag_info_two));
+
+  BOOST_CHECK(db_one.GetDihedralAngles(frag_info_one) == 
+              db_two.GetDihedralAngles(frag_info_two));
+
+  BOOST_CHECK(db_one.GetResidueDepths(frag_info_one) == 
+              db_two.GetResidueDepths(frag_info_two));
+
+  BOOST_CHECK(db_one.GetSolventAccessibilities(frag_info_one) == 
+              db_two.GetSolventAccessibilities(frag_info_two));
+
+  BOOST_CHECK((*db_one.GetSequenceProfile(frag_info_one)) == 
+              (*db_two.GetSequenceProfile(frag_info_two)));
+
+  BOOST_CHECK((*db_one.GetStructureProfile(frag_info_one)) == 
+              (*db_two.GetStructureProfile(frag_info_two)));
+}
+
+
+
+
+BOOST_AUTO_TEST_SUITE_END();
diff --git a/modelling/doc/algorithms.rst b/modelling/doc/algorithms.rst
index 439fd2d9009650a24933a6ccaebb0a6d567c8528..7ff5ae3a33e08ccccdf6d98f87abe2748e1d0d19 100644
--- a/modelling/doc/algorithms.rst
+++ b/modelling/doc/algorithms.rst
@@ -24,11 +24,9 @@ iterative superposition multiple times by using a sliding window to select the
 initial subset and gathers all unique results. These results can be very 
 similar and only differ by single positions. The algorithm therefore reduces
 the amount of solutions by merging them based on a threshold of similarity.
-If the sum of matching positions within the distance threshold divided by
-the maximum length of the two solutions is above a cluster thresh, the two
-solutions get merged by producing a common solution containing the shared
-positions. As a final result, the algorithm therefore detects common rigid
-subsets of positions.
+The similarity is defined by the fraction of positions in solution A that are
+also present in solution B. As a final result, the algorithm therefore detects 
+common rigid subsets of positions.
 
 .. method:: RigidBlocks(bb_list_one, bb_list_two, [window_length = 12, max_iterations=20, distance_thresh=3.0, cluster_thresh=0.9])
 
diff --git a/modelling/doc/loop_candidates.rst b/modelling/doc/loop_candidates.rst
index dc3b5c96a28b7320d2fbb4dbdf47fe2492b49ff1..d0711c5a7c89292a61e3f1547ed28af62841382b 100644
--- a/modelling/doc/loop_candidates.rst
+++ b/modelling/doc/loop_candidates.rst
@@ -67,6 +67,12 @@ The LoopCandidates class
     
     Uses Monte Carlo simulated annealing to sample the loop to be modelled.
     If *initial_bb* is given, every Monte Carlo run starts from that configuration.
+
+    .. warning:: The :class:`~promod3.scoring.BackboneScoreEnv`
+                 attached to *scorer* will be altered in the specified stretch.
+                 You might consider the Stash / Pop mechanism of the 
+                 :class:`~promod3.scoring.BackboneScoreEnv` to restore to the 
+                 original state once the sampling is done.    
  
     :param initial_bb: Initial configuration used for the sampling
     :param seq:        The sequence of residues to be sampled
@@ -181,10 +187,14 @@ The LoopCandidates class
              useful to keep track of scores and other data extracted before.
     :rtype:  :class:`list` of :class:`int`
 
-  .. method:: CalculateBackboneScores(score_container, scorer, \
+  .. method:: CalculateBackboneScores(score_container, scorer, scorer_env,\
                                       start_resnum, chain_idx=0)
-              CalculateBackboneScores(score_container, scorer, keys, \
+              CalculateBackboneScores(score_container, scorer, scorer_env,\
+                                      keys, start_resnum, chain_idx=0)
+              CalculateBackboneScores(score_container, mhandle,\
                                       start_resnum, chain_idx=0)
+              CalculateBackboneScores(score_container, mhandle,\
+                                      keys, start_resnum, chain_idx=0)
               CalculateAllAtomScores(score_container, mhandle, \
                                      start_resnum, chain_idx=0)
               CalculateAllAtomScores(score_container, mhandle, keys, \
@@ -201,7 +211,10 @@ The LoopCandidates class
     :param scorer: Backbone scoring object with set environment for the
                    particular loop modelling problem.
     :type scorer:  :class:`~promod3.scoring.BackboneOverallScorer`
-    :param mhandle: Modelling handle set up for all atom scoring (see
+    :param scorer_env: The scoring environment attached to *scorer*
+    :type scorer_env: :class:`~promod3.scoring.BackboneScoreEnv`
+    :param mhandle: Modelling handle set up scoring (see
+                    :func:`SetupDefaultBackboneScoring`
                     :func:`SetupDefaultAllAtomScoring`).
     :type mhandle:  :class:`ModellingHandle`
     :param keys: Keys of the desired scorers. If not given, we use the set of
@@ -484,15 +497,25 @@ on loop candidates.
   a consistent naming of keys used for backbone and all atom scorers as set up
   by :func:`SetupDefaultBackboneScoring` and :func:`SetupDefaultAllAtomScoring`.
 
+  Different sets of weights are available. You can get general weights 
+  that have been optimized for a non redundant set of loops with lengths [3,14]
+  (including stem residues). The alternative is to get weights that have only
+  been optimized on a length specific subset of loops. By default you get
+  different weights for following lengths: [0,1,2,3,4], [5,6], [7,8], [9,10],
+  [11,12], [13,14]. 
+
   If you choose to modify the weights, please ensure to set consistently named
   keys in here and to use consistently named scorers and scoring computations!
 
-  .. staticmethod:: GetWeights(with_db=False, with_aa=False)
+  .. staticmethod:: GetWeights(with_db=False, with_aa=False,\
+                               length_dependent=False, loop_length=-1)
 
     :return: Named weights to be used when scoring loop candidates. The default
              weights were optimized to give the best performance when choosing
              the loop candidate with the lowest combined score. Each set of
-             weights includes (different) backbone scoring weights.
+             weights includes (different) backbone scoring weights, that are
+             optionally only trained on a subset of loops with corresponding 
+             loop length.
     :rtype:  :class:`dict` (keys: :class:`str`, values: :class:`float`)
 
     :param with_db: True to choose a set of weights including DB specific scores
@@ -500,12 +523,21 @@ on loop candidates.
     :type with_db:  :class:`bool`
     :param with_aa: True to choose a set of weights including all atom scores
     :type with_aa:  :class:`bool`
+    :param length_dependent: Whether to use general weights or their length 
+                             length dependent counterparts.
+    :type length_dependent: :class:`bool`
+    :param loop_length: Length of full loop. If no weights are available for
+                        this length or when *loop_length* is -1, the general
+                        weights are returned.
+    :type loop_length: :class:`int`
 
-  .. staticmethod:: SetWeights(with_db, with_aa, weights)
+  .. staticmethod:: SetWeights(with_db, with_aa, weights,\
+                               length_dependent=False, loop_length=-1)
 
     Overwrite a set of weights as returned by :meth:`GetWeights`.
 
-  .. staticmethod:: GetBackboneWeights(with_db=False, with_aa=False)
+  .. staticmethod:: GetBackboneWeights(with_db=False, with_aa=False,\
+                                       length_dependent=False, loop_length=-1)
 
     :return: Subset of :meth:`GetWeights` for backbone scoring as in
              :meth:`scoring.BackboneOverallScorer.CalculateLinearCombination`.
@@ -515,8 +547,13 @@ on loop candidates.
     :type with_db:  :class:`bool`
     :param with_aa: As in :meth:`GetWeights`
     :type with_aa:  :class:`bool`
+    :param length_dependent: As in :meth:`GetWeights`
+    :type length_dependent:  :class:`bool`
+    :param loop_length: As in :meth:`GetWeights`
+    :type loop_length:  :class:`int`
 
-  .. staticmethod:: GetAllAtomWeights(with_db=False)
+  .. staticmethod:: GetAllAtomWeights(with_db=False, length_dependent=False,\
+                                      loop_length=-1)
 
     :return: Subset of :meth:`GetWeights` for all atom scoring as in
              :meth:`scoring.AllAtomOverallScorer.CalculateLinearCombination`.
@@ -524,6 +561,10 @@ on loop candidates.
 
     :param with_db: As in :meth:`GetWeights`
     :type with_db:  :class:`bool`
+    :param length_dependent: As in :meth:`GetWeights`
+    :type length_dependent:  :class:`bool`
+    :param loop_length: As in :meth:`GetWeights`
+    :type loop_length:  :class:`int`
 
 
   .. staticmethod:: GetStemRMSDsKey()
diff --git a/modelling/doc/loop_closing.rst b/modelling/doc/loop_closing.rst
index 386458ba39abdf80e0b2289a35c5eb25b7cb6463..7ec7230b20a4e32fd9cc1f15a9e84ea7b549c113 100644
--- a/modelling/doc/loop_closing.rst
+++ b/modelling/doc/loop_closing.rst
@@ -197,7 +197,11 @@ the relaxer.
 
   .. method:: Run(bb_list, steps=100, stop_criterion=0.01)
 
-    Performs steepest descent on given BackboneList.
+    Performs steepest descent on given BackboneList. The function possibly fails
+    if there are particles (almost) on top of each other, resulting in NaN 
+    positions in the OpenMM system. The positions of **bb_list** are not touched
+    in this case and the function returns an infinit potential energy. 
+    In Python you can check for that with float("inf").
 
     :param bb_list:     To be relaxed
     :param steps:       number of steepest descent steps
@@ -209,7 +213,7 @@ the relaxer.
     :type steps:        :class:`int`
     :type stop_criterion: :class:`float`
 
-    :return: Forcefield energy upon relaxation
+    :return: Forcefield energy upon relaxation, infinity in case of OpenMM Error
     :rtype:  :class:`float`
 
     :raises:  :exc:`~exceptions.RuntimeError` if *bb_list* has not the same
@@ -332,7 +336,11 @@ Example usage:
   .. method:: Run(sc_data, steps=100, stop_criterion=0.01)
 
     Performs steepest descent for this system and writes updated positions into
-    *sc_data.env_pos.all_pos*.
+    *sc_data.env_pos.all_pos*. The function possibly fails
+    if there are particles (almost) on top of each other, resulting in NaN 
+    positions in the OpenMM system. The positions of *sc_data.env_pos.all_pos* 
+    are not touched in this case and the function returns an infinit potential 
+    energy. In Python you can check for that with float("inf").
 
     :param sc_data: Sidechain reconstruction result to be updated
     :type sc_data:  :class:`~promod3.modelling.SidechainReconstructionData`
@@ -342,7 +350,7 @@ Example usage:
                            that threshold, the relaxation aborts.
     :type stop_criterion:  :class:`float`
 
-    :return: Potential energy after relaxation
+    :return: Potential energy after relaxation, infinity in case of OpenMM Error
     :rtype:  :class:`float`
 
     :raises: :exc:`~exceptions.RuntimeError` if *sc_data* is incompatible with
diff --git a/modelling/doc/monte_carlo.rst b/modelling/doc/monte_carlo.rst
index 328b73d366cf8ce5a6affe7cce3d27a1d6325036..56e572a8788749bde35c415893a964126c5e67b9 100644
--- a/modelling/doc/monte_carlo.rst
+++ b/modelling/doc/monte_carlo.rst
@@ -402,18 +402,29 @@ The scorer asses a proposed conformation and are intended to return a pseudo
 energy, the lower the better.
 
 
-.. class:: LinearScorer(scorer, start_resnum, chain_idx, linear_weights)
+.. class:: LinearScorer(scorer, scorer_env, start_resnum, num_residues,
+                        chain_idx, linear_weights)
 
   The LinearScorer allows to combine the scores available from
   :class:`~promod3.scoring.BackboneOverallScorer` in a linear manner. See
   :meth:`~promod3.scoring.BackboneOverallScorer.CalculateLinearCombination` for a
   detailed description of the arguments.
 
+  .. warning:: The provided *scorer_env* will be altered in every 
+               :func:`GetScore` call.
+               You might consider the Stash / Pop mechanism of the 
+               :class:`~promod3.scoring.BackboneScoreEnv` to restore to the 
+               original state once the sampling is done.
+
   :param scorer: Scorer Object with set environment for the particular loop
                  modelling problem.
   :type scorer:  :class:`~promod3.scoring.BackboneOverallScorer`
+  :param scorer_env: The environment that is linked to the *scorer*
+  :type scorer_env: :class:`~promod3.scoring.BackboneScoreEnv`
   :param start_resnum: Res. number defining the position in the SEQRES.
   :type start_resnum:  :class:`int`
+  :param num_residues: Number of residues to score
+  :type num_residues: :class:`int`
   :param chain_idx: Index of chain the loop(s) belong to.
   :type chain_idx:  :class:`int`
   :param linear_weights: Weights for each desired scorer.
diff --git a/modelling/doc/pipeline.rst b/modelling/doc/pipeline.rst
index db7dc9d5bf060bf81fcca1e3b918b9824d6d145d..175b65c5d6554d15f76076e3bd3c530595a7cf64 100644
--- a/modelling/doc/pipeline.rst
+++ b/modelling/doc/pipeline.rst
@@ -236,10 +236,8 @@ Modelling Steps
     - "reduced": :class:`~promod3.scoring.ReducedScorer`
     - "clash": :class:`~promod3.scoring.ClashScorer`
     - "hbond": :class:`~promod3.scoring.HBondScorer`
-    - "ss_agreement": :class:`~promod3.scoring.SSAgreementScorer`
     - "torsion": :class:`~promod3.scoring.TorsionScorer`
     - "pairwise": :class:`~promod3.scoring.PairwiseScorer`
-    - "density": :class:`~promod3.scoring.DensityScorer`
 
     :param mhandle: The modelling handle. This will set the properties
                     :attr:`~ModellingHandle.backbone_scorer` and
diff --git a/modelling/pymod/_closegaps.py b/modelling/pymod/_closegaps.py
index 96b5f819145b8c3fbd48d8b05127ba4d95e8a5c2..aa857023be8b7543a56670d0b8db6e340a4edcf1 100644
--- a/modelling/pymod/_closegaps.py
+++ b/modelling/pymod/_closegaps.py
@@ -15,7 +15,7 @@ import sys
 ###############################################################################
 # loop candidate selection setup
 def _GetBestLC(mhandle, loop_candidates, start_resnum, chain_idx,
-               db_scores, max_num_all_atom=0):
+               db_scores, max_num_all_atom=0, length_dep_weights=False):
     # returns (min_idx, min_score)
 
     # dummy check
@@ -25,19 +25,24 @@ def _GetBestLC(mhandle, loop_candidates, start_resnum, chain_idx,
     # setup weights
     with_db = (not db_scores.IsEmpty())
     with_aa = (max_num_all_atom > 0)
-    weights = ScoringWeights.GetWeights(with_db, with_aa)
+    weights = ScoringWeights.GetWeights(with_db, with_aa, 
+                                        length_dep_weights, 
+                                        len(loop_candidates[0]))
 
     # setup all scores object (we collect needed scores there)
     all_scores = db_scores.Copy()  # copy to avoid changing db_scores
 
     # add backbone scores
-    loop_candidates.CalculateBackboneScores(all_scores, mhandle.backbone_scorer,
+    loop_candidates.CalculateBackboneScores(all_scores, mhandle,
                                             start_resnum, chain_idx)
 
     # add all atom scores?
     if with_aa:
         # get best ones based on previous scores
-        non_aa_weights = ScoringWeights.GetWeights(with_db, False)
+        non_aa_weights = ScoringWeights.GetWeights(with_db, False, 
+                                                   length_dep_weights,
+                                                   len(loop_candidates[0]))
+
         non_aa_scores = all_scores.LinearCombine(non_aa_weights)
         arg_sorted_scores = sorted([(v,i) for i,v in enumerate(non_aa_scores)])
         min_indices = [i for v,i in arg_sorted_scores[:max_num_all_atom]]
@@ -102,7 +107,8 @@ def _ResolveLogInfo(gap_orig, optimal_gap, n_candidates, with_db, with_aa):
                 (str(gap_orig), str(optimal_gap), n_candidates, scor_str))
 
 def _CloseLoopFrame(mhandle, gap_orig, actual_candidates, actual_extended_gaps,
-                    actual_db_scores=[], max_num_all_atom=0):
+                    actual_db_scores=[], max_num_all_atom=0, 
+                    length_dep_weights=False):
     '''Rank candidates with "frame-approach".
     All found candidates are extended prior to scoring so they match in size.
     '''
@@ -153,7 +159,8 @@ def _CloseLoopFrame(mhandle, gap_orig, actual_candidates, actual_extended_gaps,
         # get best
         min_idx, min_score = _GetBestLC(mhandle, final_loop_candidates,
                                         min_before_resnum, actual_chain_idx,
-                                        db_scores, max_num_all_atom)
+                                        db_scores, max_num_all_atom, 
+                                        length_dep_weights)
         ost.LogVerbose("Gap %s - %d candidates, best (min) score %g" %
                        (str(gap_orig), len(final_loop_candidates), min_score))
         # resolve loop
@@ -174,7 +181,7 @@ def _CloseLoopFrame(mhandle, gap_orig, actual_candidates, actual_extended_gaps,
 
 def _CloseLoopBare(mhandle, gap_orig, actual_candidates, actual_extended_gaps,
                    actual_db_scores=[], penalize_length=True,
-                   max_num_all_atom=0):
+                   max_num_all_atom=0, length_dep_weights=False):
     '''Rank candidates directly.
     All candidates are scored directly and optionally penalized for gap length.
     '''
@@ -196,7 +203,7 @@ def _CloseLoopBare(mhandle, gap_orig, actual_candidates, actual_extended_gaps,
             db_scores = actual_db_scores[i]
         best_idx, score = _GetBestLC(mhandle, loop_candidates, before_resnum,
                                      actual_chain_idx, db_scores,
-                                     max_num_all_atom)
+                                     max_num_all_atom, length_dep_weights)
         # compare with others
         if penalize_length:
             # penalized by gap length
@@ -224,7 +231,7 @@ def _CloseLoopBare(mhandle, gap_orig, actual_candidates, actual_extended_gaps,
 
 def _CloseLoop(mhandle, gap_orig, actual_candidates,
                actual_extended_gaps, variant=0, actual_db_scores=[],
-               max_num_all_atom=0):
+               max_num_all_atom=0, length_dep_weights=False):
     '''Choose best scoring loop candidate and close loop in mhandle.
     :param gap_orig: Gap we actually wanted to close
     :param actual_candidates: List of LoopCandidates
@@ -250,11 +257,12 @@ def _CloseLoop(mhandle, gap_orig, actual_candidates,
     if variant == 0:
         return _CloseLoopFrame(mhandle, gap_orig, actual_candidates,
                                actual_extended_gaps, actual_db_scores,
-                               max_num_all_atom)
+                               max_num_all_atom, length_dep_weights)
     elif variant in [1,2]:
         return _CloseLoopBare(mhandle, gap_orig, actual_candidates,
                               actual_extended_gaps, actual_db_scores,
-                              variant == 2, max_num_all_atom)
+                              variant == 2, max_num_all_atom,
+                              length_dep_weights)
     else:
         raise RuntimeError("Unknown variant %d" % variant);
 
@@ -290,11 +298,14 @@ def _InRange(gap, chain_idx, resnum_range):
         return True
 
 def _GetMCWeights():
-    # get weights for Monte Carlo sampling (BB only)
-    return {"reduced": 3.0,
-            "cb_packing": 2.0,
-            "hbond": 1.0,
-            "clash": 0.05}
+    # get weights for Monte Carlo sampling (subset of BB only scores for super 
+    #                                       fast sampling)
+    bb_weights = ScoringWeights.GetWeights()
+    return_weights = dict()
+    return_weights["reduced"] = bb_weights["reduced"]
+    return_weights["cb_packing"] = bb_weights["cb_packing"]
+    return_weights["clash"] = bb_weights["clash"]
+    return return_weights
 
 ###############################################################################
 
@@ -335,7 +346,8 @@ def CloseSmallDeletions(mhandle, max_extension=9, clash_thresh=1.0,
                                  For the scondary-structure-penalty to work,
                                  the model-template must have the appropriate
                                  information before :func:`BuildRawModel` is
-                                 called (e.g. with :mod:`ost.bindings.dssp`).
+                                 called (e.g. with 
+                                 :meth:`ost.mol.alg.AssignSecStruct`).
     :type use_scoring_extender:  :class:`bool`
 
     :param use_full_extender: True = use :class:`FullGapExtender` instead of
@@ -374,7 +386,12 @@ def CloseSmallDeletions(mhandle, max_extension=9, clash_thresh=1.0,
     # check/setup scoring
     if not IsBackboneScoringSetUp(mhandle):
         SetupDefaultBackboneScoring(mhandle)
-    clash_scorer = mhandle.backbone_scorer.Get("clash")
+
+    # we're only calculating clash scores here, so we copy the default
+    # env and only attach a clash scorer. 
+    clash_scorer_env = mhandle.backbone_scorer_env.Copy()
+    clash_scorer = scoring.ClashScorer()
+    clash_scorer.AttachEnvironment(clash_scorer_env)
 
     if ff_lookup == None:
         ff_lookup = loop.ForcefieldLookup.GetDefault()
@@ -433,9 +450,18 @@ def CloseSmallDeletions(mhandle, max_extension=9, clash_thresh=1.0,
                 bb_relaxer = BackboneRelaxer(bb_list, ff_lookup)
                 potential_e = bb_relaxer.Run(bb_list, 300, 0.1)
                 # check for clashes
-                score = clash_scorer.CalculateScore(bb_list,
-                                                    n_stem_resnum.GetNum(),
+
+                # its a bit problematic since we score loops that are shifting 
+                # around... so we perform a stash operation for each scoring step
+
+                clash_scorer_env.Stash(n_stem_resnum.GetNum(),
+                                       len(bb_list), current_chain_index)
+                clash_scorer_env.SetEnvironment(bb_list, n_stem_resnum.GetNum(), 
+                                                current_chain_index)
+                score = clash_scorer.CalculateScore(n_stem_resnum.GetNum(),
+                                                    len(bb_list),
                                                     current_chain_index)
+                clash_scorer_env.Pop()
 
                 # if there is no clash and potential energy is low enough we
                 # just solved a gap, delete it and update the scorer for the
@@ -446,9 +472,13 @@ def CloseSmallDeletions(mhandle, max_extension=9, clash_thresh=1.0,
                     ost.LogInfo("Closed: %s by relaxing %s" % \
                                 (mhandle.gaps[current_gap_index], current_gap))
                     InsertLoopClearGaps(mhandle, bb_list, current_gap)
+                    clash_scorer_env.SetEnvironment(bb_list, 
+                                                    n_stem_resnum.GetNum(), 
+                                                    current_chain_index)
                     success = True
                     break
 
+
         # On closed gap, it is removed so the no. of gaps goes down by itself.
         # In case of no success, counter needs to be increased to jump to the
         # next gap.
@@ -539,7 +569,7 @@ def FillLoopsByDatabase(mhandle, fragment_db, structure_db,
                         use_full_extender=True, score_variant=0,
                         ring_punch_detection=1, chain_idx=None,
                         resnum_range=None, max_num_all_atom=0,
-                        clash_thresh=-1):
+                        clash_thresh=-1, length_dep_weights=False):
     '''Try to fill up loops from a structural database.
 
     Usually this will extend the gaps a bit to match candidates from the
@@ -637,6 +667,13 @@ def FillLoopsByDatabase(mhandle, fragment_db, structure_db,
     :param clash_thresh: If > 0, we only keep loop candidates which have a
                          backbone clash score lower than this.
     :type clash_thresh:  :class:`float`
+
+    :param length_dep_weights: :class:`ScoringWeights` provides different sets
+                               of weights that have been trained on different
+                               loop subsets. If this flag is true, the length
+                               dependent weights are used to select the final 
+                               loops.
+    :type length_dep_weights: :class:`bool`
     '''
 
     prof_name = 'closegaps::FillLoopsByDatabase'
@@ -757,13 +794,15 @@ def FillLoopsByDatabase(mhandle, fragment_db, structure_db,
 
             # remove clashing ones if desired
             if clash_thresh > 0:
-                scorer = mhandle.backbone_scorer.Get("clash")
+                clash_score_container = ScoreContainer()
+                candidates.CalculateBackboneScores(clash_score_container,
+                                                   mhandle, ["clash"],
+                                                   n_stem.GetNumber().GetNum(),
+                                                   actual_gap.GetChainIndex())
+                clash_scores = clash_score_container.Get("clash")
                 to_keep = []
                 for i, bb_list in enumerate(candidates):
-                    score = scorer.CalculateScore(bb_list,
-                                                  n_stem.GetNumber().GetNum(),
-                                                  actual_gap.GetChainIndex())
-                    if score < clash_thresh:
+                    if clash_scores[i] < clash_thresh:
                         to_keep.append(i)
                 candidates = candidates.Extract(to_keep)
                 orig_indices = [orig_indices[i] for i in to_keep]
@@ -815,7 +854,8 @@ def FillLoopsByDatabase(mhandle, fragment_db, structure_db,
         ##################################
         new_idx = _CloseLoop(mhandle, gap_orig, actual_candidates,
                              actual_extended_gaps, score_variant,
-                             actual_db_scores, max_num_all_atom)
+                             actual_db_scores, max_num_all_atom,
+                             length_dep_weights)
         if new_idx == -2:
             # try next one if we failed
             gap_idx += 1
@@ -831,7 +871,7 @@ def FillLoopsByMonteCarlo(mhandle, torsion_sampler, max_loops_to_search=6,
                           use_scoring_extender=True, use_full_extender=True,
                           score_variant=0, ring_punch_detection=1,
                           fragger_handles=None, chain_idx=None,
-                          resnum_range=None):
+                          resnum_range=None, length_dep_weights=False):
     '''Try to fill up loops with Monte Carlo sampling.
 
     This is meant as a "last-resort" approach when it is not possible to fill
@@ -898,6 +938,13 @@ def FillLoopsByMonteCarlo(mhandle, torsion_sampler, max_loops_to_search=6,
     :param resnum_range: If not None, only gaps within this resnum range get
                          processed
     :type resnum_range: :class:`tuple` containing two :class:`int`
+
+    :param length_dep_weights: :class:`ScoringWeights` provides different sets
+                               of weights that have been trained on different
+                               loop subsets. If this flag is true, the length
+                               dependent weights are used to select the final 
+                               loops.
+    :type length_dep_weights: :class:`bool`
     '''
 
     prof_name = 'closegaps::FillLoopsByMonteCarlo'
@@ -999,7 +1046,9 @@ def FillLoopsByMonteCarlo(mhandle, torsion_sampler, max_loops_to_search=6,
                 weights = _GetMCWeights()
                 
                 mc_scorer = LinearScorer(mhandle.backbone_scorer,
+                                         mhandle.backbone_scorer_env,
                                          actual_gap.before.GetNumber().GetNum(),
+                                         len(actual_gap.full_seq),
                                          actual_chain_idx, weights)
 
                 start_temperature = 100
@@ -1045,7 +1094,8 @@ def FillLoopsByMonteCarlo(mhandle, torsion_sampler, max_loops_to_search=6,
         # close loop
         ##################################
         new_idx = _CloseLoop(mhandle, gap_orig, actual_candidates,
-                             actual_extended_gaps, score_variant)
+                             actual_extended_gaps, score_variant,
+                             length_dep_weights=length_dep_weights)
         if new_idx == -2:
             # try next one if we failed
             gap_idx += 1
@@ -1058,7 +1108,7 @@ def FillLoopsByMonteCarlo(mhandle, torsion_sampler, max_loops_to_search=6,
 
 def CloseGaps(mhandle, merge_distance=4, fragment_db=None, structure_db=None,
               torsion_sampler=None, fragger_handles=None, chain_idx=None,
-              resnum_range=None):
+              resnum_range=None, length_dep_weights=False):
     '''
     Tries to close all gaps in a model, except termini. It will go through
     following steps:
@@ -1104,6 +1154,13 @@ def CloseGaps(mhandle, merge_distance=4, fragment_db=None, structure_db=None,
     :param resnum_range: If not None, only gaps within this resnum range get
                          processed.
     :type resnum_range: :class:`tuple` containing two :class:`int`  
+
+    :param length_dep_weights: :class:`ScoringWeights` provides different sets
+                               of weights that have been trained on different
+                               loop subsets. If this flag is true, the length
+                               dependent weights are used to close loops with
+                               database / Monte Carlo.
+    :type length_dep_weights: :class:`bool`
     '''
 
     # load stuff if needed
@@ -1125,22 +1182,26 @@ def CloseGaps(mhandle, merge_distance=4, fragment_db=None, structure_db=None,
         FillLoopsByDatabase(mhandle, fragment_db, structure_db,
                             torsion_sampler, min_loops_required=-1,
                             max_res_extension=6, chain_idx=chain_idx,
-                            resnum_range=resnum_range, clash_thresh=10)
+                            resnum_range=resnum_range, clash_thresh=10,
+                            length_dep_weights=length_dep_weights)
         
     # if above fails, try DB-fill with less restrictions
     FillLoopsByDatabase(mhandle, fragment_db, structure_db,
                         torsion_sampler, min_loops_required=-1,
                         chain_idx=chain_idx, resnum_range=resnum_range,
-                        clash_thresh=10)
+                        clash_thresh=10, 
+                        length_dep_weights=length_dep_weights)
     FillLoopsByDatabase(mhandle, fragment_db, structure_db,
                         torsion_sampler, chain_idx=chain_idx,
-                        resnum_range=resnum_range)
+                        resnum_range=resnum_range,
+                        length_dep_weights=length_dep_weights)
 
     # close remaining gaps by Monte Carlo
     FillLoopsByMonteCarlo(mhandle, torsion_sampler, 
                           fragger_handles=fragger_handles, 
                           chain_idx=chain_idx,
-                          resnum_range=resnum_range)
+                          resnum_range=resnum_range,
+                          length_dep_weights=length_dep_weights)
 
     # last resort approach to close large deletions
     CloseLargeDeletions(mhandle, structure_db, chain_idx=chain_idx, 
@@ -1236,7 +1297,9 @@ def ModelTermini(mhandle, torsion_sampler, fragger_handles=None,
 
         # setup scorer
         weights = _GetMCWeights()
-        mc_scorer = LinearScorer(mhandle.backbone_scorer, start_resnum,
+        mc_scorer = LinearScorer(mhandle.backbone_scorer, 
+                                 mhandle.backbone_scorer_env,
+                                 start_resnum, len(actual_gap.full_seq), 
                                  actual_chain_idx, weights)
 
         # setup cooler
@@ -1257,8 +1320,7 @@ def ModelTermini(mhandle, torsion_sampler, fragger_handles=None,
         if len(candidates) > 0:
             # score candidates
             bb_scores = ScoreContainer()
-            candidates.CalculateBackboneScores(bb_scores,
-                                               mhandle.backbone_scorer,
+            candidates.CalculateBackboneScores(bb_scores, mhandle,
                                                start_resnum, actual_chain_idx)
             scores = bb_scores.LinearCombine(ScoringWeights.GetWeights())
             min_score = min(scores)
@@ -1442,8 +1504,10 @@ def CloseLargeDeletions(mhandle, structure_db, linker_length=8,
             closer.Close(bb_list, bb_list)
 
             # a simple score gets calculated and best chosen
+            mhandle.backbone_scorer_env.SetEnvironment(bb_list, first_num, 
+                                                       actual_chain_idx)
             score = mhandle.backbone_scorer.CalculateLinearCombination(\
-                        scorer_weights, bb_list, first_num, actual_chain_idx)
+                        scorer_weights, first_num, len(bb_list), actual_chain_idx)
 
             if score < best_score:
                 best_score = score
diff --git a/modelling/pymod/_denovo.py b/modelling/pymod/_denovo.py
index 94a06c8ca623df214a99c9f88e3cf8ab474a2292..51dd26d0ca0b540c9b6523c66337f5aa0a96fa52 100644
--- a/modelling/pymod/_denovo.py
+++ b/modelling/pymod/_denovo.py
@@ -8,6 +8,7 @@ def GenerateDeNovoTrajectories(sequence,
                                psipred_prediction = None,
                                fragment_handler = None,
                                scorer = None,
+                               scorer_env = None,
                                scoring_weights = None):
     '''Example de novo modelling pipeline based on Fragment sampling and
     backbone scoring. Take this as a starting point for more advanced
@@ -47,6 +48,10 @@ def GenerateDeNovoTrajectories(sequence,
                         torsion and pairwise 
     :type scorer:       :class:`promod3.scoring.BackboneOverallScorer`
 
+    :param scorer_env:  The scoring env that relates to **scorer**
+                        This environment will be changed! 
+    :type scorer_env:   :class:`promod3.scoring.BackboneScoreEnv`
+
     :param scoring_weights: Linear weights for different scores. If not provided,
                             the output of ScoringWeights.GetWeights() is used.
                             Please note, that the weights must be consistent
@@ -71,6 +76,9 @@ def GenerateDeNovoTrajectories(sequence,
             err = "psipred_prediction must be consistent with the input sequence!"
             raise RuntimeError(err)
 
+    if scorer != None and scorer_env == None:
+      raise RuntimeError("Must provide an environment when you provide a scorer!")
+
     if fragment_handler == None:
         # we first have to build our own handler
         fragment_handler = modelling.FraggerHandle(sequence, 
@@ -104,7 +112,8 @@ def GenerateDeNovoTrajectories(sequence,
     mc_sampler = FragmentSampler(sequence, fragger_list, 
                                  init_fragments = 5)
     mc_closer = DeNovoCloser()
-    mc_scorer = LinearScorer(scorer, 1, 0, scoring_weights)
+    mc_scorer = LinearScorer(scorer, scorer_env, 1, len(sequence), 0, 
+                             scoring_weights)
     mc_cooler = ExponentialCooler(start_temperature,
                                   cooling_interval,
                                   cooling_factor)
diff --git a/modelling/pymod/_pipeline.py b/modelling/pymod/_pipeline.py
index 6f149369b31259b54dada119733bac167d7da50f..fdea48505c30f4bb49832cd1182c89babe04acd0 100644
--- a/modelling/pymod/_pipeline.py
+++ b/modelling/pymod/_pipeline.py
@@ -386,7 +386,9 @@ def CheckFinalModel(mhandle):
     ost.PopVerbosityLevel()
     # set bool props in model-residues
     atoms = [e.GetFirstAtom() for e in clash_info.GetClashList()]\
+          + [e.GetSecondAtom() for e in clash_info.GetClashList()]\
           + [e.GetFirstAtom() for e in stereo_info.GetBondViolationList()]\
+          + [e.GetSecondAtom() for e in stereo_info.GetBondViolationList()]\
           + [e.GetSecondAtom() for e in stereo_info.GetAngleViolationList()]
     for atomui in atoms:
         res = model_src.FindResidue(atomui.GetChainName(), atomui.GetResNum())
diff --git a/modelling/pymod/_reconstruct_sidechains.py b/modelling/pymod/_reconstruct_sidechains.py
index 26d31567bb76a95dd5703e3da840a77b937e70f5..cc465d832149d465348823cbfc67db6386235b93 100644
--- a/modelling/pymod/_reconstruct_sidechains.py
+++ b/modelling/pymod/_reconstruct_sidechains.py
@@ -1,5 +1,6 @@
 from ost import geom, mol, conop
 from promod3 import core, sidechain
+import traceback
 
 ###############################################################################
 # helper functions
@@ -10,7 +11,6 @@ def _GetRotamerIDs(res_list):
         rot_id = sidechain.TLCToRotID(r.GetName())
         if rot_id == sidechain.XXX:
             continue # no idea what it is, so we stick with ALA 
-                     # => don't model sidechain
         rotamer_ids[i] = rot_id
     return rotamer_ids
 
@@ -105,12 +105,11 @@ def _AddLigandFrameResidues(frame_residues, ent_lig, rotamer_constructor, offset
                     fr1 = rotamer_constructor.ConstructBackboneFrameResidue(\
                               res.handle, rot_id, res_idx,
                               phi, n_ter, c_ter)
-                    if rot_id != sidechain.ALA and rot_id != sidechain.GLY:
-                        fr2 = rotamer_constructor.ConstructSidechainFrameResidue(\
-                                  res.handle, rot_id, res_idx)
-                        frame_residues.extend([fr1,fr2])
-                    else:
-                        frame_residues.append(fr1)
+
+                    fr2 = rotamer_constructor.ConstructSidechainFrameResidue(\
+                              res.handle, rot_id, res_idx)
+
+                    frame_residues.extend([fr1,fr2])
                 except:
                     pass   # ignore peptide treatment and treat below
                 else:
@@ -148,9 +147,6 @@ def _AddSidechainFrameResidues(frame_residues, incomplete_sidechains,
                 cystein_indices.append(i)
                 continue
 
-            if rotamer_ids[i] == sidechain.ALA or rotamer_ids[i] == sidechain.GLY:
-                continue # no sidechain to model
-
             try:
                 frame_residue = rotamer_constructor.ConstructSidechainFrameResidue(\
                                     r.handle, rotamer_ids[i], i)
@@ -166,9 +162,6 @@ def _AddSidechainFrameResidues(frame_residues, incomplete_sidechains,
                 cystein_indices.append(i)
                 continue
 
-            if rotamer_ids[i] == sidechain.ALA or rotamer_ids[i] == sidechain.GLY:
-                continue # no sidechain to model
-
             incomplete_sidechains.append(i)
 
 def _AddCysteinFrameResidues(frame_residues, incomplete_sidechains,
@@ -231,7 +224,7 @@ def _GetRotamerGroups(res_list, rot_ids, indices, rot_lib, rot_constructor,
                       phi_angles, psi_angles, use_frm, bbdep, frame_residues):
     '''Get list of rotamer groups from subset of res_list.
     Residues are chosen as res_list[i] for i in indices and only if a rotamer
-    group can be created (e.g. no ALA, GLY).
+    group can be created.
     Rotamer groups are filtered to keep only best ones (given frame).
     Returns list of rotamer groups and list of res. indices they belong to.
     '''
@@ -249,9 +242,6 @@ def _GetRotamerGroups(res_list, rot_ids, indices, rot_lib, rot_constructor,
         # get rotamer ID
         r = res_list[i]
         rot_id = rot_ids[i]
-        
-        if rot_id == sidechain.ALA or rot_id == sidechain.GLY:
-            continue
 
         if rot_id == sidechain.CYS:
             rot_id = sidechain.CYH
@@ -442,7 +432,7 @@ def ReconstructSidechains(ent, keep_sidechains=False, build_disulfids=True,
     if type(rotamer_library) is sidechain.BBDepRotamerLib:
         bbdep = True
 
-    rotamer_constructor = sidechain.SCWRLRotamerConstructor()
+    rotamer_constructor = sidechain.SCWRLRotamerConstructor(False)
     
     # take out ligand chain and any non-peptides
     prot = ent.Select("peptide=true and cname!='_'")
diff --git a/modelling/pymod/export_loop_candidate.cc b/modelling/pymod/export_loop_candidate.cc
index 3ef94b937e1d04c803c0b87c1edac864dd69e1a5..7bb657db9d310ff2319217e054fa184b6f2df44d 100644
--- a/modelling/pymod/export_loop_candidate.cc
+++ b/modelling/pymod/export_loop_candidate.cc
@@ -133,21 +133,40 @@ boost::python::list WrapGetClusteredCandidates(LoopCandidatesPtr p,
   return return_list;
 }
 
+void WrapCalculateBackboneScoresMH(LoopCandidatesPtr p,
+                                   ScoreContainer& score_container,
+                                   const ModellingHandle& mhandle,
+                                   uint start_resnum, uint chain_idx) {
+  p->CalculateBackboneScores(score_container, mhandle, start_resnum, chain_idx);
+}
+void WrapCalculateBackboneScoresMH_K(LoopCandidatesPtr p,
+                                     ScoreContainer& score_container,
+                                     const ModellingHandle& mhandle,
+                                     const boost::python::list& keys,
+                                     uint start_resnum, uint chain_idx) {
+  std::vector<String> v_keys;
+  core::ConvertListToVector(keys, v_keys);
+  p->CalculateBackboneScores(score_container, mhandle, v_keys, start_resnum,
+                             chain_idx);
+}
 void WrapCalculateBackboneScores(LoopCandidatesPtr p,
                                  ScoreContainer& score_container,
                                  scoring::BackboneOverallScorerPtr scorer,
+                                 scoring::BackboneScoreEnvPtr scorer_env,
                                  uint start_resnum, uint chain_idx) {
-  p->CalculateBackboneScores(score_container, scorer, start_resnum, chain_idx);
+  p->CalculateBackboneScores(score_container, scorer, scorer_env, start_resnum, 
+                             chain_idx);
 }
 void WrapCalculateBackboneScoresK(LoopCandidatesPtr p,
                                   ScoreContainer& score_container,
                                   scoring::BackboneOverallScorerPtr scorer,
+                                  scoring::BackboneScoreEnvPtr scorer_env,
                                   const boost::python::list& keys,
                                   uint start_resnum, uint chain_idx) {
   std::vector<String> v_keys;
   core::ConvertListToVector(keys, v_keys);
-  p->CalculateBackboneScores(score_container, scorer, v_keys, start_resnum,
-                             chain_idx);
+  p->CalculateBackboneScores(score_container, scorer, scorer_env, v_keys, 
+                             start_resnum, chain_idx);
 }
 void WrapCalculateAllAtomScores(LoopCandidatesPtr p,
                                 ScoreContainer& score_container,
@@ -267,12 +286,18 @@ void export_loop_candidate() {
     .def("ApplyKIC", &WrapApplyKIC,
          (arg("n_stem"), arg("c_stem"), arg("pivot_one"), arg("pivot_two"),
           arg("pivot_three")))
+    .def("CalculateBackboneScores", &WrapCalculateBackboneScoresMH,
+         (arg("score_container"), arg("mhandle"),
+          arg("start_resnum"), arg("chain_idx")=0))
+    .def("CalculateBackboneScores", &WrapCalculateBackboneScoresMH_K,
+         (arg("score_container"), arg("mhandle"), arg("keys"),
+          arg("start_resnum"), arg("chain_idx")=0))
     .def("CalculateBackboneScores", &WrapCalculateBackboneScores,
-         (arg("score_container"), arg("scorer"),
+         (arg("score_container"), arg("scorer"), arg("scorer_env"),
           arg("start_resnum"), arg("chain_idx")=0))
     .def("CalculateBackboneScores", &WrapCalculateBackboneScoresK,
-         (arg("score_container"), arg("scorer"), arg("keys"),
-          arg("start_resnum"), arg("chain_idx")=0))
+         (arg("score_container"), arg("scorer"), arg("scorer_env"), 
+          arg("keys"), arg("start_resnum"), arg("chain_idx")=0))
     .def("CalculateAllAtomScores", &WrapCalculateAllAtomScores,
          (arg("score_container"), arg("mhandle"),
           arg("start_resnum"), arg("chain_idx")=0))
diff --git a/modelling/pymod/export_monte_carlo.cc b/modelling/pymod/export_monte_carlo.cc
index 84d614fd599d31afc8f58e7cfda948e06168aae6..7d296ccf9550ec7db9ebf53c06aa4e4792370e0f 100644
--- a/modelling/pymod/export_monte_carlo.cc
+++ b/modelling/pymod/export_monte_carlo.cc
@@ -225,12 +225,14 @@ CCDCloserPtr CCDCloserWrapperList(const ost::mol::ResidueHandle& n_stem,
 }
 
 LinearScorerPtr LinearScorerInitWrapper(scoring::BackboneOverallScorerPtr scorer,
-                                        uint start_resnum, uint chain_index,
+                                        scoring::BackboneScoreEnvPtr scorer_env,
+                                        uint start_resnum, uint num_residues,
+                                        uint chain_index,
                                         const boost::python::dict& weights) {
   std::map<String,Real> m_weights;
   core::ConvertDictToMap(weights, m_weights);
-  LinearScorerPtr p(new LinearScorer(scorer, start_resnum, chain_index,
-                                     m_weights));
+  LinearScorerPtr p(new LinearScorer(scorer, scorer_env, start_resnum, 
+                                     num_residues, chain_index, m_weights));
   return p;
 }
 
diff --git a/modelling/pymod/export_scoring_weights.cc b/modelling/pymod/export_scoring_weights.cc
index f6243ef7a97ccc9fd1ae835b6dc6f2641e8e98d3..11e3c18eb54a48f5162e88bab3c0286d4f8aca55 100644
--- a/modelling/pymod/export_scoring_weights.cc
+++ b/modelling/pymod/export_scoring_weights.cc
@@ -11,28 +11,40 @@ using namespace boost::python;
 // WRAPPERS
 namespace {
 
-boost::python::dict WrapGetWeights(bool with_db, bool with_aa) {
+boost::python::dict WrapGetWeights(bool with_db, bool with_aa,
+                                   bool length_dependent, int loop_length) {
   boost::python::dict result;
   core::ConvertMapToDict(
-          ScoringWeights::GetInstance().GetWeights(with_db, with_aa), result);
+    ScoringWeights::GetInstance().GetWeights(with_db, with_aa, 
+                                             length_dependent, 
+                                             loop_length), result);
   return result;
 }
-void WrapSetWeights(bool with_db, bool with_aa, const boost::python::dict& wd) {
+void WrapSetWeights(bool with_db, bool with_aa, const boost::python::dict& wd,
+                    bool length_dependent, int loop_length) {
   std::map<String, Real> weights;
   core::ConvertDictToMap(wd, weights);
-  ScoringWeights::GetInstance().SetWeights(with_db, with_aa, weights);
+  ScoringWeights::GetInstance().SetWeights(with_db, with_aa, weights,
+                                           length_dependent, loop_length);
 }
-boost::python::dict WrapGetBackboneWeights(bool with_db, bool with_aa) {
+boost::python::dict WrapGetBackboneWeights(bool with_db, bool with_aa,
+                                           bool length_dependent,
+                                           int loop_length) {
   boost::python::dict result;
   core::ConvertMapToDict(
-          ScoringWeights::GetInstance().GetBackboneWeights(with_db, with_aa),
+          ScoringWeights::GetInstance().GetBackboneWeights(with_db, with_aa,
+                                                           length_dependent, 
+                                                           loop_length),
           result);
   return result;
 }
-boost::python::dict WrapGetAllAtomWeights(bool with_db) {
+boost::python::dict WrapGetAllAtomWeights(bool with_db, bool length_dependent,
+                                          int loop_length) {
   boost::python::dict result;
   core::ConvertMapToDict(
-          ScoringWeights::GetInstance().GetAllAtomWeights(with_db), result);
+          ScoringWeights::GetInstance().GetAllAtomWeights(with_db,
+                                                          length_dependent,
+                                                          loop_length), result);
   return result;
 }
 
@@ -85,15 +97,20 @@ void export_scoring_weights() {
 
   class_<ScoringWeights>("ScoringWeights", no_init)
     .def("GetWeights", WrapGetWeights,
-         (arg("with_db")=false, arg("with_aa")=false))
+         (arg("with_db")=false, arg("with_aa")=false,
+          arg("length_dependent")=false, arg("loop_length")=-1))
     .staticmethod("GetWeights")
     .def("SetWeights", WrapSetWeights,
-         (arg("with_db"), arg("with_aa"), arg("weights")))
+         (arg("with_db"), arg("with_aa"), arg("weights"),
+          arg("length_dependent")=false, arg("loop_length")=-1))
     .staticmethod("SetWeights")
     .def("GetBackboneWeights", WrapGetBackboneWeights,
-         (arg("with_db")=false, arg("with_aa")=false))
+         (arg("with_db")=false, arg("with_aa")=false,
+          arg("length_dependent")=false, arg("loop_length")=-1))
     .staticmethod("GetBackboneWeights")
-    .def("GetAllAtomWeights", WrapGetAllAtomWeights, (arg("with_db")=false))
+    .def("GetAllAtomWeights", WrapGetAllAtomWeights, 
+         (arg("with_db")=false, arg("length_dependent")=false, 
+          arg("loop_length")=-1))
     .staticmethod("GetAllAtomWeights")
     .def("GetStemRMSDsKey", WrapGetStemRMSDsKey)
     .staticmethod("GetStemRMSDsKey")
diff --git a/modelling/src/all_atom_relaxer.cc b/modelling/src/all_atom_relaxer.cc
index 3f99edbf13851294773042c9fc4d4b98c388efe5..9fe1dc51136b70c71d5b4945978375c06f00d0e5 100644
--- a/modelling/src/all_atom_relaxer.cc
+++ b/modelling/src/all_atom_relaxer.cc
@@ -1,6 +1,8 @@
 #include <promod3/modelling/all_atom_relaxer.hh>
 #include <promod3/loop/hydrogen_constructor.hh>
 #include <promod3/core/runtime_profiling.hh>
+#include <exception>
+#include <limits>
 
 namespace promod3 { namespace modelling {
 
@@ -52,7 +54,14 @@ Real AllAtomRelaxer::Run(ScRecDataPtr sc_data, int steps, Real stop_criterion) {
 
   // run it
   ost::mol::mm::SimulationPtr sim = mm_system_creator_->GetSimulation();
-  sim->ApplySD(stop_criterion, steps);
+
+  // guard against OpenMM error that is thrown when positions become NaN
+  // => typically when you particles are (almost) on top of each other
+  try {
+    sim->ApplySD(stop_criterion, steps);
+  } catch(std::exception& e) {
+    return std::numeric_limits<Real>::infinity();
+  }
 
   // update positions in sc_data
   loop::AllAtomPositionsPtr out_pos = sc_data_->env_pos->all_pos;
diff --git a/modelling/src/backbone_relaxer.cc b/modelling/src/backbone_relaxer.cc
index 9db1825f8507f62ac3fd9dfc82b3ab8c67fd0011..ded52f6a222d2cf2135de02027563fdc94ce9a13 100644
--- a/modelling/src/backbone_relaxer.cc
+++ b/modelling/src/backbone_relaxer.cc
@@ -6,6 +6,8 @@
 #include <ost/mol/mm/system_creator.hh>
 #include <ost/mol/mm/steep.hh>
 #include <set>
+#include <exception>
+#include <limits>
 
 
 namespace{
@@ -307,7 +309,15 @@ Real BackboneRelaxer::Run(loop::BackboneList& bb_list, int steps,
   if (!simulation_) this->Init();
 
   this->SetSimulationPositions(bb_list);
-  simulation_->ApplySD(stop_criterion, steps);
+
+  // guard against OpenMM error that is thrown when positions become NaN
+  // => typicall when you particles are (almost) on top of each other
+  try {
+    simulation_->ApplySD(stop_criterion, steps);
+  } catch(std::exception& e) {
+    return std::numeric_limits<Real>::infinity();
+  }
+
   this->ExtractSimulationPositions(bb_list);
 
   return simulation_->GetPotentialEnergy();
diff --git a/modelling/src/kic.cc b/modelling/src/kic.cc
index a3ecaeca05bd5c475dafb9cda1fd87d5ab2a1145..fb7005aedd659dd59c21dbb7513657945e62726a 100644
--- a/modelling/src/kic.cc
+++ b/modelling/src/kic.cc
@@ -1,4 +1,5 @@
 #include <promod3/modelling/kic.hh>
+#include <promod3/core/eigen_types.hh>
 #include <promod3/core/message.hh>
 #include <promod3/core/runtime_profiling.hh>
 #include <Eigen/Dense>
@@ -23,10 +24,6 @@ struct KICParameters {
   geom::Mat4 F2_initial_transform;
 };
 
-typedef Eigen::Matrix<double,8,8> EMat8;
-typedef Eigen::Matrix<double,16,16> EMat16;
-typedef Eigen::Matrix<double,16,3> EMat16_3;
-
 void BuildFragmentBase(const geom::Vec3& pos1, const geom::Vec3& pos2, const geom::Vec3& pos3, geom::Mat3& base){
 
   geom::Vec3 a,b,c;
@@ -133,7 +130,8 @@ bool FillKICParameters(const promod3::loop::BackboneList& bb_list,
   return true;
 }
 
-void FillDixonMatrices(KICParameters& parameters,EMat8& R0, EMat8& R1, EMat8& R2){
+void FillDixonMatrices(KICParameters& parameters, promod3::core::EMat8& R0, 
+                       promod3::core::EMat8& R1, promod3::core::EMat8& R2){
   Real p[3][3][3];
   Real c_theta[3];   //c:cosine, s:sine, naming more or less as in the Coutsias paper
   Real s_delta[3];
@@ -202,9 +200,9 @@ void FillDixonMatrices(KICParameters& parameters,EMat8& R0, EMat8& R1, EMat8& R2
     }
   }
 
-  EMat8* RArray[3] = {&R0, &R1, &R2};
+  promod3::core::EMat8* RArray[3] = {&R0, &R1, &R2};
   for(int i = 0; i < 3; ++i){
-    EMat8& Ri = *RArray[i];
+    promod3::core::EMat8& Ri = *RArray[i];
 
     Ri(0,1) = A[0][i]; Ri(0,2) = A[1][i]; Ri(0,3) = A[2][i];
     Ri(0,5) = B[0][i]; Ri(0,6) = B[1][i]; Ri(0,7) = B[2][i];
@@ -228,9 +226,11 @@ void FillDixonMatrices(KICParameters& parameters,EMat8& R0, EMat8& R1, EMat8& R2
   }
 }
 
-void ResolveEigenProblem(EMat8& R0, EMat8& R1, EMat8& R2, std::vector<std::vector<Real> >& taus){
-  EMat16 E0 = EMat16::Zero();
-  EMat16 E1 = EMat16::Zero();
+void ResolveEigenProblem(promod3::core::EMat8& R0, promod3::core::EMat8& R1, 
+                         promod3::core::EMat8& R2, 
+                         std::vector<std::vector<Real> >& taus){
+  promod3::core::EMat16 E0 = promod3::core::EMat16::Zero();
+  promod3::core::EMat16 E1 = promod3::core::EMat16::Zero();
 
   E0.topRightCorner(8,8).setIdentity();  
   E0.bottomLeftCorner(8,8) = -R0;
@@ -239,7 +239,7 @@ void ResolveEigenProblem(EMat8& R0, EMat8& R1, EMat8& R2, std::vector<std::vecto
   E1.topLeftCorner(8,8).setIdentity();
   E1.bottomRightCorner(8,8) = R2;
 
-  typedef Eigen::GeneralizedEigenSolver<EMat16> EigenSolver;
+  typedef Eigen::GeneralizedEigenSolver<promod3::core::EMat16> EigenSolver;
   EigenSolver solver(E0, E1, true);
   const EigenSolver::ComplexVectorType& alpha = solver.alphas();
   const EigenSolver::VectorType& beta = solver.betas();
@@ -417,9 +417,9 @@ void KIC::Close(const loop::BackboneList& bb_list, uint pivot_one,
 
   KICParameters parameters;
   // initialize Dixon Matrices directly with zeros
-  EMat8 R0 = EMat8::Zero();
-  EMat8 R1 = EMat8::Zero();
-  EMat8 R2 = EMat8::Zero();
+  promod3::core::EMat8 R0 = promod3::core::EMat8::Zero();
+  promod3::core::EMat8 R1 = promod3::core::EMat8::Zero();
+  promod3::core::EMat8 R2 = promod3::core::EMat8::Zero();
   // solutions will be stored in here
   std::vector<std::vector<Real> > taus;
   if (!FillKICParameters(bb_list, n_stem_, c_stem_, pivot_one, pivot_two,
diff --git a/modelling/src/loop_candidate.cc b/modelling/src/loop_candidate.cc
index 82fda8923c1cab9c909f45903756889f6de2f577..5aa7cccee59836bc3589f851f741bf1e158c6a4e 100644
--- a/modelling/src/loop_candidate.cc
+++ b/modelling/src/loop_candidate.cc
@@ -412,25 +412,64 @@ LoopCandidatesPtr LoopCandidates::GetLargestCluster(Real max_dist,
   }
 }
 
+void LoopCandidates::CalculateBackboneScores(
+                                      ScoreContainer& score_container,
+                                      scoring::BackboneOverallScorerPtr scorer,
+                                      scoring::BackboneScoreEnvPtr scorer_env,
+                                      const std::vector<String>& keys,
+                                      uint start_resnum, uint chain_idx) const {
+
+  uint N = candidates_.size();
+  uint L = sequence_.size();
+
+  scorer_env->Stash(start_resnum, L, chain_idx);
+  
+  for (uint i = 0; i < keys.size(); ++i) {
+    std::vector<Real> scores(N);
+    for(uint j = 0; j < N; ++j) {
+      scorer_env->SetEnvironment(candidates_[j], start_resnum, chain_idx);
+      scores[j] = scorer->Calculate(keys[i], start_resnum, L, chain_idx);
+    }
+    score_container.Set(keys[i], scores);
+  }
+  scorer_env->Pop();
+}
+
+void LoopCandidates::CalculateBackboneScores(
+                                      ScoreContainer& score_container,
+                                      scoring::BackboneOverallScorerPtr scorer,
+                                      scoring::BackboneScoreEnvPtr scorer_env,
+                                      uint start_resnum, uint chain_idx) const {
+
+  const std::vector<String>&
+  keys = ScoringWeights::GetInstance().GetBackboneScoringKeys();
+  CalculateBackboneScores(score_container, scorer, scorer_env, keys, 
+                          start_resnum, chain_idx);
+}
+
 void LoopCandidates::CalculateBackboneScores(
                     ScoreContainer& score_container,
-                    scoring::BackboneOverallScorerPtr scorer,
+                    const ModellingHandle& mhandle,
                     uint start_resnum, uint chain_idx) const {
+
   const std::vector<String>&
   keys = ScoringWeights::GetInstance().GetBackboneScoringKeys();
-  CalculateBackboneScores(score_container, scorer, keys, start_resnum,
+  scoring::BackboneOverallScorerPtr scorer = mhandle.backbone_scorer;
+  scoring::BackboneScoreEnvPtr env = mhandle.backbone_scorer_env;
+  CalculateBackboneScores(score_container, scorer, env, keys, start_resnum,
                           chain_idx);
 }
+
 void LoopCandidates::CalculateBackboneScores(
                     ScoreContainer& score_container,
-                    scoring::BackboneOverallScorerPtr scorer,
+                    const ModellingHandle& mhandle,
                     const std::vector<String>& keys,
                     uint start_resnum, uint chain_idx) const {
-  for (uint i = 0; i < keys.size(); ++i) {
-    std::vector<Real> scores;
-    scores = scorer->Calculate(keys[i], candidates_, start_resnum, chain_idx);
-    score_container.Set(keys[i], scores);
-  }
+
+  scoring::BackboneOverallScorerPtr scorer = mhandle.backbone_scorer;
+  scoring::BackboneScoreEnvPtr env = mhandle.backbone_scorer_env;
+  CalculateBackboneScores(score_container, scorer, env, keys, start_resnum,
+                          chain_idx);
 }
 
 void LoopCandidates::CalculateAllAtomScores(
diff --git a/modelling/src/loop_candidate.hh b/modelling/src/loop_candidate.hh
index 39b47b8a53663ab18dd47b177e813849ca075737..0b30ecf4bf2b51c2422ca0b26ec7607d805be3e0 100644
--- a/modelling/src/loop_candidate.hh
+++ b/modelling/src/loop_candidate.hh
@@ -89,9 +89,18 @@ public:
   
   void CalculateBackboneScores(ScoreContainer& score_container,
                                scoring::BackboneOverallScorerPtr scorer,
+                               scoring::BackboneScoreEnvPtr scorer_env,
                                uint start_resnum, uint chain_idx = 0) const;
   void CalculateBackboneScores(ScoreContainer& score_container,
                                scoring::BackboneOverallScorerPtr scorer,
+                               scoring::BackboneScoreEnvPtr scorer_env,
+                               const std::vector<String>& keys,
+                               uint start_resnum, uint chain_idx = 0) const;
+  void CalculateBackboneScores(ScoreContainer& score_container,
+                               const ModellingHandle& mhandle,
+                               uint start_resnum, uint chain_idx = 0) const;
+  void CalculateBackboneScores(ScoreContainer& score_container,
+                               const ModellingHandle& mhandle,
                                const std::vector<String>& keys,
                                uint start_resnum, uint chain_idx = 0) const;
   void CalculateAllAtomScores(ScoreContainer& score_container,
diff --git a/modelling/src/monte_carlo_scorer.cc b/modelling/src/monte_carlo_scorer.cc
index f8dd0ac6cfe01f7e72a1aedbcdbb1c3f84132dd4..ba536e7d772fc8b8d506c8375269e4d9fb528da1 100644
--- a/modelling/src/monte_carlo_scorer.cc
+++ b/modelling/src/monte_carlo_scorer.cc
@@ -5,21 +5,34 @@ namespace promod3 { namespace modelling {
 MonteCarloScorer::~MonteCarloScorer() { }
 
 LinearScorer::LinearScorer(scoring::BackboneOverallScorerPtr scorer,
-                           uint start_resnum, uint chain_index,
-                           const std::map<String,Real>& weights)
-                           : scorer_(scorer)
-                           , chain_index_(chain_index)
-                           , start_resnum_(start_resnum)
+                           scoring::BackboneScoreEnvPtr scorer_env,
+                           uint start_resnum, uint num_residues, 
+                           uint chain_index, 
+                           const std::map<String,Real>& weights): 
+                           scorer_(scorer),
+                           scorer_env_(scorer_env),
+                           start_resnum_(start_resnum),
+                           num_residues_(num_residues),
+                           chain_index_(chain_index)
 {
   w_scorers_ = scorer->GetWeightedScorers(weights);
 }
 
 Real LinearScorer::GetScore(const loop::BackboneList& positions) {
-  Real score = 0;
+
+  if(positions.size() != num_residues_) {
+    throw promod3::Error("Input BackboneList is inconsistent with loop length "
+                         "that you defined at initialization of the "
+                         "LinearScorer");
+  }
+
+  scorer_env_->SetEnvironment(positions, start_resnum_, chain_index_);
+  Real score = 0.0;
   for (uint i = 0; i < w_scorers_.size(); ++i) {
     const Real weight = w_scorers_[i].first;
     scoring::BackboneScorerPtr one_scorer = w_scorers_[i].second;
-    score += weight * one_scorer->CalculateScore(positions, start_resnum_,
+    score += weight * one_scorer->CalculateScore(start_resnum_,
+                                                 num_residues_,
                                                  chain_index_);
   }
   return score;
diff --git a/modelling/src/monte_carlo_scorer.hh b/modelling/src/monte_carlo_scorer.hh
index 6bd3e47b34675df0578affed4ccc289ea294a47b..a6707b359e0a138f296120815e524bfd9f4488b8 100644
--- a/modelling/src/monte_carlo_scorer.hh
+++ b/modelling/src/monte_carlo_scorer.hh
@@ -25,15 +25,24 @@ public:
 class LinearScorer : public MonteCarloScorer {
 
 public:
-  LinearScorer(scoring::BackboneOverallScorerPtr scorer, uint start_resnum,
+  LinearScorer(scoring::BackboneOverallScorerPtr scorer, 
+               scoring::BackboneScoreEnvPtr scorer_env,
+               uint start_resnum, uint num_residues,
                uint chain_index, const std::map<String,Real>& weights);
 
   Real GetScore(const loop::BackboneList& positions);
 
+  void StashScoringEnv() { scorer_env_->Stash(start_resnum_, num_residues_, 
+                                              chain_index_); }
+
+  void PopScoringEnv() { scorer_env_->Pop(); }
+
 private:
   scoring::BackboneOverallScorerPtr scorer_;
-  uint chain_index_;
+  scoring::BackboneScoreEnvPtr scorer_env_;
   uint start_resnum_;
+  uint num_residues_;
+  uint chain_index_;
   std::vector<std::pair<Real, scoring::BackboneScorerPtr> > w_scorers_;
 };
 
diff --git a/modelling/src/rigid_blocks.cc b/modelling/src/rigid_blocks.cc
index ef24abeb7a846f4039e1fd5331a5fc13b954691b..df46c90fc4195cf3c47b6f4bb09a2b9ec5301e7f 100644
--- a/modelling/src/rigid_blocks.cc
+++ b/modelling/src/rigid_blocks.cc
@@ -30,7 +30,7 @@ inline Real IndexListSimilarity(const std::vector<uint>& v1,
     sum += complete_v1[i] * complete_v2[i]; 
   }
 
-  return static_cast<Real>(sum) / std::max(v1.size(),v2.size());
+  return static_cast<Real>(sum) / std::min(v1.size(),v2.size());
 }
 
 void DoIt(promod3::core::EMatX3& pos_mat_one, 
@@ -76,18 +76,15 @@ void DoIt(promod3::core::EMatX3& pos_mat_one,
 
     for(uint j = 1; j < clusters[i].size(); ++j){
 
-      uint size = std::max(current_indices.size(),
-                           initial_indices[clusters[i][j]].size());
+      std::vector<uint> union_result;
 
-      std::vector<uint> intersection_result(size, 0);
+      std::set_union(current_indices.begin(),
+                     current_indices.end(),
+                     initial_indices[clusters[i][j]].begin(),
+                     initial_indices[clusters[i][j]].end(),
+                     std::back_inserter(union_result));
 
-      it = std::set_intersection(current_indices.begin(),
-                                 current_indices.end(),
-                                 initial_indices[clusters[i][j]].begin(),
-                                 initial_indices[clusters[i][j]].end(),
-                                 intersection_result.begin());
-
-      current_indices.assign(intersection_result.begin(),it);
+      current_indices = union_result;
     }
     indices.push_back(current_indices);
   }
diff --git a/modelling/src/scoring_weights.cc b/modelling/src/scoring_weights.cc
index d4c58e122f32b378b2deba056c1b7214d2d35cc4..ac8ad4f8fd8408a604842f5c54744ed6a1e50f05 100644
--- a/modelling/src/scoring_weights.cc
+++ b/modelling/src/scoring_weights.cc
@@ -30,50 +30,366 @@ ScoringWeights::ScoringWeights() {
 
   // weights trained with scripts in extras/scoring_weight_training
   // BB_DB_AANR
-  weights_bb_db_aa_["aa_clash"] = 0.16219;
-  weights_bb_db_aa_["aa_interaction"] = 21.7161;
-  weights_bb_db_aa_["aa_packing"] = 0.914035;
-  weights_bb_db_aa_["cb_packing"] = 1.19015;
-  weights_bb_db_aa_["cbeta"] = 3.12139;
-  weights_bb_db_aa_["clash"] = 0.00675967;
+  weights_bb_db_aa_["aa_clash"] = 0.0171401;
+  weights_bb_db_aa_["aa_interaction"] = 0.00256632;
+  weights_bb_db_aa_["aa_packing"] = 0.0383423;
+  weights_bb_db_aa_["cb_packing"] = 1.15539;
+  weights_bb_db_aa_["cbeta"] = 0.262183;
+  weights_bb_db_aa_["clash"] = 0.0134694;
   weights_bb_db_aa_["hbond"] = 1;
+  weights_bb_db_aa_["reduced"] = 0.201682;
+  weights_bb_db_aa_["seq_prof_score"] = -0.338147;
+  weights_bb_db_aa_["stem_rmsd"] = 0.0814165;
+  weights_bb_db_aa_["str_prof_score"] = -1.75976;
+  weights_bb_db_aa_["torsion"] = 0.809906;
   weights_bb_db_aa_["pairwise"] = -0.7;
-  weights_bb_db_aa_["reduced"] = 1.83614;
-  weights_bb_db_aa_["seq_prof_score"] = -0.325626;
-  weights_bb_db_aa_["stem_rmsd"] = 0.0832467;
-  weights_bb_db_aa_["str_prof_score"] = -1.5734;
-  weights_bb_db_aa_["torsion"] = 0.761249;
   // BB_DB
-  weights_bb_db_["cb_packing"] = 0.791056;
-  weights_bb_db_["cbeta"] = 3.40341;
-  weights_bb_db_["clash"] = 0.0320885;
+  weights_bb_db_["cb_packing"] = 0.843167;
+  weights_bb_db_["cbeta"] = 0.371329;
+  weights_bb_db_["clash"] = 0.0319755;
   weights_bb_db_["hbond"] = 1;
+  weights_bb_db_["reduced"] = 0.229909;
+  weights_bb_db_["seq_prof_score"] = -0.313212;
+  weights_bb_db_["stem_rmsd"] = 0.0580353;
+  weights_bb_db_["str_prof_score"] = -1.32155;
+  weights_bb_db_["torsion"] = 0.602527;
   weights_bb_db_["pairwise"] = -0.7;
-  weights_bb_db_["reduced"] = 1.95437;
-  weights_bb_db_["seq_prof_score"] = -0.264727;
-  weights_bb_db_["stem_rmsd"] = 0.0598802;
-  weights_bb_db_["str_prof_score"] = -0.941646;
-  weights_bb_db_["torsion"] = 0.50904;
   // BB_AANR
-  weights_bb_aa_["aa_clash"] = 0.107664;
-  weights_bb_aa_["aa_interaction"] = 26.4636;
-  weights_bb_aa_["aa_packing"] = 0.860152;
-  weights_bb_aa_["cb_packing"] = 1.25946;
-  weights_bb_aa_["cbeta"] = 2.67089;
-  weights_bb_aa_["clash"] = 0.0147412;
+  weights_bb_aa_["aa_clash"] = 0.0268085;
+  weights_bb_aa_["aa_interaction"] = 0.00464609;
+  weights_bb_aa_["aa_packing"] = 0.0890843;
+  weights_bb_aa_["cb_packing"] = 1.13975;
+  weights_bb_aa_["cbeta"] = 0.383702;
+  weights_bb_aa_["clash"] = 0.0320327;
   weights_bb_aa_["hbond"] = 1;
+  weights_bb_aa_["reduced"] = 0.229512;
+  weights_bb_aa_["torsion"] = 0.839257;
   weights_bb_aa_["pairwise"] = -0.7;
-  weights_bb_aa_["reduced"] = 1.87516;
-  weights_bb_aa_["torsion"] = 0.707425;
   // BB
-  weights_bb_["cb_packing"] = 0.753716;
-  weights_bb_["cbeta"] = 3.62385;
-  weights_bb_["clash"] = 0.119614;
+  weights_bb_["cb_packing"] = 0.793275;
+  weights_bb_["cbeta"] = 0.500879;
+  weights_bb_["clash"] = 0.0801205;
   weights_bb_["hbond"] = 1;
+  weights_bb_["reduced"] = 0.238478;
+  weights_bb_["torsion"] = 0.729424;
   weights_bb_["pairwise"] = -0.7;
-  weights_bb_["reduced"] = 1.82769;
-  weights_bb_["torsion"] = 0.555789;
 
+
+
+
+  // BB_DB_AANR length dependent
+  std::map<String, Real> weight_map;
+  weight_map["aa_clash"] = 0.0120408;
+  weight_map["aa_interaction"] = 0.0114092;
+  weight_map["aa_packing"] = 0.000125384;
+  weight_map["cb_packing"] = 0.040684;
+  weight_map["cbeta"] = 0.356074;
+  weight_map["clash"] = 0.848652;
+  weight_map["hbond"] = 1;
+  weight_map["reduced"] = 0.0470799;
+  weight_map["seq_prof_score"] = -0.036081;
+  weight_map["stem_rmsd"] = 0.144414;
+  weight_map["str_prof_score"] = -0.302214;
+  weight_map["torsion"] = 0.32667;
+  length_dependent_weights_bb_db_aa_[0] = weight_map;
+  length_dependent_weights_bb_db_aa_[1] = weight_map;
+  length_dependent_weights_bb_db_aa_[2] = weight_map;
+  length_dependent_weights_bb_db_aa_[3] = weight_map;
+  length_dependent_weights_bb_db_aa_[4] = weight_map;
+
+  weight_map["aa_clash"] = 0.0301478;
+  weight_map["aa_interaction"] = 0.00839642;
+  weight_map["aa_packing"] = 0.038416;
+  weight_map["cb_packing"] = 0.250168;
+  weight_map["cbeta"] = 0.1976;
+  weight_map["clash"] = 0.0756704;
+  weight_map["hbond"] = 1;
+  weight_map["reduced"] = 0.135068;
+  weight_map["seq_prof_score"] = -0.111772;
+  weight_map["stem_rmsd"] = 0.0624659;
+  weight_map["str_prof_score"] = -0.856625;
+  weight_map["torsion"] = 0.443652;
+  length_dependent_weights_bb_db_aa_[5] = weight_map;
+  length_dependent_weights_bb_db_aa_[6] = weight_map;
+
+  weight_map["aa_clash"] = 0.0266467;
+  weight_map["aa_interaction"] = 0.00495266;
+  weight_map["aa_packing"] = 0.0570628;
+  weight_map["cb_packing"] = 0.55212;
+  weight_map["cbeta"] = 0.331541;
+  weight_map["clash"] = 0.0341554;
+  weight_map["hbond"] = 1;
+  weight_map["reduced"] = 0.189735;
+  weight_map["seq_prof_score"] = -0.293038;
+  weight_map["stem_rmsd"] = 0.0809159;
+  weight_map["str_prof_score"] = -0.851421;
+  weight_map["torsion"] = 0.548451;
+  length_dependent_weights_bb_db_aa_[7] = weight_map;
+  length_dependent_weights_bb_db_aa_[8] = weight_map;
+
+  weight_map["aa_clash"] = 0.012002;
+  weight_map["aa_interaction"] = 0.00860129;
+  weight_map["aa_packing"] = 0.0903933;
+  weight_map["cb_packing"] = 1.63694;
+  weight_map["cbeta"] = 0.171588;
+  weight_map["clash"] = 4.51029e-05;
+  weight_map["hbond"] = 1;
+  weight_map["reduced"] = 0.299024;
+  weight_map["seq_prof_score"] = -0.368841;
+  weight_map["stem_rmsd"] = 0.103716;
+  weight_map["str_prof_score"] = -2.17521;
+  weight_map["torsion"] = 1.12767;
+  length_dependent_weights_bb_db_aa_[9] = weight_map;
+  length_dependent_weights_bb_db_aa_[10] = weight_map;
+
+  weight_map["aa_clash"] = 0.0025594;
+  weight_map["aa_interaction"] = 0.00290232;
+  weight_map["aa_packing"] = 0.0819373;
+  weight_map["cb_packing"] = 1.52471;
+  weight_map["cbeta"] = 0.274828;
+  weight_map["clash"] = 0.0161732;
+  weight_map["hbond"] = 1;
+  weight_map["reduced"] = 0.124048;
+  weight_map["seq_prof_score"] = -0.407456;
+  weight_map["stem_rmsd"] = 0.074869;
+  weight_map["str_prof_score"] = -2.70179;
+  weight_map["torsion"] = 0.972806;
+  length_dependent_weights_bb_db_aa_[11] = weight_map;
+  length_dependent_weights_bb_db_aa_[12] = weight_map;
+
+  weight_map["aa_clash"] = 0.000384705;
+  weight_map["aa_interaction"] = 0.00239001;
+  weight_map["aa_packing"] = 0.0020213;
+  weight_map["cb_packing"] = 2.16407;
+  weight_map["cbeta"] = 0.288299;
+  weight_map["clash"] = 0.00155468;
+  weight_map["hbond"] = 1;
+  weight_map["reduced"] = 0.238341;
+  weight_map["seq_prof_score"] = -0.1732;
+  weight_map["stem_rmsd"] = 0.0975998;
+  weight_map["str_prof_score"] = -3.22575;
+  weight_map["torsion"] = 1.06902;
+  length_dependent_weights_bb_db_aa_[13] = weight_map;
+  length_dependent_weights_bb_db_aa_[14] = weight_map;
+  length_dependent_weights_bb_db_aa_[-1] = weights_bb_db_aa_;
+
+  // BB_DB length dependent
+  weight_map.clear();
+  weight_map["cb_packing"] = 0.426734;
+  weight_map["cbeta"] = 0.116532;
+  weight_map["clash"] = 0.963033;
+  weight_map["hbond"] = 1;
+  weight_map["reduced"] = 0.173565;
+  weight_map["seq_prof_score"] = -0.0381537;
+  weight_map["stem_rmsd"] = 0.150966;
+  weight_map["str_prof_score"] = -0.219757;
+  weight_map["torsion"] = 0.338468;
+  length_dependent_weights_bb_db_[0] = weight_map;
+  length_dependent_weights_bb_db_[1] = weight_map;
+  length_dependent_weights_bb_db_[2] = weight_map;
+  length_dependent_weights_bb_db_[3] = weight_map;
+  length_dependent_weights_bb_db_[4] = weight_map;
+
+  weight_map["cb_packing"] = 0.102926;
+  weight_map["cbeta"] = 0.32014;
+  weight_map["clash"] = 0.15599;
+  weight_map["hbond"] = 1;
+  weight_map["reduced"] = 0.228402;
+  weight_map["seq_prof_score"] = -0.173496;
+  weight_map["stem_rmsd"] = 0.0571533;
+  weight_map["str_prof_score"] = -0.622599;
+  weight_map["torsion"] = 0.356714;
+  length_dependent_weights_bb_db_[5] = weight_map;
+  length_dependent_weights_bb_db_[6] = weight_map;
+
+  weight_map["cb_packing"] = 0.448069;
+  weight_map["cbeta"] = 0.525517;
+  weight_map["clash"] = 0.0448608;
+  weight_map["hbond"] = 1;
+  weight_map["reduced"] = 0.192292;
+  weight_map["seq_prof_score"] = -0.332023;
+  weight_map["stem_rmsd"] = 0.0882085;
+  weight_map["str_prof_score"] = -0.645988;
+  weight_map["torsion"] = 0.493079;
+  length_dependent_weights_bb_db_[7] = weight_map;
+  length_dependent_weights_bb_db_[8] = weight_map;
+
+  weight_map["cb_packing"] = 1.07076;
+  weight_map["cbeta"] = 0.531162;
+  weight_map["clash"] = 0.079354;
+  weight_map["hbond"] = 1;
+  weight_map["reduced"] = 0.503881;
+  weight_map["seq_prof_score"] = -0.49335;
+  weight_map["stem_rmsd"] = 0.110282;
+  weight_map["str_prof_score"] = -2.06894;
+  weight_map["torsion"] = 0.897905;
+  length_dependent_weights_bb_db_[9] = weight_map;
+  length_dependent_weights_bb_db_[10] = weight_map;
+
+  weight_map["cb_packing"] = 1.99384;
+  weight_map["cbeta"] = 0.713817;
+  weight_map["clash"] = 0.046714;
+  weight_map["hbond"] = 1;
+  weight_map["reduced"] = 0.500903;
+  weight_map["seq_prof_score"] = -0.761715;
+  weight_map["stem_rmsd"] = 0.102398;
+  weight_map["str_prof_score"] = -2.71036;
+  weight_map["torsion"] = 1.03345;
+  length_dependent_weights_bb_db_[11] = weight_map;
+  length_dependent_weights_bb_db_[12] = weight_map;
+
+  weight_map["cb_packing"] = 1.99907;
+  weight_map["cbeta"] = 0.278163;
+  weight_map["clash"] = 0.0423564;
+  weight_map["hbond"] = 1;
+  weight_map["reduced"] = 0.20795;
+  weight_map["seq_prof_score"] = -0.106216;
+  weight_map["stem_rmsd"] = 0.0810602;
+  weight_map["str_prof_score"] = -2.98924;
+  weight_map["torsion"] = 1.06368;
+  length_dependent_weights_bb_db_[13] = weight_map;
+  length_dependent_weights_bb_db_[14] = weight_map;  
+  length_dependent_weights_bb_db_[-1] = weights_bb_db_;
+
+  // BB_AANR length dependent
+  weight_map.clear();
+  weight_map["aa_clash"] = 0.283751;
+  weight_map["aa_interaction"] = 0.017465;
+  weight_map["aa_packing"] = 0.241799;
+  weight_map["cb_packing"] = 0.127742;
+  weight_map["cbeta"] = 0.352376;
+  weight_map["clash"] = 0.704888;
+  weight_map["hbond"] = 1;
+  weight_map["reduced"] = 0.149259;
+  weight_map["torsion"] = 0.490918;
+  length_dependent_weights_bb_aa_[0] = weight_map;
+  length_dependent_weights_bb_aa_[1] = weight_map;
+  length_dependent_weights_bb_aa_[2] = weight_map;
+  length_dependent_weights_bb_aa_[3] = weight_map;
+  length_dependent_weights_bb_aa_[4] = weight_map;
+
+  weight_map["aa_clash"] = 0.036239;
+  weight_map["aa_interaction"] = 0.00620728;
+  weight_map["aa_packing"] = 0.0614946;
+  weight_map["cb_packing"] = 0.288402;
+  weight_map["cbeta"] = 0.272684;
+  weight_map["clash"] = 0.0750436;
+  weight_map["hbond"] = 1;
+  weight_map["reduced"] = 0.0720939;
+  weight_map["torsion"] = 0.348388;
+  length_dependent_weights_bb_aa_[5] = weight_map;
+  length_dependent_weights_bb_aa_[6] = weight_map;
+
+  weight_map["aa_clash"] = 0.0616729;
+  weight_map["aa_interaction"] = 0.00672076;
+  weight_map["aa_packing"] = 0.0850889;
+  weight_map["cb_packing"] = 0.617773;
+  weight_map["cbeta"] = 0.252535;
+  weight_map["clash"] = 0.0521921;
+  weight_map["hbond"] = 1;
+  weight_map["reduced"] = 0.244583;
+  weight_map["torsion"] = 0.760732;
+  length_dependent_weights_bb_aa_[7] = weight_map;
+  length_dependent_weights_bb_aa_[8] = weight_map;
+
+  weight_map["aa_clash"] = 0.0171586;
+  weight_map["aa_interaction"] = 0.0057374;
+  weight_map["aa_packing"] = 0.132462;
+  weight_map["cb_packing"] = 1.05146;
+  weight_map["cbeta"] = 0.0751599;
+  weight_map["clash"] = 0.0412901;
+  weight_map["hbond"] = 1;
+  weight_map["reduced"] = 0.233706;
+  weight_map["torsion"] = 0.932057;
+  length_dependent_weights_bb_aa_[9] = weight_map;
+  length_dependent_weights_bb_aa_[10] = weight_map;
+
+  weight_map["aa_clash"] = 0.015698;
+  weight_map["aa_interaction"] = 0.0080754;
+  weight_map["aa_packing"] = 0.0604609;
+  weight_map["cb_packing"] = 2.82079;
+  weight_map["cbeta"] = 0.289487;
+  weight_map["clash"] = 0.0174437;
+  weight_map["hbond"] = 1;
+  weight_map["reduced"] = 0.367916;
+  weight_map["torsion"] = 1.84005;
+  length_dependent_weights_bb_aa_[11] = weight_map;
+  length_dependent_weights_bb_aa_[12] = weight_map;
+
+  weight_map["aa_clash_no_relax"] = 0.00320302;
+  weight_map["aa_interaction_no_relax"] = 0.00431749;
+  weight_map["aa_packing_no_relax"] = 0.0794247;
+  weight_map["cb_packing"] = 2.55054;
+  weight_map["cbeta"] = 0.0981701;
+  weight_map["clash"] = 0.0181231;
+  weight_map["hbond"] = 1;
+  weight_map["reduced"] = 0.243598;
+  weight_map["torsion"] = 1.72607;
+  length_dependent_weights_bb_aa_[13] = weight_map;
+  length_dependent_weights_bb_aa_[14] = weight_map;
+  length_dependent_weights_bb_aa_[-1] = weights_bb_aa_;
+
+  // BB
+  weight_map.clear();
+  weight_map["cb_packing"] = 0.224327;
+  weight_map["cbeta"] = 0.226355;
+  weight_map["clash"] = 0.424003;
+  weight_map["hbond"] = 1;
+  weight_map["reduced"] = 0.076963;
+  weight_map["torsion"] = 0.253095;
+  length_dependent_weights_bb_[0] = weight_map;
+  length_dependent_weights_bb_[1] = weight_map;
+  length_dependent_weights_bb_[2] = weight_map;
+  length_dependent_weights_bb_[3] = weight_map;
+  length_dependent_weights_bb_[4] = weight_map;
+
+  weight_map["cb_packing"] = 0.137013;
+  weight_map["cbeta"] = 0.194254;
+  weight_map["clash"] = 0.283518;
+  weight_map["hbond"] = 1;
+  weight_map["reduced"] = 0.12837;
+  weight_map["torsion"] = 0.318854;
+  length_dependent_weights_bb_[5] = weight_map;
+  length_dependent_weights_bb_[6] = weight_map;
+
+  weight_map["cb_packing"] = 0.618752;
+  weight_map["cbeta"] = 0.50412;
+  weight_map["clash"] = 0.108268;
+  weight_map["hbond"] = 1;
+  weight_map["reduced"] = 0.183393;
+  weight_map["torsion"] = 0.636929;
+  length_dependent_weights_bb_[7] = weight_map;
+  length_dependent_weights_bb_[8] = weight_map;
+
+  weight_map["cb_packing"] = 0.943519;
+  weight_map["cbeta"] = 0.946992;
+  weight_map["clash"] = 0.0956615;
+  weight_map["hbond"] = 1;
+  weight_map["reduced"] = 0.251022;
+  weight_map["torsion"] = 0.921721;
+  length_dependent_weights_bb_[9] = weight_map;
+  length_dependent_weights_bb_[10] = weight_map;
+
+  weight_map["cb_packing"] = 1.06123;
+  weight_map["cbeta"] = 0.469593;
+  weight_map["clash"] = 0.0831533;
+  weight_map["hbond"] = 1;
+  weight_map["reduced"] = 0.268347;
+  weight_map["torsion"] = 0.88921;
+  length_dependent_weights_bb_[11] = weight_map;
+  length_dependent_weights_bb_[12] = weight_map;
+
+
+  weight_map["cb_packing"] = 2.05415;
+  weight_map["cbeta"] = 0.604888;
+  weight_map["clash"] = 0.024504;
+  weight_map["hbond"] = 1;
+  weight_map["reduced"] = 0.367079;
+  weight_map["torsion"] = 1.34862;
+  length_dependent_weights_bb_[13] = weight_map;
+  length_dependent_weights_bb_[14] = weight_map;
+  length_dependent_weights_bb_[-1] = weights_bb_;
+  
   // key naming consistent with default scorers and weights above
   stem_rmsd_key_ = "stem_rmsd";
   seq_prof_score_key_ = "seq_prof_score";
@@ -90,19 +406,127 @@ ScoringWeights::ScoringWeights() {
   aa_scoring_keys_.push_back("aa_packing");
 }
 
+const std::map<String, Real>& ScoringWeights::GetWeights(bool with_db,
+                                                         bool with_aa,
+                                                         bool length_dependent,
+                                                         int loop_length) const {
+
+  if(!length_dependent) {
+    // its not length dependent, so lets return the length agnostic weights!
+    if (with_db) {
+      if (with_aa) {
+        return weights_bb_db_aa_;
+      }
+      else {        
+        return weights_bb_db_;
+      }
+    } else {
+      if (with_aa) {
+        return weights_bb_aa_;
+      }
+      else {        
+        return weights_bb_;
+      }
+    }
+  } else {
+    // its length dependent!
+    std::map<int, std::map<String, Real> >::const_iterator it;
+    if (with_db) {
+      if (with_aa) {
+        it = length_dependent_weights_bb_db_aa_.find(loop_length);
+        if(it == length_dependent_weights_bb_db_aa_.end()) {
+          it = length_dependent_weights_bb_db_aa_.find(-1);
+        } 
+        return it->second;
+      }
+      else {  
+        it = length_dependent_weights_bb_db_.find(loop_length);
+        if(it == length_dependent_weights_bb_db_.end()) {
+          it = length_dependent_weights_bb_db_.find(-1);
+        } 
+        return it->second;
+      }
+    } else {
+      if (with_aa) {
+        it = length_dependent_weights_bb_aa_.find(loop_length);
+        if(it == length_dependent_weights_bb_aa_.end()) {
+          it = length_dependent_weights_bb_aa_.find(-1);
+        } 
+        return it->second;
+      }
+      else {     
+        it = length_dependent_weights_bb_.find(loop_length);
+        if(it == length_dependent_weights_bb_.end()) {
+          it = length_dependent_weights_bb_.find(-1);
+        } 
+        return it->second;
+      }
+    }
+  }
+}
+
+void ScoringWeights::SetWeights(bool with_db, bool with_aa,
+                                const std::map<String, Real>& weights,
+                                bool length_dependent, int loop_length) {
+
+  if(!length_dependent){
+    // its not length dependent, so lets set the length agnostic weights!
+    if (with_db) {
+      if (with_aa) {
+        weights_bb_db_aa_ = weights;
+      }
+      else {
+        weights_bb_db_ = weights;
+      }
+    } else {
+      if (with_aa) {
+        weights_bb_aa_ = weights;
+      }
+      else {
+        weights_bb_ = weights;
+      }
+    }
+  } else {
+    // its length dependent!
+    if (with_db) {
+      if (with_aa) {
+        length_dependent_weights_bb_db_aa_[loop_length] = weights;
+      }
+      else {
+        length_dependent_weights_bb_db_[loop_length] = weights;
+      }
+    } else {
+      if (with_aa) {
+        length_dependent_weights_bb_aa_[loop_length] = weights;
+      }
+      else {
+        length_dependent_weights_bb_[loop_length] = weights;
+      }
+    }
+  }
+}
+
 std::map<String, Real> ScoringWeights::GetBackboneWeights(bool with_db,
-                                                          bool with_aa) const {
+                                                        bool with_aa,
+                                                        bool length_dependent,
+                                                        int loop_length) const {
   std::map<String, Real> result;
-  const std::map<String, Real>& all_weights = GetWeights(with_db, with_aa);
+  const std::map<String, Real>& all_weights = GetWeights(with_db, with_aa, 
+                                                         length_dependent,
+                                                         loop_length);
   for (uint i = 0; i < bb_scoring_keys_.size(); ++i) {
     result[bb_scoring_keys_[i]] = GetWeight(all_weights, bb_scoring_keys_[i]);
   }
   return result;
 }
 
-std::map<String, Real> ScoringWeights::GetAllAtomWeights(bool with_db) const {
+std::map<String, Real> ScoringWeights::GetAllAtomWeights(bool with_db,
+                                                        bool length_dependent,
+                                                        int loop_length) const {
   std::map<String, Real> result;
-  const std::map<String, Real>& all_weights = GetWeights(with_db, true);
+  const std::map<String, Real>& all_weights = GetWeights(with_db, true,
+                                                         length_dependent,
+                                                         loop_length);
   for (uint i = 0; i < aa_scoring_keys_.size(); ++i) {
     result[aa_scoring_keys_[i]] = GetWeight(all_weights, aa_scoring_keys_[i]);
   }
diff --git a/modelling/src/scoring_weights.hh b/modelling/src/scoring_weights.hh
index 1e48d783b32e6fd1a5456b5abd755530ff4be7ee..b51158e330ef1f476c266751f4cdbf9a9f872406 100644
--- a/modelling/src/scoring_weights.hh
+++ b/modelling/src/scoring_weights.hh
@@ -17,29 +17,21 @@ public:
   }
   // Weight access
   const std::map<String, Real>& GetWeights(bool with_db = false,
-                                           bool with_aa = false) const {
-    if (with_db) {
-      if (with_aa) return weights_bb_db_aa_;
-      else         return weights_bb_db_;
-    } else {
-      if (with_aa) return weights_bb_aa_;
-      else         return weights_bb_;
-    }
-  }
+                                           bool with_aa = false,
+                                           bool length_dependent=false,
+                                           int loop_length = -1) const;
   void SetWeights(bool with_db, bool with_aa,
-                  const std::map<String, Real>& weights) {
-    if (with_db) {
-      if (with_aa) weights_bb_db_aa_ = weights;
-      else         weights_bb_db_ = weights;
-    } else {
-      if (with_aa) weights_bb_aa_ = weights;
-      else         weights_bb_ = weights;
-    }
-  }
+                  const std::map<String, Real>& weights,
+                  bool length_dependent = false, 
+                  int loop_length = -1);
   // get subsets (as copy for further editing/use)
   std::map<String, Real> GetBackboneWeights(bool with_db = false,
-                                            bool with_aa = false) const;
-  std::map<String, Real> GetAllAtomWeights(bool with_db = false) const;
+                                            bool with_aa = false,
+                                            bool length_dependent=false,
+                                            int loop_length = -1) const;
+  std::map<String, Real> GetAllAtomWeights(bool with_db = false,
+                                           bool length_dependent=false,
+                                           int loop_length = -1) const;
   // Key access
   const String& GetStemRMSDsKey() const { return stem_rmsd_key_; }
   void SetStemRMSDsKey(const String& key) { stem_rmsd_key_ = key; }
@@ -71,11 +63,19 @@ private:
   // construction only inside here
   ScoringWeights();
 
-  // weights for all combinations
+  // weights for all combinations, length agnostic
   std::map<String, Real> weights_bb_;
   std::map<String, Real> weights_bb_db_;
   std::map<String, Real> weights_bb_aa_;
   std::map<String, Real> weights_bb_db_aa_;
+
+  // weights for all combinations, length dependent. The length key of -1 
+  // represents the fallback for not covered input lengths (e.g. long loops)
+  std::map<int, std::map<String, Real> > length_dependent_weights_bb_;
+  std::map<int, std::map<String, Real> > length_dependent_weights_bb_db_;
+  std::map<int, std::map<String, Real> > length_dependent_weights_bb_aa_;
+  std::map<int, std::map<String, Real> > length_dependent_weights_bb_db_aa_;
+
   // key names
   String stem_rmsd_key_;
   String seq_prof_score_key_;
diff --git a/modelling/src/sidechain_env_listener.cc b/modelling/src/sidechain_env_listener.cc
index 18a1297eef220f6b2aa55227a17038b918216282..d72e09f30a9c918c87d1569aabe9be055c6de17f 100644
--- a/modelling/src/sidechain_env_listener.cc
+++ b/modelling/src/sidechain_env_listener.cc
@@ -150,10 +150,7 @@ void SidechainEnvListener::SetResidue_(loop::ConstAllAtomPositionsPtr all_pos,
   // we only add data if BB is set
   if (bb_set) {
     // get positions
-    const geom::Vec3& n_pos  = all_pos->GetPos(idx_N);
     const geom::Vec3& ca_pos = all_pos->GetPos(idx_CA);
-    const geom::Vec3& c_pos  = all_pos->GetPos(idx_C);
-    const geom::Vec3& o_pos  = all_pos->GetPos(idx_O);
     geom::Vec3 cb_pos;
     if (r_id != sidechain::GLY)  cb_pos = all_pos->GetPos(idx_CB);
     
@@ -177,36 +174,33 @@ void SidechainEnvListener::SetResidue_(loop::ConstAllAtomPositionsPtr all_pos,
 
     // set backbone frame res.
     bb_frame_residue_[res_idx]
-      = rot_constructor_.ConstructBackboneFrameResidue(n_pos, ca_pos, c_pos, 
-                                                       o_pos, cb_pos,
+      = rot_constructor_.ConstructBackboneFrameResidue(*all_pos, res_idx, 
                                                        r_id, res_idx, 
                                                        phi_angle_[res_idx], 
                                                        n_ter_[res_idx], 
                                                        c_ter_[res_idx]);
     
-    // do we have a sidechain?
-    if (r_id != sidechain::ALA && r_id != sidechain::GLY) {
-      // set sidechain frame res. if all set
-      if (all_set) {
-        sc_frame_residue_[res_idx]
-          = rot_constructor_.ConstructSidechainFrameResidue(*all_pos, res_idx, 
-                                                            r_id, res_idx);
-      } else {
-        sc_frame_residue_[res_idx].reset();
-      }
-      // set rotamer if needed
-      if (all_rotamers_ || !all_set) {
-        SetRotamer_(all_pos, n_pos, ca_pos, cb_pos, r_id, res_idx);
-      } else {
-        if (use_frm_) frm_rotamer_group_[res_idx].reset();
-        else          rrm_rotamer_group_[res_idx].reset();
-      }
-      // set extra cystein rotamer if needed
-      if (add_cyd_rotamers_ && r_id == sidechain::CYS) {
-        CreateRotamerGroup(cyd_frm_rotamer_group_[res_idx], n_pos, ca_pos,
-                           cb_pos, sidechain::CYD, res_idx);
-      }
+    // set sidechain frame res. if all set
+    if (all_set) {
+      sc_frame_residue_[res_idx]
+        = rot_constructor_.ConstructSidechainFrameResidue(*all_pos, res_idx, 
+                                                           r_id, res_idx);
+    } else {
+      sc_frame_residue_[res_idx].reset();
+    }
+    // set rotamer if needed
+    if (all_rotamers_ || !all_set) {
+      SetRotamer_(all_pos, r_id, res_idx);
+    } else {
+      if (use_frm_) frm_rotamer_group_[res_idx].reset();
+      else          rrm_rotamer_group_[res_idx].reset();
     }
+    // set extra cystein rotamer if needed
+    if (add_cyd_rotamers_ && r_id == sidechain::CYS) {
+      CreateRotamerGroup(cyd_frm_rotamer_group_[res_idx], all_pos,
+                         sidechain::CYD, res_idx);
+    }
+    
   } else {
     // clear stuff
     if (bb_frame_residue_[res_idx]) {
@@ -224,9 +218,6 @@ void SidechainEnvListener::SetResidue_(loop::ConstAllAtomPositionsPtr all_pos,
 }
 
 void SidechainEnvListener::SetRotamer_(loop::ConstAllAtomPositionsPtr all_pos,
-                                       const geom::Vec3& n_pos,
-                                       const geom::Vec3& ca_pos,
-                                       const geom::Vec3& cb_pos,
                                        const sidechain::RotamerID r_id,
                                        const uint res_idx) {
   // add rotamer anyways -> potentially need to change ID
@@ -245,10 +236,10 @@ void SidechainEnvListener::SetRotamer_(loop::ConstAllAtomPositionsPtr all_pos,
   //    -> same with RRM:         0.30s
   //    -> RRM w/o BBdep:         0.23s
   if (use_frm_) {
-    CreateRotamerGroup(frm_rotamer_group_[res_idx], n_pos, ca_pos, cb_pos,
+    CreateRotamerGroup(frm_rotamer_group_[res_idx], all_pos,
                        rg_r_id, res_idx);
   } else {
-    CreateRotamerGroup(rrm_rotamer_group_[res_idx], n_pos, ca_pos, cb_pos,
+    CreateRotamerGroup(rrm_rotamer_group_[res_idx], all_pos,
                        rg_r_id, res_idx);
   }
 }
diff --git a/modelling/src/sidechain_env_listener.hh b/modelling/src/sidechain_env_listener.hh
index a35a0b36b8f18f7a497ec8c27f70739fda4576bf..2f8c14a1349f80b6d36464debc298b7aa3161d01 100644
--- a/modelling/src/sidechain_env_listener.hh
+++ b/modelling/src/sidechain_env_listener.hh
@@ -119,40 +119,33 @@ public:
 
   // create a rotamer group based on internal settings (no use_frm_ check!)
   void CreateRotamerGroup(sidechain::FRMRotamerGroupPtr& rot_group,
-                          const geom::Vec3& n_pos, const geom::Vec3& ca_pos,
-                          const geom::Vec3& cb_pos, 
+                          loop::ConstAllAtomPositionsPtr all_pos, 
                           const sidechain::RotamerID r_id, const uint res_idx) {
     if (use_bbdep_lib_) {
-      rot_group = rot_constructor_.ConstructFRMRotamerGroup(n_pos, ca_pos, 
-                                                            cb_pos, r_id, 
-                                                            res_idx,
+      rot_group = rot_constructor_.ConstructFRMRotamerGroup(*all_pos, res_idx, 
+                                                            r_id, res_idx,
                                                             bbdep_library_,
                                                             phi_angle_[res_idx],
                                                             psi_angle_[res_idx]);
     } else {
-      rot_group = rot_constructor_.ConstructFRMRotamerGroup(n_pos, ca_pos, cb_pos, 
+      rot_group = rot_constructor_.ConstructFRMRotamerGroup(*all_pos, res_idx, 
                                                             r_id, res_idx,
                                                             library_);
     }
     rot_constructor_.AssignInternalEnergies(rot_group);
   }
   void CreateRotamerGroup(sidechain::RRMRotamerGroupPtr& rot_group,
-                          const geom::Vec3& n_pos, 
-                          const geom::Vec3& ca_pos,
-                          const geom::Vec3& cb_pos, 
-                          const sidechain::RotamerID r_id,
-                          const uint res_idx) {
+                          loop::ConstAllAtomPositionsPtr all_pos, 
+                          const sidechain::RotamerID r_id, const uint res_idx) {
     if (use_bbdep_lib_) {
-      rot_group = rot_constructor_.ConstructRRMRotamerGroup(n_pos, ca_pos, 
-                                                            cb_pos, r_id, 
-                                                            res_idx,
+      rot_group = rot_constructor_.ConstructRRMRotamerGroup(*all_pos, res_idx,
+                                                            r_id, res_idx,
                                                             bbdep_library_,
                                                             phi_angle_[res_idx],
                                                             psi_angle_[res_idx]);
     } else {
-      rot_group = rot_constructor_.ConstructRRMRotamerGroup(n_pos, ca_pos, 
-                                                            cb_pos, r_id, 
-                                                            res_idx,
+      rot_group = rot_constructor_.ConstructRRMRotamerGroup(*all_pos, res_idx,
+                                                            r_id, res_idx,
                                                             library_);
     }
     rot_constructor_.AssignInternalEnergies(rot_group);
@@ -163,9 +156,7 @@ private:
   // set stuff for one residue
   void SetResidue_(loop::ConstAllAtomPositionsPtr all_pos, const uint res_idx);
   void SetRotamer_(loop::ConstAllAtomPositionsPtr all_pos,
-                   const geom::Vec3& n_pos, const geom::Vec3& ca_pos,
-                   const geom::Vec3& cb_pos, const sidechain::RotamerID r_id,
-                   const uint res_idx);
+                   const sidechain::RotamerID r_id, const uint res_idx);
 
   // global data
   bool all_rotamers_;  // construct rotamers for all res. with BB instead of
@@ -185,8 +176,8 @@ private:
   
   // dynamic data per residue
   // -> any data only set if BB set ("if (bb_frame_residue_[res_idx]) ...")
-  // -> sc_frame_residue set if not ALA/GLY and all pos. available
-  // -> xxx_rotamer_group set if not ALA/GLY and atoms missing or all_rotamers_
+  // -> sc_frame_residue set if not GLY and all pos. available
+  // -> xxx_rotamer_group set if no atoms are missing or all_rotamers_
   //    -> if use_frm_, only xxx = frm valid, else, only xxx = rrm
   //    -> CalculateInternalEnergies done for all rotamer groups
   ScCBetaSpatialOrganizerItem* env_data_;
diff --git a/modelling/tests/data/port_frag_db.dat b/modelling/tests/data/port_frag_db.dat
index 1cc848360e16ec2840bc6c540fa6c7eda9e4fb95..167582ab4c931037fc88519a53f8a6d841a67e1c 100644
Binary files a/modelling/tests/data/port_frag_db.dat and b/modelling/tests/data/port_frag_db.dat differ
diff --git a/modelling/tests/data/port_str_db.dat b/modelling/tests/data/port_str_db.dat
index 5c183190ce902c88a35cc99fb5e4fd69a71ef62f..a861977c6a974dd2a15929b9f5c71415d57901d3 100644
Binary files a/modelling/tests/data/port_str_db.dat and b/modelling/tests/data/port_str_db.dat differ
diff --git a/modelling/tests/test_loop_candidates.cc b/modelling/tests/test_loop_candidates.cc
index fe902a579d7de55cad3a2a06026aa325b765847b..70c92d55fb35c002c0d3077aaaa1c334b9df29b5 100644
--- a/modelling/tests/test_loop_candidates.cc
+++ b/modelling/tests/test_loop_candidates.cc
@@ -303,7 +303,7 @@ BOOST_AUTO_TEST_CASE(test_loop_candidates_from_db) {
   ost::mol::EntityHandle ent = LoadTestStructure("data/1CRN.pdb");
   ost::seq::ProfileHandlePtr prof;
   prof = ost::io::LoadSequenceProfile("data/1CRNA.hhm");
-  const uint loop_length = 5;
+  const uint loop_length = 7;
   const uint start_idx = 10;
 
   // get dbs (small DBs created as in example codes using crambin)
@@ -311,15 +311,15 @@ BOOST_AUTO_TEST_CASE(test_loop_candidates_from_db) {
   structure_db = loop::StructureDB::LoadPortable("data/port_str_db.dat");
   // get known fragments to put in here
   std::vector<loop::FragmentInfo> fragments;
-  fragments.push_back(loop::FragmentInfo(1, 108, 5));
-  fragments.push_back(loop::FragmentInfo(1, 24, 5));
-  fragments.push_back(loop::FragmentInfo(1, 93, 5));
-  fragments.push_back(loop::FragmentInfo(0, 10, 5));
-  fragments.push_back(loop::FragmentInfo(0, 9, 5));
-  fragments.push_back(loop::FragmentInfo(1, 90, 5));
-  fragments.push_back(loop::FragmentInfo(0, 7, 5));
-  fragments.push_back(loop::FragmentInfo(1, 28, 5));
-  fragments.push_back(loop::FragmentInfo(1, 4, 5));
+  fragments.push_back(loop::FragmentInfo(1, 108, loop_length));
+  fragments.push_back(loop::FragmentInfo(1, 24, loop_length));
+  fragments.push_back(loop::FragmentInfo(1, 93, loop_length));
+  fragments.push_back(loop::FragmentInfo(0, 10, loop_length));
+  fragments.push_back(loop::FragmentInfo(0, 9, loop_length));
+  fragments.push_back(loop::FragmentInfo(1, 90, loop_length));
+  fragments.push_back(loop::FragmentInfo(0, 7, loop_length));
+  fragments.push_back(loop::FragmentInfo(1, 28, loop_length));
+  fragments.push_back(loop::FragmentInfo(1, 4, loop_length));
 
   // manually fill loop candidates
   String loop_seq = "";
@@ -343,9 +343,9 @@ BOOST_AUTO_TEST_CASE(test_loop_candidates_from_db) {
                         structure_db, *prof, start_idx);
   stem_rmsds = loop_candidates->CalculateStemRMSDs(n_stem, c_stem);
   // check scores
-  CheckScore(seq_prof_scores, N_cand, -2.12749, 2.07746, -0.484273);
-  CheckScore(str_prof_scores, N_cand, 0.149246, 0.426513, 0.282906);
-  CheckScore(stem_rmsds, N_cand, 0.00893292, 1.66355, 0.691202);
+  CheckScore(seq_prof_scores, N_cand, -2.73226428, 2.37290597, -1.04137301);
+  CheckScore(str_prof_scores, N_cand, 0.0652512088, 0.749628067, 0.391301066);
+  CheckScore(stem_rmsds, N_cand, 0.0314558744, 2.9163394, 1.22806919);
 
   // check ApplyXXX
   // -> expected ApplyCCD: 0, 2, .., 8 converging
@@ -354,41 +354,51 @@ BOOST_AUTO_TEST_CASE(test_loop_candidates_from_db) {
   orig_indices = lc.ApplyCCD(n_stem, c_stem);
   CheckOrigIndices(lc, orig_indices, fragments);
   // ShowIndices(orig_indices);
-  BOOST_CHECK_EQUAL(orig_indices.size(), uint(8));
+  BOOST_CHECK_EQUAL(orig_indices.size(), uint(9));
   BOOST_CHECK_EQUAL(orig_indices[0], uint(0));
-  BOOST_CHECK_EQUAL(orig_indices[1], uint(2));
-  BOOST_CHECK_EQUAL(orig_indices[7], uint(8));
+  BOOST_CHECK_EQUAL(orig_indices[1], uint(1));
+  BOOST_CHECK_EQUAL(orig_indices[8], uint(8));
   CheckProfScores(lc, orig_indices, structure_db, prof, start_idx,
                   seq_prof_scores, str_prof_scores);
   // -> expected ApplyKIC: 0 converging with 2 LC
   lc = *loop_candidates; // COPY
-  orig_indices = lc.ApplyKIC(n_stem, c_stem, 1, 2, 3);
+  orig_indices = lc.ApplyKIC(n_stem, c_stem, 1, 3, 5);
   CheckOrigIndices(lc, orig_indices, fragments);
   // ShowIndices(orig_indices);
-  BOOST_CHECK_EQUAL(orig_indices.size(), uint(2));
-  BOOST_CHECK_EQUAL(orig_indices[0], uint(3));
-  BOOST_CHECK_EQUAL(orig_indices[1], uint(3));
+  BOOST_CHECK_EQUAL(orig_indices.size(), uint(50));
+
+
+  BOOST_CHECK_EQUAL(orig_indices[0], uint(0));
+  BOOST_CHECK_EQUAL(orig_indices[1], uint(0));
+  BOOST_CHECK_EQUAL(orig_indices[2], uint(0));
+  BOOST_CHECK_EQUAL(orig_indices[3], uint(0));
+  BOOST_CHECK_EQUAL(orig_indices[4], uint(1));
+  BOOST_CHECK_EQUAL(orig_indices[5], uint(1));
+  BOOST_CHECK_EQUAL(orig_indices[6], uint(1));
+  BOOST_CHECK_EQUAL(orig_indices[49], uint(8));
+
   CheckProfScores(lc, orig_indices, structure_db, prof, start_idx,
                   seq_prof_scores, str_prof_scores);
 
   // cluster them
   std::vector< std::vector<uint> > clusters;
-  const Real max_dist = 0.23;
+  const Real max_dist = 0.35;
   loop_candidates->GetClusters(max_dist, clusters);
   // ShowClusters(clusters);
 
-  BOOST_CHECK_EQUAL(clusters.size(), uint(4));
+  BOOST_CHECK_EQUAL(clusters.size(), uint(5));
 
   std::vector<uint> cluster_sizes;
-  for(int i = 0; i < 4; ++i){
+  for(uint i = 0; i < clusters.size(); ++i){
     cluster_sizes.push_back(clusters[i].size());
   }
   std::sort(cluster_sizes.begin(), cluster_sizes.end());
 
   BOOST_CHECK_EQUAL(cluster_sizes[0], uint(1));
   BOOST_CHECK_EQUAL(cluster_sizes[1], uint(1));
-  BOOST_CHECK_EQUAL(cluster_sizes[2], uint(3));
-  BOOST_CHECK_EQUAL(cluster_sizes[3], uint(4));
+  BOOST_CHECK_EQUAL(cluster_sizes[2], uint(1));
+  BOOST_CHECK_EQUAL(cluster_sizes[3], uint(3));
+  BOOST_CHECK_EQUAL(cluster_sizes[4], uint(3));
 
   CheckClusters(clusters, N_cand);
   // get filtered variant to check neglect_size_one below
diff --git a/scoring/doc/CMakeLists.txt b/scoring/doc/CMakeLists.txt
index c9d338020d208177bad785892b3e9aaa84f90d4a..a33e0d61b2c2ac4907e423be78ad9c31c4a08c79 100644
--- a/scoring/doc/CMakeLists.txt
+++ b/scoring/doc/CMakeLists.txt
@@ -3,6 +3,7 @@ set(SCORING_RST
   backbone_score_env.rst
   backbone_scorers.rst
   all_atom_scorers.rst
+  other_scoring_functions.rst
 )
 
 add_doc_source(NAME scoring RST ${SCORING_RST})
diff --git a/scoring/doc/all_atom_scorers.rst b/scoring/doc/all_atom_scorers.rst
index 5637039287244c727e7e700670d182e2b64bacec..0a1b39b1613522dd671df0b73b32e98dcaac55eb 100644
--- a/scoring/doc/all_atom_scorers.rst
+++ b/scoring/doc/all_atom_scorers.rst
@@ -37,10 +37,10 @@ AllAtomOverallScorer class
     :type env:  :class:`~promod3.loop.AllAtomEnv`
 
   .. method:: CalculateLinearCombination(linear_weights, start_resnum, \
-                                         num_residues, chain_idx=0)
+                                         num_residues, chain_idx)
 
-    Calculate linear combination of scores for the desired loop (extracted from
-    environment) against the set environment (see
+    Calculate linear combination of scores for the desired loop(s) (extracted 
+    from environment) against the set environment (see
     :meth:`AllAtomScorer.CalculateScore`).
 
     :param linear_weights: Weights for each desired scorer. You can add a
@@ -48,14 +48,14 @@ AllAtomOverallScorer class
                            with key "intercept".
     :type linear_weights:  :class:`dict` (keys: :class:`str`,
                            values: :class:`float`)
-    :param start_resnum: Res. number defining the position in the SEQRES
+    :param start_resnum: Res. number(s) defining the position(s) in the SEQRES
                          (see :class:`~promod3.loop.AllAtomEnv` for indexing)
-    :type start_resnum:  :class:`int` / :class:`ost.mol.ResNum`
-    :param num_residues: Length of loop.
-    :type num_residues:  :class:`int`
-    :param chain_idx: Index of chain the loop belongs to
+    :type start_resnum:  :class:`int` / :class:`list` of :class:`int`
+    :param num_residues: Length of loop(s).
+    :type num_residues:  :class:`int` / :class:`list` of :class:`int`
+    :param chain_idx: Index of chain the loop(s) belongs to
                       (see :class:`~promod3.loop.AllAtomEnv` for indexing)
-    :type chain_idx:  :class:`int`
+    :type chain_idx:  :class:`int` / :class:`list` of :class:`int`
 
     :return: Score for the given set of atoms.
     :rtype:  :class:`float`
@@ -91,25 +91,20 @@ AllAtomScorer base class
     :param env: Link scorer to this score environment.
     :type env:  :class:`~promod3.loop.AllAtomEnv`
 
-  .. method:: CalculateScore(start_resnum, num_residues, chain_idx=0)
+  .. method:: CalculateScore(start_resnum, num_residues, chain_idx)
 
-    Calculates score for the desired loop (extracted from environment) against
+    Calculates score for the desired loop(s) (extracted from environment) against
     the set environment. Unless otherwise noted in the scorer, a lower "score"
     is better!
 
-    Note that the structural data of the loop is expected to be in the linked
-    environment before calling this! This behavior is different from the
-    corresponding function in :class:`BackboneScorer` as, for performance
-    reasons, we require all the comparisons to be done against the environment.
-
-    :param start_resnum: Res. number defining the position in the SEQRES
+    :param start_resnum: Res. number(s) defining the position(s) in the SEQRES
                          (see :class:`~promod3.loop.AllAtomEnv` for indexing)
-    :type start_resnum:  :class:`int` / :class:`ost.mol.ResNum`
-    :param num_residues: Length of loop.
-    :type num_residues:  :class:`int`
-    :param chain_idx: Index of chain the loop belongs to
+    :type start_resnum:  :class:`int` / :class:`list` of :class:`int`
+    :param num_residues: Length of loop(s).
+    :type num_residues:  :class:`int` / :class:`list` of :class:`int`
+    :param chain_idx: Index of chain the loop(s) belongs to
                       (see :class:`~promod3.loop.AllAtomEnv` for indexing)
-    :type chain_idx:  :class:`int`
+    :type chain_idx:  :class:`int` / :class:`list` of :class:`int`
 
     :return: Score for the given set of atoms.
     :rtype:  :class:`float`
@@ -121,25 +116,21 @@ AllAtomScorer base class
 
   .. method:: CalculateScoreProfile(start_resnum, num_residues, chain_idx=0)
 
-    Calculates per residue scores for the desired loop (extracted from
+    Calculates per residue scores for the desired loop(s) (extracted from
     environment) against the set environment.
 
-    Note that the structural data of the loop is expected to be in the linked
-    environment before calling this! This behavior is different from the
-    corresponding function in :class:`BackboneScorer` as, for performance
-    reasons, we require all the comparisons to be done against the environment.
-
-    :param start_resnum: Res. number defining the position in the SEQRES
+    :param start_resnum: Res. number(s) defining the position(s) in the SEQRES
                          (see :class:`~promod3.loop.AllAtomEnv` for indexing)
-    :type start_resnum:  :class:`int` / :class:`ost.mol.ResNum`
-    :param num_residues: Length of loop.
+    :type start_resnum:  :class:`int` / :class:`list` of :class:`int`
+    :param num_residues: Length of loop(s).
     :type num_residues:  :class:`int`
-    :param chain_idx: Index of chain the loop belongs to
+    :param chain_idx: Index of chain the loop(s) belongs to
                       (see :class:`~promod3.loop.AllAtomEnv` for indexing)
-    :type chain_idx:  :class:`int`
+    :type chain_idx:  :class:`int` / :class:`list` of :class:`int`
 
-    :return: Scores for the given loop, one for each residue.
-    :rtype:  :class:`list` of :class:`float`
+    :return: Scores for the given loop(s), one for each residue.
+    :rtype:  :class:`list` of :class:`float` / :class:`list` of :class:`list` 
+             of :class:`float`
 
     :raises: same :exc:`~exceptions.RuntimeError` as :meth:`CalculateScore`.
 
@@ -154,8 +145,11 @@ AllAtomInteractionScorer class
   *cutoff* and which are at least *seq_sep* residues apart. An energy is
   assigned to each distance using equally sized bins and distinguishing all
   possible pairs of atoms (usually the energy only differs for chemically
-  distinguishable heavy atoms). The calculated score is normalized by the number
-  of interacting atom pairs.
+  distinguishable heavy atoms). 
+  By default, the scorer calculates the scores by
+  including everything, the stuff set in the environment and the coordinates
+  in the input loops. You can change this behaviour with the according 
+  functions. 
 
   The scorer needs to be initialized either by loading a predefined scorer (e.g.
   :func:`LoadAllAtomInteractionScorer`) or by setting all energies (see :meth:`SetEnergy`).
@@ -204,6 +198,10 @@ AllAtomInteractionScorer class
 
     Setup one energy value. Unless a predefined scorer is loaded, this must be
     called for every pair of heavy atom types and for every *bin* < *bins*.
+    Internal symmetry is enforced => Calling SetEnergy(aaa1, aaa2, bin, energy) is
+    equivalent to calling SetEnergy(aaa1, aaa2, bin, energy) AND
+    SetEnergy(aaa2, aaa1, bin, energy).
+
 
     :param aaa1: Heavy atom type for first interaction partner.
     :type aaa1:  :class:`~promod3.loop.AminoAcidAtom`
@@ -216,6 +214,24 @@ AllAtomInteractionScorer class
 
     :raises: :exc:`~exceptions.RuntimeError` if inputs are invalid
 
+  .. method:: DoInternalScores(do_it) 
+
+    :param do_it:       Whether to include pairwise interactions within the 
+                        loop. True by default.
+    :type do_it:        :class:`bool`
+
+  .. method:: DoExternalScores(do_it) 
+
+    :param do_it:       Whether to include pairwise interactions towards the 
+                        environment. True by default.
+    :type do_it:        :class:`bool`
+
+  .. method:: DoNormalize(do_it) 
+
+    :param do_it:       Whether to normalize the calculated scores by the number
+                        of residues in the input loop. True by default.
+    :type do_it:        :class:`bool`
+
 
 .. function:: LoadAllAtomInteractionScorer()
 
@@ -230,8 +246,7 @@ AllAtomPackingScorer class
 
   Inherits all functionality of :class:`AllAtomScorer`. Evaluates pseudo
   energies by counting surrounding atoms within a certain *cutoff* radius around
-  all heavy atoms not belonging to the assessed residue itself. The calculated
-  score is normalized by the number of atoms being assessed.
+  all heavy atoms not belonging to the assessed residue itself. 
 
   The scorer needs to be initialized either by loading a predefined scorer (e.g.
   :func:`LoadAllAtomPackingScorer`) or by setting all energies (see
@@ -287,6 +302,12 @@ AllAtomPackingScorer class
 
     :raises: :exc:`~exceptions.RuntimeError` if inputs are invalid
 
+  .. method:: DoNormalize(do_it) 
+
+    :param do_it:       Whether to normalize the calculated scores by the number
+                        of residues in the input loop. True by default.
+    :type do_it:        :class:`bool`
+
 
 .. function:: LoadAllAtomPackingScorer()
 
@@ -302,5 +323,25 @@ AllAtomClashScorer class
   Inherits all functionality of :class:`AllAtomScorer`. Calculates a simple
   clash score of all atoms against the environment. There is no need to define
   any parameters here as all interaction energies are fixed (see Eq. (11) in
-  [canutescu2003b]_). The calculated score is normalized by the number of atoms
-  being assessed.
+  [canutescu2003b]_). By default, the scorer calculates the scores by
+  including everything, the stuff set in the environment and the coordinates
+  in the input loops. You can change this behaviour with the according 
+  functions. 
+
+  .. method:: DoInternalScores(do_it) 
+
+    :param do_it:       Whether to include pairwise interactions within the 
+                        loop. True by default.
+    :type do_it:        :class:`bool`
+
+  .. method:: DoExternalScores(do_it) 
+
+    :param do_it:       Whether to include pairwise interactions towards the 
+                        environment. True by default.
+    :type do_it:        :class:`bool`
+
+  .. method:: DoNormalize(do_it) 
+
+    :param do_it:       Whether to normalize the calculated scores by the number
+                        of residues in the input loop. True by default.
+    :type do_it:        :class:`bool`
diff --git a/scoring/doc/backbone_score_env.rst b/scoring/doc/backbone_score_env.rst
index f9c1e18ce2d2537df02f053e2932ab28d24b7712..25980a4d34ba90890e7686c87838fa8dcd0f1679 100644
--- a/scoring/doc/backbone_score_env.rst
+++ b/scoring/doc/backbone_score_env.rst
@@ -12,10 +12,18 @@ BackboneScoreEnv class
   used by the scorers. It is linked to a (list of) seqres (one per chain) at
   construction. The idea is to initialize it at the beginning of the modelling
   process with all known data (positions extracted from template, psipred
-  prediction, density map, etc) and then update the environment whenever a new
-  loop is being added. Note that, depending on the used scorers, some
-  information must be provided for the score to make sense and any env. data can
-  be set at any time before actually calculating a score.
+  prediction, etc). All scorers attached to that environment will see that data 
+  and can calculate scores accordingly.
+  Scoring with this setup is a two step process:
+
+  * Set the positions you want to score in the environment to make it available
+    to all attached scorers
+  * Call the scorers to get the desired scores
+
+  One problem that might occur is that you mess around with the environment and
+  at some point you want to restore the original state. The 
+  :class:`BackboneScoreEnv` provides a Stash / Pop mechanism to perform this 
+  task.
 
   :param seqres: Internal SEQRES to be set (single chain or list with one per
                  chain). Whenever setting structural data, consistency with this SEQRES is enforced.
@@ -94,17 +102,6 @@ BackboneScoreEnv class
              inconsistent with the number of internal chains or when one of the
              predictions' sizes is inconsistent with the internal SEQRES size.
 
-  .. method:: SetMap(map, resolution, all_atom=False)
-
-    Sets an internal density map, which is necessary to calculate some scores.
-
-    :param map:         The density map
-    :type map:          :class:`ost.img.ImageHandle`
-    :param resolution:  Expected resolution of the density map.
-    :type resolution:   :class:`float`
-    :param all_atom:    Whether the map is accurate enough to resolve all atoms.
-    :type all_atom:     :class:`bool`
-
   .. method:: AddPairwiseFunction(function, function_type)
 
     Adds a pairwise function that can be used in :meth:`ApplyPairwiseFunction`.
@@ -139,6 +136,26 @@ BackboneScoreEnv class
               res. numbers is invalid, the interaction partners are the same
               residue or when *f_idx* is an invalid index.
 
+  .. method:: Stash(start_rnum, num_residues, chain_idx) 
+
+    FILO style stashing. You can perform up to 100 stash operations to save
+    the current state of certain stretches in the environment. This state can
+    be restored by calling :func:`Pop`. In one stash operation you can either 
+    stash one stretch by providing integers as input or several stretches by 
+    providing lists of integers.
+
+    :param start_rnum:  start rnum of stretch to stash
+    :param num_residues: length of stretch to stash
+    :param chain_idx:   chain idx of stretch to stash
+
+    :type start_rnum:   :class:`int` / :class:`list` of :class:`int`
+    :type num_residues: :class:`int` / :class:`list` of :class:`int`
+    :type chain_idx:    :class:`int` / :class:`list` of :class:`int`
+
+  .. method:: Pop()
+
+    Remove and apply the the last stash operation.
+
   .. method:: GetSeqres()
 
     :return: SEQRES that was set in constructor (one sequence per chain).
diff --git a/scoring/doc/backbone_scorers.rst b/scoring/doc/backbone_scorers.rst
index ebb0bc300bd52033bb4a020ac0a5a63c390d3617..55a07ec77cc2e0ebc0b619c90c4ebaf824e9531a 100644
--- a/scoring/doc/backbone_scorers.rst
+++ b/scoring/doc/backbone_scorers.rst
@@ -36,55 +36,51 @@ BackboneOverallScorer class
     :param env: Link all scorers to this score environment.
     :type env:  :class:`BackboneScoreEnv`
 
-  .. method:: Calculate(key, bb_list, start_resnum, chain_idx=0)
+  .. method:: Calculate(key, start_resnum, num_residues, chain_idx=0)
 
-    Calculate score(s) for one or many loop(s) with
-    :meth:`BackboneScorer.CalculateScore`.
+    Calculate score for one or several stretches of amino acids given the 
+    current scoring environment.
 
     :param key: Key for desired scorer.
     :type key:  :class:`str`
-    :param bb_list: Loop(s) for which to calculate the given score
-    :type bb_list:  :class:`~promod3.loop.BackboneList` / :class:`list` of
-                    :class:`~promod3.loop.BackboneList`
     :param start_resnum: Res. number defining the position in the SEQRES
                          (see :class:`BackboneScoreEnv` for indexing)
-    :type start_resnum:  :class:`int`
-    :param chain_idx: Index of chain the loop(s) belong to
+    :type start_resnum:  :class:`int` / :class:`list` of :class:`int`
+    :param num_residues: Number of residues in the stretch(es) to score
+    :type num_residues: :class:`int` / :class:`list` of :class:`int`
+    :param chain_idx: Index of chain the stretch(es) belongs to
                       (see :class:`BackboneScoreEnv` for indexing)
-    :type chain_idx:  :class:`int`
+    :type chain_idx:  :class:`int` / :class:`list` of :class:`int`
 
-    :return: Score(s) calculated with the desired scorer for the given loop(s).
-             In the case of multiple loops, the returned list has the same
-             order as the input.
-    :rtype:  :class:`float` / :class:`list` of :class:`float`
+    :return: Score calculated with the desired scorer for the given stretch(es).
+    :rtype:  :class:`float` 
 
     :raises: :exc:`~exceptions.RuntimeError` if there is no scorer with that
              *key* or anything raised in :meth:`BackboneScorer.CalculateScore`.
 
-  .. method:: CalculateLinearCombination(linear_weights, bb_list, start_resnum,\
-                                         chain_idx=0)
+  .. method:: CalculateLinearCombination(linear_weights, start_resnum,\
+                                         num_residues, chain_idx=0)
 
-    Calculate linear combination(s) of scores for one or many loop(s).
+    Calculate linear combination of scores for one or several stretches of 
+    amino acids given the current scoring environment.
 
     :param linear_weights: Weights for each desired scorer. You can add a
                            constant value to each score by defining a weight
                            with key "intercept".
     :type linear_weights:  :class:`dict` (keys: :class:`str`,
                            values: :class:`float`)
-    :param bb_list: Loop(s) for which to calculate the given score
-    :type bb_list:  :class:`~promod3.loop.BackboneList` / :class:`list` of
-                    :class:`~promod3.loop.BackboneList`
     :param start_resnum: Res. number defining the position in the SEQRES
                          (see :class:`BackboneScoreEnv` for indexing)
-    :type start_resnum:  :class:`int`
-    :param chain_idx: Index of chain the loop(s) belong to
+    :type start_resnum:  :class:`int` / :class:`list` of :class:`int`
+    :param num_residues: Number of residues in the stretch(es) to score
+    :type num_residues: :class:`int` / :class:`list` of :class:`int`
+    :param chain_idx: Index of chain the stretch(es) belongs to
                       (see :class:`BackboneScoreEnv` for indexing)
-    :type chain_idx:  :class:`int`
+    :type chain_idx:  :class:`int` / :class:`list` of :class:`int`
 
-    :return: Linear combination(s) of the scores calculated with the desired
-             scorers for the given loop(s). In the case of multiple loops, the
-             returned list has the same order as the input.
-    :rtype:  :class:`float` / :class:`list` of :class:`float`
+    :return: Linear combination of the scores calculated with the desired
+             scorers for the given stretch(es)
+    :rtype:  :class:`float` 
 
     :raises: :exc:`~exceptions.RuntimeError` if *linear_weights* has a *key* for
              which no scorer exists or anything raised in
@@ -103,7 +99,7 @@ BackboneOverallScorer class
   :returns: Loads or creates the default scorers accessible through 
             following keys:
             "cb_packing", "cbeta", "reduced", "clash", "hbond", "ss_agreement",\
-            "torsion", "pairwise", "density"
+            "torsion", "pairwise"
   :rtype:   :class:`BackboneOverallScorer`
 
 
@@ -119,47 +115,46 @@ BackboneScorer base class
     :param env: Link scorer to this score environment.
     :type env:  :class:`BackboneScoreEnv`
 
-  .. method:: CalculateScore(bb_list, start_resnum, chain_idx=0)
+  .. method:: CalculateScore(start_resnum, num_residues, chain_idx=0)
 
-    Calculates score for the given loop internally and against the set
-    environment. Data in the environment, which overlaps with the given
-    *bb_list* is ignored. Unless otherwise noted in the scorer, a lower "score"
-    is better!
+    Calculates score for one or several stretches given the structural 
+    information in the attached environment. Unless otherwise noted in the 
+    scorer, a lower "score" is better!
 
-    :param bb_list: Loop for which to calculate the given score
-    :type bb_list:  :class:`~promod3.loop.BackboneList`
     :param start_resnum: Res. number defining the position in the SEQRES
                          (see :class:`BackboneScoreEnv` for indexing)
-    :type start_resnum:  :class:`int`
-    :param chain_idx: Index of chain the loop belongs to
+    :type start_resnum:  :class:`int` / :class:`list` of :class:`int`
+    :param num_residues: Number of residues in the stretch(es) to score
+    :type num_residues: :class:`int` / :class:`list` of :class:`int`
+    :param chain_idx: Index of chain the stretch(es) belongs to
                       (see :class:`BackboneScoreEnv` for indexing)
-    :type chain_idx:  :class:`int`
+    :type chain_idx:  :class:`int` / :class:`list` of :class:`int`
 
-    :return: Score for the given loop.
+    :return: Score for the given stretch(es).
     :rtype:  :class:`float`
 
     :raises: (for most scorers) :exc:`~exceptions.RuntimeError` if scorer was
              never attached to a score environment, if scorer has never been
-             properly initialized or if *chain_index* / *start_resnum* lead to
-             invalid positions.
+             properly initialized or if *start_resnum* / *num_residues* / 
+             *chain_idx* lead to invalid positions.
 
-  .. method:: CalculateScoreProfile(bb_list, start_resnum, chain_idx=0)
+  .. method:: CalculateScoreProfile(start_resnum, num_residues, chain_idx=0)
 
-    Calculates per residue scores for the given loop internally and against the
-    set environment. Data in the environment, which overlaps with the given
-    *bb_list* is ignored.
+    Calculates per residue scores for one or several stretches given the 
+    structural information in the attached environment.
 
-    :param bb_list: Loop for which to calculate the given scores
-    :type bb_list:  :class:`~promod3.loop.BackboneList`
     :param start_resnum: Res. number defining the position in the SEQRES
                          (see :class:`BackboneScoreEnv` for indexing)
-    :type start_resnum:  :class:`int`
-    :param chain_idx: Index of chain the loop belongs to
+    :type start_resnum:  :class:`int` / :class:`list` of :class:`int`
+    :param num_residues: Number of residues in the stretch(es) to score
+    :type num_residues: :class:`int` / :class:`list` of :class:`int`
+    :param chain_idx: Index of chain the stretch(es) belongs to
                       (see :class:`BackboneScoreEnv` for indexing)
-    :type chain_idx:  :class:`int`
+    :type chain_idx:  :class:`int` / :class:`list` of :class:`int`
 
-    :return: Scores for the given loop, one for each residue.
-    :rtype:  :class:`list` of :class:`float`
+    :return: Scores for the given stretch(es), one for each residue.
+    :rtype:  :class:`list` of :class:`float` or :class:`list` of :class:`list`
+             of :class:`float`
 
     :raises: same :exc:`~exceptions.RuntimeError` as :meth:`CalculateScore`.
 
@@ -171,25 +166,7 @@ CBPackingScorer class
 
   Inherits all functionality of :class:`BackboneScorer`. Evaluates pseudo
   energies by counting the number of other CB positions within a certain
-  *cutoff* radius of the CB position of the residue to be evaluated. The
-  calculated score is normalized by the number of residues in the loop.
-  In the default mode, the scorer scores a :class:`promod3.loop.BackboneList` 
-  given the defined environment. By placing this 
-  :class:`promod3.loop.BackboneList`, the score of the residues in the 
-  environment also change. It is possible to honour this effect by using the 
-  "IncludeEnv" mode. In this alternative mode, every environment residue close 
-  to the input :class:`promod3.loop.BackboneList` also contributes 
-  to the final score by adding the difference in score when the environment 
-  residue sees the original environment and the score when the environment would 
-  be modified by the :class:`promod3.loop.BackboneList`. You choose the mode 
-  by specifically calling the according CalculateEnergy functions. 
-  If you call the CalculateScore function from the parent class
-  (e.g. when the scorer is part of the :class:`BackboneOverallScorer`), it
-  gets checked what mode is currently active. You can toggle the mode by calling
-  the appropriate functions in this class. By default (when you load a scorer or
-  when you create a new scorer) the classic version gets called. If you want to
-  get per residue scores, the "IncludeEnv" mode makes not much sense and the 
-  scorer throws an error if a profile is requeset in this mode.
+  *cutoff* radius of the CB position of the residue to be evaluated. 
 
   The scorer needs to be initialized either by loading a predefined scorer (e.g.
   :func:`LoadCBPackingScorer`) or by setting all energies (see
@@ -245,16 +222,12 @@ CBPackingScorer class
 
     :raises: :exc:`~exceptions.RuntimeError` if inputs are invalid
 
-  .. method:: UseClassicMode()
+  .. method:: DoNormalize(do_it) 
 
-    If you call this function, the default mode is set to classic if the 
-    CalculateScore function from the parent class gets called. 
+    :param do_it:       Whether to normalize the calculated scores by the number
+                        of residues to be scored. True by default.
+    :type do_it:        :class:`bool`
 
-  .. method:: UseIncludeEnvMode()
-
-    If you call this function, the default mode is set to the 
-    described alternative mode if the CalculateScore function from the parent 
-    class gets called. 
 
 .. function:: LoadCBPackingScorer()
 
@@ -270,9 +243,8 @@ CBetaScorer class
   Inherits all functionality of :class:`BackboneScorer`. Evaluates a pairwise
   pseudo interaction energy between CB atoms which are located within a *cutoff*
   and which are at least *seq_sep* residues apart. An energy is assigned to each
-  distance using *bins* equally sized bins and distinguishing all possible pairs
-  of amino acids. The calculated score is normalized by the number of
-  interacting CB pairs.
+  distance using equally sized bins and distinguishing all possible pairs
+  of amino acids.  
 
   The scorer needs to be initialized either by loading a predefined scorer (e.g.
   :func:`LoadCBetaScorer`) or by setting all energies (see :meth:`SetEnergy`).
@@ -321,6 +293,9 @@ CBetaScorer class
 
     Setup one energy value. Unless a predefined scorer is loaded, this must be
     called for every pair of amino acids and for every *bin* < *bins*.
+    Internal symmetry is enforced => Calling SetEnergy(aa1, aa2, bin, energy) is
+    equivalent to calling SetEnergy(aa1, aa2, bin, energy) AND
+    SetEnergy(aa2, aa1, bin, energy).
 
     :param aa1: Amino acid for first interaction partner.
     :type aa1:  :class:`ost.conop.AminoAcid`
@@ -333,6 +308,25 @@ CBetaScorer class
 
     :raises: :exc:`~exceptions.RuntimeError` if inputs are invalid
 
+  .. method:: DoInternalScores(do_it) 
+
+    :param do_it:       Whether to include pairwise interactions between
+                        the scored residues. True by default.
+    :type do_it:        :class:`bool`
+
+  .. method:: DoExternalScores(do_it) 
+
+    :param do_it:       Whether to include pairwise interactions of the scored
+                        residues towards the surrounding environment. 
+                        True by default.
+    :type do_it:        :class:`bool`
+
+  .. method:: DoNormalize(do_it) 
+
+    :param do_it:       Whether to normalize the calculated scores by the number
+                        of residues to be scored. True by default.
+    :type do_it:        :class:`bool`
+
 
 .. function:: LoadCBetaScorer()
 
@@ -348,7 +342,7 @@ ReducedScorer class
   Inherits all functionality of :class:`BackboneScorer`. Evaluates a pairwise
   pseudo interaction energy between the reduced representation of residues.
   Every residue gets represented by its CA position p and a directional
-  component ``v = norm(ca_pos-n_pos) + norm (ca_pos-c_pos)``. Residues with CA
+  component ``v = norm(p-n_pos) + norm(p-c_pos)``. Residues with CA
   distance < *cutoff* and which are at least *seq_sep* residues apart are
   considered to be interacting. For interacting residues r1 and r2, we can
   define a line l between p1 and p2. The potential then considers:
@@ -358,10 +352,6 @@ ReducedScorer class
   * beta => angle between v2 and l
   * gamma => dihedral between (p1+v1,p1,p2,p2+v2)
 
-  Every pairwise interaction within the loop and to the environment gets
-  evaluated according to the given parametrization, summed up and finally
-  normalized by the number of total interactions.
-
   The scorer needs to be initialized either by loading a predefined scorer (e.g.
   :func:`LoadReducedScorer`) or by setting all energies (see :meth:`SetEnergy`).
 
@@ -418,6 +408,11 @@ ReducedScorer class
     called for every pair of amino acids, every *dist_bin* < *dist_bins*, every
     *alpha_bin* < *angle_bins*, every *beta_bin* < *angle_bins* and every
     *gamma_bin* < *dihedral_bins*.
+    Internal symmetry is enforced => Calling 
+    SetEnergy(aa1, aa2, dist_bin, alpha_bin, beta_bin, energy) is
+    equivalent to calling 
+    SetEnergy(aa1, aa2, dist_bin, alpha_bin, beta_bin, energy) AND
+    SetEnergy(aa2, aa1, dist_bin, beta_bin, alpha_bin, energy).
 
     :param aa1: Amino acid for first interaction partner.
     :type aa1:  :class:`ost.conop.AminoAcid`
@@ -436,6 +431,24 @@ ReducedScorer class
 
     :raises: :exc:`~exceptions.RuntimeError` if inputs are invalid
 
+  .. method:: DoInternalScores(do_it) 
+
+    :param do_it:       Whether to include pairwise interactions between
+                        the scored residues. True by default.
+    :type do_it:        :class:`bool`
+
+  .. method:: DoExternalScores(do_it) 
+
+    :param do_it:       Whether to include pairwise interactions of the scored
+                        residues towards the surrounding environment. 
+                        True by default.
+    :type do_it:        :class:`bool`
+
+  .. method:: DoNormalize(do_it) 
+
+    :param do_it:       Whether to normalize the calculated scores by the number
+                        of residues to be scored. True by default.
+    :type do_it:        :class:`bool`
 
 .. function:: LoadReducedScorer()
 
@@ -450,29 +463,27 @@ ClashScorer class
 
   Inherits all functionality of :class:`BackboneScorer`. Calculates a simple
   clash score of a loop itself and with the set environment. There is no need to
-  define any parameters here as all interaction energies are fixed. The
-  calculated score is normalized by the number of residues in the loop.
+  define any parameters here as all interaction energies are fixed (see Eq. (11) 
+  in [canutescu2003b]_). 
 
+  .. method:: DoInternalScores(do_it) 
 
-DensityScorer class
---------------------------------------------------------------------------------
+    :param do_it:       Whether to include pairwise interactions between
+                        the scored residues. True by default.
+    :type do_it:        :class:`bool`
 
-.. class:: DensityScorer
+  .. method:: DoExternalScores(do_it) 
 
-  Inherits all functionality of :class:`BackboneScorer`. Calculates the
-  normalized cross correlation between a density generated from the input
-  :class:`~promod3.loop.BackboneList` and a set map.
+    :param do_it:       Whether to include pairwise interactions of the scored
+                        residues towards the surrounding environment. 
+                        True by default.
+    :type do_it:        :class:`bool`
 
-  This scorer requires that the attached environment has a density map defined
-  (see :meth:`BackboneScoreEnv.SetMap`) as soon as a score is to be calculated.
-  The *resolution* and *all_atom* flags that were specified in SetMap determine
-  how the backbone list is translated into an artificial density map. If
-  *all_atom* is set to False (which is recommended for low resolution maps), the
-  artificial map gets constructed by only using CA positions instead of all
-  atoms.
+  .. method:: DoNormalize(do_it) 
 
-  Note that for this scorer a higher "score" is better! So take care when
-  combining this to other scores, where it is commonly the other way around.
+    :param do_it:       Whether to normalize the calculated scores by the number
+                        of residues to be scored. True by default.
+    :type do_it:        :class:`bool`
 
 
 HBondScorer class
@@ -499,10 +510,6 @@ HBondScorer class
   thats the one from which the energy is extracted. In all other cases, the
   energy is extracted from the 0 state.
 
-  Every pairwise interaction within the loop and to the environment gets
-  evaluated according to the given parametrization, summed up and finally
-  normalized by the number of residues in the loop.
-
   The scorer needs to be initialized either by loading a predefined scorer (e.g.
   :func:`LoadHBondScorer`) or by setting all energies (see :meth:`SetEnergy`).
 
@@ -589,6 +596,25 @@ HBondScorer class
 
     :raises: :exc:`~exceptions.RuntimeError` if inputs are invalid
 
+  .. method:: DoInternalScores(do_it) 
+
+    :param do_it:       Whether to include pairwise interactions between
+                        the scored residues. True by default.
+    :type do_it:        :class:`bool`
+
+  .. method:: DoExternalScores(do_it) 
+
+    :param do_it:       Whether to include pairwise interactions of the scored
+                        residues towards the surrounding environment. 
+                        True by default.
+    :type do_it:        :class:`bool`
+
+  .. method:: DoNormalize(do_it) 
+
+    :param do_it:       Whether to normalize the calculated scores by the number
+                        of residues to be scored. True by default.
+    :type do_it:        :class:`bool`
+
 
 .. function:: LoadHBondScorer()
 
@@ -607,8 +633,7 @@ SSAgreementScorer class
   structure in the model. In every score evaluation, the secondary structure of
   the loop is estimated by searching for hydrogen bonds leading to a secondary
   structure as defined by dssp. The hbonds are searched internally in the loop
-  as well as in the environment. The final score gets summed up over all
-  residues in the loop and normalized by the number of residues.
+  as well as in the environment. 
 
   The scorer needs to be initialized either by loading a predefined scorer (e.g.
   :func:`LoadSSAgreementScorer`) or by setting scores for all possible states
@@ -665,6 +690,11 @@ SSAgreementScorer class
 
     :raises: :exc:`~exceptions.RuntimeError` if inputs are invalid
 
+  .. method:: DoNormalize(do_it) 
+
+    :param do_it:       Whether to normalize the calculated scores by the number
+                        of residues to be scored. True by default.
+    :type do_it:        :class:`bool`
 
 .. function:: LoadSSAgreementScorer()
 
@@ -679,9 +709,7 @@ TorsionScorer class
 
   Inherits all functionality of :class:`BackboneScorer`. Evaluates pseudo
   energies based on the identity of three consecutive residues and the phi/psi
-  dihedral angles of the central residue. Every residue gets evaluated according
-  to the set parametrization and the final score gets normalized by the total
-  number of summed pseudo energies. The first phi and last psi angle get
+  dihedral angles of the central residue. The first phi and last psi angle get
   determined with the help of the environment if set.
 
   The scorer needs to be initialized either by loading a predefined scorer (e.g.
@@ -746,6 +774,11 @@ TorsionScorer class
 
     :raises: :exc:`~exceptions.RuntimeError` if inputs are invalid
 
+  .. method:: DoNormalize(do_it) 
+
+    :param do_it:       Whether to normalize the calculated scores by the number
+                        of residues to be scored. True by default.
+    :type do_it:        :class:`bool`
 
 .. function:: LoadTorsionScorer()
 
@@ -759,14 +792,28 @@ PairwiseScorer class
 .. class:: PairwiseScorer
 
   Inherits all functionality of :class:`BackboneScorer`. Evaluates a list of
-  generic pairwise functions (see :class:`PairwiseFunction`). When evaluating a
-  loop, the scores of all pairwise functions which involve a residue in the loop
-  are summed up (the other residue can be either in the loop or in the env.) and
-  normalized by the number of residues in the loop.
-
-  This scorer assumes that the attached environment has pairwise functions
-  defined (see :meth:`BackboneScoreEnv.ApplyPairwiseFunction`) as soon as a
-  score is to be calculated.
+  generic pairwise functions (see :class:`PairwiseFunction`). 
+  That are set in the attached scoring environment 
+  (see :meth:`BackboneScoreEnv.ApplyPairwiseFunction`).
 
   Note that for this scorer a higher "score" is better! So take care when
   combining this to other scores, where it is commonly the other way around.
+
+  .. method:: DoInternalScores(do_it) 
+
+    :param do_it:       Whether to include pairwise interactions between
+                        the scored residues. True by default.
+    :type do_it:        :class:`bool`
+
+  .. method:: DoExternalScores(do_it) 
+
+    :param do_it:       Whether to include pairwise interactions of the scored
+                        residues towards the surrounding environment. 
+                        True by default.
+    :type do_it:        :class:`bool`, true by default.
+
+  .. method:: DoNormalize(do_it) 
+
+    :param do_it:       Whether to normalize the calculated scores by the number
+                        of residues to be scored. True by default.
+    :type do_it:        :class:`bool`
diff --git a/scoring/doc/index.rst b/scoring/doc/index.rst
index 9b9a97882cf52c828b6d48133c6b721a34cb66b8..983d6b5587c5f70fc9088e6bdac386567fef16c3 100644
--- a/scoring/doc/index.rst
+++ b/scoring/doc/index.rst
@@ -9,8 +9,8 @@
 Tools and algorithms to score loops. The scoring system is split between an
 environment which contains model-specific data and scorers which evaluate loops.
 
-In this example, we load a structure, setup a score environment and a few
-scorers and finally score some loops:
+In this example, we load a structure, setup a score environment, link a few
+scorers to it and finally score some loops:
 
 .. literalinclude:: ../../../tests/doc/scripts/scoring_main.py
 
@@ -22,3 +22,4 @@ Contents:
    backbone_score_env
    backbone_scorers
    all_atom_scorers
+   other_scoring_functions
diff --git a/scoring/doc/other_scoring_functions.rst b/scoring/doc/other_scoring_functions.rst
new file mode 100644
index 0000000000000000000000000000000000000000..f505232e026655cdebf83d068269e805eb99fedd
--- /dev/null
+++ b/scoring/doc/other_scoring_functions.rst
@@ -0,0 +1,56 @@
+Other Scoring Functions
+================================================================================
+
+.. currentmodule:: promod3.scoring
+
+
+Scoring Functions from SCWRL3
+--------------------------------------------------------------------------------
+
+.. method:: SCWRL3PairwiseScore(d, Rij)
+
+  Pairwise score from the SCWRL3 sidechain construction algorithm 
+  [canutescu2003b]_.
+
+  :param d:             Distance between the two interacting particles
+  :param Rij:           Summed hard-sphere radii of the interacting particles.
+                        Suggestions from the paper:
+
+                        - carbon: 1.6
+                        - oxygen: 1.3
+                        - nitrogen: 1.3
+                        - sulfur: 1.7
+
+  :type d:              :class:`float`
+  :type Rij:            :class:`float`
+
+  :returns:             The score
+  :rtype:               :class:`float`
+
+
+.. method:: SCWRL3DisulfidScore(ca_pos_one, cb_pos_one, sg_pos_one\
+                                ca_pos_two, cb_pos_two, sg_pos_two)
+
+  Implements the empirically derived disulfid score from the SCWRL3 sidechain 
+  construction algorithm [canutescu2003b]_.
+
+  :param ca_pos_one:    CA carbon position of first amino acid
+  :param cb_pos_one:    CB carbon position of first amino acid
+  :param sg_pos_one:    SG sulfur position of first amino acid
+  :param ca_pos_two:    CA carbon position of second amino acid
+  :param cb_pos_two:    CB carbon position of second amino acid
+  :param sg_pos_two:    SG sulfur position of second amino acid
+
+  :type ca_pos_one:     :class:`ost.geoom.Vec3`
+  :type cb_pos_one:     :class:`ost.geoom.Vec3`
+  :type sg_pos_one:     :class:`ost.geoom.Vec3`
+  :type ca_pos_two:     :class:`ost.geoom.Vec3`
+  :type cb_pos_two:     :class:`ost.geoom.Vec3`
+  :type sg_pos_two:     :class:`ost.geoom.Vec3`
+
+  :returns:             The score
+  :rtype:               :class:`float`
+
+
+
+.. [canutescu2003b] Canutescu AA, Shelenkov AA, Dunbrack RL Jr. (2003). A graph-theory algorithm for rapid protein side-chain prediction. Protein Sci (2003).
diff --git a/scoring/pymod/CMakeLists.txt b/scoring/pymod/CMakeLists.txt
index 5ab970484bfd5417bb6dab9677e8e29e8a3a0cad..204b23c99faca4e12550be667881f6bf5e3cb867 100644
--- a/scoring/pymod/CMakeLists.txt
+++ b/scoring/pymod/CMakeLists.txt
@@ -4,6 +4,8 @@ export_all_atom_score.cc
 export_object_loader.cc
 export_pairwise_functions.cc
 export_constraint_constructor.cc
+export_scwrl3_energy_functions.cc
+export_density_scorer.cc
 wrap_scoring.cc
 )
 
diff --git a/scoring/pymod/export_all_atom_score.cc b/scoring/pymod/export_all_atom_score.cc
index c2d0f3da72a497c1830266da8207b7a77d87952b..ddaa3f50594fadf0dad1e71ee833d26e1d970777 100644
--- a/scoring/pymod/export_all_atom_score.cc
+++ b/scoring/pymod/export_all_atom_score.cc
@@ -28,26 +28,44 @@ Real WrapCalculateLinearCombination(AllAtomOverallScorer& s,
   core::ConvertDictToMap(weights, w);
   return s.CalculateLinearCombination(w, start_resnum, num_residues, chain_idx);
 }
-Real WrapCalculateLinearCombinationRN(AllAtomOverallScorer& s,
-                                      const boost::python::dict& weights,
-                                      const ost::mol::ResNum& start_resnum,
-                                      uint num_residues, uint chain_idx) {
-  uint num = start_resnum.GetNum();
-  return WrapCalculateLinearCombination(s, weights, num, num_residues,
-                                        chain_idx);
-}
+Real WrapCalculateLinearCombinationList(AllAtomOverallScorer& s,
+                                        const boost::python::dict& weights,
+                                        const boost::python::list& start_resnum, 
+                                        const boost::python::list& num_residues,
+                                        const boost::python::list& chain_idx) {
+  std::map<String, Real> w;
+  core::ConvertDictToMap(weights, w);
+  
+  std::vector<uint> v_start_resnum;
+  std::vector<uint> v_num_residues;
+  std::vector<uint> v_chain_idx;
+
+  core::ConvertListToVector(start_resnum, v_start_resnum);
+  core::ConvertListToVector(num_residues, v_num_residues);
+  core::ConvertListToVector(chain_idx, v_chain_idx);
 
+  return s.CalculateLinearCombination(w, v_start_resnum, v_num_residues, 
+                                      v_chain_idx);
+}
 Real WrapAACalculateScore(const AllAtomScorer& scorer, uint start_resnum,
                           uint num_residues, uint chain_idx) {
   return scorer.CalculateScore(start_resnum, num_residues, chain_idx);
-}
-Real WrapAACalculateScoreRN(const AllAtomScorer& scorer,
-                            const ost::mol::ResNum& start_resnum,
-                            uint num_residues, uint chain_idx) {
-  uint num = start_resnum.GetNum();
-  return scorer.CalculateScore(num, num_residues, chain_idx);
-}
+}  
+Real WrapAACalculateScoreList(AllAtomScorer& scorer, 
+                              boost::python::list& start_resnum,
+                              boost::python::list& num_residues,
+                              boost::python::list& chain_idx) {
+
+  std::vector<uint> v_start_resnum;
+  std::vector<uint> v_num_residues;
+  std::vector<uint> v_chain_idx;
+
+  core::ConvertListToVector(start_resnum, v_start_resnum);
+  core::ConvertListToVector(num_residues, v_num_residues);
+  core::ConvertListToVector(chain_idx, v_chain_idx);
 
+  return scorer.CalculateScore(v_start_resnum, v_num_residues, v_chain_idx);
+}
 boost::python::list
 WrapAACalculateScoreProfile(const AllAtomScorer& scorer, uint start_resnum,
                             uint num_residues, uint chain_idx) {
@@ -57,21 +75,48 @@ WrapAACalculateScoreProfile(const AllAtomScorer& scorer, uint start_resnum,
   core::AppendVectorToList(profile, return_list);
   return return_list;
 }
-boost::python::list
-WrapAACalculateScoreProfileRN(const AllAtomScorer& scorer,
-                              const ost::mol::ResNum& start_resnum,
-                              uint num_residues, uint chain_idx) {
-  uint num = start_resnum.GetNum();
-  return WrapAACalculateScoreProfile(scorer, num, num_residues, chain_idx);
-}
+boost::python::list 
+WrapAACalculateScoreProfileList(const AllAtomScorer& scorer,
+                                boost::python::list& start_resnum,
+                                boost::python::list& num_residues,
+                                boost::python::list& chain_idx) {
+
+  std::vector<uint> v_start_resnum;
+  std::vector<uint> v_num_residues;
+  std::vector<uint> v_chain_idx;
+
+  core::ConvertListToVector(start_resnum, v_start_resnum);
+  core::ConvertListToVector(num_residues, v_num_residues);
+  core::ConvertListToVector(chain_idx, v_chain_idx);
+
+  std::vector<std::vector<Real> > profile;
+  scorer.CalculateScoreProfile(v_start_resnum, v_num_residues, v_chain_idx, 
+                               profile);
 
+  boost::python::list return_list;
+  for(uint i = 0; i < profile.size(); ++i) {
+    boost::python::list l;
+    core::AppendVectorToList(profile[i], l);
+    return_list.append(l);
+  }
+  return return_list;   
+}
 } // anon wrapper ns
 
 void export_AllAtomScore() {
   
   // base scorer
   class_<AllAtomScorer, boost::noncopyable, AllAtomScorerPtr>
-    ("AllAtomScorer", no_init);
+    ("AllAtomScorer", no_init)
+    .def("CalculateScore", WrapAACalculateScore,
+         (arg("start_resnum"), arg("num_residues"), arg("chain_idx")=0))
+    .def("CalculateScore", WrapAACalculateScoreList,
+         (arg("start_resnum"), arg("num_residues"), arg("chain_idx")))
+    .def("CalculateScoreProfile", WrapAACalculateScoreProfile,
+         (arg("start_resnum"), arg("num_residues"), arg("chain_idx")=0))
+    .def("CalculateScoreProfile", WrapAACalculateScoreProfileList,
+         (arg("start_resnum"), arg("num_residues"), arg("chain_idx")))
+  ;
 
   // overall scorer
   class_<AllAtomOverallScorer, AllAtomOverallScorerPtr>
@@ -85,9 +130,9 @@ void export_AllAtomScore() {
     .def("CalculateLinearCombination", &WrapCalculateLinearCombination,
          (arg("linear_weights"), arg("start_resnum"), arg("num_residues"),
           arg("chain_idx")=0))
-    .def("CalculateLinearCombination", &WrapCalculateLinearCombinationRN,
+    .def("CalculateLinearCombination", &WrapCalculateLinearCombinationList,
          (arg("linear_weights"), arg("start_resnum"), arg("num_residues"),
-          arg("chain_idx")=0))
+          arg("chain_idx")))
   ;
 
   class_<AllAtomInteractionScorer, AllAtomInteractionScorerPtr,
@@ -103,16 +148,11 @@ void export_AllAtomScore() {
          (arg("filename")))
     .def("SetEnergy", &AllAtomInteractionScorer::SetEnergy,
          (arg("aaa1"), arg("aaa2"), arg("bin"), arg("energy")))
-    .def("CalculateScore", WrapAACalculateScore,
-         (arg("start_resnum"), arg("num_residues"), arg("chain_idx")=0))
-    .def("CalculateScore", WrapAACalculateScoreRN,
-         (arg("start_resnum"), arg("num_residues"), arg("chain_idx")=0))
-    .def("CalculateScoreProfile", WrapAACalculateScoreProfile,
-         (arg("start_resnum"), arg("num_residues"), arg("chain_idx")=0))
-    .def("CalculateScoreProfile", WrapAACalculateScoreProfileRN,
-         (arg("start_resnum"), arg("num_residues"), arg("chain_idx")=0))
     .def("AttachEnvironment", &AllAtomInteractionScorer::AttachEnvironment,
          (arg("env")))
+    .def("DoInternalScores", &AllAtomInteractionScorer::DoInternalScores)
+    .def("DoExternalScores", &AllAtomInteractionScorer::DoExternalScores)
+    .def("DoNormalize", &AllAtomInteractionScorer::DoNormalize)
   ;
 
   class_<AllAtomPackingScorer, AllAtomPackingScorerPtr,
@@ -128,31 +168,19 @@ void export_AllAtomScore() {
          (arg("filename")))
     .def("SetEnergy", &AllAtomPackingScorer::SetEnergy,
          (arg("aaa"), arg("count"), arg("energy")))
-    .def("CalculateScore", WrapAACalculateScore,
-         (arg("start_resnum"), arg("num_residues"), arg("chain_idx")=0))
-    .def("CalculateScore", WrapAACalculateScoreRN,
-         (arg("start_resnum"), arg("num_residues"), arg("chain_idx")=0))
-    .def("CalculateScoreProfile", WrapAACalculateScoreProfile,
-         (arg("start_resnum"), arg("num_residues"), arg("chain_idx")=0))
-    .def("CalculateScoreProfile", WrapAACalculateScoreProfileRN,
-         (arg("start_resnum"), arg("num_residues"), arg("chain_idx")=0))
     .def("AttachEnvironment", &AllAtomPackingScorer::AttachEnvironment,
          (arg("env")))
+    .def("DoNormalize", &AllAtomPackingScorer::DoNormalize)
   ;
 
   class_<AllAtomClashScorer, AllAtomClashScorerPtr,
          bases<AllAtomScorer> >
     ("AllAtomClashScorer",init<>())
-    .def("CalculateScore", WrapAACalculateScore,
-         (arg("start_resnum"), arg("num_residues"), arg("chain_idx")=0))
-    .def("CalculateScore", WrapAACalculateScoreRN,
-         (arg("start_resnum"), arg("num_residues"), arg("chain_idx")=0))
-    .def("CalculateScoreProfile", WrapAACalculateScoreProfile,
-         (arg("start_resnum"), arg("num_residues"), arg("chain_idx")=0))
-    .def("CalculateScoreProfile", WrapAACalculateScoreProfileRN,
-         (arg("start_resnum"), arg("num_residues"), arg("chain_idx")=0))
     .def("AttachEnvironment", &AllAtomClashScorer::AttachEnvironment,
          (arg("env")))
+    .def("DoInternalScores", &AllAtomClashScorer::DoInternalScores)
+    .def("DoExternalScores", &AllAtomClashScorer::DoExternalScores)
+    .def("DoNormalize", &AllAtomClashScorer::DoNormalize)
   ;
 
 }
diff --git a/scoring/pymod/export_backbone_score.cc b/scoring/pymod/export_backbone_score.cc
index 2d405b074bdec64c3d04e226808fb3f3e2836e53..8bc2b5800aac45118768dc14f9f0a44427bf0b36 100644
--- a/scoring/pymod/export_backbone_score.cc
+++ b/scoring/pymod/export_backbone_score.cc
@@ -8,7 +8,6 @@
 #include <promod3/scoring/clash_score.hh>
 #include <promod3/scoring/hbond_score.hh>
 #include <promod3/scoring/ss_agreement_score.hh>
-#include <promod3/scoring/density_score.hh>
 #include <promod3/scoring/torsion_score.hh>
 #include <promod3/scoring/pairwise_score.hh>
 
@@ -68,6 +67,27 @@ namespace {
     env->SetPsipredPrediction(pp_v);
   }
 
+  void WrapStashSingle(BackboneScoreEnvPtr env, uint rnum, uint num_residues,
+                       uint chain_idx) {
+    env->Stash(rnum, num_residues, chain_idx);
+  }
+
+
+  void WrapStashList(BackboneScoreEnvPtr env, const boost::python::list& rnum, 
+                     const boost::python::list& num_residues,
+                     const boost::python::list& chain_idx) {
+
+    std::vector<uint> v_rnum;
+    std::vector<uint> v_num_residues;
+    std::vector<uint> v_chain_idx;
+
+    core::ConvertListToVector(rnum, v_rnum);
+    core::ConvertListToVector(num_residues, v_num_residues);
+    core::ConvertListToVector(chain_idx, v_chain_idx);
+
+    env->Stash(v_rnum, v_num_residues, v_chain_idx);
+  }
+
   BackboneScorerPtr bos_getitem(BackboneOverallScorer& s, const String& key) {
     return s[key];
   }
@@ -76,52 +96,53 @@ namespace {
     s[key] = item;
   }
   Real WrapCalculate(BackboneOverallScorer& s, const String& key,
-                     const loop::BackboneList& bb_list,
-                     uint start_resnum, uint chain_idx) {
-    return s.Calculate(key, bb_list, start_resnum, chain_idx);
+                     uint start_resnum, uint num_residues, uint chain_idx) {
+    return s.Calculate(key, start_resnum, num_residues, chain_idx);
   }
-  boost::python::list WrapCalculateList(
-                        BackboneOverallScorer& s, const String& key,
-                        const boost::python::list& py_list,
-                        uint start_resnum, uint chain_idx) {
-    // get bb_lists
-    std::vector<loop::BackboneList> bb_lists;
-    core::ConvertListToVector(py_list, bb_lists);
-    // get scores
-    std::vector<Real> scores = s.Calculate(key, bb_lists, start_resnum,
-                                           chain_idx);
-    // convert and return
-    boost::python::list return_list;
-    core::AppendVectorToList(scores, return_list);
-    return return_list;
+  Real WrapCalculateList(BackboneOverallScorer& s, const String& key,
+                         const boost::python::list& start_resnum, 
+                         const boost::python::list& num_residues, 
+                         const boost::python::list& chain_idx) {
+
+    std::vector<uint> v_start_resnum;
+    std::vector<uint> v_num_residues;
+    std::vector<uint> v_chain_idx;
+
+    core::ConvertListToVector(start_resnum, v_start_resnum);
+    core::ConvertListToVector(num_residues, v_num_residues);
+    core::ConvertListToVector(chain_idx, v_chain_idx);
+
+    return s.Calculate(key, v_start_resnum, v_num_residues, v_chain_idx);
   }
   Real WrapCalculateLinearCombination(BackboneOverallScorer& s,
                                       const boost::python::dict& weights,
-                                      const loop::BackboneList& bb_list,
-                                      uint start_resnum, uint chain_idx) {
+                                      uint start_resnum, 
+                                      uint num_residues, 
+                                      uint chain_idx) {
     std::map<String, Real> w;
     core::ConvertDictToMap(weights, w);
-    return s.CalculateLinearCombination(w, bb_list, start_resnum, chain_idx);
+    return s.CalculateLinearCombination(w, start_resnum, num_residues, 
+                                        chain_idx);
   }
-  boost::python::list WrapCalculateLinearCombinationList(
-                        BackboneOverallScorer& s,
-                        const boost::python::dict& weights,
-                        const boost::python::list& py_list,
-                        uint start_resnum, uint chain_idx) {
-    // get bb_lists
-    std::vector<loop::BackboneList> bb_lists;
-    core::ConvertListToVector(py_list, bb_lists);
-    // get scores
+  Real WrapCalculateLinearCombinationList(BackboneOverallScorer& s,
+                                      const boost::python::dict& weights,
+                                      const boost::python::list& start_resnum, 
+                                      const boost::python::list& num_residues, 
+                                      const boost::python::list& chain_idx) {
     std::map<String, Real> w;
     core::ConvertDictToMap(weights, w);
-    std::vector<Real> scores =
-      s.CalculateLinearCombination(w, bb_lists, start_resnum, chain_idx);
-    // convert and return
-    boost::python::list return_list;
-    core::AppendVectorToList(scores, return_list);
-    return return_list;
-  }
 
+    std::vector<uint> v_start_resnum;
+    std::vector<uint> v_num_residues;
+    std::vector<uint> v_chain_idx;
+
+    core::ConvertListToVector(start_resnum, v_start_resnum);
+    core::ConvertListToVector(num_residues, v_num_residues);
+    core::ConvertListToVector(chain_idx, v_chain_idx);
+
+    return s.CalculateLinearCombination(w, v_start_resnum, v_num_residues, 
+                                        v_chain_idx);
+  }
   TorsionScorerPtr WrapTorsionScorerInit(
                       const boost::python::list& group_identifier,
                       uint bins_per_dimension) {
@@ -131,15 +152,60 @@ namespace {
     return p;
   }
 
-  boost::python::list WrapScoreProfile(BackboneScorerPtr scorer,
-                                       const promod3::loop::BackboneList& bb_list,
-                                       uint start_resnum, uint chain_idx){
+  Real WrapScoreSingle(BackboneScorerPtr scorer, uint start_resnum, 
+                       uint num_residues, uint chain_idx){
+
+    return scorer->CalculateScore(start_resnum, num_residues, chain_idx);
+  }
+  boost::python::list WrapScoreProfileSingle(BackboneScorerPtr scorer,
+                                             uint start_resnum, uint num_residues,
+                                             uint chain_idx){
     std::vector<Real> profile;
-    scorer->CalculateScoreProfile(bb_list, start_resnum, chain_idx, profile);
+    scorer->CalculateScoreProfile(start_resnum, num_residues, chain_idx, profile);
     boost::python::list return_list;
     core::AppendVectorToList(profile, return_list);
     return return_list;   
   }
+  Real WrapScoreList(BackboneScorerPtr scorer, 
+                     boost::python::list& start_resnum,
+                     boost::python::list& num_residues,
+                     boost::python::list& chain_idx) {
+
+    std::vector<uint> v_start_resnum;
+    std::vector<uint> v_num_residues;
+    std::vector<uint> v_chain_idx;
+
+    core::ConvertListToVector(start_resnum, v_start_resnum);
+    core::ConvertListToVector(num_residues, v_num_residues);
+    core::ConvertListToVector(chain_idx, v_chain_idx);
+
+    return scorer->CalculateScore(v_start_resnum, v_num_residues, v_chain_idx);
+  }
+  boost::python::list WrapScoreProfileList(BackboneScorerPtr scorer,
+                                           boost::python::list& start_resnum,
+                                           boost::python::list& num_residues,
+                                           boost::python::list& chain_idx){
+
+    std::vector<uint> v_start_resnum;
+    std::vector<uint> v_num_residues;
+    std::vector<uint> v_chain_idx;
+
+    core::ConvertListToVector(start_resnum, v_start_resnum);
+    core::ConvertListToVector(num_residues, v_num_residues);
+    core::ConvertListToVector(chain_idx, v_chain_idx);
+
+    std::vector<std::vector<Real> > profile;
+    scorer->CalculateScoreProfile(v_start_resnum, v_num_residues, v_chain_idx, 
+                                  profile);
+
+    boost::python::list return_list;
+    for(uint i = 0; i < profile.size(); ++i) {
+      boost::python::list l;
+      core::AppendVectorToList(profile[i], l);
+      return_list.append(l);
+    }
+    return return_list;   
+  }
 }
 
 void export_BackboneScore() {
@@ -166,19 +232,28 @@ void export_BackboneScore() {
          (arg("start_resnum"), arg("num_residues"), arg("chain_idx") = 0))
     .def("SetPsipredPrediction", &WrapSetPsipredPrediction, (arg("pred")))
     .def("SetPsipredPrediction", &WrapSetPsipredPredictionList, (arg("pred")))
-    .def("SetMap", &BackboneScoreEnv::SetMap,
-         (arg("map"), arg("resolution"), arg("all_atom")=false))
     .def("AddPairwiseFunction", &BackboneScoreEnv::AddPairwiseFunction,
          (arg("function"), arg("function_type")))
     .def("ApplyPairwiseFunction", &BackboneScoreEnv::ApplyPairwiseFunction,
          (arg("chain_idx_one"), arg("resnum_one"), arg("chain_idx_two"),
           arg("resnum_two"), arg("f_idx")))
+    .def("Stash", &WrapStashSingle, (arg("start_rnum"), arg("num_residues"), 
+                                     arg("chain_idx")=0))
+    .def("Stash", &WrapStashList, (arg("start_rnums"), arg("num_residues"), 
+                                     arg("chain_indices")=0))    
+    .def("Pop", &BackboneScoreEnv::Pop)
     .def("GetSeqres", &BackboneScoreEnv::GetSeqres)
   ;
 
   // base scorer
   class_<BackboneScorer, boost::noncopyable, BackboneScorerPtr>
-    ("BackboneScorer", no_init);
+    ("BackboneScorer", no_init)
+    .def("CalculateScore", &WrapScoreSingle,(arg("start_resnum"), arg("num_residues"), arg("chain_idx") = 0))
+    .def("CalculateScoreProfile", &WrapScoreProfileSingle,(arg("start_resnum"), arg("num_residues"), arg("chain_idx") = 0))
+    .def("CalculateScore", &WrapScoreList,(arg("start_resnum"), arg("num_residues"), arg("chain_idx") = 0))
+    .def("CalculateScoreProfile", &WrapScoreProfileList,(arg("start_resnum"), arg("num_residues"), arg("chain_idx") = 0))
+
+    ;
 
   // overall scorer
   class_<BackboneOverallScorer, BackboneOverallScorerPtr>
@@ -190,15 +265,15 @@ void export_BackboneScore() {
     .def("AttachEnvironment", &BackboneOverallScorer::AttachEnvironment,
          (arg("env")))
     .def("Calculate", &WrapCalculate,
-         (arg("key"), arg("bb_list"), arg("start_resnum"), arg("chain_idx")=0))
-    .def("Calculate", &WrapCalculateList,
-         (arg("key"), arg("bb_lists"), arg("start_resnum"), arg("chain_idx")=0))
+         (arg("key"), arg("start_resnum"), arg("num_residues"), arg("chain_idx")=0))
     .def("CalculateLinearCombination", &WrapCalculateLinearCombination,
-         (arg("linear_weights"), arg("bb_list"), arg("start_resnum"),
+         (arg("linear_weights"), arg("start_resnum"), arg("num_residues"),
           arg("chain_idx")=0))
+    .def("Calculate", &WrapCalculateList,
+         (arg("key"), arg("start_resnum"), arg("num_residues"), arg("chain_idx")=0))
     .def("CalculateLinearCombination", &WrapCalculateLinearCombinationList,
-         (arg("linear_weights"), arg("bb_lists"), arg("start_resnum"),
-          arg("chain_idx")=0))
+         (arg("linear_weights"), arg("start_resnum"), arg("num_residues"),
+          arg("chain_idx")))
   ;
 
   // individual scorers
@@ -209,10 +284,7 @@ void export_BackboneScore() {
     .def("LoadPortable", &CBPackingScorer::LoadPortable,(arg("filename"))).staticmethod("LoadPortable")
     .def("SavePortable", &CBPackingScorer::SavePortable,(arg("filename")))
     .def("SetEnergy", &CBPackingScorer::SetEnergy,(arg("aa"),arg("count"),arg("energy")))
-    .def("CalculateScore", &CBPackingScorer::CalculateScore,(arg("bb_list"), arg("start_resnum"), arg("chain_idx") = 0))
-    .def("CalculateScoreProfile", &WrapScoreProfile,(arg("bb_list"), arg("start_resnum"), arg("chain_idx") = 0))
-    .def("UseClassicMode", &CBPackingScorer::UseClassicMode)
-    .def("UseIncludeEnvMode",&CBPackingScorer::UseIncludeEnvMode)
+    .def("DoNormalize", &CBPackingScorer::DoNormalize)
     .def("AttachEnvironment", &CBPackingScorer::AttachEnvironment,(arg("env")))
   ;
 
@@ -223,8 +295,9 @@ void export_BackboneScore() {
     .def("LoadPortable", &CBetaScorer::LoadPortable,(arg("filename"))).staticmethod("LoadPortable")
     .def("SavePortable", &CBetaScorer::SavePortable,(arg("filename")))
     .def("SetEnergy", &CBetaScorer::SetEnergy,(arg("aa1"),arg("aa2"),arg("bin"),arg("energy")))
-    .def("CalculateScore", &CBetaScorer::CalculateScore,(arg("bb_list"), arg("start_resnum"), arg("chain_idx") = 0))
-    .def("CalculateScoreProfile", &WrapScoreProfile,(arg("bb_list"), arg("start_resnum"), arg("chain_idx") = 0))
+    .def("DoInternalScores", &CBetaScorer::DoInternalScores)
+    .def("DoExternalScores", &CBetaScorer::DoExternalScores)
+    .def("DoNormalize", &CBetaScorer::DoNormalize)
     .def("AttachEnvironment", &CBetaScorer::AttachEnvironment,(arg("env")))
   ;
 
@@ -235,23 +308,18 @@ void export_BackboneScore() {
     .def("LoadPortable", &ReducedScorer::LoadPortable,(arg("filename"))).staticmethod("LoadPortable")
     .def("SavePortable", &ReducedScorer::SavePortable,(arg("filename")))
     .def("SetEnergy", &ReducedScorer::SetEnergy,(arg("aa1"),arg("aa2"),arg("dist_bin"),arg("alpha_bin"),arg("beta_bin"),arg("gamma_bin"),arg("energy")))
-    .def("CalculateScore", &ReducedScorer::CalculateScore,(arg("bb_list"), arg("start_resnum"), arg("chain_idx") = 0))
-    .def("CalculateScoreProfile", &WrapScoreProfile,(arg("bb_list"), arg("start_resnum"), arg("chain_idx") = 0))
+    .def("DoInternalScores", &ReducedScorer::DoInternalScores)
+    .def("DoExternalScores", &ReducedScorer::DoExternalScores)
+    .def("DoNormalize", &ReducedScorer::DoNormalize)
     .def("AttachEnvironment", &ReducedScorer::AttachEnvironment,(arg("env")))
   ;
 
   class_<ClashScorer, ClashScorerPtr, bases<BackboneScorer> >
     ("ClashScorer",init<>())
-    .def("CalculateScore", &ClashScorer::CalculateScore,(arg("bb_list"), arg("start_resnum"), arg("chain_idx") = 0))
-    .def("CalculateScoreProfile", &WrapScoreProfile,(arg("bb_list"), arg("start_resnum"), arg("chain_idx") = 0))
     .def("AttachEnvironment", &ClashScorer::AttachEnvironment,(arg("env")))
-  ;
-
-  class_<DensityScorer, DensityScorerPtr, bases<BackboneScorer> >
-    ("DensityScorer", init<>())
-    .def("CalculateScore", &DensityScorer::CalculateScore,(arg("bb_list"), arg("start_resnum"), arg("chain_idx") = 0))
-    .def("CalculateScoreProfile", &WrapScoreProfile,(arg("bb_list"), arg("start_resnum"), arg("chain_idx") = 0))
-    .def("AttachEnvironment", &DensityScorer::AttachEnvironment,(arg("env")))
+    .def("DoInternalScores", &ClashScorer::DoInternalScores)
+    .def("DoExternalScores", &ClashScorer::DoExternalScores)
+    .def("DoNormalize", &ClashScorer::DoNormalize)
   ;
 
   class_<HBondScorer, HBondScorerPtr, bases<BackboneScorer> >
@@ -261,8 +329,9 @@ void export_BackboneScore() {
     .def("LoadPortable", &HBondScorer::LoadPortable,(arg("filename"))).staticmethod("LoadPortable")
     .def("SavePortable", &HBondScorer::SavePortable,(arg("filename")))
     .def("SetEnergy", &HBondScorer::SetEnergy,(arg("state"),arg("d_bin"),arg("alpha_bin"),arg("beta_bin"),arg("gamma_bin"),arg("energy")))
-    .def("CalculateScore", &HBondScorer::CalculateScore,(arg("bb_list"), arg("start_resnum"), arg("chain_idx") = 0))
-    .def("CalculateScoreProfile", &WrapScoreProfile,(arg("bb_list"), arg("start_resnum"), arg("chain_idx") = 0))
+    .def("DoInternalScores", &HBondScorer::DoInternalScores)
+    .def("DoExternalScores", &HBondScorer::DoExternalScores)
+    .def("DoNormalize", &HBondScorer::DoNormalize)
     .def("AttachEnvironment", &HBondScorer::AttachEnvironment,(arg("env")))
   ;
 
@@ -273,8 +342,7 @@ void export_BackboneScore() {
     .def("LoadPortable", &SSAgreementScorer::LoadPortable,(arg("filename"))).staticmethod("LoadPortable")
     .def("SavePortable", &SSAgreementScorer::SavePortable,(arg("filename")))
     .def("SetScore", &SSAgreementScorer::SetScore,(arg("psipred_state"),arg("psipred_cfi"),arg("dssp_state"),arg("score")))
-    .def("CalculateScore", &SSAgreementScorer::CalculateScore,(arg("bb_list"), arg("start_resnum"), arg("chain_idx") = 0))
-    .def("CalculateScoreProfile", &WrapScoreProfile,(arg("bb_list"), arg("start_resnum"), arg("chain_idx") = 0))
+    .def("DoNormalize", &SSAgreementScorer::DoNormalize)
     .def("AttachEnvironment", &SSAgreementScorer::AttachEnvironment,(arg("env")))
   ;
 
@@ -286,16 +354,16 @@ void export_BackboneScore() {
     .def("LoadPortable", &TorsionScorer::LoadPortable,(arg("filename"))).staticmethod("LoadPortable")
     .def("SavePortable", &TorsionScorer::SavePortable,(arg("filename")))
     .def("SetEnergy", &TorsionScorer::SetEnergy,(arg("group_idx"),arg("phi_bin"),arg("psi_bin"),arg("energy")))
-    .def("CalculateScore", &TorsionScorer::CalculateScore,(arg("bb_list"), arg("start_resnum"), arg("chain_idx") = 0))
-    .def("CalculateScoreProfile", &WrapScoreProfile,(arg("bb_list"), arg("start_resnum"), arg("chain_idx") = 0))
+    .def("DoNormalize", &TorsionScorer::DoNormalize)
     .def("AttachEnvironment", &TorsionScorer::AttachEnvironment,(arg("env")))
   ;
 
   class_<PairwiseScorer, PairwiseScorerPtr, bases<BackboneScorer> >
     ("PairwiseScorer", init<>())
-    .def("CalculateScore", &PairwiseScorer::CalculateScore,(arg("bb_list"), arg("start_resnum"), arg("chain_idx") = 0))
-    .def("CalculateScoreProfile", &WrapScoreProfile,(arg("bb_list"), arg("start_resnum"), arg("chain_idx") = 0))
     .def("AttachEnvironment", &PairwiseScorer::AttachEnvironment,(arg("env")))
+    .def("DoInternalScores", &PairwiseScorer::DoInternalScores)
+    .def("DoExternalScores", &PairwiseScorer::DoExternalScores)
+    .def("DoNormalize", &PairwiseScorer::DoNormalize)
   ;
 
 }
diff --git a/scoring/pymod/export_density_scorer.cc b/scoring/pymod/export_density_scorer.cc
new file mode 100644
index 0000000000000000000000000000000000000000..f022f963aee63b41120ca950a1db90d89b14ffec
--- /dev/null
+++ b/scoring/pymod/export_density_scorer.cc
@@ -0,0 +1,11 @@
+#include <boost/python.hpp>
+#include <promod3/scoring/density_score.hh>
+
+using namespace boost::python;
+
+void export_DensityScoring() {
+  def("DensityScore", &promod3::scoring::DensityScore, (arg("bb_list"), 
+                                                        arg("map"),
+                                                        arg("resolution"),
+                                                        arg("all_atom")));
+}
diff --git a/scoring/pymod/export_scwrl3_energy_functions.cc b/scoring/pymod/export_scwrl3_energy_functions.cc
new file mode 100644
index 0000000000000000000000000000000000000000..54c5a8e1e8155b575dc8d0971eeaee102c683a89
--- /dev/null
+++ b/scoring/pymod/export_scwrl3_energy_functions.cc
@@ -0,0 +1,18 @@
+#include <boost/python.hpp>
+#include <promod3/scoring/scwrl3_energy_functions.hh>
+#include <promod3/core/export_helper.hh>
+
+using namespace promod3;
+using namespace promod3::scoring;
+using namespace boost::python;
+
+
+void export_SCWRL3EnergyFunctions() {
+
+  def("SCWRL3PairwiseScore", &SCWRL3PairwiseScore, (arg("distance"), arg("summed_vdw_radii")));
+
+  def("SCWRL3DisulfidScore", &SCWRL3DisulfidScore, (arg("ca_pos_one"), arg("cb_pos_one"),
+                                                    arg("sg_pos_one"), arg("ca_pos_two"),
+                                                    arg("cb_pos_two"), arg("sg_pos_two")));
+
+}
diff --git a/scoring/pymod/wrap_scoring.cc b/scoring/pymod/wrap_scoring.cc
index c4384b81842dd601cbba1dc9898707a067198044..4b717f9cbc40743c1e84fcef141dc8e95bdb874f 100644
--- a/scoring/pymod/wrap_scoring.cc
+++ b/scoring/pymod/wrap_scoring.cc
@@ -5,6 +5,8 @@ void export_ObjectLoader();
 void export_PairwiseFunction();
 void export_constraint_constructor();
 void export_AllAtomScore();
+void export_SCWRL3EnergyFunctions();
+void export_DensityScoring();
 
 using namespace boost::python;
 
@@ -15,4 +17,6 @@ BOOST_PYTHON_MODULE(_scoring)
   export_ObjectLoader();
   export_PairwiseFunction();
   export_constraint_constructor();
+  export_SCWRL3EnergyFunctions();
+  export_DensityScoring();
 }
diff --git a/scoring/src/CMakeLists.txt b/scoring/src/CMakeLists.txt
index 37549f126a3e914713972017c4b1bbee2da74ba0..b094b380024947c20e5282ad135f429006b4d8c9 100644
--- a/scoring/src/CMakeLists.txt
+++ b/scoring/src/CMakeLists.txt
@@ -24,6 +24,7 @@ all_atom_interaction_env_listener.hh
 all_atom_interaction_score.hh
 all_atom_packing_score.hh
 all_atom_clash_score.hh
+scwrl3_energy_functions.hh
 )
 
 set(SCORING_SOURCES
diff --git a/scoring/src/all_atom_clash_score.cc b/scoring/src/all_atom_clash_score.cc
index 571ca5954569a9e1e22744549ef4fd587ab5ec01..eb011421297ff1de8c10f6fbd5a14533c2c2706e 100644
--- a/scoring/src/all_atom_clash_score.cc
+++ b/scoring/src/all_atom_clash_score.cc
@@ -1,10 +1,14 @@
 #include <promod3/scoring/all_atom_clash_score.hh>
 #include <promod3/core/runtime_profiling.hh>
 #include <promod3/core/check_io.hh>
+#include <promod3/scoring/scwrl3_energy_functions.hh>
 
 namespace promod3 { namespace scoring {
 
-AllAtomClashScorer::AllAtomClashScorer(): attached_environment_(false) {
+AllAtomClashScorer::AllAtomClashScorer(): do_internal_scores_(true),
+                                          do_external_scores_(true),
+                                          normalize_(true),
+                                          attached_environment_(false) {
 
   promod3::core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
                        "AllAtomClashScorer::AllAtomClashScorer", 2);
@@ -67,14 +71,8 @@ AllAtomClashScorer::AllAtomClashScorer(): attached_environment_(false) {
         Rij = 2.5;
       }
       for (uint bin = 0; bin < bins_; ++bin) {
-        Real energy = 0;
-        const Real r = bin / bins_per_a_;
-        if (r < Real(0.8254) * Rij) {
-          energy = 10;
-        } else if (r <= Rij) {
-          energy = 57.273 * (1 - r/Rij);
-        }
-        energies_[this->EIdx(a, b, bin)] = energy;
+        const Real d = static_cast<Real>(bin) / bins_per_a_;
+        energies_[this->EIdx(a, b, bin)] = SCWRL3PairwiseScore(d, Rij);
       }
     }
   }
@@ -90,22 +88,35 @@ Real AllAtomClashScorer::CalculateScore(uint start_resnum, uint num_residues,
   promod3::core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
                             "AllAtomClashScorer::CalculateScore", 2);
 
+  if (!attached_environment_) {
+    String err = "Can only calculate score when environment is attached!";
+    throw promod3::Error(err);
+  }
+
+  // get scores
+  std::vector<uint> idx_vec;
+  std::vector<bool> occupied; 
+  idx_handler_->SetupScoreCalculation(start_resnum, num_residues, 
+                                      chain_idx, idx_vec, occupied);
+
   // get scores
   std::vector<Real> ex_scores, in_scores;
-  std::vector<uint> counts;
-  Score(start_resnum, num_residues, chain_idx, ex_scores, in_scores, counts);
-  // sum / normalize them
-  // -> we count internal scores half as the same pair appears twice
-  uint count = 0;
+  this->Score(idx_vec, ex_scores, in_scores, occupied);
   Real ex_score = 0.0;
   Real in_score = 0.0;
   for (uint i = 0; i < num_residues; ++i) {
     ex_score += ex_scores[i];
     in_score += in_scores[i];
-    count += counts[i];
   }
-  if (count > 0) return (ex_score + Real(0.5)*in_score) / count;
-  else           return (ex_score + Real(0.5)*in_score);
+
+  // we count internal scores half as the same pair appears twice
+  Real score = ex_score + Real(0.5)*in_score;
+
+  if(normalize_ && !ex_scores.empty()) {
+    score /= ex_scores.size();
+  }
+
+  return score;
 }
 
 void AllAtomClashScorer::CalculateScoreProfile(
@@ -115,14 +126,101 @@ void AllAtomClashScorer::CalculateScoreProfile(
   promod3::core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
                             "AllAtomClashScorer::CalculateScoreProfile", 2);
 
+  if (!attached_environment_) {
+    String err = "Can only calculate score when environment is attached!";
+    throw promod3::Error(err);
+  }
+
   // get scores
+  std::vector<uint> idx_vec;
+  std::vector<bool> occupied; 
+  idx_handler_->SetupScoreCalculation(start_resnum, num_residues, 
+                                      chain_idx, idx_vec, occupied);
+
   std::vector<Real> in_scores;
-  std::vector<uint> counts;
-  Score(start_resnum, num_residues, chain_idx, profile, in_scores, counts);
-  // combine and normalize them
+  this->Score(idx_vec, profile, in_scores, occupied);
+  // combine them
   for (uint i = 0; i < num_residues; ++i) {
-    if (counts[i] > 0) profile[i] = (profile[i] + in_scores[i]) / counts[i];
-    else               profile[i] += in_scores[i];
+    profile[i] = profile[i] + in_scores[i];
+  }
+}
+
+Real AllAtomClashScorer::CalculateScore(
+                                    const std::vector<uint>& start_resnum, 
+                                    const std::vector<uint>& num_residues,
+                                    const std::vector<uint>& chain_idx) const {
+  
+  promod3::core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
+                                "AllAtomClashScorer::CalculateScore", 2);
+
+  if (!attached_environment_) {
+    String err = "Can only calculate score when environment is attached!";
+    throw promod3::Error(err);
+  }
+
+  // setup
+  std::vector<std::vector<uint> > indices_vec;
+  std::vector<bool> occupied; 
+  idx_handler_->SetupScoreCalculation(start_resnum, num_residues, 
+                                      chain_idx, indices_vec, 
+                                      occupied);
+
+  // get scores and sum them up
+  Real external_score = 0.0;
+  Real internal_score = 0.0;
+  uint n_scored_residues = 0;
+  for(uint i = 0; i < start_resnum.size(); ++i) {
+    std::vector<Real> external_scores;
+    std::vector<Real> internal_scores;
+    this->Score(indices_vec[i], external_scores, internal_scores, occupied);
+    for (uint j = 0; j < external_scores.size(); ++j) {
+      external_score += external_scores[j];
+      internal_score += internal_scores[j];
+    }
+    n_scored_residues += external_scores.size();
+  }
+
+  // all interactions in internal_score have been observed twice!
+  external_score += Real(0.5)*internal_score;
+
+  if(normalize_ && n_scored_residues > 0) {
+    external_score /= n_scored_residues;
+  }
+
+  return external_score;
+}
+
+void AllAtomClashScorer::CalculateScoreProfile(
+                              const std::vector<uint>& start_resnum, 
+                              const std::vector<uint>& num_residues,
+                              const std::vector<uint>& chain_idx,
+                              std::vector<std::vector<Real> >& profile) const {
+  
+  promod3::core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
+                                "AllAtomClashScorer::CalculateScore", 2);
+
+  if (!attached_environment_) {
+    String err = "Can only calculate score when environment is attached!";
+    throw promod3::Error(err);
+  }
+
+  // setup
+  std::vector<std::vector<uint> > indices_vec;
+  std::vector<bool> occupied; 
+  idx_handler_->SetupScoreCalculation(start_resnum, num_residues, 
+                                      chain_idx, indices_vec, 
+                                      occupied);
+
+  // get scores 
+  profile.resize(start_resnum.size());
+  for(uint i = 0; i < start_resnum.size(); ++i) {
+    std::vector<Real> external_scores;
+    std::vector<Real> internal_scores;
+    std::vector<Real>& current_profile = profile[i];
+    this->Score(indices_vec[i], current_profile, internal_scores, occupied);
+    for (uint j = 0; j < current_profile.size(); ++j) {
+      current_profile[j] += internal_scores[j];
+    }
   }
 }
 
@@ -134,33 +232,28 @@ void AllAtomClashScorer::AttachEnvironment(loop::AllAtomEnv& env) {
   attached_environment_ = true;
 }
 
-void AllAtomClashScorer::Score(
-             uint start_resnum, uint num_residues, uint chain_idx,
-             std::vector<Real>& ex_scores, std::vector<Real>& in_scores,
-             std::vector<uint>& counts) const {
+void AllAtomClashScorer::Score(const std::vector<uint>& indices,
+                               std::vector<Real>& external_scores,
+                               std::vector<Real>& internal_scores,
+                               std::vector<bool>& occupied) const {
   
   // setup
-  if (!attached_environment_) {
-    String err = "Can only calculate score when environment is attached!";
-    throw promod3::Error(err);
+  uint n_indices = indices.size();
+  external_scores.resize(n_indices);
+  internal_scores.resize(n_indices);
+
+  if(n_indices == 0) {
+    return;
   }
-  uint start_idx, end_idx;
-  idx_handler_->SetupScoreCalculation(start_resnum, num_residues, chain_idx,
-                                      start_idx, end_idx);
 
-  // get scores
-  ex_scores.resize(num_residues);
-  in_scores.resize(num_residues);
-  counts.resize(num_residues);
   // let's go over every atom
   AllAtomInteractionSpatialOrganizer::WithinResult within_result;
   std::pair<AllAtomInteractionSpatialOrganizerItem*,Real>* a;
   // helpers
   int min_idx_chain, max_idx_chain, start_neglect, end_neglect;
-  for (uint i = 0; i < num_residues; ++i) {
+  for (uint i = 0; i < indices.size(); ++i) {
     // init
-    const uint res_idx = start_idx + i;
-    uint num_set_atoms = 0;
+    const uint res_idx = indices[i];
     Real ex_score = 0.0;
     Real in_score = 0.0;
     // check neglect range for residue
@@ -175,34 +268,35 @@ void AllAtomClashScorer::Score(
     for (uint idx = first_idx; idx <= last_idx; ++idx) {
       // only if set
       if (all_pos_->IsSet(idx)) {
-        ++num_set_atoms;
         // get clash scores
         const AllAtomClashType my_ct = clash_type_[all_pos_->GetAAA(idx)];
         within_result = env_->FindWithin(all_pos_->GetPos(idx), cutoff_[my_ct]);
         a = within_result.first;
         for (uint j = 0; j < within_result.second; ++j) {
           // skip if too close
-          const int other_idx = int(a[j].first->res_idx);
-          if (other_idx < start_neglect || other_idx > end_neglect) {
+          const int other_res_idx = int(a[j].first->res_idx);
+          if (other_res_idx < start_neglect || other_res_idx > end_neglect) {
             // score it
             const AllAtomClashType other_ct = clash_type_[a[j].first->aaa];
             const uint bin = a[j].second * bins_per_a_;
-            if (uint(other_idx) < start_idx || uint(other_idx) > end_idx) {
-              // external interaction
-              ex_score += energies_[this->EIdx(my_ct, other_ct, bin)];
-            } else {
+            if (occupied[other_res_idx]) {
               // internal interaction
-              in_score += energies_[this->EIdx(my_ct, other_ct, bin)];
+              if(do_internal_scores_) {
+                in_score += energies_[this->EIdx(my_ct, other_ct, bin)];
+              }
+            } else {
+              // external interaction
+              if(do_external_scores_) {
+                ex_score += energies_[this->EIdx(my_ct, other_ct, bin)];
+              }
             }
-            
           }
         }
       }
     }
     // set values
-    ex_scores[i] = ex_score;
-    in_scores[i] = in_score;
-    counts[i] = num_set_atoms;
+    external_scores[i] = ex_score;
+    internal_scores[i] = in_score;
   }
 }
 
diff --git a/scoring/src/all_atom_clash_score.hh b/scoring/src/all_atom_clash_score.hh
index 24c05b1fa9bd29952dda0c9f5f2149a10070330b..df69a60646241c8a1c563c8234b7bc30283ee193 100644
--- a/scoring/src/all_atom_clash_score.hh
+++ b/scoring/src/all_atom_clash_score.hh
@@ -30,12 +30,28 @@ public:
 
   virtual ~AllAtomClashScorer();
 
-  virtual Real CalculateScore(uint start_resnum, uint num_residues,
-                              uint chain_idx) const;
+  void DoInternalScores(bool do_it) { do_internal_scores_ = do_it; }
+
+  void DoExternalScores(bool do_it) { do_external_scores_ = do_it; }
+
+  void DoNormalize(bool do_it) { normalize_ = do_it; }
+
+  virtual Real 
+  CalculateScore(uint start_resnum, uint num_residues, uint chain_idx) const;
+
   virtual void
   CalculateScoreProfile(uint start_resnum, uint num_residues, uint chain_idx,
                         std::vector<Real>& profile) const;
 
+  virtual Real CalculateScore(const std::vector<uint>& start_resnum, 
+                              const std::vector<uint>& num_residues,
+                              const std::vector<uint>& chain_idx) const;
+
+  virtual void CalculateScoreProfile(const std::vector<uint>& start_resnum,
+                              const std::vector<uint>& num_residues, 
+                              const std::vector<uint>& chain_idx,
+                              std::vector<std::vector<Real> >& profile) const;
+
   virtual void AttachEnvironment(loop::AllAtomEnv& env);
 
 private:
@@ -44,16 +60,20 @@ private:
     return (a * ALL_ATOM_CLASH_NUM + b) * bins_ + bin;
   }
 
-  void Score(uint start_resnum, uint num_residues, uint chain_idx,
-             std::vector<Real>& ex_scores, std::vector<Real>& in_scores,
-             std::vector<uint>& counts) const;
+  void Score(const std::vector<uint>& indices, 
+             std::vector<Real>& external_scores,
+             std::vector<Real>& internal_scores,
+             std::vector<bool>& occupied) const;
 
   // hard coded bounds (safe for dist. < 3.41 (should be enough...))
   static const uint bins_ = 341;
-  static const Real bins_per_a_ = 100;
+  static const uint bins_per_a_ = 100;
   AllAtomClashType clash_type_[loop::XXX_NUM_ATOMS];
   Real cutoff_[ALL_ATOM_CLASH_NUM];
-  Real* energies_;
+  Real* energies_;  
+  bool do_internal_scores_;
+  bool do_external_scores_;
+  bool normalize_;
 
   // environment specific information, set upon calling AttachEnvironment
   bool attached_environment_;
diff --git a/scoring/src/all_atom_interaction_score.cc b/scoring/src/all_atom_interaction_score.cc
index 08c61660944238820d9190f193ade731d4818f58..35c9f4955e2a13070a4b6ff4fa3b93731a90ac4f 100644
--- a/scoring/src/all_atom_interaction_score.cc
+++ b/scoring/src/all_atom_interaction_score.cc
@@ -6,8 +6,9 @@ namespace promod3 { namespace scoring {
 
 AllAtomInteractionScorer::AllAtomInteractionScorer(
                          Real cutoff, uint bins, uint seq_sep)
-                         : cutoff_(cutoff), bins_(bins), seq_sep_(seq_sep)
-                         , attached_environment_(false) {
+                         : cutoff_(cutoff), bins_(bins), seq_sep_(seq_sep),
+                           do_internal_scores_(true), do_external_scores_(true),
+                           normalize_(true), attached_environment_(false) {
 
   promod3::core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
                        "AllAtomInteractionScorer::AllAtomInteractionScorer", 2);
@@ -181,6 +182,7 @@ void AllAtomInteractionScorer::SetEnergy(loop::AminoAcidAtom a,
   }
 
   energies_[this->EIdx(a, b, bin)] = e;
+  energies_[this->EIdx(b, a, bin)] = e;
 }
 
 Real AllAtomInteractionScorer::CalculateScore(uint start_resnum,
@@ -190,27 +192,36 @@ Real AllAtomInteractionScorer::CalculateScore(uint start_resnum,
   promod3::core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
                             "AllAtomInteractionScorer::CalculateScore", 2);
 
+  if (!attached_environment_) {
+    String err = "Can only calculate score when environment is attached!";
+    throw promod3::Error(err);
+  }
+
+  // setup
+  std::vector<uint> idx_vec;
+  std::vector<bool> occupied; 
+  idx_handler_->SetupScoreCalculation(start_resnum, num_residues, 
+                                      chain_idx, idx_vec, occupied);
+
   // get scores
   std::vector<Real> ex_scores, in_scores;
-  std::vector<uint> ex_counts, in_counts;
-  Score(start_resnum, num_residues, chain_idx, ex_scores, in_scores,
-        ex_counts, in_counts);
+  this->Score(idx_vec, ex_scores, in_scores, occupied);
   // sum them
-  uint ex_count = 0;
-  uint in_count = 0;
   Real ex_score = 0.0;
   Real in_score = 0.0;
   for (uint i = 0; i < num_residues; ++i) {
     ex_score += ex_scores[i];
     in_score += in_scores[i];
-    ex_count += ex_counts[i];
-    in_count += in_counts[i];
   }
-  // normalize: we count internal scores half as the same pair appears twice
-  const Real score = ex_score + Real(0.5) * in_score;
-  const Real count = ex_count + Real(0.5) * in_count;
-  if (count > 0) return score / count;
-  else           return score;
+
+  // we count internal scores half as the same pair appears twice
+  Real score = ex_score + Real(0.5)*in_score;
+
+  if(normalize_ && !in_scores.empty()) {
+    score /= in_scores.size();
+  }
+
+  return score;
 }
 
 void AllAtomInteractionScorer::CalculateScoreProfile(
@@ -220,16 +231,101 @@ void AllAtomInteractionScorer::CalculateScoreProfile(
   promod3::core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
                           "AllAtomInteractionScorer::CalculateScoreProfile", 2);
 
+  if (!attached_environment_) {
+    String err = "Can only calculate score when environment is attached!";
+    throw promod3::Error(err);
+  }
+
   // get scores
+  std::vector<uint> idx_vec;
+  std::vector<bool> occupied; 
+  idx_handler_->SetupScoreCalculation(start_resnum, num_residues, 
+                                      chain_idx, idx_vec, occupied);
+
   std::vector<Real> in_scores;
-  std::vector<uint> ex_counts, in_counts;
-  Score(start_resnum, num_residues, chain_idx, profile, in_scores,
-        ex_counts, in_counts);
-  // combine and normalize them
+  this->Score(idx_vec, profile, in_scores, occupied);
+  // combine them
   for (uint i = 0; i < num_residues; ++i) {
-    const uint count = ex_counts[i] + in_counts[i];
-    if (count > 0) profile[i] = (profile[i] + in_scores[i]) / count;
-    else           profile[i] += in_scores[i];
+    profile[i] = profile[i] + in_scores[i];
+  }
+}
+
+Real AllAtomInteractionScorer::CalculateScore(
+                                    const std::vector<uint>& start_resnum, 
+                                    const std::vector<uint>& num_residues,
+                                    const std::vector<uint>& chain_idx) const {
+  
+  promod3::core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
+                                "AllAtomInteractionScorer::CalculateScore", 2);
+
+  if (!attached_environment_) {
+    String err = "Can only calculate score when environment is attached!";
+    throw promod3::Error(err);
+  }
+
+  // setup
+  std::vector<std::vector<uint> > indices_vec;
+  std::vector<bool> occupied; 
+  idx_handler_->SetupScoreCalculation(start_resnum, num_residues, 
+                                      chain_idx, indices_vec, 
+                                      occupied);
+
+  // get scores and sum them up
+  Real external_score = 0.0;
+  Real internal_score = 0.0;
+  uint n_scored_residues = 0;
+  for(uint i = 0; i < start_resnum.size(); ++i) {
+    std::vector<Real> external_scores;
+    std::vector<Real> internal_scores;
+    this->Score(indices_vec[i], external_scores, internal_scores, occupied);
+    for (uint j = 0; j < external_scores.size(); ++j) {
+      external_score += external_scores[j];
+      internal_score += internal_scores[j];
+    }
+    n_scored_residues += external_scores.size();
+  }
+
+  // all interactions in internal_score have been observed twice!
+  external_score += Real(0.5)*internal_score;
+
+  if(normalize_ && n_scored_residues > 0) {
+    external_score /= n_scored_residues;
+  }
+
+  return external_score;
+}
+
+void AllAtomInteractionScorer::CalculateScoreProfile(
+                              const std::vector<uint>& start_resnum, 
+                              const std::vector<uint>& num_residues,
+                              const std::vector<uint>& chain_idx,
+                              std::vector<std::vector<Real> >& profile) const {
+  
+  promod3::core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
+                                "AllAtomInteractionScorer::CalculateScore", 2);
+
+  if (!attached_environment_) {
+    String err = "Can only calculate score when environment is attached!";
+    throw promod3::Error(err);
+  }
+
+  // setup
+  std::vector<std::vector<uint> > indices_vec;
+  std::vector<bool> occupied; 
+  idx_handler_->SetupScoreCalculation(start_resnum, num_residues, 
+                                      chain_idx, indices_vec, 
+                                      occupied);
+
+  // get scores 
+  profile.resize(start_resnum.size());
+  for(uint i = 0; i < start_resnum.size(); ++i) {
+    std::vector<Real> external_scores;
+    std::vector<Real> internal_scores;
+    std::vector<Real>& current_profile = profile[i];
+    this->Score(indices_vec[i], current_profile, internal_scores, occupied);
+    for (uint j = 0; j < current_profile.size(); ++j) {
+      current_profile[j] += internal_scores[j];
+    }
   }
 }
 
@@ -241,40 +337,35 @@ void AllAtomInteractionScorer::AttachEnvironment(loop::AllAtomEnv& env) {
   attached_environment_ = true;
 }
 
-void AllAtomInteractionScorer::Score(
-             uint start_resnum, uint num_residues, uint chain_idx,
-             std::vector<Real>& ex_scores, std::vector<Real>& in_scores,
-             std::vector<uint>& ex_counts, std::vector<uint>& in_counts) const {
+void AllAtomInteractionScorer::Score(const std::vector<uint>& indices,
+                                     std::vector<Real>& external_scores,
+                                     std::vector<Real>& internal_scores,
+                                     std::vector<bool>& occupied) const {
 
   // setup
-  if (!attached_environment_) {
-    String err = "Can only calculate score when environment is attached!";
-    throw promod3::Error(err);
+  uint n_indices = indices.size();
+  external_scores.resize(n_indices);
+  internal_scores.resize(n_indices);
+
+  if(n_indices == 0) {
+    return;
   }
-  uint start_idx, end_idx;
-  idx_handler_->SetupScoreCalculation(start_resnum, num_residues, chain_idx,
-                                      start_idx, end_idx);
+
   const Real inv_bin_size = bins_ / cutoff_;
   // let's reduce the cutoff a bit -> hack to ensure bin always within range
   const Real cutoff = cutoff_ - 0.001;
 
-  // get scores
-  ex_scores.resize(num_residues);
-  ex_counts.resize(num_residues);
-  in_scores.resize(num_residues);
-  in_counts.resize(num_residues);
   // let's go over every residue
   AllAtomInteractionSpatialOrganizer::WithinResult within_result;
   std::pair<AllAtomInteractionSpatialOrganizerItem*,Real>* a;
   // helpers
   int neglect_range = int(seq_sep_) - 1;
   int min_idx_chain, max_idx_chain, start_neglect, end_neglect;
-  for (uint i = 0; i < num_residues; ++i) {
+
+  for (uint i = 0; i < indices.size(); ++i) {
     // init
-    const uint res_idx = start_idx + i;
-    uint ex_count = 0;
+    const uint res_idx = indices[i];
     Real ex_score = 0.0;
-    uint in_count = 0;
     Real in_score = 0.0;
     // check neglect range for residue
     const uint chain_idx = idx_handler_->GetChainIdx(res_idx);
@@ -292,27 +383,27 @@ void AllAtomInteractionScorer::Score(
         within_result = env_->FindWithin(all_pos_->GetPos(idx), cutoff);
         a = within_result.first;
         for (uint j = 0; j < within_result.second; ++j) {
-          const int other_idx = int(a[j].first->res_idx);
-          if (other_idx < start_neglect || other_idx > end_neglect) {
+          const int other_res_idx = int(a[j].first->res_idx);
+          if (other_res_idx < start_neglect || other_res_idx > end_neglect) {
             const uint bin = a[j].second * inv_bin_size;
-            if (uint(other_idx) < start_idx || uint(other_idx) > end_idx) {
-              // external interaction
-              ex_score += energies_[this->EIdx(myaaa, a[j].first->aaa, bin)];
-              ++ex_count;
-            } else {
+            if(occupied[other_res_idx]) {
               // internal interaction
-              in_score += energies_[this->EIdx(myaaa, a[j].first->aaa, bin)];
-              ++in_count;
+              if(do_internal_scores_) {
+                in_score += energies_[this->EIdx(myaaa, a[j].first->aaa, bin)];
+              } 
+            } else {
+              // external interaction
+              if(do_external_scores_) {
+                ex_score += energies_[this->EIdx(myaaa, a[j].first->aaa, bin)];
+              }
             }
           }
         }
       }
     }
     // set values
-    ex_scores[i] = ex_score;
-    ex_counts[i] = ex_count;
-    in_scores[i] = in_score;
-    in_counts[i] = in_count;
+    external_scores[i] = ex_score;
+    internal_scores[i] = in_score;
   }
 }
 
diff --git a/scoring/src/all_atom_interaction_score.hh b/scoring/src/all_atom_interaction_score.hh
index e4f21cb1ae827cf6b0982cf95488ce425ac4248b..5aadd05c56ca9b67ac8f86259ef6e06d9350c1fa 100644
--- a/scoring/src/all_atom_interaction_score.hh
+++ b/scoring/src/all_atom_interaction_score.hh
@@ -31,17 +31,36 @@ public:
   void SetEnergy(loop::AminoAcidAtom a, loop::AminoAcidAtom b, uint bin,
                  Real e);
 
-  virtual Real CalculateScore(uint start_resnum, uint num_residues,
-                              uint chain_idx) const;
+  void DoInternalScores(bool do_it) { do_internal_scores_ = do_it; }
+
+  void DoExternalScores(bool do_it) { do_external_scores_ = do_it; }
+
+  void DoNormalize(bool do_it) { normalize_ = do_it; }
+
+  virtual Real 
+  CalculateScore(uint start_resnum, uint num_residues, uint chain_idx) const;
+
   virtual void
   CalculateScoreProfile(uint start_resnum, uint num_residues, uint chain_idx,
                         std::vector<Real>& profile) const;
 
+  virtual Real CalculateScore(const std::vector<uint>& start_resnum, 
+                              const std::vector<uint>& num_residues,
+                              const std::vector<uint>& chain_idx) const;
+
+  virtual void CalculateScoreProfile(const std::vector<uint>& start_resnum,
+                              const std::vector<uint>& num_residues, 
+                              const std::vector<uint>& chain_idx,
+                              std::vector<std::vector<Real> >& profile) const;
+
   virtual void AttachEnvironment(loop::AllAtomEnv& env);
 
 private:
 
-  AllAtomInteractionScorer(): attached_environment_(false) { }
+  AllAtomInteractionScorer(): do_internal_scores_(true),
+                              do_external_scores_(true),
+                              normalize_(true),
+                              attached_environment_(false) { }
 
   uint EIdx(loop::AminoAcidAtom a, loop::AminoAcidAtom b,
                    uint bin) const {
@@ -51,9 +70,10 @@ private:
     return loop::XXX_NUM_ATOMS * loop::XXX_NUM_ATOMS * bins_;
   }
 
-  void Score(uint start_resnum, uint num_residues, uint chain_idx,
-             std::vector<Real>& ex_scores, std::vector<Real>& in_scores,
-             std::vector<uint>& ex_counts, std::vector<uint>& in_counts) const;
+  void Score(const std::vector<uint>& indices, 
+             std::vector<Real>& external_scores,
+             std::vector<Real>& internal_scores,
+             std::vector<bool>& occupied) const;
 
   // portable serialization (only stores data relevant for Load/Save!)
   // (cleanly element by element with fixed-width base-types)
@@ -73,6 +93,9 @@ private:
   uint bins_;
   uint seq_sep_;
   Real* energies_;
+  bool do_internal_scores_;
+  bool do_external_scores_;
+  bool normalize_;
 
   // environment specific information, set upon calling AttachEnvironment
   bool attached_environment_;
diff --git a/scoring/src/all_atom_overall_scorer.cc b/scoring/src/all_atom_overall_scorer.cc
index 9f2ff97d5ee389b8b119f6843ab7c40f82eddb91..314f22d7c5e5336bc30fe62b09af20e414561489 100644
--- a/scoring/src/all_atom_overall_scorer.cc
+++ b/scoring/src/all_atom_overall_scorer.cc
@@ -49,4 +49,25 @@ Real AllAtomOverallScorer::CalculateLinearCombination(
   return score;
 }
 
+Real AllAtomOverallScorer::CalculateLinearCombination(
+                            const std::map<String, Real>& linear_weights,
+                            const std::vector<uint>& start_resnum, 
+                            const std::vector<uint>& num_residues,
+                            const std::vector<uint>& chain_idx) const {
+  // loop and sum up
+  Real score = 0;
+  for (std::map<String, Real>::const_iterator i = linear_weights.begin();
+       i != linear_weights.end(); ++i) {
+    if (i->first == "intercept") {
+      score += i->second;
+    } else {
+      // error checking done by Get
+      AllAtomScorerPtr scorer = this->Get(i->first);
+      score += i->second * scorer->CalculateScore(start_resnum, num_residues, 
+                                                  chain_idx);
+    }
+  }
+  return score;
+}
+
 }} // ns
diff --git a/scoring/src/all_atom_overall_scorer.hh b/scoring/src/all_atom_overall_scorer.hh
index a201ef86ff4534f973bbfa75a69f9faa9d2cd05c..ac090a46f7f55b58aba5dd27a09f4a9c0c6c04a1 100644
--- a/scoring/src/all_atom_overall_scorer.hh
+++ b/scoring/src/all_atom_overall_scorer.hh
@@ -22,6 +22,21 @@ public:
                         std::vector<Real>& profile) const {
     profile.assign(num_residues, 1.0);
   }
+  virtual Real CalculateScore(const std::vector<uint>& start_resnum, 
+                              const std::vector<uint>& num_residues, 
+                              const std::vector<uint>& chain_idx) const { 
+    return 1.0; 
+  }
+
+  virtual void CalculateScoreProfile(const std::vector<uint>& start_resnum, 
+                            const std::vector<uint>& num_residues, 
+                            const std::vector<uint>& chain_idx, 
+                            std::vector<std::vector<Real> >& profile) const {
+    profile.resize(num_residues.size());
+    for(uint i = 0; i < num_residues.size(); ++i) {
+      profile[i].assign(num_residues[i], 1.0);
+    }
+  }
 };
 
 // simple map of key-scorer pairs
@@ -60,6 +75,10 @@ public:
                                   uint start_resnum, uint num_residues,
                                   uint chain_idx = 0) const;
 
+  Real CalculateLinearCombination(const std::map<String, Real>& linear_weights,
+                                  const std::vector<uint>& start_resnum, 
+                                  const std::vector<uint>& num_residues,
+                                  const std::vector<uint>& chain_idx) const;
 private:
   std::map<String, AllAtomScorerPtr> map_;
 };
diff --git a/scoring/src/all_atom_packing_score.cc b/scoring/src/all_atom_packing_score.cc
index b07514b2b963d162918e56cbe7a145fc67f3dd64..aef0d0a0ee488290b48cf5546d863f761c640cdb 100644
--- a/scoring/src/all_atom_packing_score.cc
+++ b/scoring/src/all_atom_packing_score.cc
@@ -7,6 +7,7 @@ namespace promod3 { namespace scoring {
 AllAtomPackingScorer::AllAtomPackingScorer(Real cutoff, uint max_count):
                                            cutoff_(cutoff),
                                            max_count_(max_count),
+                                           normalize_(true),
                                            attached_environment_(false) {
 
   promod3::core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
@@ -183,18 +184,26 @@ Real AllAtomPackingScorer::CalculateScore(uint start_resnum, uint num_residues,
   promod3::core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
                             "AllAtomPackingScorer::CalculateScore", 2);
 
-  // get scores
-  std::vector<Real> scores;
-  std::vector<uint> counts;
-  Score(start_resnum, num_residues, chain_idx, scores, counts);
+  if (!attached_environment_) {
+    String err = "Can only calculate score when environment is attached!";
+    throw promod3::Error(err);
+  }
+
+  std::vector<Real> scores;  
+  std::vector<uint> idx_vector = 
+  idx_handler_->ToIdxVector(start_resnum, num_residues, chain_idx);
+
+  this->Score(idx_vector, scores);
   // sum / normalize them
-  uint num_set_atoms = 0;
   Real score = 0.0;
   for (uint i = 0; i < num_residues; ++i) {
     score += scores[i];
-    num_set_atoms += counts[i];
   }
-  if (num_set_atoms > 0) score /= num_set_atoms;
+
+  if(normalize_ && !scores.empty()) {
+    score /= scores.size();
+  }
+
   return score;
 }
 
@@ -205,12 +214,96 @@ void AllAtomPackingScorer::CalculateScoreProfile(
   promod3::core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
                             "AllAtomPackingScorer::CalculateScoreProfile", 2);
 
+  if (!attached_environment_) {
+    String err = "Can only calculate score when environment is attached!";
+    throw promod3::Error(err);
+  }
+
   // get scores
-  std::vector<uint> counts;
-  Score(start_resnum, num_residues, chain_idx, profile, counts);
-  // normalize them
-  for (uint i = 0; i < num_residues; ++i) {
-    if (counts[i] > 0) profile[i] /= counts[i];
+  std::vector<uint> idx_vector = 
+  idx_handler_->ToIdxVector(start_resnum, num_residues, chain_idx);
+  Score(idx_vector, profile);
+}
+
+Real AllAtomPackingScorer::CalculateScore(
+                                    const std::vector<uint>& start_resnum, 
+                                    const std::vector<uint>& num_residues,
+                                    const std::vector<uint>& chain_idx) const {
+
+  promod3::core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
+                                "AllAtomPackingScorer::CalculateScore", 2);
+
+
+  // setup
+  if (!attached_environment_) {
+    String err = "Can only calculate score when environment is attached!";
+    throw promod3::Error(err);
+  }
+
+  if(start_resnum.size() != num_residues.size()) {
+    throw promod3::Error("Inconsistent input data in CBetaScore!");
+  }
+
+  if(start_resnum.size() != chain_idx.size()) {
+    throw promod3::Error("Inconsistent input data in CBetaScore!");
+  }
+
+  std::vector<std::vector<uint> > indices_vec;
+  for(uint i = 0; i < start_resnum.size(); ++i) {
+    indices_vec.push_back(idx_handler_->ToIdxVector(start_resnum[i], 
+                                                    num_residues[i], 
+                                                    chain_idx[i]));
+  }
+
+  // get scores and sum them up
+  Real score = 0.0;
+  uint n_scored_residues = 0;
+  for(uint i = 0; i < indices_vec.size(); ++i) {
+    std::vector<Real> scores;
+    this->Score(indices_vec[i], scores);
+    for(uint j = 0; j < scores.size(); ++j) {
+      score += scores[j];
+    }
+    n_scored_residues += scores.size();
+  }
+
+  if(normalize_ && n_scored_residues > 0) {
+    score /= n_scored_residues;
+  }
+
+  return score;
+}
+
+void AllAtomPackingScorer::CalculateScoreProfile(
+                              const std::vector<uint>& start_resnum, 
+                              const std::vector<uint>& num_residues,
+                              const std::vector<uint>& chain_idx,
+                              std::vector<std::vector<Real> >& profile) const {
+  
+  promod3::core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
+                                "CBPackingScorer::CalculateScoreProfile", 2);
+
+  // setup
+  if (!attached_environment_) {
+    String err = "Can only calculate score when environment is attached!";
+    throw promod3::Error(err);
+  }
+
+  if(start_resnum.size() != num_residues.size()) {
+    throw promod3::Error("Inconsistent input data in CBetaScore!");
+  }
+
+  if(start_resnum.size() != chain_idx.size()) {
+    throw promod3::Error("Inconsistent input data in CBetaScore!");
+  }
+
+  // get scores
+  profile.resize(start_resnum.size());
+  for(uint i = 0; i < start_resnum.size(); ++i) {
+    std::vector<uint> idx_vector = 
+    idx_handler_->ToIdxVector(start_resnum[i], num_residues[i], 
+                                       chain_idx[i]);
+    this->Score(idx_vector, profile[i]);
   }
 }
 
@@ -222,28 +315,22 @@ void AllAtomPackingScorer::AttachEnvironment(loop::AllAtomEnv& env) {
   attached_environment_ = true;
 }
 
-void AllAtomPackingScorer::Score(uint start_resnum, uint num_residues,
-                                 uint chain_idx, std::vector<Real>& scores,
-                                 std::vector<uint>& counts) const {
+void AllAtomPackingScorer::Score(const std::vector<uint>& indices,
+                                 std::vector<Real>& scores) const {
   // setup
-  if (!attached_environment_) {
-    String err = "Can only calculate score when environment is attached!";
-    throw promod3::Error(err);
+  uint n_indices = indices.size();
+  scores.resize(n_indices);
+
+  if(n_indices == 0) {
+    return;
   }
-  uint start_idx, end_idx;
-  idx_handler_->SetupScoreCalculation(start_resnum, num_residues, chain_idx,
-                                      start_idx, end_idx);
 
-  // get scores
-  scores.resize(num_residues);
-  counts.resize(num_residues);
   // let's go over every residue
   AllAtomInteractionSpatialOrganizer::WithinResult within_result;
   std::pair<AllAtomInteractionSpatialOrganizerItem*,Real>* a;
-  for (uint i = 0; i < num_residues; ++i) {
-    const uint res_idx = start_idx + i;
+  for (uint i = 0; i < n_indices; ++i) {
+    const uint res_idx = indices[i];
     // loop over all heavy atoms
-    uint num_set_atoms = 0;
     Real score = 0.0;
     const uint first_idx = all_pos_->GetFirstIndex(res_idx);
     const uint last_idx = all_pos_->GetLastIndex(res_idx);
@@ -261,12 +348,10 @@ void AllAtomPackingScorer::Score(uint start_resnum, uint num_residues,
         // score it
         counter = std::min(counter, max_count_);
         score += energies_[this->EIdx(all_pos_->GetAAA(idx), counter)];
-        ++num_set_atoms;
       }
     }
     // set values
     scores[i] = score;
-    counts[i] = num_set_atoms;
   }
 }
 
diff --git a/scoring/src/all_atom_packing_score.hh b/scoring/src/all_atom_packing_score.hh
index 59616aaddd057084929447449d77c70f4b15c76e..71cf70ea1a9359398923571105c41bd6e7a6b71f 100644
--- a/scoring/src/all_atom_packing_score.hh
+++ b/scoring/src/all_atom_packing_score.hh
@@ -30,17 +30,28 @@ public:
 
   void SetEnergy(loop::AminoAcidAtom aaa, uint count, Real e);
 
+  void DoNormalize(bool do_it) { normalize_ = do_it; }
+
   virtual Real CalculateScore(uint start_resnum, uint num_residues,
                               uint chain_idx) const;
   virtual void
   CalculateScoreProfile(uint start_resnum, uint num_residues, uint chain_idx,
                         std::vector<Real>& profile) const;
 
+  virtual Real CalculateScore(const std::vector<uint>& start_resnum, 
+                              const std::vector<uint>& num_residues,
+                              const std::vector<uint>& chain_idx) const;
+
+  virtual void CalculateScoreProfile(const std::vector<uint>& start_resnum,
+                              const std::vector<uint>& num_residues, 
+                              const std::vector<uint>& chain_idx,
+                              std::vector<std::vector<Real> >& profile) const;
+
   virtual void AttachEnvironment(loop::AllAtomEnv& env);
 
 private:
 
-  AllAtomPackingScorer(): attached_environment_(false) { }
+  AllAtomPackingScorer(): normalize_(true), attached_environment_(false) { }
 
   uint EIdx(loop::AminoAcidAtom aaa, uint count) const {
     return aaa * (max_count_ + 1) + count;
@@ -49,9 +60,8 @@ private:
     return loop::XXX_NUM_ATOMS * (max_count_ + 1);
   }
 
-  void Score(uint start_resnum, uint num_residues, uint chain_idx,
-             std::vector<Real>& scores,
-             std::vector<uint>& counts) const;
+  void Score(const std::vector<uint>& indices,
+             std::vector<Real>& scores) const;
 
   // portable serialization (only stores data relevant for Load/Save!)
   // (cleanly element by element with fixed-width base-types)
@@ -69,6 +79,7 @@ private:
   Real cutoff_;
   uint max_count_;
   Real* energies_;
+  bool normalize_;
 
   // environment specific information, set upon calling AttachEnvironment
   bool attached_environment_;
diff --git a/scoring/src/all_atom_score_base.hh b/scoring/src/all_atom_score_base.hh
index ab2c16c63bc2671be4c5595a958107e8445df187..ba17cb0843b8523633bdcb24d530d3a53f89cfcb 100644
--- a/scoring/src/all_atom_score_base.hh
+++ b/scoring/src/all_atom_score_base.hh
@@ -25,6 +25,15 @@ public:
   CalculateScoreProfile(uint start_resnum, uint num_residues, uint chain_idx,
                         std::vector<Real>& profile) const = 0;
 
+  virtual Real CalculateScore(const std::vector<uint>& start_resnum, 
+                              const std::vector<uint>& num_residues, 
+                              const std::vector<uint>& chain_idx) const = 0;
+
+  virtual void CalculateScoreProfile(const std::vector<uint>& start_resnum, 
+                            const std::vector<uint>& num_residues, 
+                            const std::vector<uint>& chain_idx, 
+                            std::vector<std::vector<Real> >& profile) const = 0;
+
   virtual void AttachEnvironment(loop::AllAtomEnv& env) { }
 };
 
diff --git a/scoring/src/backbone_overall_scorer.cc b/scoring/src/backbone_overall_scorer.cc
index 1933a0d73f0d12bc9865d7e9d5c80d96bee71f67..bfa296653be248bcbdca2e27ebe81328abe01840 100644
--- a/scoring/src/backbone_overall_scorer.cc
+++ b/scoring/src/backbone_overall_scorer.cc
@@ -30,30 +30,15 @@ BackboneOverallScorer::GetWeightedScorers(
 }
 
 Real BackboneOverallScorer::Calculate(const String& key,
-                            const loop::BackboneList& bb_list,
-                            uint start_resnum, uint chain_idx) const {
-  return this->Get(key)->CalculateScore(bb_list, start_resnum, chain_idx);
-}
-
-std::vector<Real> BackboneOverallScorer::Calculate(
-                            const String& key,
-                            const std::vector<loop::BackboneList>& bb_lists,
-                            uint start_resnum, uint chain_idx) const {
-  // get scorer once (avoid check / lookup)
-  BackboneScorerPtr scorer = this->Get(key);
-  // score all
-  const uint N = bb_lists.size();
-  std::vector<Real> scores(N);
-  for (uint i = 0; i < N; ++i) {
-    scores[i] = scorer->CalculateScore(bb_lists[i], start_resnum, chain_idx);
-  }
-  return scores;
+                            uint start_resnum, uint num_residues, 
+                            uint chain_idx) const {
+  return this->Get(key)->CalculateScore(start_resnum, num_residues, chain_idx);
 }
 
 Real BackboneOverallScorer::CalculateLinearCombination(
                             const std::map<String, Real>& linear_weights,
-                            const loop::BackboneList& bb_list,
-                            uint start_resnum, uint chain_idx) const {
+                            uint start_resnum, uint num_residues,
+                            uint chain_idx) const {
   // loop and sum up
   Real score = 0;
   for (std::map<String, Real>::const_iterator i = linear_weights.begin();
@@ -62,35 +47,38 @@ Real BackboneOverallScorer::CalculateLinearCombination(
       score += i->second;
     } else {
       // note: error checking done by Calculate
-      score += i->second * this->Calculate(i->first, bb_list, start_resnum,
+      score += i->second * this->Calculate(i->first, start_resnum, num_residues,
                                            chain_idx);
     }
   }
   return score;
 }
 
-std::vector<Real> BackboneOverallScorer::CalculateLinearCombination(
+Real BackboneOverallScorer::Calculate(const String& key,
+                            const std::vector<uint>& start_resnum, 
+                            const std::vector<uint>& num_residues, 
+                            const std::vector<uint>& chain_idx) const {
+  return this->Get(key)->CalculateScore(start_resnum, num_residues, chain_idx);
+}
+
+Real BackboneOverallScorer::CalculateLinearCombination(
                             const std::map<String, Real>& linear_weights,
-                            const std::vector<loop::BackboneList>& bb_lists,
-                            uint start_resnum, uint chain_idx) const {
-  // get scorers once (avoid check / lookup)
-  std::vector<std::pair<Real, BackboneScorerPtr> > scorers;
-  scorers = this->GetWeightedScorers(linear_weights);
-  const uint Nscores = scorers.size();
-  // score all
-  const uint N = bb_lists.size();
-  std::vector<Real> scores(N);
-  for (uint i = 0; i < N; ++i) {
-    Real score = 0;
-    for (uint j = 0; j < Nscores; ++j) {
-      const Real weight = scorers[j].first;
-      BackboneScorerPtr scorer = scorers[j].second;
-      score += weight * scorer->CalculateScore(bb_lists[i], start_resnum,
-                                               chain_idx);
+                            const std::vector<uint>& start_resnum, 
+                            const std::vector<uint>& num_residues,
+                            const std::vector<uint>& chain_idx) const {
+  // loop and sum up
+  Real score = 0;
+  for (std::map<String, Real>::const_iterator i = linear_weights.begin();
+       i != linear_weights.end(); ++i) {
+    if (i->first == "intercept") {
+      score += i->second;
+    } else {
+      // note: error checking done by Calculate
+      score += i->second * this->Calculate(i->first, start_resnum, num_residues,
+                                           chain_idx);
     }
-    scores[i] = score;
   }
-  return scores;
+  return score;
 }
 
 }} // ns
\ No newline at end of file
diff --git a/scoring/src/backbone_overall_scorer.hh b/scoring/src/backbone_overall_scorer.hh
index 17016a75de74d4eaef1703e3598c0e5f3011a90f..94af847f50e8e9bcd99414526e420cdc33da6902 100644
--- a/scoring/src/backbone_overall_scorer.hh
+++ b/scoring/src/backbone_overall_scorer.hh
@@ -13,15 +13,31 @@ typedef boost::shared_ptr<BackboneOverallScorer> BackboneOverallScorerPtr;
 // dummy score for intercept -> always returns 1
 class InterceptScorer : public BackboneScorer {
 public:
-  virtual Real CalculateScore(const loop::BackboneList& bb_list,
-                              uint start_resnum,
+
+  virtual Real CalculateScore(uint start_resnum, uint num_residues,
                               uint chain_idx) const { return 1.0; }
 
-  virtual void CalculateScoreProfile(const loop::BackboneList& bb_list,
-                                     uint start_resnum,
+  virtual void CalculateScoreProfile(uint start_resnum,
+                                     uint num_residues,
                                      uint chain_idx,
                                      std::vector<Real>& profile) const{ 
-    profile.assign(bb_list.size(), 1.0);
+    profile.assign(num_residues, 1.0);
+  }
+
+  virtual Real CalculateScore(const std::vector<uint>& start_resnum, 
+                              const std::vector<uint>& num_residues, 
+                              const std::vector<uint>& chain_idx) const { 
+    return 1.0; 
+  }
+
+  virtual void CalculateScoreProfile(const std::vector<uint>& start_resnum, 
+                            const std::vector<uint>& num_residues, 
+                            const std::vector<uint>& chain_idx, 
+                            std::vector<std::vector<Real> >& profile) const {
+    profile.resize(num_residues.size());
+    for(uint i = 0; i < num_residues.size(); ++i) {
+      profile[i].assign(num_residues[i], 1.0);
+    }
   }
 };
 
@@ -56,21 +72,28 @@ public:
   GetWeightedScorers(const std::map<String, Real>& linear_weights) const;
 
   // calculate one single score
-  Real Calculate(const String& key, const loop::BackboneList& bb_list,
-                 uint start_resnum, uint chain_idx = 0) const;
-  std::vector<Real>
-  Calculate(const String& key, const std::vector<loop::BackboneList>& bb_lists,
-            uint start_resnum, uint chain_idx = 0) const;
+  Real Calculate(const String& key, uint start_resnum, uint num_residues,
+                 uint chain_idx = 0) const;
 
   // linear combination of weighted scores
   // -> use special key "intercept" to add a constant value to the score
   Real CalculateLinearCombination(const std::map<String, Real>& linear_weights,
-                                  const loop::BackboneList& bb_list,
-                                  uint start_resnum, uint chain_idx = 0) const;
-  std::vector<Real>
-  CalculateLinearCombination(const std::map<String, Real>& linear_weights,
-                             const std::vector<loop::BackboneList>& bb_lists,
-                             uint start_resnum, uint chain_idx = 0) const;
+                                  uint start_resnum, uint num_residues, 
+                                  uint chain_idx = 0) const;
+
+  // calculate one single score
+  Real Calculate(const String& key,
+                 const std::vector<uint>& start_resnum, 
+                 const std::vector<uint>& num_residues,
+                 const std::vector<uint>& chain_idx) const;
+
+
+  // calculate one single score
+  Real CalculateLinearCombination(const std::map<String, Real>& linear_weights,
+                                  const std::vector<uint>& start_resnum, 
+                                  const std::vector<uint>& num_residues,
+                                  const std::vector<uint>& chain_idx) const;
+
 
 private:
   std::map<String, BackboneScorerPtr> map_;
@@ -78,4 +101,4 @@ private:
 
 }} // ns
 
-#endif
\ No newline at end of file
+#endif
diff --git a/scoring/src/backbone_score_base.cc b/scoring/src/backbone_score_base.cc
index c1bcaa59398baf2d51bcf6bb5c559d3f19618a91..30888ec88eac26787f32d63406ea5f686404ae07 100644
--- a/scoring/src/backbone_score_base.cc
+++ b/scoring/src/backbone_score_base.cc
@@ -63,9 +63,6 @@ BackboneScoreEnvPtr BackboneScoreEnv::Copy() const{
   return_ptr->psipred_pred_ = psipred_pred_;
   return_ptr->psipred_cfi_ = psipred_cfi_;
   return_ptr->env_set_ = env_set_;
-  if(density_map_data_.map.IsValid()) {
-    return_ptr->density_map_data_ = density_map_data_;
-  }
   return_ptr->n_pos_ = n_pos_;
   return_ptr->ca_pos_ = ca_pos_;
   return_ptr->cb_pos_ = cb_pos_;
@@ -146,7 +143,7 @@ void BackboneScoreEnv::SetInitialEnvironment(const ost::mol::EntityHandle& env)
   }
   for (std::vector<BackboneScoreEnvListener*>::iterator i = listener_.begin();
        i != listener_.end(); ++i) {
-    (*i)->ClearEnvironment(*this, indices_to_delete);  
+    (*i)->ClearEnvironment(indices_to_delete);  
   }
   
 
@@ -198,7 +195,7 @@ void BackboneScoreEnv::SetInitialEnvironment(const ost::mol::EntityHandle& env)
     }
     for (std::vector<BackboneScoreEnvListener*>::iterator i = listener_.begin();
          i != listener_.end(); ++i){
-      (*i)->SetEnvironment(*this, indices_to_set);  
+      (*i)->SetEnvironment(indices_to_set);  
     }
   }
 }
@@ -243,8 +240,8 @@ void BackboneScoreEnv::SetEnvironment(const loop::BackboneList& bb_list,
   //and call all listeners
   for(std::vector<BackboneScoreEnvListener*>::iterator i = listener_.begin();
       i != listener_.end(); ++i){
-    (*i)->SetEnvironment(*this, indices_to_set);
-    (*i)->ResetEnvironment(*this, indices_to_reset);
+    (*i)->SetEnvironment(indices_to_set);
+    (*i)->ResetEnvironment(indices_to_reset);
   }  
 }
 
@@ -274,7 +271,7 @@ void BackboneScoreEnv::ClearEnvironment(uint start_resnum, uint num_residues,
   // and call all listeners
   for (std::vector<BackboneScoreEnvListener*>::iterator i = listener_.begin();
        i != listener_.end(); ++i) {
-    (*i)->ClearEnvironment(*this, indices_to_clear);
+    (*i)->ClearEnvironment(indices_to_clear);
   }
 }
 
@@ -324,13 +321,6 @@ void BackboneScoreEnv::SetPsipredPrediction(std::vector<loop::PsipredPredictionP
   }
 }
 
-void BackboneScoreEnv::SetMap(const ost::img::MapHandle& map, Real resolution,
-                              bool all_atom) {
-  density_map_data_.map = map;
-  density_map_data_.resolution = resolution;
-  density_map_data_.all_atom = all_atom;
-}
-
 uint BackboneScoreEnv::AddPairwiseFunction(PairwiseFunctionPtr f,
                                            PairwiseFunctionType ft) {
   pairwise_functions_.push_back(f);
@@ -371,6 +361,127 @@ void BackboneScoreEnv::ApplyPairwiseFunction(uint chain_idx_one, uint resnum_one
   applied_pairwise_functions_[idx_two].push_back(data_two);
 }
 
+void BackboneScoreEnv::Stash(uint start_resnum, uint num_residues, 
+                             uint chain_idx) {
+  std::vector<uint> indices = idx_handler_.ToIdxVector(start_resnum,
+                                                       num_residues,
+                                                       chain_idx);
+  this->Stash(indices);
+}
+
+void BackboneScoreEnv::Stash(const std::vector<uint>& start_resnum, 
+                             const std::vector<uint>& num_residues,
+                             const std::vector<uint>& chain_idx) {
+
+  std::vector<uint> start_indices;
+  std::vector<uint> lengths;
+
+  std::vector<uint> indices = idx_handler_.ToIdxVector(start_resnum,
+                                                       num_residues,
+                                                       chain_idx,
+                                                       start_indices,
+                                                       lengths);
+  this->Stash(indices);
+}
+
+void BackboneScoreEnv::Stash(const std::vector<uint>& indices) {
+
+  if(stashed_indices_.size() > 100) {
+    throw promod3::Error("You already performed a 100 stash events... "
+                         "Cant do more....");
+  }
+
+  std::vector<uint> stash_indices;
+  std::vector<int> stash_env_set;
+  std::vector<geom::Vec3> stash_n_pos;
+  std::vector<geom::Vec3> stash_ca_pos;
+  std::vector<geom::Vec3> stash_cb_pos;
+  std::vector<geom::Vec3> stash_c_pos;
+  std::vector<geom::Vec3> stash_o_pos;
+
+  uint n_indices = indices.size();
+  stash_indices.reserve(n_indices);
+  stash_env_set.reserve(n_indices);
+  stash_n_pos.reserve(n_indices);
+  stash_ca_pos.reserve(n_indices);
+  stash_cb_pos.reserve(n_indices);
+  stash_c_pos.reserve(n_indices);
+  stash_o_pos.reserve(n_indices);
+
+  for(std::vector<uint>::const_iterator i = indices.begin(); 
+      i != indices.end(); ++i) {
+    stash_indices.push_back(*i);
+    stash_env_set.push_back(env_set_[*i]);
+    stash_n_pos.push_back(n_pos_[*i]);
+    stash_ca_pos.push_back(ca_pos_[*i]);
+    stash_cb_pos.push_back(cb_pos_[*i]);
+    stash_c_pos.push_back(c_pos_[*i]);
+    stash_o_pos.push_back(o_pos_[*i]);
+  }
+
+  stashed_indices_.push(stash_indices);
+  stashed_env_set_.push(stash_env_set);
+  stashed_n_pos_.push(stash_n_pos);
+  stashed_ca_pos_.push(stash_ca_pos);
+  stashed_cb_pos_.push(stash_cb_pos);
+  stashed_c_pos_.push(stash_c_pos);
+  stashed_o_pos_.push(stash_o_pos);
+}
+
+void BackboneScoreEnv::Pop() {
+
+  if(stashed_indices_.empty()) {
+    throw promod3::Error("Nothing stashed! Cannot pop!");
+  }
+
+  std::vector<uint> indices_to_set;
+  std::vector<uint> indices_to_reset;
+  std::vector<uint> indices_to_clear;
+  
+  const std::vector<uint>& stash_indices = stashed_indices_.top();
+  const std::vector<int>& stash_env_set = stashed_env_set_.top();
+  const std::vector<geom::Vec3>& stash_n_pos = stashed_n_pos_.top();
+  const std::vector<geom::Vec3>& stash_ca_pos = stashed_ca_pos_.top();
+  const std::vector<geom::Vec3>& stash_cb_pos = stashed_cb_pos_.top();
+  const std::vector<geom::Vec3>& stash_c_pos = stashed_c_pos_.top();
+  const std::vector<geom::Vec3>& stash_o_pos = stashed_o_pos_.top();
+
+  for(uint i = 0; i < stash_indices.size(); ++i) {
+    uint env_idx = stash_indices[i];
+    n_pos_[env_idx] = stash_n_pos[i];
+    ca_pos_[env_idx] = stash_ca_pos[i];
+    cb_pos_[env_idx] = stash_cb_pos[i];
+    c_pos_[env_idx] = stash_c_pos[i];
+    o_pos_[env_idx] = stash_o_pos[i];
+
+    if(env_set_[env_idx] == 1 && stash_env_set[i] == 1) {
+      indices_to_reset.push_back(env_idx);
+    } else if(env_set_[env_idx] == 1 && stash_env_set[i] == 0) {
+      indices_to_clear.push_back(env_idx);
+    } else if(env_set_[env_idx] == 0 && stash_env_set[i] == 1) {
+      indices_to_set.push_back(env_idx);
+    }
+
+    env_set_[env_idx] = stash_env_set[i]; 
+  }
+
+  //and call all listeners
+  for(std::vector<BackboneScoreEnvListener*>::iterator i = listener_.begin();
+      i != listener_.end(); ++i){
+    (*i)->SetEnvironment(indices_to_set);
+    (*i)->ResetEnvironment(indices_to_reset);
+    (*i)->ClearEnvironment(indices_to_clear);
+  } 
+
+  stashed_indices_.pop();
+  stashed_env_set_.pop(); 
+  stashed_n_pos_.pop();
+  stashed_ca_pos_.pop();
+  stashed_cb_pos_.pop();
+  stashed_c_pos_.pop();
+  stashed_o_pos_.pop();
+}
+
 BackboneScoreEnvListener* BackboneScoreEnv::GetListener(const String& id) const {
   for (uint i = 0; i < listener_.size(); ++i) {
     if (listener_[i]->WhoAmI() == id) return listener_[i];
@@ -390,7 +501,7 @@ void BackboneScoreEnv::AttachListener(BackboneScoreEnvListener* listener) {
   for (uint i = 0; i < env_set_.size(); ++i) {
     if (env_set_[i]) indices_to_set.push_back(i);
   }
-  listener->SetEnvironment(*this, indices_to_set);
+  listener->SetEnvironment(indices_to_set);
   listener_.push_back(listener);
 }
 
diff --git a/scoring/src/backbone_score_base.hh b/scoring/src/backbone_score_base.hh
index feade33ead9a28e021a79d4f72f852f4bdce878b..8631f8a888f3cea59db7c5c4ba5638723c17d2e1 100644
--- a/scoring/src/backbone_score_base.hh
+++ b/scoring/src/backbone_score_base.hh
@@ -11,6 +11,7 @@
 #include <promod3/scoring/pairwise_scoring_function.hh>
 
 #include <algorithm> 
+#include <stack>
 
 
 namespace promod3 { namespace scoring {
@@ -37,13 +38,6 @@ struct PairwiseFunctionData {
 };
 
 
-struct DensityMapData {
-  ost::img::MapHandle map;
-  Real resolution;
-  bool all_atom;
-};
-
-
 class BackboneScoreEnv {
 
 public:
@@ -68,9 +62,6 @@ public:
 
   void SetPsipredPrediction(std::vector<loop::PsipredPredictionPtr>& pp);
 
-  void SetMap(const ost::img::MapHandle& map, Real resolution, 
-              bool all_atom = false);
-
   uint AddPairwiseFunction(PairwiseFunctionPtr f,
                            PairwiseFunctionType ft);
 
@@ -78,6 +69,14 @@ public:
                              uint chain_idx_two, uint resnum_two,
                              uint f_idx);
 
+  void Stash(uint start_resnum, uint num_residues, uint chain_idx = 0);
+
+  void Stash(const std::vector<uint>& start_resnum, 
+             const std::vector<uint>& num_residues,
+             const std::vector<uint>& chain_idx);
+
+  void Pop();
+
   ost::seq::SequenceList GetSeqres() const { return seqres_; }
 
   // methods to access internal data intended to be used by the scorer objects
@@ -105,9 +104,6 @@ public:
   const std::vector<PairwiseFunctionData>* 
   GetPairwiseFunctionData() const { return &applied_pairwise_functions_[0]; }
 
-  const DensityMapData* GetDensityMapData() const { return &density_map_data_; }
-
-
   // listener related methods
 
   // return listener with that ID or NULL if not existing
@@ -133,6 +129,8 @@ public:
 
 private:
 
+  void Stash(const std::vector<uint>& indices);
+
   ost::seq::SequenceList seqres_;
   loop::IdxHandler idx_handler_;
   std::vector<ost::conop::AminoAcid> aa_seqres_;
@@ -141,12 +139,19 @@ private:
   // the reason to use a vector with int here is that the STL has an optimized
   // vector<bool> (bitset, min. memory usage) which can't be used as C arrays
   std::vector<int> env_set_; 
-  DensityMapData density_map_data_;
   std::vector<geom::Vec3> n_pos_;
   std::vector<geom::Vec3> ca_pos_;
   std::vector<geom::Vec3> cb_pos_;
   std::vector<geom::Vec3> c_pos_;
   std::vector<geom::Vec3> o_pos_;
+  // same as above, but to stash things
+  std::stack<std::vector<uint> > stashed_indices_;
+  std::stack<std::vector<int> > stashed_env_set_; 
+  std::stack<std::vector<geom::Vec3> > stashed_n_pos_;
+  std::stack<std::vector<geom::Vec3> > stashed_ca_pos_;
+  std::stack<std::vector<geom::Vec3> > stashed_cb_pos_;
+  std::stack<std::vector<geom::Vec3> > stashed_c_pos_;
+  std::stack<std::vector<geom::Vec3> > stashed_o_pos_;
   // every residue gets a vector of pairs 
   // every pair contains: 
   // - a function ptr as a first element, i.e. the pairwise 
@@ -169,14 +174,11 @@ public:
 
   virtual void Init(const BackboneScoreEnv& base_env) = 0;
 
-  virtual void SetEnvironment(const BackboneScoreEnv& base_env, 
-                              const std::vector<uint>& idx) = 0;
+  virtual void SetEnvironment(const std::vector<uint>& idx) = 0;
 
-  virtual void ResetEnvironment(const BackboneScoreEnv& base_env, 
-                                const std::vector<uint>& idx) = 0;
+  virtual void ResetEnvironment(const std::vector<uint>& idx) = 0;
 
-  virtual void ClearEnvironment(const BackboneScoreEnv& base_env, 
-                                const std::vector<uint>& idx) = 0;
+  virtual void ClearEnvironment(const std::vector<uint>& idx) = 0;
 
   virtual String WhoAmI() const = 0;
 };
@@ -188,15 +190,22 @@ public:
 
   virtual ~BackboneScorer() { }
 
-  virtual Real CalculateScore(const loop::BackboneList& bb_list, 
-                              uint start_resnum, 
+  virtual Real CalculateScore(uint start_resnum, uint num_residues, 
                               uint chain_idx) const = 0;
 
-  virtual void CalculateScoreProfile(const loop::BackboneList& bb_list, 
-                                     uint start_resnum, 
-                                     uint chain_idx,
+  virtual void CalculateScoreProfile(uint start_resnum, uint num_residues, 
+                                     uint chain_idx, 
                                      std::vector<Real>& profile) const = 0;
 
+  virtual Real CalculateScore(const std::vector<uint>& start_resnum, 
+                              const std::vector<uint>& num_residues, 
+                              const std::vector<uint>& chain_idx) const = 0;
+
+  virtual void CalculateScoreProfile(const std::vector<uint>& start_resnum, 
+                            const std::vector<uint>& num_residues, 
+                            const std::vector<uint>& chain_idx, 
+                            std::vector<std::vector<Real> >& profile) const = 0;
+
   virtual void AttachEnvironment(BackboneScoreEnv& env) { }
 };
 
diff --git a/scoring/src/cb_packing_score.cc b/scoring/src/cb_packing_score.cc
index fdf9e25203040b4505bfebad7d612b89bf3efbb0..0f0b307df7677da899b0d155d7ced9cd72775f56 100644
--- a/scoring/src/cb_packing_score.cc
+++ b/scoring/src/cb_packing_score.cc
@@ -6,8 +6,7 @@ namespace promod3 { namespace scoring {
 CBPackingScorer::CBPackingScorer(Real cutoff, uint max_count): 
                                  cutoff_(cutoff),
                                  max_count_(max_count),
-                                 attached_environment_(false),
-                                 include_env_mode_(false),
+                                 normalize_(true),
                                  env_(NULL) {
 
   promod3::core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
@@ -181,213 +180,180 @@ void CBPackingScorer::SetEnergy(ost::conop::AminoAcid aa, uint count, Real e) {
   energies_[this->EIdx(aa, count)] = e;
 }
 
-Real CBPackingScorer::CalculateScore(const loop::BackboneList& bb_list, 
-                                     uint start_resnum, 
-                                     uint chain_idx) const{
+Real CBPackingScorer::CalculateScore(uint start_resnum, uint num_residues,
+                                     uint chain_idx) const {
 
   promod3::core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
                                 "CBPackingScorer::CalculateScore", 2);
 
-  if(include_env_mode_) {
-    return this->CalculateScoreIncludeEnv(bb_list, start_resnum, chain_idx);
+  if(env_ == NULL) {
+    String err = "Can only calculate score when environment is attached!";
+    throw promod3::Error(err);
   }
-  else {
-    std::vector<Real> scores;  
-    this->Score(bb_list, start_resnum, chain_idx, scores);
-    Real score = 0.0;
-    for(uint i = 0; i < scores.size(); ++i){
-      score += scores[i];
-    }
 
-    if(!scores.empty()){
-      score /= scores.size();
-    }
-    return score;
+  std::vector<Real> scores;  
+  std::vector<uint> idx_vector = 
+  env_->GetIdxHandler()->ToIdxVector(start_resnum, num_residues, chain_idx);
+
+  this->Score(idx_vector, scores);
+  Real score = 0.0;
+  for(uint i = 0; i < scores.size(); ++i) {
+    score += scores[i];
+  }
+
+  if(normalize_ && !scores.empty()) {
+    score /= scores.size();
   }
+
+  return score;
 }
 
 
-void CBPackingScorer::CalculateScoreProfile(const loop::BackboneList& bb_list, 
-                                            uint start_resnum, uint chain_idx,
+void CBPackingScorer::CalculateScoreProfile(uint start_resnum, uint num_residues,
+                                            uint chain_idx,
                                             std::vector<Real>& profile) const {
   
   promod3::core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
                                 "CBPackingScorer::CalculateScoreProfile", 2);
 
-  if(include_env_mode_){
-    throw promod3::Error("CBPackingScorer cannot generate score profile when "
-                         "include_env_mode is active! Call the UseClassicMode()"
-                         "function to deactivate and try again...");
+  if(env_ == NULL) {
+    String err = "Can only calculate score when environment is attached!";
+    throw promod3::Error(err);
   }
 
-  this->Score(bb_list, start_resnum, chain_idx, profile);
+  std::vector<uint> idx_vector = 
+  env_->GetIdxHandler()->ToIdxVector(start_resnum, num_residues, chain_idx);
+  this->Score(idx_vector, profile);
 }
 
 
-void CBPackingScorer::Score(const loop::BackboneList& bb_list, 
-                            uint start_resnum, 
-                            uint chain_idx,
-                            std::vector<Real>& scores) const{
+Real CBPackingScorer::CalculateScore(const std::vector<uint>& start_resnum, 
+                                     const std::vector<uint>& num_residues,
+                                     const std::vector<uint>& chain_idx) const {
 
   promod3::core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
-                                "CBPackingScorer::Score", 2);
+                                "CBPackingScorer::CalculateScore", 2);
 
   // setup
-  if(!attached_environment_){
+  if(env_ == NULL) {
     String err = "Can only calculate score when environment is attached!";
     throw promod3::Error(err);
   }
-  uint bb_list_size, start_idx, end_idx;
-  idx_handler_->SetupScoreCalculation(bb_list, start_resnum, chain_idx,
-                                      bb_list_size, start_idx, end_idx);
-
-  scores.assign(bb_list_size, 0.0);
-  if(bb_list_size == 0) return;
-
-  // get counts
-  std::vector<uint> count_buffer(bb_list_size, 0);
-
-  // first internal
-  const Real squared_cutoff = cutoff_ * cutoff_;
-  for (uint i = 0; i < bb_list_size; ++i) {
-    for (uint j = i+1; j < bb_list_size; ++j) {
-      if (geom::Length2(bb_list.GetCB(i) - bb_list.GetCB(j)) < squared_cutoff) {
-        count_buffer[i] += 1;
-        count_buffer[j] += 1;
-      }
-    }
+
+  if(start_resnum.size() != num_residues.size()) {
+    throw promod3::Error("Inconsistent input data in CBetaScore!");
   }
-  // then external and sum up score as we go
-  CBetaSpatialOrganizer::WithinResult within_result;
-  std::pair<CBetaSpatialOrganizerItem*,Real>* a;
-  for (uint i = 0; i < bb_list_size; ++i) {
-    // add neighbors to internal count
-    within_result = env_->FindWithin(bb_list.GetCB(i), cutoff_);
-    a = within_result.first;
-    uint counter = count_buffer[i];
-    for (uint j = 0; j < within_result.second; ++j) {
-      if (a[j].first->idx < start_idx || a[j].first->idx > end_idx) {
-        ++counter;
-      }
+
+  if(start_resnum.size() != chain_idx.size()) {
+    throw promod3::Error("Inconsistent input data in CBetaScore!");
+  }
+
+  std::vector<std::vector<uint> > indices_vec;
+  for(uint i = 0; i < start_resnum.size(); ++i) {
+    indices_vec.push_back(env_->GetIdxHandler()->ToIdxVector(start_resnum[i], 
+                                                    num_residues[i], 
+                                                    chain_idx[i]));
+  }
+
+  // get scores and sum them up
+  Real score = 0.0;
+  uint n_scored_residues = 0;
+  for(uint i = 0; i < indices_vec.size(); ++i) {
+    std::vector<Real> scores;
+    this->Score(indices_vec[i], scores);
+    for(uint j = 0; j < scores.size(); ++j) {
+      score += scores[j];
     }
-    // score it
-    counter = std::min(counter, max_count_);
-    scores[i] = energies_[this->EIdx(bb_list.GetAA(i), counter)];
+    n_scored_residues += scores.size();
   }
+
+  if(normalize_ && n_scored_residues > 0) {
+    score /= n_scored_residues;
+  }
+
+  return score;
 }
 
-Real CBPackingScorer::CalculateScoreIncludeEnv(const loop::BackboneList& bb_list, 
-                                               uint start_resnum, 
-                                               uint chain_idx) const{
 
+void CBPackingScorer::CalculateScoreProfile(
+                              const std::vector<uint>& start_resnum, 
+                              const std::vector<uint>& num_residues,
+                              const std::vector<uint>& chain_idx,
+                              std::vector<std::vector<Real> >& profile) const {
+  
   promod3::core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
-                                "CBPackingScorer::CalculateScoreIncludeEnv", 2);
+                                "CBPackingScorer::CalculateScoreProfile", 2);
 
   // setup
-  if(!attached_environment_){
+  if(env_ == NULL) {
     String err = "Can only calculate score when environment is attached!";
     throw promod3::Error(err);
   }
-  uint bb_list_size, start_idx, end_idx;
-  std::map<uint,uint> close_env_residues;
-  std::map<uint,uint>::iterator close_env_it;
-  uint env_idx;
-
-  idx_handler_->SetupScoreCalculation(bb_list, start_resnum, chain_idx,
-                                      bb_list_size, start_idx, end_idx);
-
-  // get counts
-  std::vector<uint> count_buffer(bb_list_size,0);
-
-  // first internal
-  Real squared_cutoff = cutoff_ * cutoff_;
-  for (uint i = 0; i < bb_list_size; ++i) {
-    for (uint j = i+1; j < bb_list_size; ++j) {
-      if (geom::Length2(bb_list.GetCB(i) - bb_list.GetCB(j)) < squared_cutoff) {
-        count_buffer[i] += 1;
-        count_buffer[j] += 1;
-      }
-    }
-  }
 
-  // score the bb_list items and keep track of the surroundings
-  Real score = 0.0;
-  CBetaSpatialOrganizer::WithinResult within_result;
-  std::pair<CBetaSpatialOrganizerItem*,Real>* a;
-  for (uint i = 0; i < bb_list_size; ++i) {
-    // add neighbors to internal count
-    within_result = env_->FindWithin(bb_list.GetCB(i), cutoff_);
-    a = within_result.first;
-    uint counter = count_buffer[i];
-    for (uint j = 0; j < within_result.second; ++j) {
-      env_idx = a[j].first->idx; 
-      if (env_idx < start_idx || env_idx > end_idx) {
-        ++counter;
-        close_env_it = close_env_residues.find(env_idx);
-        if(close_env_it == close_env_residues.end()){
-          close_env_residues[env_idx] = 1;
-        }
-        else{
-          close_env_it->second += 1;
-        }
-      }
-    }
-    // score it
-    counter = std::min(counter, max_count_);
-    score += energies_[this->EIdx(bb_list.GetAA(i), counter)];
+  if(start_resnum.size() != num_residues.size()) {
+    throw promod3::Error("Inconsistent input data in CBetaScore!");
   }
 
-  // We have now all energies of the residues in the BackboneList...
-  // The problem is, that the residues closeby also get affected
-  // by the positions of bb_list. The effect gets honoured by calculating
-  // a delta in energy for those residue between the energy they would
-  // have in the environment and the new energy, given the positions of the 
-  // bb_list
-  Real diff_score = 0.0;
-  uint old_env_counter, new_env_counter;
+  if(start_resnum.size() != chain_idx.size()) {
+    throw promod3::Error("Inconsistent input data in CBetaScore!");
+  }
 
-  for(close_env_it = close_env_residues.begin();
-      close_env_it != close_env_residues.end(); ++close_env_it){
+  // get scores
+  profile.resize(start_resnum.size());
+  for(uint i = 0; i < start_resnum.size(); ++i) {
+    std::vector<uint> idx_vector = 
+    env_->GetIdxHandler()->ToIdxVector(start_resnum[i], num_residues[i], 
+                                       chain_idx[i]);
+    this->Score(idx_vector, profile[i]);
+  }
+}
 
-    const CBetaSpatialOrganizerItem& env_data = 
-    env_->GetEnvData(close_env_it->first);
 
-    within_result = env_->FindWithin(env_data.pos, cutoff_);
-    a = within_result.first;
+void CBPackingScorer::Score(const std::vector<uint>& indices,
+                            std::vector<Real>& scores) const {
 
-    // the number of neighbours before looking at the input bb_list
-    old_env_counter = within_result.second - 1; // -1, because the position 
-                                                // itself also gets found...
+  promod3::core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
+                                "CBPackingScorer::Score", 2);
 
-    // the number of neighbours when bb_list would be added to env
-    new_env_counter = close_env_it->second; // the number of close residues 
-                                            // it has from the bb_list
+  // setup
+  uint n_indices = indices.size();
 
-    // we still have to add all the residues from the environment not
-    // part of the bb_list
-    for(uint j = 0; j < within_result.second; ++j){
-      env_idx = a[j].first->idx; 
-      if(env_idx < start_idx || env_idx > end_idx) ++new_env_counter; 
-    }
-    new_env_counter -= 1;// The position itself will also be found
+  scores.assign(n_indices, 0.0);
 
-    new_env_counter = std::min(new_env_counter, max_count_);
-    old_env_counter = std::min(old_env_counter, max_count_);
-    diff_score += energies_[this->EIdx(env_data.aa,new_env_counter)];
-    diff_score -= energies_[this->EIdx(env_data.aa,old_env_counter)];
+  if(n_indices == 0) {
+    return;
   }
 
-  score += diff_score;
+  // then external and sum up score as we go
+  CBetaSpatialOrganizer::WithinResult within_result;
+  std::pair<CBetaSpatialOrganizerItem*,Real>* a;
+  const int* env_set = env_->GetEnvSetData();
+  for (uint i = 0; i < indices.size(); ++i) {
+    uint my_idx = indices[i];
+
+    if(!env_set[my_idx]) {
+      throw promod3::Error("Must set environment before scoring!");
+    }
+
+    ost::conop::AminoAcid my_aa = env_->GetEnvData(my_idx).aa;
 
-  // avg. it
-  if (bb_list_size > 0) return (score / bb_list_size); 
-  else return score;
+    // count neighbours
+    uint count = 0;
+    within_result = env_->FindWithin(env_->GetEnvData(my_idx).pos, cutoff_);
+    a = within_result.first;
+    for (uint j = 0; j < within_result.second; ++j) {
+      if (my_idx != a[j].first->idx) {
+        ++count;
+      }
+    }
+    // score it
+    count = std::min(count, max_count_);
+    scores[i] = energies_[this->EIdx(my_aa, count)];
+  }
 }
 
 void CBPackingScorer::AttachEnvironment(BackboneScoreEnv& env) {
   env_ = env.UniqueListener<CBetaEnvListener>("CBetaEnvListener");
-  idx_handler_ = env.GetIdxHandlerData();
-  attached_environment_ = true;
 }
 
 }}
diff --git a/scoring/src/cb_packing_score.hh b/scoring/src/cb_packing_score.hh
index d0d7a84da6d7426e155ee00ca1f0ff2dda103fac..0f3e5518e8a17eb2c9eaf7b041a3deafe6c337fb 100644
--- a/scoring/src/cb_packing_score.hh
+++ b/scoring/src/cb_packing_score.hh
@@ -30,39 +30,38 @@ public:
 
   void SetEnergy(ost::conop::AminoAcid aa, uint count, Real e);
 
-  virtual Real CalculateScore(const loop::BackboneList& bb_list, 
-                              uint start_resnum, 
+  virtual Real CalculateScore(uint start_resnum, uint num_residues,
                               uint chain_idx) const;
 
-  void CalculateScoreProfile(const loop::BackboneList& bb_list, 
-                             uint start_resnum, uint chain_idx,
-                             std::vector<Real>& profile) const;
+  virtual void CalculateScoreProfile(uint start_resnum, uint num_residues,
+                                     uint chain_idx,
+                                     std::vector<Real>& profile) const;
 
-  void UseClassicMode() { include_env_mode_ = false; }
+  virtual Real CalculateScore(const std::vector<uint>& start_resnum, 
+                              const std::vector<uint>& num_residues,
+                              const std::vector<uint>& chain_idx) const;
 
-  void UseIncludeEnvMode() { include_env_mode_ = true; }
+  virtual void CalculateScoreProfile(const std::vector<uint>& start_resnum,
+                              const std::vector<uint>& num_residues, 
+                              const std::vector<uint>& chain_idx,
+                              std::vector<std::vector<Real> >& profile) const;
+
+  void DoNormalize(bool do_it) {normalize_ = do_it; }
 
   void AttachEnvironment(BackboneScoreEnv& env);
 
 private:
 
-  CBPackingScorer(): attached_environment_(false),
-                     include_env_mode_(false),
+  CBPackingScorer(): normalize_(true),
                      env_(NULL) { }
 
   inline uint EIdx(ost::conop::AminoAcid aa, uint count) const{ 
     return aa * (max_count_ + 1) + count;
   }
 
-  void Score(const loop::BackboneList& bb_list, 
-             uint start_resnum, 
-             uint chain_idx,
+  void Score(const std::vector<uint>& indices, 
              std::vector<Real>& scores) const;
 
-  Real CalculateScoreIncludeEnv(const loop::BackboneList& bb_list, 
-                                uint start_resnum, 
-                                uint chain_idx) const;
-
   // portable serialization (only stores data relevant for Load/Save!)
   // (cleanly element by element with fixed-width base-types)
   template <typename DS>
@@ -83,13 +82,11 @@ private:
   Real cutoff_;
   uint max_count_;
   Real* energies_;
+  bool normalize_;
 
   //environment specific information, that will be set upon calling 
   //AttachEnvironment
-  bool attached_environment_;
-  bool include_env_mode_;
   CBetaEnvListener* env_;
-  const loop::IdxHandler* idx_handler_;
 };
 
 
diff --git a/scoring/src/cbeta_env_listener.cc b/scoring/src/cbeta_env_listener.cc
index 00557c561cc7eb8f4ec46de58f92ad203f7e6efc..6b8092f5c7ca8d6c93cc9b0cbe1208e48e88b044 100644
--- a/scoring/src/cbeta_env_listener.cc
+++ b/scoring/src/cbeta_env_listener.cc
@@ -23,8 +23,10 @@ void CBetaEnvListener::Init(const BackboneScoreEnv& base_env) {
     env_.Clear();
   }
 
-  const loop::IdxHandler* idx_handler = base_env.GetIdxHandlerData();
-  uint num_residues = idx_handler->GetNumResidues();
+  idx_handler_ = base_env.GetIdxHandlerData();
+  env_set_ = base_env.GetEnvSetData();
+  cb_pos_data_ = base_env.GetCBPosData();
+  uint num_residues = idx_handler_->GetNumResidues();
   env_data_ = new CBetaSpatialOrganizerItem[num_residues];
   const ost::conop::AminoAcid* aa_data = base_env.GetAAData();
 
@@ -34,39 +36,33 @@ void CBetaEnvListener::Init(const BackboneScoreEnv& base_env) {
   }
 }
 
-void CBetaEnvListener::SetEnvironment(const BackboneScoreEnv& base_env, 
-                                      const std::vector<uint>& idx) {
+void CBetaEnvListener::SetEnvironment(const std::vector<uint>& idx) {
 
   core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
                                 "CBetaEnvListener::SetEnvironment", 2);
 
-  const geom::Vec3* cb_pos_data = base_env.GetCBPosData();
-
   for (std::vector<uint>::const_iterator i = idx.begin();
        i != idx.end(); ++i) {
-    env_data_[*i].pos = cb_pos_data[*i];
-    env_.Add(&env_data_[*i], cb_pos_data[*i]);
+    env_data_[*i].pos = cb_pos_data_[*i];
+    env_.Add(&env_data_[*i], cb_pos_data_[*i]);
   }
 }
 
-void CBetaEnvListener::ResetEnvironment(const BackboneScoreEnv& base_env,
-                                        const std::vector<uint>& idx) {
+void CBetaEnvListener::ResetEnvironment(const std::vector<uint>& idx) {
 
   core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
                                 "CBetaEnvListener::ResetEnvironment", 2);
 
-  const geom::Vec3* cb_pos_data = base_env.GetCBPosData();
   geom::Vec3 old_pos;
   for (std::vector<uint>::const_iterator i = idx.begin();
        i != idx.end(); ++i) {
     old_pos = env_data_[*i].pos;
-    env_data_[*i].pos = cb_pos_data[*i];
-    env_.Reset(&env_data_[*i], old_pos, cb_pos_data[*i]);
+    env_data_[*i].pos = cb_pos_data_[*i];
+    env_.Reset(&env_data_[*i], old_pos, cb_pos_data_[*i]);
   }
 }
 
-void CBetaEnvListener::ClearEnvironment(const BackboneScoreEnv& base_env,
-                                        const std::vector<uint>& idx) {
+void CBetaEnvListener::ClearEnvironment(const std::vector<uint>& idx) {
 
   core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
                                 "CBetaEnvListener::ClearEnvironment", 2);
diff --git a/scoring/src/cbeta_env_listener.hh b/scoring/src/cbeta_env_listener.hh
index e58d173dcfeac5eeee09a184105a5a6864211ac4..af07e116c9f8386fa9db2313f8ea8b31d5e3ed9c 100644
--- a/scoring/src/cbeta_env_listener.hh
+++ b/scoring/src/cbeta_env_listener.hh
@@ -30,21 +30,22 @@ public:
 
   virtual void Init(const BackboneScoreEnv& base_env);
 
-  virtual void SetEnvironment(const BackboneScoreEnv& base_env, 
-                              const std::vector<uint>& idx);
+  virtual void SetEnvironment(const std::vector<uint>& idx);
 
-  virtual void ResetEnvironment(const BackboneScoreEnv& base_env, 
-                                const std::vector<uint>& idx);
+  virtual void ResetEnvironment(const std::vector<uint>& idx);
 
-  virtual void ClearEnvironment(const BackboneScoreEnv& base_env, 
-                                const std::vector<uint>& idx);
+  virtual void ClearEnvironment(const std::vector<uint>& idx);
 
   virtual String WhoAmI() const { return "CBetaEnvListener"; }
 
   const CBetaSpatialOrganizerItem& GetEnvData(uint idx) const {
     return env_data_[idx];
   }
-  
+
+  const int* GetEnvSetData() { return env_set_; }
+
+  const loop::IdxHandler* GetIdxHandler() { return idx_handler_; }
+
   // get all cbetas within cutoff
   // - result.first: std::pair<CBetaSpatialOrganizerItem*,Real>*
   // - result.second: uint = size of partners found
@@ -57,6 +58,11 @@ private:
   
   CBetaSpatialOrganizer env_;  
   CBetaSpatialOrganizerItem* env_data_;
+
+  // data ptrs fetched from base env at initialization
+  const int* env_set_;
+  const loop::IdxHandler* idx_handler_;
+  const geom::Vec3* cb_pos_data_;
 };
 
 }} //ns
diff --git a/scoring/src/cbeta_score.cc b/scoring/src/cbeta_score.cc
index a5c2a5b3fcc64fa535a4f59e8de5fcbab00f05b7..1932a20038350aa5d03f1f9c898abd8b62070de3 100644
--- a/scoring/src/cbeta_score.cc
+++ b/scoring/src/cbeta_score.cc
@@ -7,7 +7,9 @@ CBetaScorer::CBetaScorer(Real cutoff, uint bins, uint seq_sep):
                          cutoff_(cutoff),
                          bins_(bins),
                          seq_sep_(seq_sep),
-                         attached_environment_(false),
+                         do_internal_scores_(true),
+                         do_external_scores_(true),
+                         normalize_(true),
                          env_(NULL) {
 
   promod3::core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
@@ -179,138 +181,213 @@ void CBetaScorer::SetEnergy(ost::conop::AminoAcid a, ost::conop::AminoAcid b,
   }
 
   energies_[this->EIdx(a, b, bin)] = e;
+  energies_[this->EIdx(b, a, bin)] = e;
 }
 
-Real CBetaScorer::CalculateScore(const loop::BackboneList& bb_list, 
-                                 uint start_resnum, uint chain_idx) const {
+Real CBetaScorer::CalculateScore(uint start_resnum, uint num_residues,
+                                 uint chain_idx) const {
   
   promod3::core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
                                 "CBetaScorer::CalculateScore", 2);
 
+  if (env_ == NULL) {
+    String err = "Can only calculate score when environment is attached!";
+    throw promod3::Error(err);
+  }
+
+  // setup
+  std::vector<uint> idx_vector;
+  std::vector<bool> occupied;
+  env_->GetIdxHandler()->SetupScoreCalculation(start_resnum, num_residues, 
+                                               chain_idx, idx_vector, 
+                                               occupied);
+
   // get scores
-  std::vector<Real> scores;
+  std::vector<Real> external_scores;
   std::vector<Real> internal_scores;
-  std::vector<uint> counts;
-  std::vector<uint> internal_counts;
-  this->Score(bb_list, start_resnum, chain_idx, scores, internal_scores, 
-              counts, internal_counts);
+  this->Score(idx_vector, external_scores, internal_scores, occupied);
+
   // sum them
-  Real score = 0.0;
+  Real external_score = 0.0;
   Real internal_score = 0.0;
-  uint counter = 0;
-  uint internal_counter = 0;
-  for (uint i = 0; i < scores.size(); ++i) {
-    score += scores[i];
+  for (uint i = 0; i < external_scores.size(); ++i) {
+    external_score += external_scores[i];
     internal_score += internal_scores[i];
-    counter += counts[i];
-    internal_counter += internal_counts[i];
   }
-  // normalize: we count internal scores half as the same pair appears twice
-  score += Real(0.5) * internal_score;
-  const Real count = counter + Real(0.5) * internal_counter;
-  if (count > 0) return score / count;
-  else           return score;
+
+  // all interactions in internal_score have been observed twice!
+  external_score += Real(0.5)*internal_score;
+
+  if(normalize_ && !external_scores.empty()) {
+    external_score /= external_scores.size();
+  }
+
+  return external_score;
 }
 
-void CBetaScorer::CalculateScoreProfile(const loop::BackboneList& bb_list, 
-                                        uint start_resnum, uint chain_idx,
+
+void CBetaScorer::CalculateScoreProfile(uint start_resnum, uint num_residues,
+                                        uint chain_idx,
                                         std::vector<Real>& profile) const {
   
   promod3::core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
                                 "CBetaScorer::CalculateScoreProfile", 2);
 
-  std::vector<Real> scores;
+  if (env_ == NULL) {
+    String err = "Can only calculate score when environment is attached!";
+    throw promod3::Error(err);
+  }
+
+  // setup
+  std::vector<uint> idx_vector;
+  std::vector<bool> occupied;
+  env_->GetIdxHandler()->SetupScoreCalculation(start_resnum, num_residues, 
+                                               chain_idx, idx_vector, 
+                                               occupied);
+
+  // get scores
   std::vector<Real> internal_scores;
-  std::vector<uint> counts;
-  std::vector<uint> internal_counts;
-  this->Score(bb_list, start_resnum, chain_idx, scores, internal_scores, 
-              counts, internal_counts);
-
-  profile.clear();
-  for(uint i = 0; i < scores.size(); ++i){
-    uint count = counts[i] + internal_counts[i];
-    if(count > 0) profile.push_back((scores[i] + internal_scores[i]) / count);
-    else profile.push_back(scores[i] + internal_scores[i]);
+  this->Score(idx_vector, profile, internal_scores, occupied);
+
+  for(uint i = 0; i < profile.size(); ++i) {
+    profile[i] += internal_scores[i];
   }
 }
 
 
-void CBetaScorer::Score(const loop::BackboneList& bb_list, 
-                        uint start_resnum, 
-                        uint chain_idx,
-                        std::vector<Real>& scores,
-                        std::vector<Real>& internal_scores,
-                        std::vector<uint>& counts,
-                        std::vector<uint>& internal_counts) const{
+Real CBetaScorer::CalculateScore(const std::vector<uint>& start_resnum, 
+                                 const std::vector<uint>& num_residues,
+                                 const std::vector<uint>& chain_idx) const {
+  
+  promod3::core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
+                                "CBetaScorer::CalculateScore", 2);
+
+  if (env_ == NULL) {
+    String err = "Can only calculate score when environment is attached!";
+    throw promod3::Error(err);
+  }
+
+  // setup
+  std::vector<std::vector<uint> > indices_vec;
+  std::vector<bool> occupied; 
+  env_->GetIdxHandler()->SetupScoreCalculation(start_resnum, num_residues, 
+                                               chain_idx, indices_vec, 
+                                               occupied);
+
+  // get scores and sum them up
+  Real external_score = 0.0;
+  Real internal_score = 0.0;
+  uint n_scored_residues = 0;
+  for(uint i = 0; i < start_resnum.size(); ++i) {
+    std::vector<Real> external_scores;
+    std::vector<Real> internal_scores;
+    this->Score(indices_vec[i], external_scores, internal_scores, occupied);
+    for (uint j = 0; j < external_scores.size(); ++j) {
+      external_score += external_scores[j];
+      internal_score += internal_scores[j];
+    }
+    n_scored_residues += external_scores.size();
+  }
+
+  // all interactions in internal_score have been observed twice!
+  external_score += Real(0.5)*internal_score;
+
+  if(normalize_ && n_scored_residues > 0) {
+    external_score /= n_scored_residues;
+  }
+
+  return external_score;
+}
 
 
+void CBetaScorer::CalculateScoreProfile(const std::vector<uint>& start_resnum, 
+                              const std::vector<uint>& num_residues,
+                              const std::vector<uint>& chain_idx,
+                              std::vector<std::vector<Real> >& profile) const {
+  
   promod3::core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
-                                "CBetaScorer::Score", 2);
+                                "CBetaScorer::CalculateScore", 2);
 
-  // setup
-  if (!attached_environment_) {
+  if (env_ == NULL) {
     String err = "Can only calculate score when environment is attached!";
     throw promod3::Error(err);
   }
-  uint bb_list_size, start_idx, end_idx;
-  idx_handler_->SetupScoreCalculation(bb_list, start_resnum, chain_idx,
-                                      bb_list_size, start_idx, end_idx);
 
-  counts.assign(bb_list_size, 0);
-  scores.assign(bb_list_size, 0.0);
-  if(bb_list_size == 0) return;
+  // setup
+  std::vector<std::vector<uint> > indices_vec;
+  std::vector<bool> occupied; 
+  env_->GetIdxHandler()->SetupScoreCalculation(start_resnum, num_residues, 
+                                               chain_idx, indices_vec, 
+                                               occupied);
+
+  // get scores 
+  profile.resize(start_resnum.size());
+  for(uint i = 0; i < start_resnum.size(); ++i) {
+    std::vector<Real> external_scores;
+    std::vector<Real> internal_scores;
+    std::vector<Real>& current_profile = profile[i];
+    this->Score(indices_vec[i], current_profile, internal_scores, occupied);
+    for (uint j = 0; j < current_profile.size(); ++j) {
+      current_profile[j] += internal_scores[j];
+    }
+  }
+}
+
+
+void CBetaScorer::Score(const std::vector<uint>& indices,
+                        std::vector<Real>& external_scores,
+                        std::vector<Real>& internal_scores,
+                        std::vector<bool>& occupied) const {
+
+
+  promod3::core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
+                                "CBetaScorer::Score", 2);
+
+  // setup
+  uint n_indices = indices.size();
+
+  external_scores.assign(n_indices, 0.0);
+  internal_scores.assign(n_indices, 0.0);
+
+  if(n_indices == 0) return;
 
   const Real inv_bin_size = bins_ / cutoff_;
   // let's reduce the cutoff a bit -> hack to ensure bin always within range
-  const Real squared_cutoff = cutoff_*cutoff_ - 0.0001;
   const Real cutoff = cutoff_ - 0.0001;
 
-  // let's precalculate the idx ranges we have to neglect
-  int min_idx_chain = idx_handler_->GetChainStartIdx(chain_idx);
-  int max_idx_chain = min_idx_chain + idx_handler_->GetChainSize(chain_idx) - 1;
-  std::vector<int> start_neglect(bb_list_size, start_idx);
-  std::vector<int> end_neglect(bb_list_size, end_idx);
-  int neglect_range = int(seq_sep_) - 1;
-
-  int max_i = std::min(neglect_range, static_cast<int>(bb_list_size));
-  for (int i = 0; i < max_i; ++i) {
-    start_neglect[i] =
-      std::max(min_idx_chain, start_neglect[i]-(neglect_range-i));
-    end_neglect[bb_list_size-1-i] =
-      std::min(max_idx_chain, end_neglect[i]+(neglect_range-i));
-  }
-
   // let's go over every loop residue
   CBetaSpatialOrganizer::WithinResult within_result;
+  const loop::IdxHandler* idx_handler = env_->GetIdxHandler();
+  const int* env_set = env_->GetEnvSetData();
   std::pair<CBetaSpatialOrganizerItem*,Real>* a;
-  for (uint i = 0; i < bb_list_size; ++i) {
-    within_result = env_->FindWithin(bb_list.GetCB(i), cutoff);
+  for (uint i = 0; i < n_indices; ++i) {
+    int my_idx = indices[i];
+
+    if(!env_set[my_idx]) {
+      throw promod3::Error("Must set environment before scoring!");
+    }
+
+    int my_chain_idx = idx_handler->GetChainIdx(my_idx);
+    ost::conop::AminoAcid my_aa = env_->GetEnvData(my_idx).aa;
+
+    within_result = env_->FindWithin(env_->GetEnvData(my_idx).pos, cutoff);
     a = within_result.first;
-    const ost::conop::AminoAcid myaa = bb_list.GetAA(i);
+    
     for (uint j = 0; j < within_result.second; ++j) {
-      const int my_idx = int(a[j].first->idx);
-      if (my_idx < start_neglect[i] || my_idx > end_neglect[i]) {
-        const uint bin = a[j].second * inv_bin_size;
-        scores[i] += energies_[this->EIdx(myaa, a[j].first->aa, bin)];
-        counts[i] += 1;
-      }
-    }
-  }
-  // now all the loop internal interactions
-  internal_counts.assign(bb_list_size, 0);
-  internal_scores.assign(bb_list_size, 0.0);
-  if (bb_list_size >= seq_sep_) {
-    for (uint i = 0; i < bb_list_size-seq_sep_; ++i) {
-      const ost::conop::AminoAcid myaa = bb_list.GetAA(i);
-      for (uint j = i+seq_sep_; j < bb_list_size; ++j) {
-        const Real dist2 = geom::Length2(bb_list.GetCB(i) - bb_list.GetCB(j));
-        if (dist2 < squared_cutoff) {
-          const uint bin = std::sqrt(dist2) * inv_bin_size;
-          // go symmetric
-          internal_scores[i] += energies_[this->EIdx(myaa, bb_list.GetAA(j), bin)];
-          internal_scores[j] += energies_[this->EIdx(bb_list.GetAA(j), myaa, bin)];
-          internal_counts[i] += 1;
-          internal_counts[j] += 1;
+      int other_idx = int(a[j].first->idx);
+      int other_chain_idx = idx_handler->GetChainIdx(other_idx);
+
+      if(my_chain_idx != other_chain_idx || 
+         std::abs(my_idx - other_idx) >= seq_sep_) {
+        uint bin = a[j].second * inv_bin_size;
+        Real e = energies_[this->EIdx(my_aa, a[j].first->aa, bin)];
+
+        if(occupied[other_idx] && do_internal_scores_) {
+          internal_scores[i] += e;
+        }
+
+        if(!occupied[other_idx] && do_external_scores_) {
+          external_scores[i] += e;
         }
       }
     }
@@ -320,8 +397,6 @@ void CBetaScorer::Score(const loop::BackboneList& bb_list,
 
 void CBetaScorer::AttachEnvironment(BackboneScoreEnv& env) {
   env_ = env.UniqueListener<CBetaEnvListener>("CBetaEnvListener");
-  idx_handler_ = env.GetIdxHandlerData();
-  attached_environment_ = true;
 }
 
 }}
diff --git a/scoring/src/cbeta_score.hh b/scoring/src/cbeta_score.hh
index 78bbf9c34c4f9a219169238161ec51c542e2f63e..c2686975efc7e187710954e1d3d32952c35134b2 100644
--- a/scoring/src/cbeta_score.hh
+++ b/scoring/src/cbeta_score.hh
@@ -31,33 +31,45 @@ public:
   void SetEnergy(ost::conop::AminoAcid a, ost::conop::AminoAcid b, uint bin,
                  Real e);
 
-  virtual Real CalculateScore(const loop::BackboneList& bb_list, 
-                              uint start_resnum, 
+  void DoInternalScores(bool do_it) { do_internal_scores_ = do_it; }
+
+  void DoExternalScores(bool do_it) { do_external_scores_ = do_it; }
+
+  void DoNormalize(bool do_it) { normalize_ = do_it; }
+
+  virtual Real CalculateScore(uint start_resnum, uint num_residues,
                               uint chain_idx) const;
 
-  virtual void CalculateScoreProfile(const loop::BackboneList& bb_list, 
-                                     uint start_resnum, 
+  virtual void CalculateScoreProfile(uint start_resnum,
+                                     uint num_residues, 
                                      uint chain_idx,
                                      std::vector<Real>& profile) const;
 
+  virtual Real CalculateScore(const std::vector<uint>& start_resnum, 
+                              const std::vector<uint>& num_residues,
+                              const std::vector<uint>& chain_idx) const;
+
+  virtual void CalculateScoreProfile(const std::vector<uint>& start_resnum,
+                              const std::vector<uint>& num_residues, 
+                              const std::vector<uint>& chain_idx,
+                              std::vector<std::vector<Real> >& profile) const;
+
   void AttachEnvironment(BackboneScoreEnv& env);
 
 private:
 
-  CBetaScorer(): attached_environment_(false), env_(NULL) { }
+  CBetaScorer(): do_internal_scores_(true), do_external_scores_(true), 
+                 normalize_(true), env_(NULL) { }
 
   inline uint EIdx(ost::conop::AminoAcid a, ost::conop::AminoAcid b,
                    uint bin) const {
     return (a * ost::conop::XXX + b) * bins_ + bin;
   }
 
-  void Score(const loop::BackboneList& bb_list, 
-             uint start_resnum, 
-             uint chain_idx,
-             std::vector<Real>& scores,
+  void Score(const std::vector<uint>& indices, 
+             std::vector<Real>& external_scores,
              std::vector<Real>& internal_scores,
-             std::vector<uint>& counts,
-             std::vector<uint>& internal_counts) const;
+             std::vector<bool>& occupied) const;
 
   // portable serialization (only stores data relevant for Load/Save!)
   // (cleanly element by element with fixed-width base-types)
@@ -77,12 +89,13 @@ private:
   uint bins_;
   uint seq_sep_;
   Real* energies_;
+  bool do_internal_scores_;
+  bool do_external_scores_;
+  bool normalize_;
 
   //environment specific information, that will be set upon calling 
   //AttachEnvironment
-  bool attached_environment_;
   CBetaEnvListener* env_;
-  const loop::IdxHandler* idx_handler_;
 };
 
 
diff --git a/scoring/src/clash_env_listener.cc b/scoring/src/clash_env_listener.cc
index 287bcecef49150b7050b46c22672cbcc2806a520..3bf1c656436207a3eb23c2d551d83cb9ed7fe838 100644
--- a/scoring/src/clash_env_listener.cc
+++ b/scoring/src/clash_env_listener.cc
@@ -7,7 +7,10 @@ ClashEnvListener::ClashEnvListener(): env_(8.0),
                                       env_data_(NULL) { }
 
 ClashEnvListener::~ClashEnvListener() {
-  if (env_data_ != NULL) delete [] env_data_;
+  if (env_data_ != NULL) {
+    delete [] is_glycine_;
+    delete [] env_data_;
+  }
 }
 
 void ClashEnvListener::Init(const BackboneScoreEnv& base_env) {
@@ -18,133 +21,131 @@ void ClashEnvListener::Init(const BackboneScoreEnv& base_env) {
   if (env_data_ != NULL) {
     // the env listener has already been initialized at some point...
     // let's clean up first...
+    delete [] is_glycine_;
     delete [] env_data_;
     env_data_ = NULL;
     env_.Clear();
   }
 
-  const loop::IdxHandler* idx_handler = base_env.GetIdxHandlerData();
-  uint num_residues = idx_handler->GetNumResidues();
+  idx_handler_ = base_env.GetIdxHandlerData();
+  env_set_ = base_env.GetEnvSetData();
+  n_pos_data_ = base_env.GetNPosData();
+  ca_pos_data_ = base_env.GetCAPosData();
+  c_pos_data_ = base_env.GetCPosData();
+  o_pos_data_ = base_env.GetOPosData();
+  cb_pos_data_ = base_env.GetCBPosData();
+  aa_data_ = base_env.GetAAData();
+
+  uint num_residues = idx_handler_->GetNumResidues();
+
   env_data_ = new ClashSpatialOrganizerItem[5*num_residues];
+  is_glycine_ = new bool[num_residues];
 
   for (uint i = 0; i < num_residues; ++i) {
     // N
-    env_data_[5*i  ].clash_type = CLASH_N;
+    env_data_[5*i  ].clash_type = BB_CLASH_N;
     env_data_[5*i  ].idx = i;
     // CA
-    env_data_[5*i+1].clash_type = CLASH_C;
+    env_data_[5*i+1].clash_type = BB_CLASH_C;
     env_data_[5*i+1].idx = i;
     // C
-    env_data_[5*i+2].clash_type = CLASH_C;
+    env_data_[5*i+2].clash_type = BB_CLASH_C;
     env_data_[5*i+2].idx = i;
     // O
-    env_data_[5*i+3].clash_type = CLASH_O;
+    env_data_[5*i+3].clash_type = BB_CLASH_O;
     env_data_[5*i+3].idx = i;
     // CB
-    env_data_[5*i+4].clash_type = CLASH_C;
+    env_data_[5*i+4].clash_type = BB_CLASH_C;
     env_data_[5*i+4].idx = i;
+
+    if(aa_data_[i] == ost::conop::GLY) {
+      is_glycine_[i] = true;
+    }
+    else {
+      is_glycine_[i] = false;
+    }
   }
 }
 
-void ClashEnvListener::SetEnvironment(const BackboneScoreEnv& base_env, 
-                                      const std::vector<uint>& idx) {
+void ClashEnvListener::SetEnvironment(const std::vector<uint>& idx) {
 
   core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
                                 "ClashEnvListener::SetEnvironment", 2);
 
-
-  const geom::Vec3* n_pos_data = base_env.GetNPosData();
-  const geom::Vec3* ca_pos_data = base_env.GetCAPosData();
-  const geom::Vec3* c_pos_data = base_env.GetCPosData();
-  const geom::Vec3* o_pos_data = base_env.GetOPosData();
-  const geom::Vec3* cb_pos_data = base_env.GetCBPosData();
-  const ost::conop::AminoAcid* aa_data = base_env.GetAAData();
-
   geom::Vec3 pos;
   for (std::vector<uint>::const_iterator i = idx.begin();
        i != idx.end(); ++i) {
     // N
-    pos = n_pos_data[*i];
+    pos = n_pos_data_[*i];
     env_data_[5*(*i)].pos = pos;
     env_.Add(&env_data_[5*(*i)], pos);
     // CA
-    pos = ca_pos_data[*i];
+    pos = ca_pos_data_[*i];
     env_data_[5*(*i)+1].pos = pos;
     env_.Add(&env_data_[5*(*i)+1], pos);
     // C
-    pos = c_pos_data[*i];
+    pos = c_pos_data_[*i];
     env_data_[5*(*i)+2].pos = pos;
     env_.Add(&env_data_[5*(*i)+2], pos);
     // O
-    pos = o_pos_data[*i];
+    pos = o_pos_data_[*i];
     env_data_[5*(*i)+3].pos = pos;
     env_.Add(&env_data_[5*(*i)+3], pos);
     // CB (if necessary)
-    if (aa_data[*i] != ost::conop::GLY) {
-      pos = cb_pos_data[*i];
+    if (aa_data_[*i] != ost::conop::GLY) {
+      pos = cb_pos_data_[*i];
       env_data_[5*(*i)+4].pos = pos;
       env_.Add(&env_data_[5*(*i)+4], pos);
     }
   }
 }
 
-void ClashEnvListener::ResetEnvironment(const BackboneScoreEnv& base_env,
-                                        const std::vector<uint>& idx) {
+void ClashEnvListener::ResetEnvironment(const std::vector<uint>& idx) {
 
   core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
                                 "ClashEnvListener::ResetEnvironment", 2);
 
-  const geom::Vec3* n_pos_data = base_env.GetNPosData();
-  const geom::Vec3* ca_pos_data = base_env.GetCAPosData();
-  const geom::Vec3* c_pos_data = base_env.GetCPosData();
-  const geom::Vec3* o_pos_data = base_env.GetOPosData();
-  const geom::Vec3* cb_pos_data = base_env.GetCBPosData();
-  const ost::conop::AminoAcid* aa_data = base_env.GetAAData();
-
   geom::Vec3 pos, old_pos;
   for (std::vector<uint>::const_iterator i = idx.begin();
        i != idx.end(); ++i) {
     // N
     old_pos = env_data_[5*(*i)].pos;
-    pos = n_pos_data[*i];
+    pos = n_pos_data_[*i];
     env_data_[5*(*i)].pos = pos;
     env_.Reset(&env_data_[5*(*i)], old_pos, pos);
     // CA
     old_pos = env_data_[5*(*i)+1].pos;
-    pos = ca_pos_data[*i];
+    pos = ca_pos_data_[*i];
     env_data_[5*(*i)+1].pos = pos;
     env_.Reset(&env_data_[5*(*i)+1], old_pos, pos);
     // C
     old_pos = env_data_[5*(*i)+2].pos;
-    pos = c_pos_data[*i];
+    pos = c_pos_data_[*i];
     env_data_[5*(*i)+2].pos = pos;
     env_.Reset(&env_data_[5*(*i)+2], old_pos, pos);
     // O
     old_pos = env_data_[5*(*i)+3].pos;
-    pos = o_pos_data[*i];
+    pos = o_pos_data_[*i];
     env_data_[5*(*i)+3].pos = pos;
     env_.Reset(&env_data_[5*(*i)+3], old_pos, pos);
     // CB (if necessary)
-    if (aa_data[*i] != ost::conop::GLY) {
+    if (aa_data_[*i] != ost::conop::GLY) {
       old_pos = env_data_[5*(*i)+4].pos;
-      pos = cb_pos_data[*i];
+      pos = cb_pos_data_[*i];
       env_data_[5*(*i)+4].pos = pos;
       env_.Reset(&env_data_[5*(*i)+4], old_pos, pos);
     }
   }
 }
 
-void ClashEnvListener::ClearEnvironment(const BackboneScoreEnv& base_env,
-                                        const std::vector<uint>& idx) {
+void ClashEnvListener::ClearEnvironment(const std::vector<uint>& idx) {
 
   core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
                                 "ClashEnvListener::ClearEnvironment", 2);
 
-  const ost::conop::AminoAcid* aa_data = base_env.GetAAData();
-
   for (std::vector<uint>::const_iterator i = idx.begin();
        i != idx.end(); ++i) {
-    uint num_clash_items = (aa_data[*i] != ost::conop::GLY) ? 5 : 4;
+    uint num_clash_items = (aa_data_[*i] != ost::conop::GLY) ? 5 : 4;
     for (uint j = 0; j < num_clash_items; ++j) {
       env_.Remove(&env_data_[5*(*i)+j], env_data_[5*(*i)+j].pos);
     }
diff --git a/scoring/src/clash_env_listener.hh b/scoring/src/clash_env_listener.hh
index 686001134af9695a757b5515317e023a873e7174..cb4ee362b1d30c99823e6e3517879a7c56103fa7 100644
--- a/scoring/src/clash_env_listener.hh
+++ b/scoring/src/clash_env_listener.hh
@@ -6,18 +6,19 @@
 
 namespace promod3 { namespace scoring {
 
-enum ClashType {
-  CLASH_C,
-  CLASH_N,
-  CLASH_O
+enum BBClashType {
+  BB_CLASH_C,
+  BB_CLASH_N,
+  BB_CLASH_O,
+  BB_CLASH_NUM
 };
 
 struct ClashSpatialOrganizerItem {
   ClashSpatialOrganizerItem() { }
 
-  ClashSpatialOrganizerItem(ClashType type, const geom::Vec3& p, uint i)
+  ClashSpatialOrganizerItem(BBClashType type, const geom::Vec3& p, uint i)
                            : clash_type(type), pos(p), idx(i) { }
-  ClashType clash_type;
+  BBClashType clash_type;
   geom::Vec3 pos;
   uint idx;
 };
@@ -35,14 +36,11 @@ public:
 
   virtual void Init(const BackboneScoreEnv& base_env);
 
-  virtual void SetEnvironment(const BackboneScoreEnv& base_env, 
-                              const std::vector<uint>& idx);
+  virtual void SetEnvironment(const std::vector<uint>& idx);
 
-  virtual void ResetEnvironment(const BackboneScoreEnv& base_env, 
-                                const std::vector<uint>& idx);
+  virtual void ResetEnvironment(const std::vector<uint>& idx);
 
-  virtual void ClearEnvironment(const BackboneScoreEnv& base_env, 
-                                const std::vector<uint>& idx);
+  virtual void ClearEnvironment(const std::vector<uint>& idx);
 
   virtual String WhoAmI() const { return "ClashEnvListener"; }
 
@@ -51,11 +49,31 @@ public:
     return env_.FindWithin(pos, cutoff);
   }
 
+  const int* GetEnvSetData() { return env_set_; }
+
+  const loop::IdxHandler* GetIdxHandler() { return idx_handler_; }
+
+  // for internal use in the actual scorer to access required per residue data
+  // NO RANGE CHECK!
+  ClashSpatialOrganizerItem* GetParticleData(uint idx) { return &env_data_[5*idx]; };
+  bool IsGlycine(uint idx) { return is_glycine_[idx]; } 
+
 private:
 
   ClashSpatialOrganizer env_;
   // here: 5 atoms stored for each index: use env_data_[5*idx + sub_idx]
+  bool* is_glycine_;
   ClashSpatialOrganizerItem* env_data_;
+
+  // data ptrs fetched from base env at initialization
+  const int* env_set_;
+  const loop::IdxHandler* idx_handler_;
+  const geom::Vec3* n_pos_data_;
+  const geom::Vec3* ca_pos_data_;
+  const geom::Vec3* c_pos_data_;
+  const geom::Vec3* o_pos_data_;
+  const geom::Vec3* cb_pos_data_;
+  const ost::conop::AminoAcid* aa_data_;
 };
 
 }} //ns
diff --git a/scoring/src/clash_score.cc b/scoring/src/clash_score.cc
index dc0ab88e8aeeeb7015c5b088fa2ab4d3228b9d1b..c7c2849124252180da3e5af0f76a4b63dc4f632f 100644
--- a/scoring/src/clash_score.cc
+++ b/scoring/src/clash_score.cc
@@ -1,384 +1,255 @@
 #include <promod3/scoring/clash_score.hh>
+#include <promod3/scoring/scwrl3_energy_functions.hh>
 
 
 namespace promod3 { namespace scoring {
 
-namespace {
-// LOOK UP TABLES
-const uint MAX_CLASH_BIN = 320;
-const Real CLASH_BIN_SIZE = 1.0 / 100.0;
-const uint CLASH_BINS_PER_A = 100;
-
-const Real CLASH_SCORE_26[321] = {
-  10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,
-  10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,
-  10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,
-  10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,
-  10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,
-  10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,
-  10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,
-  10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,
-  10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,
-  10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,
-  10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,
-  10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,
-  10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,
-  10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,
-  10.0,10.0,10.0,10.0,10.0,9.91263461538,9.69235384615,9.47207307692,
-  9.25179230769,9.03151153846,8.81123076923,8.59095,8.37066923077,
-  8.15038846154,7.93010769231,7.70982692308,7.48954615385,7.26926538462,
-  7.04898461538,6.82870384615,6.60842307692,6.38814230769,6.16786153846,
-  5.94758076923,5.7273,5.50701923077,5.28673846154,5.06645769231,
-  4.84617692308,4.62589615385,4.40561538462,4.18533461538,3.96505384615,
-  3.74477307692,3.52449230769,3.30421153846,3.08393076923,2.86365,
-  2.64336923077,2.42308846154,2.20280769231,1.98252692308,1.76224615385,
-  1.54196538462,1.32168461538,1.10140384615,0.881123076923,0.660842307693,
-  0.440561538462,0.220280769231,2.54343213157e-13,0.0,0.0,0.0,0.0,0.0,0.0,0.0,
-  0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,
-  0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,
-  0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0};
-
-const Real CLASH_SCORE_29[321] = {
-  10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,
-  10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,
-  10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,
-  10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,
-  10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,
-  10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,
-  10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,
-  10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,
-  10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,
-  10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,
-  10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,
-  10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,
-  10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,
-  10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,
-  10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,
-  10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,
-  9.87465517241,9.67716206897,9.47966896552,9.28217586207,9.08468275862,
-  8.88718965517,8.68969655172,8.49220344828,8.29471034483,8.09721724138,
-  7.89972413793,7.70223103448,7.50473793103,7.30724482759,7.10975172414,
-  6.91225862069,6.71476551724,6.51727241379,6.31977931035,6.1222862069,
-  5.92479310345,5.7273,5.52980689655,5.3323137931,5.13482068966,4.93732758621,
-  4.73983448276,4.54234137931,4.34484827586,4.14735517241,3.94986206897,
-  3.75236896552,3.55487586207,3.35738275862,3.15988965517,2.96239655172,
-  2.76490344828,2.56741034483,2.36991724138,2.17242413793,1.97493103448,
-  1.77743793103,1.57994482759,1.38245172414,1.18495862069,0.987465517242,
-  0.789972413793,0.592479310345,0.394986206897,0.197493103449,3.49721918091e-13,
-  0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,
-  0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0};
-
-const Real CLASH_SCORE_32[321] = {
-  10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,
-  10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,
-  10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,
-  10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,
-  10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,
-  10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,
-  10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,
-  10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,
-  10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,
-  10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,
-  10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,
-  10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,
-  10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,
-  10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,
-  10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,
-  10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,
-  10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,
-  10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,9.843796875,9.66481875,
-  9.485840625,9.3068625,9.127884375,8.94890625,8.769928125,8.59095,8.411971875,
-  8.23299375,8.054015625,7.8750375,7.696059375,7.51708125,7.338103125,7.159125,
-  6.980146875,6.80116875,6.622190625,6.4432125,6.264234375,6.08525625,
-  5.906278125,5.7273,5.548321875,5.36934375,5.190365625,5.0113875,4.832409375,
-  4.65343125,4.474453125,4.295475,4.116496875,3.93751875,3.758540625,3.5795625,
-  3.400584375,3.22160625,3.042628125,2.86365,2.684671875,2.50569375,2.326715625,
-  2.1477375,1.968759375,1.78978125,1.610803125,1.431825,1.252846875,1.07386875,
-  0.894890625,0.7159125,0.536934375,0.35795625,0.178978125,0.0};
-
-const Real* CLASH_SCORES[3][3] = {{CLASH_SCORE_32,CLASH_SCORE_29,CLASH_SCORE_29},
-                                  {CLASH_SCORE_29,CLASH_SCORE_26,CLASH_SCORE_26},
-                                  {CLASH_SCORE_29,CLASH_SCORE_26,CLASH_SCORE_26}};
-
-} // anon ns
-
-
-Real ClashScorer::CalculateScore(const loop::BackboneList& bb_list, 
-                                 uint start_resnum, uint chain_idx) const {
-  
-  promod3::core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
-                                "ClashScorer::CalculateScore", 2);
+ClashScorer::ClashScorer(): do_internal_scores_(true), 
+                            do_external_scores_(true), 
+                            normalize_(true), 
+                            env_(NULL) { 
 
-  std::vector<Real> scores;
-  std::vector<Real> internal_scores;
+  for(uint i = 0; i < BB_CLASH_NUM; ++i) {
+    for(uint j = 0; j < BB_CLASH_NUM; ++j) {
+      clash_scores_[i][j] = new Real[bins_];
+    }
+  }  
+
+  // setup radii
+  Real radius[BB_CLASH_NUM] = {1.6, 1.3, 1.3};
+
+  // estimate clash scores
+  for(uint i = 0; i < BB_CLASH_NUM; ++i) {
+    for(uint j = i; j < BB_CLASH_NUM; ++j) {
+      const Real Rij = radius[i] + radius[j];
+      for(uint bin = 0; bin < bins_; ++bin) {
+        Real d = static_cast<Real>(bin) / bins_per_a_;
+        clash_scores_[i][j][bin] = SCWRL3PairwiseScore(d, Rij);
+      }
+      if(i != j) {
+        memcpy(clash_scores_[j][i], clash_scores_[i][j], bins_ * sizeof(Real));
+      }
+    }
+  }
+}
 
-  this->Score(bb_list, start_resnum, chain_idx, scores, internal_scores);
 
-  Real score = 0.0;
+ClashScorer::~ClashScorer() {
+  for(uint i = 0; i < BB_CLASH_NUM; ++i) {
+    for(uint j = 0; j < BB_CLASH_NUM; ++j) {
+      delete [] clash_scores_[i][j];
+    }
+  }  
+}
+
+
+Real ClashScorer::CalculateScore(uint start_resnum, uint num_residues,
+                                 uint chain_idx) const {
+  
+  promod3::core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
+                                "ClashScorer::CalculateScore", 2);
 
-  for(uint i = 0; i < scores.size(); ++i){
-    score += scores[i];
+  if (env_ == NULL) {
+    String err = "Can only calculate score when environment is attached!";
+    throw promod3::Error(err);
   }
 
+  // setup
+  std::vector<uint> idx_vector;
+  std::vector<bool> occupied;
+  env_->GetIdxHandler()->SetupScoreCalculation(start_resnum, num_residues, 
+                                               chain_idx, idx_vector, 
+                                               occupied);
+
+  // get scores
+  std::vector<Real> external_scores;
+  std::vector<Real> internal_scores;
+  this->Score(idx_vector, external_scores, internal_scores, occupied);
+
+  Real external_score = 0.0;
   Real internal_score = 0.0;
-  for(uint i = 0; i < internal_scores.size(); ++i){
+  for(uint i = 0; i < external_scores.size(); ++i) {
+    external_score += external_scores[i];
     internal_score += internal_scores[i];
   }
 
-  score += (0.5 * internal_score);
+  // all interactions in internal score have been observed twice!
+  external_score += Real(0.5)*internal_score;
 
-  if(!scores.empty()){
-    score /= scores.size();
+  if(normalize_ && ! external_scores.empty()) {
+    external_score /= external_scores.size();
   }
-
-  return score;
+  
+  return external_score;
 }
 
 
-void ClashScorer::CalculateScoreProfile(const loop::BackboneList& bb_list, 
-                                        uint start_resnum, uint chain_idx,
+void ClashScorer::CalculateScoreProfile(uint start_resnum, uint num_residues,
+                                        uint chain_idx,
                                         std::vector<Real>& profile) const {
   
   promod3::core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
                                 "ClashScorer::CalculateScoreProfile", 2);
 
-  std::vector<Real> scores;
-  std::vector<Real> internal_scores;
+  if (env_ == NULL) {
+    String err = "Can only calculate score when environment is attached!";
+    throw promod3::Error(err);
+  }
 
-  this->Score(bb_list, start_resnum, chain_idx, scores, internal_scores);
+  // setup
+  std::vector<uint> idx_vector;
+  std::vector<bool> occupied;
+  env_->GetIdxHandler()->SetupScoreCalculation(start_resnum, num_residues, 
+                                               chain_idx, idx_vector, 
+                                               occupied);
+
+  // get scores
+  std::vector<Real> external_scores;
+  std::vector<Real> internal_scores;
+  this->Score(idx_vector, external_scores, internal_scores, occupied);
 
-  profile.clear();
-  for(uint i = 0; i < scores.size(); ++i){
-    profile.push_back(scores[i] + internal_scores[i]);
+  profile.resize(external_scores.size());
+  for(uint i = 0; i < external_scores.size(); ++i) {
+    profile[i] = external_scores[i] + internal_scores[i];
   }
 }
 
 
-void ClashScorer::Score(const loop::BackboneList& bb_list, 
-                        uint start_resnum, uint chain_idx,
-                        std::vector<Real>& scores,
-                        std::vector<Real>& internal_scores) const {
+Real ClashScorer::CalculateScore(const std::vector<uint>& start_resnum, 
+                                 const std::vector<uint>& num_residues,
+                                 const std::vector<uint>& chain_idx) const {
   
   promod3::core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
-                                "ClashScorer::Score", 2);
+                                "ClashScorer::CalculateScore", 2);
+
+  if (env_ == NULL) {
+    String err = "Can only calculate score when environment is attached!";
+    throw promod3::Error(err);
+  }
 
   // setup
-  if (!attached_environment_) {
+  std::vector<std::vector<uint> > indices_vec;
+  std::vector<bool> occupied; 
+  env_->GetIdxHandler()->SetupScoreCalculation(start_resnum, num_residues, 
+                                               chain_idx, indices_vec, 
+                                               occupied);
+
+  // get scores and sum them up
+  Real external_score = 0.0;
+  Real internal_score = 0.0;
+  uint n_scored_residues = 0;
+  for(uint i = 0; i < start_resnum.size(); ++i) {
+    std::vector<Real> external_scores;
+    std::vector<Real> internal_scores;
+    this->Score(indices_vec[i], external_scores, internal_scores, occupied);
+    for (uint j = 0; j < external_scores.size(); ++j) {
+      external_score += external_scores[j];
+      internal_score += internal_scores[j];
+    }
+    n_scored_residues += external_scores.size();
+  }
+
+  // all interactions in internal_score have been observed twice!
+  external_score += Real(0.5)*internal_score;
+
+  if(normalize_ && n_scored_residues > 0) {
+    external_score /= n_scored_residues;
+  }
+
+  return external_score;
+}
+
+
+void ClashScorer::CalculateScoreProfile(const std::vector<uint>& start_resnum, 
+                              const std::vector<uint>& num_residues,
+                              const std::vector<uint>& chain_idx,
+                              std::vector<std::vector<Real> >& profile) const {
+  
+  promod3::core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
+                                "ClashScorer::CalculateScore", 2);
+
+  if (env_ == NULL) {
     String err = "Can only calculate score when environment is attached!";
     throw promod3::Error(err);
   }
-  uint bb_list_size, start_idx, end_idx;
-  idx_handler_->SetupScoreCalculation(bb_list, start_resnum, chain_idx,
-                                      bb_list_size, start_idx, end_idx);
-
-  // setup result
-  scores.assign(bb_list_size, 0.0);
-  internal_scores.assign(bb_list_size, 0.0);
-  if (bb_list_size == 0) return;
-
-  // let's precalculate the idx ranges we have to neglect
-  int min_idx_chain = idx_handler_->GetChainStartIdx(chain_idx);
-  int max_idx_chain = min_idx_chain + idx_handler_->GetChainSize(chain_idx) - 1;
-  std::vector<int> start_neglect(bb_list_size, start_idx);
-  std::vector<int> end_neglect(bb_list_size, end_idx);
-  // we use a fixed seq. separation of 2 residues
-  const uint seq_sep = 2;
-  int neglect_range = int(seq_sep) - 1;
-  int max_i = std::min(neglect_range, static_cast<int>(bb_list_size));
-  for (int i = 0; i < max_i; ++i) {
-    start_neglect[i] =
-      std::max(min_idx_chain, start_neglect[i]-(neglect_range-i));
-    end_neglect[bb_list_size-1-i] =
-      std::min(max_idx_chain, end_neglect[i]+(neglect_range-i));
+
+  // setup
+  std::vector<std::vector<uint> > indices_vec;
+  std::vector<bool> occupied; 
+  env_->GetIdxHandler()->SetupScoreCalculation(start_resnum, num_residues, 
+                                               chain_idx, indices_vec, 
+                                               occupied);
+
+  // get scores 
+  profile.resize(start_resnum.size());
+  for(uint i = 0; i < start_resnum.size(); ++i) {
+    std::vector<Real> external_scores;
+    std::vector<Real> internal_scores;
+    std::vector<Real>& current_profile = profile[i];
+    this->Score(indices_vec[i], current_profile, internal_scores, occupied);
+    for (uint j = 0; j < current_profile.size(); ++j) {
+      current_profile[j] += internal_scores[j];
+
+    }
   }
+}
+
+
+void ClashScorer::Score(const std::vector<uint>& indices,
+                        std::vector<Real>& external_scores,
+                        std::vector<Real>& internal_scores,
+                        std::vector<bool>& occupied) const {
+  
+  promod3::core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
+                                "ClashScorer::Score", 2);
+
+  // setup
+
+  uint n_indices = indices.size();
 
-  // get scores to environment
+  external_scores.assign(n_indices, 0.0);
+  internal_scores.assign(n_indices, 0.0);
+
+  if(n_indices == 0) return;
+
+  uint seq_sep = 2;
   uint bin;
+  Real score;
+  const int* env_set = env_->GetEnvSetData();
+
   // let's go over every loop residue
   ClashSpatialOrganizer::WithinResult within_result;
   std::pair<ClashSpatialOrganizerItem*,Real>* a;
-  for (uint i = 0; i < bb_list_size; ++i) {
-    // N
-    within_result = env_->FindWithin(bb_list.GetN(i), 2.9);
-    a = within_result.first;
-    for (uint j = 0; j < within_result.second; ++j) {
-      const int my_idx = int(a[j].first->idx);
-      if (my_idx < start_neglect[i] || my_idx > end_neglect[i]) {
-        bin = a[j].second * CLASH_BINS_PER_A;
-        bin = (bin<MAX_CLASH_BIN) ? bin : MAX_CLASH_BIN;
-        scores[i] += CLASH_SCORES[CLASH_N][a[j].first->clash_type][bin];
-      }
-    }
-    // CA
-    within_result = env_->FindWithin(bb_list.GetCA(i), 3.2);
-    a = within_result.first;
-    for (uint j = 0; j < within_result.second; ++j) {
-      const int my_idx = int(a[j].first->idx);
-      if (my_idx < start_neglect[i] || my_idx > end_neglect[i]) {
-        bin = a[j].second * CLASH_BINS_PER_A;
-        bin = (bin<MAX_CLASH_BIN) ? bin : MAX_CLASH_BIN;
-        scores[i] += CLASH_SCORES[CLASH_C][a[j].first->clash_type][bin];
-      }
-    }
-    // C
-    within_result = env_->FindWithin(bb_list.GetC(i), 3.2);
-    a = within_result.first;
-    for (uint j = 0; j < within_result.second; ++j) {
-      const int my_idx = int(a[j].first->idx);
-      if (my_idx < start_neglect[i] || my_idx > end_neglect[i]) {
-        bin = a[j].second * CLASH_BINS_PER_A;
-        bin = (bin<MAX_CLASH_BIN) ? bin : MAX_CLASH_BIN;
-        scores[i] += CLASH_SCORES[CLASH_C][a[j].first->clash_type][bin];
-      }
-    }
-    // O
-    within_result = env_->FindWithin(bb_list.GetO(i), 2.9);
-    a = within_result.first;
-    for (uint j = 0; j < within_result.second; ++j) {
-      const int my_idx = int(a[j].first->idx);
-      if (my_idx < start_neglect[i] || my_idx > end_neglect[i]) {
-        bin = a[j].second * CLASH_BINS_PER_A;
-        bin = (bin<MAX_CLASH_BIN) ? bin : MAX_CLASH_BIN;
-        scores[i] += CLASH_SCORES[CLASH_O][a[j].first->clash_type][bin];
-      }
+
+  for (uint i = 0; i < n_indices; ++i) {
+    int my_idx = indices[i];
+
+    if(!env_set[my_idx]) {
+      throw promod3::Error("Must set environment before scoring!");
     }
-    // CB (if needed)
-    if (bb_list.GetAA(i) != ost::conop::GLY) {
-      within_result = env_->FindWithin(bb_list.GetCB(i), 3.2);
+
+    uint n_particles = env_->IsGlycine(my_idx) ? 4 : 5;
+    ClashSpatialOrganizerItem* particle_data = env_->GetParticleData(my_idx);
+
+    for(uint j = 0; j < n_particles; ++j) {
+      int clash_type = particle_data[j].clash_type;
+      within_result = env_->FindWithin(particle_data[j].pos, 3.2);
       a = within_result.first;
-      for (uint j = 0; j < within_result.second; ++j) {
-        const int my_idx = int(a[j].first->idx);
-        if (my_idx < start_neglect[i] || my_idx > end_neglect[i]) {
-          bin = a[j].second * CLASH_BINS_PER_A;
-          bin = (bin<MAX_CLASH_BIN) ? bin : MAX_CLASH_BIN;
-          scores[i] += CLASH_SCORES[CLASH_C][a[j].first->clash_type][bin];
-        }
-      }
-    }
-  }
 
-  // skip stuff below if BB list too small
-  if (bb_list_size <= seq_sep) return;
-
-  // get internal scores -> N^2 loop
-  Real clash_score;
-  Real d;
-  for (uint i = 0; i < bb_list_size-seq_sep; ++i) {
-    // do not consider neighbours
-    for (uint j = i+seq_sep; j < bb_list_size; ++j) {
-      // skip this residue-residue interaction if ca-distance is above 7A
-      d = geom::Length2(bb_list.GetCA(i) - bb_list.GetCA(j)); 
-      if (d > Real(49)) continue;
-    
-      bin = std::sqrt(d) * CLASH_BINS_PER_A;
-      clash_score = CLASH_SCORE_32[(bin<MAX_CLASH_BIN) ? bin : MAX_CLASH_BIN];
-      internal_scores[i] += clash_score;
-      internal_scores[j] += clash_score;
-      bin = geom::Distance(bb_list.GetCA(i), bb_list.GetN(j)) * CLASH_BINS_PER_A;
-      clash_score = CLASH_SCORE_29[(bin<MAX_CLASH_BIN) ? bin : MAX_CLASH_BIN];
-      internal_scores[i] += clash_score;
-      internal_scores[j] += clash_score;
-      bin = geom::Distance(bb_list.GetCA(i), bb_list.GetC(j)) * CLASH_BINS_PER_A;
-      clash_score = CLASH_SCORE_32[(bin<MAX_CLASH_BIN) ? bin : MAX_CLASH_BIN];
-      internal_scores[i] += clash_score;
-      internal_scores[j] += clash_score;
-      bin = geom::Distance(bb_list.GetCA(i), bb_list.GetO(j)) * CLASH_BINS_PER_A;
-      clash_score = CLASH_SCORE_29[(bin<MAX_CLASH_BIN) ? bin : MAX_CLASH_BIN];
-      internal_scores[i] += clash_score;
-      internal_scores[j] += clash_score;
-
-      bin = geom::Distance(bb_list.GetN(i), bb_list.GetN(j)) * CLASH_BINS_PER_A;
-      clash_score = CLASH_SCORE_26[(bin<MAX_CLASH_BIN) ? bin : MAX_CLASH_BIN];
-      internal_scores[i] += clash_score;
-      internal_scores[j] += clash_score;
-      bin = geom::Distance(bb_list.GetN(i), bb_list.GetCA(j)) * CLASH_BINS_PER_A;
-      clash_score = CLASH_SCORE_29[(bin<MAX_CLASH_BIN) ? bin : MAX_CLASH_BIN];
-      internal_scores[i] += clash_score;
-      internal_scores[j] += clash_score;
-      bin = geom::Distance(bb_list.GetN(i), bb_list.GetC(j)) * CLASH_BINS_PER_A;
-      clash_score = CLASH_SCORE_29[(bin<MAX_CLASH_BIN) ? bin : MAX_CLASH_BIN];
-      internal_scores[i] += clash_score;
-      internal_scores[j] += clash_score;
-      bin = geom::Distance(bb_list.GetN(i), bb_list.GetO(j)) * CLASH_BINS_PER_A;
-      clash_score = CLASH_SCORE_26[(bin<MAX_CLASH_BIN) ? bin : MAX_CLASH_BIN];
-      internal_scores[i] += clash_score;
-      internal_scores[j] += clash_score;
-
-      bin = geom::Distance(bb_list.GetC(i), bb_list.GetN(j)) * CLASH_BINS_PER_A;
-      clash_score = CLASH_SCORE_29[(bin<MAX_CLASH_BIN) ? bin : MAX_CLASH_BIN];
-      internal_scores[i] += clash_score;
-      internal_scores[j] += clash_score;
-      bin = geom::Distance(bb_list.GetC(i), bb_list.GetCA(j)) * CLASH_BINS_PER_A;
-      clash_score = CLASH_SCORE_32[(bin<MAX_CLASH_BIN) ? bin : MAX_CLASH_BIN];
-      internal_scores[i] += clash_score;
-      internal_scores[j] += clash_score;
-      bin = geom::Distance(bb_list.GetC(i), bb_list.GetC(j)) * CLASH_BINS_PER_A;
-      clash_score = CLASH_SCORE_32[(bin<MAX_CLASH_BIN) ? bin : MAX_CLASH_BIN];
-      internal_scores[i] += clash_score;
-      internal_scores[j] += clash_score;
-      bin = geom::Distance(bb_list.GetC(i), bb_list.GetO(j)) * CLASH_BINS_PER_A;
-      clash_score = CLASH_SCORE_29[(bin<MAX_CLASH_BIN) ? bin : MAX_CLASH_BIN];
-      internal_scores[i] += clash_score;
-      internal_scores[j] += clash_score;
-
-      bin = geom::Distance(bb_list.GetO(i), bb_list.GetN(j)) * CLASH_BINS_PER_A;
-      clash_score = CLASH_SCORE_26[(bin<MAX_CLASH_BIN) ? bin : MAX_CLASH_BIN];
-      internal_scores[i] += clash_score;
-      internal_scores[j] += clash_score;
-      bin = geom::Distance(bb_list.GetO(i), bb_list.GetCA(j)) * CLASH_BINS_PER_A;
-      clash_score = CLASH_SCORE_29[(bin<MAX_CLASH_BIN) ? bin : MAX_CLASH_BIN];
-      internal_scores[i] += clash_score;
-      internal_scores[j] += clash_score;
-      bin = geom::Distance(bb_list.GetO(i), bb_list.GetC(j)) * CLASH_BINS_PER_A;
-      clash_score = CLASH_SCORE_29[(bin<MAX_CLASH_BIN) ? bin : MAX_CLASH_BIN];
-      internal_scores[i] += clash_score;
-      internal_scores[j] += clash_score;
-      bin = geom::Distance(bb_list.GetO(i), bb_list.GetO(j)) * CLASH_BINS_PER_A;
-      clash_score = CLASH_SCORE_26[(bin<MAX_CLASH_BIN) ? bin : MAX_CLASH_BIN];
-      internal_scores[i] += clash_score;
-      internal_scores[j] += clash_score;
-
-      if (bb_list.GetAA(i) != ost::conop::GLY) {
-        bin = geom::Distance(bb_list.GetCB(i), bb_list.GetN(j)) * CLASH_BINS_PER_A;
-        clash_score = CLASH_SCORE_29[(bin<MAX_CLASH_BIN) ? bin : MAX_CLASH_BIN];
-        internal_scores[i] += clash_score;
-        internal_scores[j] += clash_score;
-        bin = geom::Distance(bb_list.GetCB(i), bb_list.GetCA(j)) * CLASH_BINS_PER_A;
-        clash_score = CLASH_SCORE_32[(bin<MAX_CLASH_BIN) ? bin : MAX_CLASH_BIN];
-        internal_scores[i] += clash_score;
-        internal_scores[j] += clash_score;
-        bin = geom::Distance(bb_list.GetCB(i), bb_list.GetC(j)) * CLASH_BINS_PER_A;
-        clash_score = CLASH_SCORE_32[(bin<MAX_CLASH_BIN) ? bin : MAX_CLASH_BIN];
-        internal_scores[i] += clash_score;
-        internal_scores[j] += clash_score;
-        bin = geom::Distance(bb_list.GetCB(i), bb_list.GetO(j)) * CLASH_BINS_PER_A;
-        clash_score = CLASH_SCORE_29[(bin<MAX_CLASH_BIN) ? bin : MAX_CLASH_BIN];
-        internal_scores[i] += clash_score;
-        internal_scores[j] += clash_score;
-      }
+      for(uint k = 0; k < within_result.second; ++k) {
+        int other_idx = int(a[k].first->idx);
+
+        if(std::abs(my_idx - other_idx) >= seq_sep) {
+          bin = a[k].second * bins_per_a_;
+          score = clash_scores_[clash_type][a[k].first->clash_type][bin];
+
+          if(occupied[other_idx] && do_internal_scores_) {
+            internal_scores[i] += score;
+          }
 
-      if (bb_list.GetAA(j) != ost::conop::GLY) {
-        bin = geom::Distance(bb_list.GetN(i), bb_list.GetCB(j)) * CLASH_BINS_PER_A;
-        clash_score = CLASH_SCORE_29[(bin<MAX_CLASH_BIN) ? bin : MAX_CLASH_BIN];
-        internal_scores[i] += clash_score;
-        internal_scores[j] += clash_score;
-        bin = geom::Distance(bb_list.GetCA(i), bb_list.GetCB(j)) * CLASH_BINS_PER_A;
-        clash_score = CLASH_SCORE_32[(bin<MAX_CLASH_BIN) ? bin : MAX_CLASH_BIN];
-        internal_scores[i] += clash_score;
-        internal_scores[j] += clash_score;
-        bin = geom::Distance(bb_list.GetC(i), bb_list.GetCB(j)) * CLASH_BINS_PER_A;
-        clash_score = CLASH_SCORE_32[(bin<MAX_CLASH_BIN) ? bin : MAX_CLASH_BIN];
-        internal_scores[i] += clash_score;
-        internal_scores[j] += clash_score;
-        bin = geom::Distance(bb_list.GetO(i), bb_list.GetCB(j)) * CLASH_BINS_PER_A;
-        clash_score = CLASH_SCORE_29[(bin<MAX_CLASH_BIN) ? bin : MAX_CLASH_BIN];
-        internal_scores[i] += clash_score;
-        internal_scores[j] += clash_score;
-        if (bb_list.GetAA(i) != ost::conop::GLY) {
-          bin = geom::Distance(bb_list.GetCB(i), bb_list.GetCB(j)) * CLASH_BINS_PER_A;
-          clash_score = CLASH_SCORE_32[(bin<MAX_CLASH_BIN) ? bin : MAX_CLASH_BIN];
-          internal_scores[i] += clash_score;
-          internal_scores[j] += clash_score;
+          if(!occupied[other_idx] && do_external_scores_) {
+            external_scores[i] += score;
+          }
         }
       }
     }
@@ -387,8 +258,6 @@ void ClashScorer::Score(const loop::BackboneList& bb_list,
 
 void ClashScorer::AttachEnvironment(BackboneScoreEnv& env) {
   env_ = env.UniqueListener<ClashEnvListener>("ClashEnvListener");
-  idx_handler_ = env.GetIdxHandlerData();
-  attached_environment_ = true;
 }
 
 }}
diff --git a/scoring/src/clash_score.hh b/scoring/src/clash_score.hh
index 07f15a006b7dcfe00aa66e20aae9dde98082ff22..2a06194ca6bb549c887f362bcb18641dc132511c 100644
--- a/scoring/src/clash_score.hh
+++ b/scoring/src/clash_score.hh
@@ -11,38 +11,58 @@ namespace promod3 { namespace scoring {
 class ClashScorer;
 typedef boost::shared_ptr<ClashScorer> ClashScorerPtr;
 
-
 class ClashScorer : public BackboneScorer {
 
 public:
 
-  ClashScorer(): attached_environment_(false), env_(NULL) { }
+  ClashScorer();
+
+  ~ClashScorer();
+
+  void DoInternalScores(bool do_it) { do_internal_scores_ = do_it; }
+
+  void DoExternalScores(bool do_it) { do_external_scores_ = do_it; }
 
+  void DoNormalize(bool do_it) { normalize_ = do_it; }
 
-  virtual Real CalculateScore(const loop::BackboneList& bb_list, 
-                              uint start_resnum, 
+  virtual Real CalculateScore(uint start_resnum,
+                              uint num_residues, 
                               uint chain_idx) const;
 
-  virtual void CalculateScoreProfile(const loop::BackboneList& bb_list, 
-                                     uint start_resnum, 
+  virtual void CalculateScoreProfile(uint start_resnum, 
+                                     uint num_residues,
                                      uint chain_idx,
                                      std::vector<Real>& profile) const;
 
+  virtual Real CalculateScore(const std::vector<uint>& start_resnum, 
+                              const std::vector<uint>& num_residues,
+                              const std::vector<uint>& chain_idx) const;
+
+  virtual void CalculateScoreProfile(const std::vector<uint>& start_resnum,
+                              const std::vector<uint>& num_residues, 
+                              const std::vector<uint>& chain_idx,
+                              std::vector<std::vector<Real> >& profile) const;
+
   void AttachEnvironment(BackboneScoreEnv& env);
 
 private:
 
-  void Score(const loop::BackboneList& bb_list, 
-             uint start_resnum, 
-             uint chain_idx,
-             std::vector<Real>& scores,
-             std::vector<Real>& internal_scores) const;
-
+  void Score(const std::vector<uint>& indices, 
+             std::vector<Real>& external_scores,
+             std::vector<Real>& internal_scores,
+             std::vector<bool>& occupied) const;
+
+  // hard coded bounds (safe for dist. < 3.21A)
+  static const uint bins_ = 321;
+  static const uint bins_per_a_ = 100;
+  Real* clash_scores_[BB_CLASH_NUM][BB_CLASH_NUM];
+  bool do_internal_scores_;
+  bool do_external_scores_;
+  bool normalize_;
+  
   //environment specific information, that will be set upon calling 
   //AttachEnvironment
-  bool attached_environment_;
   ClashEnvListener* env_;
-  const loop::IdxHandler* idx_handler_;
 };
 
 
diff --git a/scoring/src/density_score.cc b/scoring/src/density_score.cc
index 8a8c77aa7816db5afcce9aaa785b713f1e0d2bcb..803a843b68e1dd8396d27b3cd67ef916c5232649 100644
--- a/scoring/src/density_score.cc
+++ b/scoring/src/density_score.cc
@@ -2,28 +2,14 @@
 
 namespace promod3{ namespace scoring{
 
-Real DensityScorer::CalculateScore(const loop::BackboneList& bb_list,
-	                                 uint start_resnum, uint chain_idx) const {
 
-  promod3::core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
-                                "DensityScorer::CalculateScore", 2);
-
-
-  if (!attached_environment_) {
-    String err = "Can only calculate score when environment is attached!";
-    throw promod3::Error(err);
-  }
-
-  if(!map_data_->map.IsValid()){
-    String err = "Environment attached to density scorer must have a valid ";
-    err += "density map for score calculation!";
-    throw promod3::Error(err);
-  }
+Real DensityScore(const loop::BackboneList& bb_list, ost::img::MapHandle& map, 
+                  Real resolution, bool all_atom) {
 
   geom::AlignedCuboid bounding_box = bb_list.GetBounds(true);
   geom::Vec3 min = bounding_box.GetMin();
   geom::Vec3 max = bounding_box.GetMax();
-  geom::Vec3 sampling = map_data_->map.GetSpatialSampling();
+  geom::Vec3 sampling = map.GetSpatialSampling();
 
   //thats the extend of the image we're actually interested in
   uint x_extent = std::ceil((max[0] - min[0]) / sampling[0]);
@@ -31,9 +17,9 @@ Real DensityScorer::CalculateScore(const loop::BackboneList& bb_list,
   uint z_extent = std::ceil((max[2] - min[2]) / sampling[2]); 
 
   //let's enlarge a bit...
-  Real x_overlap = Real(2 * map_data_->resolution) / sampling[0];
-  Real y_overlap = Real(2 * map_data_->resolution) / sampling[1];
-  Real z_overlap = Real(2 * map_data_->resolution) / sampling[2];
+  Real x_overlap = Real(2 * resolution) / sampling[0];
+  Real y_overlap = Real(2 * resolution) / sampling[1];
+  Real z_overlap = Real(2 * resolution) / sampling[2];
   x_extent += static_cast<uint>(2 * x_overlap);
   y_extent += static_cast<uint>(2 * y_overlap);
   z_extent += static_cast<uint>(2 * z_overlap);
@@ -46,20 +32,19 @@ Real DensityScorer::CalculateScore(const loop::BackboneList& bb_list,
   ost::img::MapHandle bb_list_map = ost::img::CreateImage(s);
   bb_list_map.SetSpatialSampling(sampling);
   
-  geom::Vec3 pixel_coord = map_data_->map.CoordToIndex(min - 
-                                                       geom::Vec3(x_overlap,
-                                                                  y_overlap,
-                                                                  z_overlap));
+  geom::Vec3 pixel_coord = map.CoordToIndex(min - geom::Vec3(x_overlap,
+                                                             y_overlap,
+                                                             z_overlap));
 
   ost::img::Point rounded_pixel_coord(round(pixel_coord[0]),
                                       round(pixel_coord[1]),
                                       round(pixel_coord[2]));
 
-  min = map_data_->map.IndexToCoord(rounded_pixel_coord);
+  min = map.IndexToCoord(rounded_pixel_coord);
   bb_list_map.SetAbsoluteOrigin(min);
 
   //let's fill the density of the BackboneList
-  bb_list.InsertInto(bb_list_map, map_data_->resolution, map_data_->all_atom);
+  bb_list.InsertInto(bb_list_map, resolution, all_atom);
 
   uint num_voxels = (s[0] * s[1] * s[2]);
 
@@ -74,164 +59,13 @@ Real DensityScorer::CalculateScore(const loop::BackboneList& bb_list,
         p = ost::img::Point(i,j,k);
         p_orig = p + rounded_pixel_coord;
         //will return 0.0 if outside of map
-        map_values[vec_position] = map_data_->map.GetReal(p_orig);
+        map_values[vec_position] = map.GetReal(p_orig);
         bb_list_values[vec_position] = bb_list_map.GetReal(p); 
         ++vec_position;
       }
     }
   }
 
-  return this->Correlate(map_values, bb_list_values, num_voxels);
-}
-
-
-void DensityScorer::CalculateScoreProfile(const loop::BackboneList& bb_list,
-                                          uint start_resnum, uint chain_idx,
-                                          std::vector<Real>& profile) const{
-
-  promod3::core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
-                                "DensityScorer::CalculateScore", 2);
-
-
-  if (!attached_environment_) {
-    String err = "Can only calculate score when environment is attached!";
-    throw promod3::Error(err);
-  }
-
-  if(!map_data_->map.IsValid()){
-    String err = "Environment attached to density scorer must have a valid ";
-    err += "density map for score calculation!";
-    throw promod3::Error(err);
-  }
-
-  geom::Vec3 sampling = map_data_->map.GetSpatialSampling();
-  Real x_overlap = Real(2 * map_data_->resolution) / sampling[0];
-  Real y_overlap = Real(2 * map_data_->resolution) / sampling[1];
-  Real z_overlap = Real(2 * map_data_->resolution) / sampling[2];
-
-  profile.clear();
-  for(uint res_idx = 0; res_idx < bb_list.size(); ++res_idx){
-
-    //we have to calculate the bounding box for a single residue manually
-    
-    Real min_x = std::numeric_limits<Real>::max(); 
-    Real max_x = -std::numeric_limits<Real>::max();
-    Real min_y = std::numeric_limits<Real>::max();
-    Real max_y = -std::numeric_limits<Real>::max();
-    Real min_z = std::numeric_limits<Real>::max(); 
-    Real max_z = -std::numeric_limits<Real>::max();
-
-    geom::Vec3 pos;
-    pos = bb_list.GetN(res_idx);
-    min_x = std::min(pos[0], min_x);
-    max_x = std::max(pos[0], max_x);
-    min_y = std::min(pos[1], min_y);
-    max_y = std::max(pos[1], max_y);
-    min_z = std::min(pos[2], min_z);
-    max_z = std::max(pos[2], max_z);
-
-    pos = bb_list.GetCA(res_idx);
-    min_x = std::min(pos[0], min_x);
-    max_x = std::max(pos[0], max_x);
-    min_y = std::min(pos[1], min_y);
-    max_y = std::max(pos[1], max_y);
-    min_z = std::min(pos[2], min_z);
-    max_z = std::max(pos[2], max_z);
-
-    if (bb_list.GetAA(res_idx) != ost::conop::GLY) {
-      pos = bb_list.GetCB(res_idx);
-      min_x = std::min(pos[0], min_x);
-      max_x = std::max(pos[0], max_x);
-      min_y = std::min(pos[1], min_y);
-      max_y = std::max(pos[1], max_y);
-      min_z = std::min(pos[2], min_z);
-      max_z = std::max(pos[2], max_z);
-    }
-
-    pos = bb_list.GetC(res_idx);
-    min_x = std::min(pos[0], min_x);
-    max_x = std::max(pos[0], max_x);
-    min_y = std::min(pos[1], min_y);
-    max_y = std::max(pos[1], max_y);
-    min_z = std::min(pos[2], min_z);
-    max_z = std::max(pos[2], max_z);
-
-    pos = bb_list.GetO(res_idx);
-    min_x = std::min(pos[0], min_x);
-    max_x = std::max(pos[0], max_x);
-    min_y = std::min(pos[1], min_y);
-    max_y = std::max(pos[1], max_y);
-    min_z = std::min(pos[2], min_z);
-    max_z = std::max(pos[2], max_z);
-
-    //thats the extend of the image we're actually interested in
-    uint x_extent = std::ceil((max_x - min_x) / sampling[0]);
-    uint y_extent = std::ceil((max_y - min_y) / sampling[1]);
-    uint z_extent = std::ceil((max_z - min_z) / sampling[2]); 
-
-    //let's enlarge a bit...
-    x_extent += static_cast<uint>(2 * x_overlap);
-    y_extent += static_cast<uint>(2 * y_overlap);
-    z_extent += static_cast<uint>(2 * z_overlap);
-
-    //let's create a new image, where we will fill the density of the bb_list
-    //we make sure, that the grid cubes exactly match the ones in the
-    //set map
-    ost::img::Size s(x_extent,y_extent,z_extent);
-
-    ost::img::MapHandle bb_list_map = ost::img::CreateImage(s);
-    bb_list_map.SetSpatialSampling(sampling);
-  
-    geom::Vec3 pixel_coord = map_data_->map.CoordToIndex(geom::Vec3(min_x, 
-                                                                    min_y, 
-                                                                    min_z) - 
-                                                         geom::Vec3(x_overlap,
-                                                                    y_overlap,
-                                                                    z_overlap));
-
-    ost::img::Point rounded_pixel_coord(round(pixel_coord[0]),
-                                        round(pixel_coord[1]),
-                                        round(pixel_coord[2]));
-
-    geom::Vec3 min = map_data_->map.IndexToCoord(rounded_pixel_coord);
-    bb_list_map.SetAbsoluteOrigin(min);
-
-    //let's fill the density of the BackboneList
-    bb_list.InsertInto(bb_list_map, map_data_->resolution, map_data_->all_atom);
-
-    uint num_voxels = (s[0] * s[1] * s[2]);
-
-    std::vector<Real> map_values(num_voxels);
-    std::vector<Real> bb_list_values(num_voxels);
-
-    uint vec_position = 0;
-    ost::img::Point p, p_orig;
-    for(uint i = 0; i < s[0]; ++i){
-      for(uint j = 0; j < s[1]; ++j){
-        for(uint k = 0; k < s[2]; ++k){
-          p = ost::img::Point(i,j,k);
-          p_orig = p + rounded_pixel_coord;
-          //will return 0.0 if outside of map
-          map_values[vec_position] = map_data_->map.GetReal(p_orig);
-          bb_list_values[vec_position] = bb_list_map.GetReal(p); 
-          ++vec_position;
-        }
-      }
-    }
-    
-    profile.push_back(this->Correlate(map_values, bb_list_values, num_voxels));
-  }
-}
-
-void DensityScorer::AttachEnvironment(BackboneScoreEnv& env) {
-  map_data_ = env.GetDensityMapData();
-  attached_environment_ = true;
-}
-
-Real DensityScorer::Correlate(const std::vector<Real>& map_values,
-                              const std::vector<Real>& bb_list_values,
-                              uint num_voxels) const{
-
   //we have to get the means, the standart deviations and the correlation itself...
   Real m_one = 0.0;
   Real m_two = 0.0;
diff --git a/scoring/src/density_score.hh b/scoring/src/density_score.hh
index 5a8d7bcb961e3ec7c3c0ab68e23f9dc8fc60817a..d5e5123c3f733f2976e47c8928d32b6d11dc8f57 100644
--- a/scoring/src/density_score.hh
+++ b/scoring/src/density_score.hh
@@ -3,42 +3,14 @@
 
 #include <ost/img/map.hh>
 #include <promod3/loop/density_creator.hh>
-#include <promod3/scoring/backbone_score_base.hh>
+#include <promod3/loop/backbone.hh>
 #include <promod3/core/runtime_profiling.hh>
 
 namespace promod3 { namespace scoring {
 
-class DensityScorer;
-typedef boost::shared_ptr<DensityScorer> DensityScorerPtr;
-
-
-class DensityScorer : public BackboneScorer {
-
-public:
-
-  DensityScorer(): attached_environment_(false) { }
-
-  virtual ~DensityScorer() { }
-
-  virtual Real CalculateScore(const loop::BackboneList& bb_list, 
-                              uint start_resnum, uint chain_idx) const;
-
-  void CalculateScoreProfile(const loop::BackboneList& bb_list,
-                             uint start_resnum, uint chain_idx,
-                             std::vector<Real>& profile) const;
-
-void AttachEnvironment(BackboneScoreEnv& env);
-
-private:
-
-  Real Correlate(const std::vector<Real>& map_values,
-                 const std::vector<Real>& bb_list_values,
-                 uint num_voxels) const;
-
-  const DensityMapData* map_data_;
-  bool attached_environment_;
-};
-
+Real DensityScore(const promod3::loop::BackboneList& bb_list, 
+                  ost::img::MapHandle& map, 
+                  Real resolution, bool all_atom);
 
 }}//ns
 
diff --git a/scoring/src/hbond_env_listener.cc b/scoring/src/hbond_env_listener.cc
index ca4fbd672d9899f6da2332d119d399bc454391bb..08a64dce7b0f74939f5d6b7e04580e54038891e2 100644
--- a/scoring/src/hbond_env_listener.cc
+++ b/scoring/src/hbond_env_listener.cc
@@ -1,4 +1,5 @@
 #include <promod3/scoring/hbond_env_listener.hh>
+#include <set>
 
 namespace promod3{ namespace scoring{
 
@@ -22,10 +23,15 @@ void HBondEnvListener::Init(const BackboneScoreEnv& base_env) {
     env_.Clear();
   }
 
-  const loop::IdxHandler* idx_handler = base_env.GetIdxHandlerData();
-  uint num_residues = idx_handler->GetNumResidues();
+  idx_handler_ = base_env.GetIdxHandlerData();
+  env_set_ = base_env.GetEnvSetData();
+  uint num_residues = idx_handler_->GetNumResidues();
   env_data_ = new HBondSpatialOrganizerItem[num_residues];
   const ost::conop::AminoAcid* aa_data = base_env.GetAAData();
+  n_pos_data_ = base_env.GetNPosData();
+  ca_pos_data_ = base_env.GetCAPosData();
+  c_pos_data_ = base_env.GetCPosData();
+  o_pos_data_ = base_env.GetOPosData();
 
   for(uint i = 0; i < num_residues; ++i){
     env_data_[i].idx = i;
@@ -33,56 +39,43 @@ void HBondEnvListener::Init(const BackboneScoreEnv& base_env) {
   }
 }
 
-void HBondEnvListener::SetEnvironment(const BackboneScoreEnv& base_env, 
-                                      const std::vector<uint>& idx) {
+void HBondEnvListener::SetEnvironment(const std::vector<uint>& idx) {
 
   core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
                                 "HBondEnvListener::SetEnvironment", 2);
 
-  const geom::Vec3* n_pos_data = base_env.GetNPosData();
-  const geom::Vec3* ca_pos_data = base_env.GetCAPosData();
-  const geom::Vec3* c_pos_data = base_env.GetCPosData();
-  const geom::Vec3* o_pos_data = base_env.GetOPosData();
-
   for(std::vector<uint>::const_iterator i = idx.begin();
   	  i != idx.end(); ++i){
-  	env_data_[*i].pos = ca_pos_data[*i];
-  	env_data_[*i].n_pos = n_pos_data[*i];
-  	env_data_[*i].c_pos = c_pos_data[*i];
-  	env_data_[*i].o_pos = o_pos_data[*i];
-  	env_.Add(&env_data_[*i], ca_pos_data[*i]);
+  	env_data_[*i].pos = ca_pos_data_[*i];
+  	env_data_[*i].n_pos = n_pos_data_[*i];
+  	env_data_[*i].c_pos = c_pos_data_[*i];
+  	env_data_[*i].o_pos = o_pos_data_[*i];
+  	env_.Add(&env_data_[*i], ca_pos_data_[*i]);
   }
 
-  this->UpdateStatesAndHPos(idx, base_env);
+  this->UpdateStatesAndHPos(idx);
 }
 
-void HBondEnvListener::ResetEnvironment(const BackboneScoreEnv& base_env,
-	                                      const std::vector<uint>& idx) {
+void HBondEnvListener::ResetEnvironment(const std::vector<uint>& idx) {
 
   core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
                                 "HBondEnvListener::ResetEnvironment", 2);
 
-  const geom::Vec3* n_pos_data = base_env.GetNPosData();
-  const geom::Vec3* ca_pos_data = base_env.GetCAPosData();
-  const geom::Vec3* c_pos_data = base_env.GetCPosData();
-  const geom::Vec3* o_pos_data = base_env.GetOPosData();
-
   geom::Vec3 old_pos;
   for(std::vector<uint>::const_iterator i = idx.begin();
   	  i != idx.end(); ++i){
   	old_pos = env_data_[*i].pos;
-    env_data_[*i].pos = ca_pos_data[*i];
-    env_data_[*i].n_pos = n_pos_data[*i];
-    env_data_[*i].c_pos = c_pos_data[*i];
-    env_data_[*i].o_pos = o_pos_data[*i];
-  	env_.Reset(&env_data_[*i], old_pos, ca_pos_data[*i]);
+    env_data_[*i].pos = ca_pos_data_[*i];
+    env_data_[*i].n_pos = n_pos_data_[*i];
+    env_data_[*i].c_pos = c_pos_data_[*i];
+    env_data_[*i].o_pos = o_pos_data_[*i];
+  	env_.Reset(&env_data_[*i], old_pos, ca_pos_data_[*i]);
   }
 
-  this->UpdateStatesAndHPos(idx, base_env);
+  this->UpdateStatesAndHPos(idx);
 }
 
-void HBondEnvListener::ClearEnvironment(const BackboneScoreEnv& base_env,
-	                                      const std::vector<uint>& idx) {
+void HBondEnvListener::ClearEnvironment(const std::vector<uint>& idx) {
 
   core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
                                 "HBondEnvListener::ClearEnvironment", 2);
@@ -92,116 +85,62 @@ void HBondEnvListener::ClearEnvironment(const BackboneScoreEnv& base_env,
     env_.Remove(&env_data_[*i], env_data_[*i].pos);
   }  
 
-  this->UpdateStatesAndHPos(idx, base_env);
+  this->UpdateStatesAndHPos(idx);
 }
 
-void HBondEnvListener::UpdateStatesAndHPos(uint chain_idx, 
-                                           const BackboneScoreEnv& env) {
-
-  const loop::IdxHandler* idx_handler = env.GetIdxHandlerData();
-  const int* env_set = env.GetEnvSetData();
-
-  //the h positions and states of the hbond term get calculated as a 
-  //postprocessing step
-  //note, that we reconstruct the stuff for the full chain, since the state of
-  //one residue incluences the neighbouring residues...
-  //we dont really know how far this influence goes
-  Real phi,psi;
-  HBondSpatialOrganizerItem* current_item;
-  std::vector<int> states(idx_handler->GetChainSize(chain_idx),0);
-  int actual_idx = idx_handler->GetChainStartIdx(chain_idx);
-
-  for(uint i = 0; i < idx_handler->GetChainSize(chain_idx); ++i){
-    if(env_set[actual_idx]){
-      current_item = &env_data_[actual_idx];
-      phi = -1.0472;
-      psi = -0.78540;
-      if(i > 0 && i < idx_handler->GetChainSize(chain_idx)-1){
-        if(env_set[actual_idx - 1] && 
-           env_set[actual_idx + 1]){
-
-          phi = geom::DihedralAngle(env_data_[actual_idx-1].c_pos,
-                                    current_item->n_pos,
-                                    current_item->pos,
-                                    current_item->c_pos);
-          psi = geom::DihedralAngle(current_item->n_pos,
-                                    current_item->pos,
-                                    current_item->c_pos,
-                                    env_data_[actual_idx+1].n_pos);
-
-          states[i] = GetHBondState(phi,psi);
-        }
-      }
-
-      core::ConstructAtomPos(current_item->c_pos, current_item->pos,
-                             current_item->n_pos, 0.9970, 2.0420,
-                             phi + Real(M_PI), current_item->h_pos);
-    }
-    ++actual_idx;
-  }
-  
-  //we still need to check consistency of consecutive residues
-  //if state is 1 or 2, at least one neighbouring residues must
-  //have the same state, the state is set to zero otherwise
-
-  //first do the first and last residue
-  if(idx_handler->GetChainSize(chain_idx) > 2){
-    if(states[0] == 1){
-      if(states[1] != 1) states[0] = 0;
-    }
-    if(states[0] == 2){
-      if(states[1] != 2) states[0] = 0;    
+void HBondEnvListener::UpdateStatesAndHPos(const std::vector<uint>& idx) {
+
+  // we have no guarentee that the indices are consecutive...
+  // we have to do the inefficient way and always add a full triplett 
+  // to a set to get a unique set for further processing.
+  std::set<uint> stuff_to_check;
+
+  for(std::vector<uint>::const_iterator i = idx.begin();
+      i != idx.end(); ++i){
+
+    uint chain_idx = idx_handler_->GetChainIdx(*i);
+    uint chain_start_idx = idx_handler_->GetChainIdx(chain_idx);
+    uint chain_last_idx = idx_handler_->GetChainLastIdx(chain_idx);
+
+    if(env_set_[*i]) {
+      stuff_to_check.insert(*i);
     }
-    if(states.back() == 1){
-      if(states[states.size()-2] != 1) states.back() = 0;
+
+    if(*i > chain_start_idx && env_set_[*i - 1]) {
+      stuff_to_check.insert(*i - 1);
     }
-    if(states.back() == 2){
-      if(states[states.size()-2] != 2) states.back() = 0;
+
+    if(*i < chain_last_idx && env_set_[*i + 1]) {
+      stuff_to_check.insert(*i + 1);
     }
   }
-  //let's do the remaining residues in between
-  for(uint i = 1; i < states.size()-1; ++i){
-    if(states[i] == 0) continue;
-    if(states[i] == 1){
-      if(states[i-1] == 1 || states[i+1] == 1) continue;
-    }
-    if(states[i] == 2){
-      if(states[i-1] == 2 || states[i+1] == 2) continue;
-    }
-    states[i] = 0;
-  } 
-
-  //let's finally map the states to the hbond_env
-  actual_idx = idx_handler->GetChainStartIdx(chain_idx);
-  for(uint i = 0; i < idx_handler->GetChainSize(chain_idx); ++i){
-    env_data_[actual_idx].state = states[i];
-    ++actual_idx;
-  }   
-}
 
-void HBondEnvListener::UpdateStatesAndHPos(const std::vector<uint>& idx,
-                                           const BackboneScoreEnv& env) {
-
-  const loop::IdxHandler* idx_handler = env.GetIdxHandlerData();
-
-  //we have to figure out to which chains the residue belong to
-  std::set<uint> affected_chains;
-  uint chain_start, chain_end;
-  for(std::vector<uint>::const_iterator i = idx.begin(); i != idx.end(); ++i){
-    for(uint j = 0; j < idx_handler->GetNumChains(); ++j){
-      chain_start = idx_handler->GetChainStartIdx(j);
-      chain_end = chain_start + idx_handler->GetChainSize(j);
-      if( (*i >= chain_start) && (*i < chain_end) ){
-        affected_chains.insert(j);
-        break;
-      }  
+  for(std::set<uint>::iterator i = stuff_to_check.begin(); 
+      i != stuff_to_check.end(); ++i) {
+    
+    Real phi = -1.0472;
+    Real psi = -0.78540;
+
+    uint chain_idx = idx_handler_->GetChainIdx(*i);
+    uint chain_start_idx = idx_handler_->GetChainIdx(chain_idx);
+    uint chain_last_idx = idx_handler_->GetChainLastIdx(chain_idx);
+
+    if(*i > chain_start_idx && *i < chain_last_idx && 
+       env_set_[*i - 1] && env_set_[*i + 1]) {
+
+      phi = geom::DihedralAngle(env_data_[*i-1].c_pos, env_data_[*i].n_pos,
+                                env_data_[*i].pos, env_data_[*i].c_pos);
+      psi = geom::DihedralAngle(env_data_[*i].n_pos, env_data_[*i].pos,
+                                env_data_[*i].c_pos, env_data_[*i+1].n_pos);
+
+      // we only assign a state if both, phi and psi, are set
+      env_data_[*i].state = GetHBondState(phi,psi);
+      
     }
-  }
 
-  //call according function for every affected chain
-  for(std::set<uint>::iterator i = affected_chains.begin(); 
-      i != affected_chains.end(); ++i){
-    this->UpdateStatesAndHPos(*i, env);
+    core::ConstructAtomPos(env_data_[*i].c_pos, env_data_[*i].pos,
+                           env_data_[*i].n_pos, 0.9970, 2.0420,
+                           phi + Real(M_PI), env_data_[*i].h_pos);
   }
 }
 
diff --git a/scoring/src/hbond_env_listener.hh b/scoring/src/hbond_env_listener.hh
index efcc9c5ff118332dd2599b18d699504158c00a78..d5e6ea01849d5de7f3d08abfe36652040bccfee5 100644
--- a/scoring/src/hbond_env_listener.hh
+++ b/scoring/src/hbond_env_listener.hh
@@ -6,7 +6,6 @@
 #include <promod3/core/dynamic_spatial_organizer.hh>
 #include <promod3/core/portable_binary_serializer.hh>
 #include <promod3/core/check_io.hh>
-#include <promod3/loop/sec_struct.hh>
 #include <set>
 
 namespace promod3 { namespace scoring {
@@ -42,7 +41,7 @@ struct HBondSpatialOrganizerItem {
   geom::Vec3 h_pos; //donor H
   geom::Vec3 c_pos; //acceptor C
   geom::Vec3 o_pos; //acceptor O
-  uint state;
+  uint8_t state;
   uint idx;
   bool is_proline;
 };
@@ -60,20 +59,21 @@ public:
 
   virtual void Init(const BackboneScoreEnv& base_env);
 
-  virtual void SetEnvironment(const BackboneScoreEnv& base_env, 
-                              const std::vector<uint>& idx);
+  virtual void SetEnvironment(const std::vector<uint>& idx);
 
-  virtual void ResetEnvironment(const BackboneScoreEnv& base_env, 
-                                const std::vector<uint>& idx);
+  virtual void ResetEnvironment(const std::vector<uint>& idx);
 
-  virtual void ClearEnvironment(const BackboneScoreEnv& base_env, 
-                                const std::vector<uint>& idx);
+  virtual void ClearEnvironment(const std::vector<uint>& idx);
 
   virtual String WhoAmI() const { return "HBondEnvListener"; }
 
   const HBondSpatialOrganizerItem& GetEnvData(uint idx) const {
     return env_data_[idx];
   }
+
+  const int* GetEnvSetData() { return env_set_; }
+
+  const loop::IdxHandler* GetIdxHandler() { return idx_handler_; }
   
   HBondSpatialOrganizer::WithinResult FindWithin(const geom::Vec3& pos,
                                                  Real cutoff) const {
@@ -82,14 +82,18 @@ public:
 
 private:
 
-  //update the hbond states and h positions of one particular chain
-  void UpdateStatesAndHPos(uint chain_idx, const BackboneScoreEnv& env);
-
-  //figures out which chains are affected and calls the function above
-  void UpdateStatesAndHPos(const std::vector<uint>& idx, const BackboneScoreEnv& env);
+  void UpdateStatesAndHPos(const std::vector<uint>& idx);
 
   HBondSpatialOrganizer env_;  
   HBondSpatialOrganizerItem* env_data_;
+
+  // data ptrs fetched from base env at initialization
+  const int* env_set_;
+  const loop::IdxHandler* idx_handler_;
+  const geom::Vec3* n_pos_data_;
+  const geom::Vec3* ca_pos_data_;
+  const geom::Vec3* c_pos_data_;
+  const geom::Vec3* o_pos_data_;
 }; 
 
 }} // ns
diff --git a/scoring/src/hbond_score.cc b/scoring/src/hbond_score.cc
index 0b719390cf0ce6a7899b1a88271aebe921d148f6..19940c002455a7087c7966fbbdcbe7e1bfef8dd8 100644
--- a/scoring/src/hbond_score.cc
+++ b/scoring/src/hbond_score.cc
@@ -20,42 +20,44 @@ HBondScorer::HBondScorer(Real min_d, Real max_d,
                                                   alpha_bins_(alpha_bins),
                                                   beta_bins_(beta_bins),
                                                   gamma_bins_(gamma_bins),
-                                                  attached_environment_(false),
+                                                  do_internal_scores_(true),
+                                                  do_external_scores_(true),
+                                                  normalize_(true),
                                                   env_(NULL) {
 
   promod3::core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
                                 "HBondScorer::HBondScorer", 2);
 
 
-  if(d_bins == 0){
+  if(d_bins == 0) {
     throw promod3::Error("Number of distance bins must be nonzero!");
   }
 
-  if(alpha_bins == 0){
+  if(alpha_bins == 0) {
     throw promod3::Error("Number of alpha bins must be nonzero!");
   }
 
-  if(beta_bins == 0){
+  if(beta_bins == 0) {
     throw promod3::Error("Number of beta bins must be nonzero!");
   }
 
-  if(gamma_bins == 0){
+  if(gamma_bins == 0) {
     throw promod3::Error("Number of gamma bins must be nonzero!");
   }
 
-  if(max_d_ <= min_d_){
+  if(max_d_ <= min_d_) {
     throw promod3::Error("hb_max_d must be larger than hb_min_d");
   }
 
-  if(max_alpha_ <= min_alpha_){
+  if(max_alpha_ <= min_alpha_) {
     throw promod3::Error("hb_max_alpha must be larger than hb_min_alpha");
   }
 
-  if(max_beta_ <= min_beta_){
+  if(max_beta_ <= min_beta_) {
     throw promod3::Error("max_beta must be larger than min_beta");
   }
 
-  if(max_gamma_ <= min_gamma_){
+  if(max_gamma_ <= min_gamma_) {
     throw promod3::Error("max_gamma must be larger than min_gamma");
   }
 
@@ -249,265 +251,289 @@ void HBondScorer::SetEnergy(uint state, uint d_bin, uint alpha_bin,
   promod3::core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
                                 "HBondScorer::SetEnergy", 2);
 
-  if(state >= 3){
+  if(state >= 3) {
     throw promod3::Error("Invalid state when setting energy for hbond potential!");
   }
 
-  if(d_bin >= d_bins_){
+  if(d_bin >= d_bins_) {
     throw promod3::Error("Invalid d bin when setting energy for hbond potential!");
   }
 
-  if(alpha_bin >= alpha_bins_){
+  if(alpha_bin >= alpha_bins_) {
     throw promod3::Error("Invalid alpha bin when setting energy for hbond potential!");
   }
 
-  if(beta_bin >= beta_bins_){
+  if(beta_bin >= beta_bins_) {
     throw promod3::Error("Invalid beta bin when setting energy for hbond potential!");
   }
 
-  if(gamma_bin >= gamma_bins_){
+  if(gamma_bin >= gamma_bins_) {
     throw promod3::Error("Invalid gamma bin when setting energy for hbond potential!");
   }
 
   energies_[this->EIdx(state, d_bin, alpha_bin, beta_bin, gamma_bin)] = e;
 }
 
-Real HBondScorer::CalculateScore(const loop::BackboneList& bb_list, 
-                                 uint start_resnum, uint chain_idx) const {
+Real HBondScorer::CalculateScore(uint start_resnum, uint num_residues,
+                                 uint chain_idx) const {
   
   promod3::core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
                                 "HBondScorer::CalculateScore", 2);
 
-  std::vector<Real> scores;
-  std::vector<Real> internal_scores;
+  if (env_ == NULL) {
+    String err = "Can only calculate score when environment is attached!";
+    throw promod3::Error(err);
+  }
 
-  this->Score(bb_list, start_resnum, chain_idx, scores, internal_scores);
+ 
+  // setup
+  std::vector<uint> idx_vector;
+  std::vector<bool> occupied;
+  env_->GetIdxHandler()->SetupScoreCalculation(start_resnum, num_residues, 
+                                               chain_idx, idx_vector, 
+                                               occupied);
 
-  Real score = 0.0;
 
-  for(uint i = 0; i < scores.size(); ++i){
-    score += scores[i];
-  }
+  // get scores
+  std::vector<Real> external_scores;
+  std::vector<Real> internal_scores;
+  this->Score(idx_vector, external_scores, internal_scores, occupied);
 
+  // sum them
+  Real external_score = 0.0;
   Real internal_score = 0.0;
-  for(uint i = 0; i < internal_scores.size(); ++i){
+  for (uint i = 0; i < external_scores.size(); ++i) {
+    external_score += external_scores[i];
     internal_score += internal_scores[i];
   }
 
-  score += (0.5 * internal_score);
+  // all interactions in internal_score have been observed twice!
+  external_score += Real(0.5)*internal_score;
 
-  if(!scores.empty()){
-    score /= scores.size();
+  if(normalize_ && !external_scores.empty()) {
+    external_score /= external_scores.size();
   }
 
-  return score;
+  return external_score;
 }
 
 
-void HBondScorer::CalculateScoreProfile(const loop::BackboneList& bb_list, 
-                                        uint start_resnum, uint chain_idx,
+void HBondScorer::CalculateScoreProfile(uint start_resnum, uint num_residues,
+                                        uint chain_idx,
                                         std::vector<Real>& profile) const {
   
   promod3::core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
                                 "HBondScorer::CalculateScoreProfile", 2);
 
-  std::vector<Real> scores;
-  std::vector<Real> internal_scores;
+  if (env_ == NULL) {
+    String err = "Can only calculate score when environment is attached!";
+    throw promod3::Error(err);
+  }
 
-  this->Score(bb_list, start_resnum, chain_idx, scores, internal_scores);
+  // setup
+  std::vector<uint> idx_vector;
+  std::vector<bool> occupied;
+  env_->GetIdxHandler()->SetupScoreCalculation(start_resnum, num_residues, 
+                                               chain_idx, idx_vector, 
+                                               occupied);
+
+  // get scores
+  std::vector<Real> internal_scores;
+  this->Score(idx_vector, profile, internal_scores, occupied);
 
-  profile.clear();
-  for(uint i = 0; i < scores.size(); ++i){
-    profile.push_back(scores[i] + internal_scores[i]);
+  for(uint i = 0; i < profile.size(); ++i) {
+    profile[i] += internal_scores[i];
   }
 }
 
-void HBondScorer::Score(const loop::BackboneList& bb_list, 
-                        uint start_resnum, uint chain_idx,
-                        std::vector<Real>& scores,
-                        std::vector<Real>& internal_scores) const {
 
+Real HBondScorer::CalculateScore(const std::vector<uint>& start_resnum, 
+                                 const std::vector<uint>& num_residues,
+                                 const std::vector<uint>& chain_idx) const {
+  
   promod3::core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
-                                "HBondScorer::Score", 2);
+                                "HBondScorer::CalculateScore", 2);
 
-  if(!attached_environment_){
+  if (env_ == NULL) {
     String err = "Can only calculate score when environment is attached!";
     throw promod3::Error(err);
   }
 
   // setup
-  uint bb_list_size, start_idx, end_idx;
-  idx_handler_->SetupScoreCalculation(bb_list, start_resnum, chain_idx,
-                                      bb_list_size, start_idx, end_idx);
+  std::vector<std::vector<uint> > indices_vec;
+  std::vector<bool> occupied; 
+  env_->GetIdxHandler()->SetupScoreCalculation(start_resnum, num_residues, 
+                                               chain_idx, indices_vec, 
+                                               occupied);
+
+  // get scores and sum them up
+  Real external_score = 0.0;
+  Real internal_score = 0.0;
+  uint n_scored_residues = 0;
+  for(uint i = 0; i < start_resnum.size(); ++i) {
+    std::vector<Real> external_scores;
+    std::vector<Real> internal_scores;
+    this->Score(indices_vec[i], external_scores, internal_scores, occupied);
+    for (uint j = 0; j < external_scores.size(); ++j) {
+      external_score += external_scores[j];
+      internal_score += internal_scores[j];
+    }
+    n_scored_residues += external_scores.size();
+  }
 
-  scores.assign(bb_list_size, 0.0);
-  internal_scores.assign(bb_list_size, 0.0);
-  if(bb_list_size == 0) return;
+  // all interactions in internal_score have been observed twice!
+  external_score += Real(0.5)*internal_score;
 
+  if(normalize_ && n_scored_residues > 0) {
+    external_score /= n_scored_residues;
+  }
 
-  HBondSpatialOrganizer::WithinResult within_result;
-  std::pair<HBondSpatialOrganizerItem*,Real>* a;
+  return external_score;
+}
 
-  //note, that the n-terminal backbone hydrogen will be constructed below
-  std::vector<geom::Vec3> h_positions(bb_list_size);
 
-  for(uint i = 1; i < bb_list_size; ++i){
-    Real phi = bb_list.GetPhiTorsion(i);
-    core::ConstructAtomPos(bb_list.GetC(i), bb_list.GetCA(i),
-                           bb_list.GetN(i), 0.9970, 2.0420,
-                           phi + Real(M_PI), h_positions[i]);    
-  }
+void HBondScorer::CalculateScoreProfile(const std::vector<uint>& start_resnum, 
+                              const std::vector<uint>& num_residues,
+                              const std::vector<uint>& chain_idx,
+                              std::vector<std::vector<Real> >& profile) const {
+  
+  promod3::core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
+                                "HBondScorer::CalculateScore", 2);
 
-  std::vector<uint> bb_list_states(bb_list_size);
-  Real n_phi = -1.0472;
-  Real c_psi = -0.78540;
-  if(start_resnum > 1){
-    if(env_set_[start_idx - 1]){
-      n_phi = geom::DihedralAngle(env_->GetEnvData(start_idx - 1).c_pos,
-                                  bb_list.GetN(0), 
-                                  bb_list.GetCA(0), 
-                                  bb_list.GetC(0));
-    }
+  if (env_ == NULL) {
+    String err = "Can only calculate score when environment is attached!";
+    throw promod3::Error(err);
   }
 
-  if((start_resnum + bb_list_size - 1) < idx_handler_->GetChainSize(chain_idx)){
-    if(env_set_[end_idx + 1]){
-      c_psi = geom::DihedralAngle(bb_list.GetN(bb_list_size-1),
-                                  bb_list.GetCA(bb_list_size-1),
-                                  bb_list.GetC(bb_list_size-1),
-                                  env_->GetEnvData(end_idx + 1).n_pos);
+  // setup
+  std::vector<std::vector<uint> > indices_vec;
+  std::vector<bool> occupied; 
+  env_->GetIdxHandler()->SetupScoreCalculation(start_resnum, num_residues, 
+                                               chain_idx, indices_vec, 
+                                               occupied);
+
+  // get scores 
+  profile.resize(start_resnum.size());
+  for(uint i = 0; i < start_resnum.size(); ++i) {
+    std::vector<Real> external_scores;
+    std::vector<Real> internal_scores;
+    std::vector<Real>& current_profile = profile[i];
+    this->Score(indices_vec[i], current_profile, internal_scores, occupied);
+    for (uint j = 0; j < current_profile.size(); ++j) {
+      current_profile[j] += internal_scores[j];
+
     }
   }
+}
 
-  //we still have to calculate the position of the n-terminal hydrogen
-  core::ConstructAtomPos(bb_list.GetC(0), bb_list.GetCA(0),
-                         bb_list.GetN(0), 0.9970, 2.0420,
-                         n_phi + Real(M_PI), h_positions[0]);
-
-  if(bb_list_size == 1){
-    bb_list_states[0] = GetHBondState(n_phi, c_psi);
-  } 
-  else{
-    bb_list_states[0] = GetHBondState(n_phi,bb_list.GetPsiTorsion(0));
-    bb_list_states[bb_list_size-1] = 
-    GetHBondState(bb_list.GetPhiTorsion(bb_list_size-1),c_psi); 
-  }                          
-
-  for(uint i = 1; i < bb_list_size-1; ++i){
-    bb_list_states[i] = GetHBondState(bb_list.GetPhiTorsion(i),
-                                      bb_list.GetPsiTorsion(i));
-  }
 
-  //handle the terminal states
-  int prev_state = 0;
-  int next_state = 0;
-  if(start_resnum > 1){
-    if(env_set_[start_idx - 1]){
-      prev_state = env_->GetEnvData(start_idx - 1).state;
-    }
-  }
-  if((start_resnum + bb_list_size - 1) < idx_handler_->GetChainSize(chain_idx)){
-    if(env_set_[end_idx + 1]){
-      next_state = env_->GetEnvData(end_idx + 1).state;
-    }
-  }
+void HBondScorer::Score(const std::vector<uint>& indices,
+                        std::vector<Real>& external_scores,
+                        std::vector<Real>& internal_scores,
+                        std::vector<bool>& occupied) const {
 
-  if(bb_list_states[0] == 1){
-    if(prev_state != 1 && bb_list_states[1] != 1){
-      bb_list_states[0] = 0;
-    }
-  }
-  if(bb_list_states[0] == 2){
-    if(prev_state != 2 && bb_list_states[1] != 2){
-      bb_list_states[0] = 0;
-    }
-  }
-  if(bb_list_states[bb_list_size-1] == 1){
-    if(next_state != 1 && bb_list_states[bb_list_size-2] != 1){
-      bb_list_states[bb_list_size-1] = 0;
-    }
-  }
-  if(bb_list_states[bb_list_size-1] == 2){
-    if(next_state != 2 && bb_list_states[bb_list_size-2] != 2){
-      bb_list_states[bb_list_size-1] = 0;
-    }
-  }
+  promod3::core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
+                                "HBondScorer::Score", 2);
+
+  // setup
+  uint n_indices = indices.size();
+
+  external_scores.assign(n_indices, 0.0);
+  internal_scores.assign(n_indices, 0.0);
+
+  if(n_indices == 0) return;
+
+  HBondSpatialOrganizer::WithinResult within_result;
+  std::pair<HBondSpatialOrganizerItem*,Real>* a;
+  const int* env_set = env_->GetEnvSetData();
+  const loop::IdxHandler* idx_handler = env_->GetIdxHandler();
+
+  for(uint i = 0; i <  n_indices; ++i) {
+    int my_idx = indices[i];
 
-  for(uint i = 1; i < bb_list_size-1; ++i){
-    if(bb_list_states[i] == 1){
-      if(bb_list_states[i-1] == 1 || bb_list_states[i+1] == 1) continue;
+    if(!env_set[my_idx]) {
+      throw promod3::Error("Must set environment before scoring!");
     }
-    if(bb_list_states[i] == 2){
-      if(bb_list_states[i-1] == 2 || bb_list_states[i+1] == 2) continue;
+
+    int my_chain_idx = idx_handler->GetChainIdx(my_idx);
+    const HBondSpatialOrganizerItem& my_env_data = env_->GetEnvData(my_idx);
+    int my_state = my_env_data.state;
+    
+    if(my_state != 0) {
+
+      int my_chain_start_idx = idx_handler->GetChainIdx(my_chain_idx);
+      int my_chain_last_idx = idx_handler->GetChainLastIdx(my_chain_idx);
+      bool consistent_state = false;
+
+      if(my_idx > my_chain_start_idx && env_set[my_idx - 1] && 
+         env_->GetEnvData(my_idx - 1).state == my_state) {
+        consistent_state = true;
+      } else if(my_idx < my_chain_last_idx && env_set[my_idx + 1] && 
+         env_->GetEnvData(my_idx + 1).state == my_state) {
+        consistent_state = true;
+      }
+
+      if(!consistent_state) {
+         my_state = 0;
+      }
     }
-    bb_list_states[i] = 0;
-  }
 
-  //let's go over every bb_list residue
-  int state;
-  for(uint i = 0; i < bb_list_size; ++i){
-    within_result = env_->FindWithin(bb_list.GetCA(i), 9.0);
+    within_result = env_->FindWithin(my_env_data.pos, 9.0);
     a = within_result.first;
-    for(uint j = 0; j < within_result.second; ++j){
 
-      if(a[j].first->idx < start_idx || a[j].first->idx > end_idx){
+    for(uint j = 0; j < within_result.second; ++j) {
+
+      int state = 0;
+      int other_idx = a[j].first->idx;
+      int other_state = a[j].first->state;
 
-        if(bb_list_states[i] == a[j].first->state) state = bb_list_states[i];
-        else state = 0;
+      if(other_state != 0 && other_state == my_state) {
 
-        //case of being donor for current bb item
-        if(bb_list.GetOLC(i) != 'P'){
-          scores[i] += this->EvalHBondPotential(state,bb_list.GetN(i),
-                                                  h_positions[i],
-                                                  a[j].first->pos,
-                                                  a[j].first->c_pos,
-                                                  a[j].first->o_pos);
+        int other_chain_idx = idx_handler->GetChainIdx(other_idx);
+        int other_chain_start_idx = idx_handler->GetChainIdx(other_chain_idx);
+        int other_chain_last_idx = idx_handler->GetChainLastIdx(other_chain_idx);
+
+        bool consistent_state = false;
+
+        if(other_idx > other_chain_start_idx && env_set[other_idx - 1] && 
+           env_->GetEnvData(other_idx - 1).state == other_state) {
+          consistent_state = true;
+        } else if(other_idx < other_chain_last_idx && env_set[other_idx + 1] && 
+           env_->GetEnvData(other_idx + 1).state == other_state) {
+          consistent_state = true;
         }
 
-        //case of being acceptor for current bb item
-        if(!a[j].first->is_proline){
-          scores[i] += this->EvalHBondPotential(state, a[j].first->n_pos, 
-                                                  a[j].first->h_pos,
-                                                  bb_list.GetCA(i), 
-                                                  bb_list.GetC(i),
-                                                  bb_list.GetO(i));
+        if(consistent_state) {
+          state = my_state;
         }
       }
-    }
-  }
 
-  // we do not have the loop internal interactions yet...
-  for (uint i = 0; i < bb_list_size; ++i) {
-    for (uint j = i+3; j < bb_list_size; ++j) {
-      // hbonds closer than 3 residues do not really make sense...
-      if (geom::Length2(bb_list.GetCA(i) - bb_list.GetCA(j)) > 81) continue;
-
-      if (bb_list_states[i] == bb_list_states[j]) state = bb_list_states[i];
-      else state = 0;
-
-      // case of i being donor
-      if(bb_list.GetOLC(i) != 'P'){
-        Real score = this->EvalHBondPotential(state,
-                                              bb_list.GetN(i),
-                                              h_positions[i],
-                                              bb_list.GetCA(j), 
-                                              bb_list.GetC(j), 
-                                              bb_list.GetO(j));
-        internal_scores[i] += score;
-        internal_scores[j] += score;
+      Real e = 0.0;
+
+      //case of being donor for current bb item
+      if(!my_env_data.is_proline) {
+         e += this->EvalHBondPotential(state, my_env_data.n_pos, 
+                                       my_env_data.h_pos,
+                                       a[j].first->pos, 
+                                       a[j].first->c_pos,
+                                       a[j].first->o_pos);
+      }
+
+      //case of being acceptor for current bb item
+      if(!a[j].first->is_proline) {
+         e += this->EvalHBondPotential(state, a[j].first->n_pos, 
+                                       a[j].first->h_pos,
+                                       my_env_data.pos, 
+                                       my_env_data.c_pos,
+                                       my_env_data.o_pos);
+      }
+
+      if(occupied[other_idx] && do_internal_scores_) {
+        internal_scores[i] += e;
       }
 
-      // case of i being acceptor
-      if(bb_list.GetOLC(j) != 'P'){
-        Real score = this->EvalHBondPotential(state,
-                                              bb_list.GetN(j),
-                                              h_positions[j],
-                                              bb_list.GetCA(i),
-                                              bb_list.GetC(i), 
-                                              bb_list.GetO(i));
-
-        internal_scores[i] += score;
-        internal_scores[j] += score;
+      if(!occupied[other_idx] && do_external_scores_) {
+        external_scores[i] += e;
       }
     }
   }
@@ -515,9 +541,6 @@ void HBondScorer::Score(const loop::BackboneList& bb_list,
 
 void HBondScorer::AttachEnvironment(BackboneScoreEnv& env) {
   env_ = env.UniqueListener<HBondEnvListener>("HBondEnvListener");
-  idx_handler_ = env.GetIdxHandlerData();
-  env_set_ = env.GetEnvSetData();
-  attached_environment_ = true;
 }
 
 }} // ns
diff --git a/scoring/src/hbond_score.hh b/scoring/src/hbond_score.hh
index fcf52f216d1dfd87266cb0280bca1ff90319cdb8..e8211fd43cc83e65585c049b9485c704ed17aa9b 100644
--- a/scoring/src/hbond_score.hh
+++ b/scoring/src/hbond_score.hh
@@ -39,21 +39,37 @@ public:
   void SetEnergy(uint state, uint d_bin, uint alpha_bin, 
                  uint beta_bin, uint gamma_bin, Real e);
 
-  virtual Real CalculateScore(const loop::BackboneList& bb_list, 
-                              uint start_resnum, uint chain_idx) const;
+  void DoInternalScores(bool do_it) { do_internal_scores_ = do_it; }
 
-  virtual void CalculateScoreProfile(const loop::BackboneList& bb_list, 
-                                     uint start_resnum, uint chain_idx,
+  void DoExternalScores(bool do_it) { do_external_scores_ = do_it; }
+
+  void DoNormalize(bool do_it) { normalize_ = do_it; }
+
+  virtual Real CalculateScore(uint start_resnum, uint num_residues,
+                              uint chain_idx) const;
+
+  virtual void CalculateScoreProfile(uint start_resnum, uint num_residues,
+                                     uint chain_idx,
                                      std::vector<Real>& profile) const;
 
+  virtual Real CalculateScore(const std::vector<uint>& start_resnum, 
+                              const std::vector<uint>& num_residues,
+                              const std::vector<uint>& chain_idx) const;
+
+  virtual void CalculateScoreProfile(const std::vector<uint>& start_resnum,
+                              const std::vector<uint>& num_residues, 
+                              const std::vector<uint>& chain_idx,
+                              std::vector<std::vector<Real> >& profile) const;
+
   void AttachEnvironment(BackboneScoreEnv& env);
 
 private:
 
-  HBondScorer(): attached_environment_(false), env_(NULL) { }
+  HBondScorer(): do_internal_scores_(true), do_external_scores_(true),
+                 normalize_(true), env_(NULL) { }
 
   inline uint EIdx(uint state, uint d_bin, uint alpha_bin, uint beta_bin, 
-                   uint gamma_bin) const{ 
+                   uint gamma_bin) const { 
 
     return  ((((state)*d_bins_+d_bin)*alpha_bins_+alpha_bin)*
             beta_bins_+beta_bin)*gamma_bins_+gamma_bin;
@@ -80,12 +96,10 @@ private:
     return energies_[this->EIdx(state, d_bin, alpha_bin, beta_bin, gamma_bin)];
   }
 
-
-  void Score(const loop::BackboneList& bb_list, 
-             uint start_resnum, 
-             uint chain_idx,
-             std::vector<Real>& scores,
-             std::vector<Real>& internal_scores) const;
+  void Score(const std::vector<uint>& indices, 
+             std::vector<Real>& external_scores,
+             std::vector<Real>& internal_scores,
+             std::vector<bool>& occupied) const;
 
   // portable serialization (only stores data relevant for Load/Save!)
   // (cleanly element by element with fixed-width base-types)
@@ -108,11 +122,11 @@ private:
     core::ConvertBaseType<float>(ds, beta_bin_size_);
     core::ConvertBaseType<float>(ds, gamma_bin_size_);
     uint num_values = 3 * d_bins_ * alpha_bins_ * beta_bins_ * gamma_bins_;
-    if(ds.IsSource()){
+    if(ds.IsSource()) {
       energies_ = new Real[num_values];
       memset(energies_, 0, num_values * sizeof(Real)); 
     }
-    for(uint i = 0; i < num_values; ++i){
+    for(uint i = 0; i < num_values; ++i) {
       core::ConvertBaseType<float>(ds, energies_[i]);
     }
   }
@@ -133,14 +147,14 @@ private:
   Real alpha_bin_size_;
   Real beta_bin_size_;
   Real gamma_bin_size_;
-  Real* energies_;
+  Real* energies_;  
+  bool do_internal_scores_;
+  bool do_external_scores_;
+  bool normalize_;
 
   //environment specific information, that will be set upon calling 
   //AttachEnvironment
-  bool attached_environment_;
   HBondEnvListener* env_;
-  const loop::IdxHandler* idx_handler_;
-  const int* env_set_;
 };
 
 
diff --git a/scoring/src/pairwise_score.cc b/scoring/src/pairwise_score.cc
index a650ee28e8fdb1a2439a658026c1d2e66ca7c624..1a0ef644e17b316b17ab735e0d34576efa8b2962 100644
--- a/scoring/src/pairwise_score.cc
+++ b/scoring/src/pairwise_score.cc
@@ -2,64 +2,147 @@
 
 namespace promod3{ namespace scoring{
 
-PairwiseScorer::PairwiseScorer(): attached_environment_(false) { }
+PairwiseScorer::PairwiseScorer(): do_internal_scores_(true),
+                                  do_external_scores_(true),
+                                  normalize_(true),
+                                  attached_environment_(false) { }
 
 PairwiseScorer::~PairwiseScorer() { }
 
-Real PairwiseScorer::CalculateScore(const loop::BackboneList& bb_list, 
-                                    uint start_resnum, uint chain_idx) const {
+Real PairwiseScorer::CalculateScore(uint start_resnum, uint num_residues,
+                                    uint chain_idx) const {
   
   promod3::core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
                                 "PairwiseScorer::CalculateScore", 2);
 
-  std::vector<Real> scores;
+  // setup
+  std::vector<uint> idx_vector;
+  std::vector<bool> occupied;
+  idx_handler_->SetupScoreCalculation(start_resnum, num_residues, 
+                                      chain_idx, idx_vector, 
+                                      occupied);
+
+  // get scores
+  std::vector<Real> external_scores;
   std::vector<Real> internal_scores;
+  this->Score(idx_vector, external_scores, internal_scores, occupied);
 
-  this->Score(bb_list, start_resnum, chain_idx, scores, internal_scores);
-
-  Real score = 0.0;
-
-  for(uint i = 0; i < scores.size(); ++i){
-    score += scores[i];
-  }
-
+  // sum them
+  Real external_score = 0.0;
   Real internal_score = 0.0;
-  for(uint i = 0; i < internal_scores.size(); ++i){
+  for (uint i = 0; i < external_scores.size(); ++i) {
+    external_score += external_scores[i];
     internal_score += internal_scores[i];
   }
 
-  score += (0.5 * internal_score);
+  // all interactions in internal_score have been observed twice!
+  external_score += Real(0.5)*internal_score;
 
-  if(!scores.empty()){
-    score /= scores.size();
+  if(normalize_ && !external_scores.empty()) {
+    external_score /= external_scores.size();
   }
 
-  return score;
+  return external_score;
 }
 
 
-void PairwiseScorer::CalculateScoreProfile(const loop::BackboneList& bb_list, 
-                                           uint start_resnum, uint chain_idx,
+void PairwiseScorer::CalculateScoreProfile(uint start_resnum, uint num_residues,
+                                           uint chain_idx,
                                            std::vector<Real>& profile) const {
   
   promod3::core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
                                 "PairwiseScorer::CalculateScoreProfile", 2);
 
-  std::vector<Real> scores;
+  // setup
+  std::vector<uint> idx_vector;
+  std::vector<bool> occupied;
+  idx_handler_->SetupScoreCalculation(start_resnum, num_residues, 
+                                      chain_idx, idx_vector, 
+                                      occupied);
+
+  // get scores
   std::vector<Real> internal_scores;
+  this->Score(idx_vector, profile, internal_scores, occupied);
+
+  for(uint i = 0; i < profile.size(); ++i) {
+    profile[i] += internal_scores[i];
+  }
+}
+
+
+Real PairwiseScorer::CalculateScore(const std::vector<uint>& start_resnum, 
+                                    const std::vector<uint>& num_residues,
+                                    const std::vector<uint>& chain_idx) const {
+  
+  promod3::core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
+                                "PairwiseScorer::CalculateScore", 2);
+
+  // setup
+  std::vector<std::vector<uint> > indices_vec;
+  std::vector<bool> occupied; 
+  idx_handler_->SetupScoreCalculation(start_resnum, num_residues, 
+                                      chain_idx, indices_vec, 
+                                      occupied);
+
+  // get scores and sum them up
+  Real external_score = 0.0;
+  Real internal_score = 0.0;
+  uint n_scored_residues = 0;
+  for(uint i = 0; i < start_resnum.size(); ++i) {
+    std::vector<Real> external_scores;
+    std::vector<Real> internal_scores;
+    this->Score(indices_vec[i], external_scores, internal_scores, occupied);
+    for (uint j = 0; j < external_scores.size(); ++j) {
+      external_score += external_scores[j];
+      internal_score += internal_scores[j];
+    }
+    n_scored_residues += external_scores.size();
+  }
+
+  // all interactions in internal_score have been observed twice!
+  external_score += Real(0.5)*internal_score;
+
+  if(normalize_ && n_scored_residues > 0) {
+    external_score /= n_scored_residues;
+  }
 
-  this->Score(bb_list, start_resnum, chain_idx, scores, internal_scores);
+  return external_score;
+}
+
+
+void PairwiseScorer::CalculateScoreProfile(const std::vector<uint>& start_resnum, 
+                                const std::vector<uint>& num_residues,
+                                const std::vector<uint>& chain_idx,
+                                std::vector<std::vector<Real> >& profile) const {
+  
+  promod3::core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
+                                "PairwiseScorer::CalculateScore", 2);
 
-  profile.clear();
-  for(uint i = 0; i < scores.size(); ++i){
-    profile.push_back(scores[i] + internal_scores[i]);
+  // setup
+  std::vector<std::vector<uint> > indices_vec;
+  std::vector<bool> occupied; 
+  idx_handler_->SetupScoreCalculation(start_resnum, num_residues, 
+                                      chain_idx, indices_vec, 
+                                      occupied);
+
+  // get scores 
+  profile.resize(start_resnum.size());
+  for(uint i = 0; i < start_resnum.size(); ++i) {
+    std::vector<Real> external_scores;
+    std::vector<Real> internal_scores;
+    std::vector<Real>& current_profile = profile[i];
+    this->Score(indices_vec[i], current_profile, internal_scores, occupied);
+    for (uint j = 0; j < current_profile.size(); ++j) {
+      current_profile[j] += internal_scores[j];
+    }
   }
 }
 
-void PairwiseScorer::Score(const loop::BackboneList& bb_list,
-	                         uint start_resnum, uint chain_idx,
-                           std::vector<Real>& scores,
-                           std::vector<Real>& internal_scores) const {
+
+void PairwiseScorer::Score(const std::vector<uint>& indices,
+                           std::vector<Real>& external_scores,
+                           std::vector<Real>& internal_scores,
+                           std::vector<bool>& occupied) const {
 
   promod3::core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
                                 "PairwiseScorer::Score", 2);
@@ -70,51 +153,45 @@ void PairwiseScorer::Score(const loop::BackboneList& bb_list,
     throw promod3::Error(err);
   }
 
-  uint bb_list_size, start_idx, end_idx;
-  idx_handler_->SetupScoreCalculation(bb_list, start_resnum, chain_idx,
-                                      bb_list_size, start_idx, end_idx);
+  uint n_indices = indices.size();
 
-  scores.assign(bb_list_size, 0.0);
-  internal_scores.assign(bb_list_size, 0.0);
-  if(bb_list_size == 0) return;
+  external_scores.assign(n_indices, 0.0);
+  internal_scores.assign(n_indices, 0.0);
+
+  if(n_indices == 0) return;
+
+  for(uint i = 0; i < n_indices; ++i) {
+    uint my_idx = indices[i];
+
+    if(!env_set_[my_idx]) {
+      throw promod3::Error("Must set environment before scoring!");
+    }
 
-  Real d;
-  uint other_idx;
-  
-  for(uint i = 0; i < bb_list_size; ++i){
     const std::vector<PairwiseFunctionData>& functions = 
-    pairwise_functions_[start_idx + i];
-    if(!functions.empty()){
-      for(uint j = 0; j < functions.size(); ++j){
-        other_idx = functions[j].other_idx;
-        if(other_idx < start_idx || other_idx > end_idx){
-          //it's a constraint to the environment!
-          //let's see wether the env residue is set...
-          if(env_set_[other_idx]){
-            if(functions[j].ft == CB_PAIRWISE_FUNCTION){
-              d = geom::Distance(bb_list.GetCB(i), cb_pos_[other_idx]);
-            }
-            else{
-              d = geom::Distance(bb_list.GetCA(i), ca_pos_[other_idx]);
-            }
-            scores[i] += functions[j].f->Score(d);
+    pairwise_functions_[my_idx];
+    if(!functions.empty()) {
+      for(uint j = 0; j < functions.size(); ++j) {
+
+        uint other_idx = functions[j].other_idx;
+
+        if(env_set_[other_idx]) {
+          Real val;  
+
+          if(functions[j].ft == CB_PAIRWISE_FUNCTION) {
+            val = geom::Distance(cb_pos_[my_idx], cb_pos_[other_idx]);
           }
-        }
-        else{
-          //it's an internal contact!
-          if(other_idx < start_idx + i){
-            //make sure, every constraint gets only evaluated once...
-            if(functions[j].ft == CB_PAIRWISE_FUNCTION){
-              d = geom::Distance(bb_list.GetCB(i), 
-                                 bb_list.GetCB(other_idx - start_idx));
-            }
-            else{
-              d = geom::Distance(bb_list.GetCA(i), 
-                                 bb_list.GetCA(other_idx - start_idx));
-            }
-            Real score = functions[j].f->Score(d);
-            internal_scores[i] += score;
-            internal_scores[other_idx - start_idx] += score;
+          else{
+            val = geom::Distance(ca_pos_[my_idx], ca_pos_[other_idx]);
+          }
+
+          val = functions[j].f->Score(val);
+
+          if(occupied[other_idx] && do_internal_scores_) {
+            internal_scores[i] += val;
+          }
+
+          if(!occupied[other_idx] && do_external_scores_) {
+            external_scores[i] += val;
           }
         }
       }
diff --git a/scoring/src/pairwise_score.hh b/scoring/src/pairwise_score.hh
index c93e0bda9f71af17b1aec0340c3f56e3f563a834..dcd712e8d3e8ef3564d04252e7a73d2d73435826 100644
--- a/scoring/src/pairwise_score.hh
+++ b/scoring/src/pairwise_score.hh
@@ -19,22 +19,40 @@ public:
 
   virtual ~PairwiseScorer();
 
-  virtual Real CalculateScore(const loop::BackboneList& bb_list, 
-                              uint start_resnum, uint chain_idx) const;
+  void DoInternalScores(bool do_it) { do_internal_scores_ = do_it; }
 
-  virtual void CalculateScoreProfile(const loop::BackboneList& bb_list, 
-                                     uint start_resnum, uint chain_idx,
+  void DoExternalScores(bool do_it) { do_external_scores_ = do_it; }
+
+  void DoNormalize(bool do_it) { normalize_ = do_it; }
+
+  virtual Real CalculateScore(uint start_resnum, uint num_residues,
+                              uint chain_idx) const;
+
+  virtual void CalculateScoreProfile(uint start_resnum, uint num_residues,
+                                     uint chain_idx,
                                      std::vector<Real>& profile) const;
 
+  virtual Real CalculateScore(const std::vector<uint>& start_resnum, 
+                              const std::vector<uint>& num_residues,
+                              const std::vector<uint>& chain_idx) const;
+
+  virtual void CalculateScoreProfile(const std::vector<uint>& start_resnum,
+                              const std::vector<uint>& num_residues, 
+                              const std::vector<uint>& chain_idx,
+                              std::vector<std::vector<Real> >& profile) const;
+
   void AttachEnvironment(BackboneScoreEnv& env);
 
 private:
 
-  void Score(const loop::BackboneList& bb_list, 
-             uint start_resnum, 
-             uint chain_idx,
-             std::vector<Real>& scores,
-             std::vector<Real>& internal_scores) const;
+  void Score(const std::vector<uint>& indices, 
+             std::vector<Real>& external_scores,
+             std::vector<Real>& internal_scores,
+             std::vector<bool>& occupied) const;
+
+  bool do_internal_scores_;
+  bool do_external_scores_;
+  bool normalize_;
 
   //environment specific information, that will be set upon calling 
   //AttachEnvironment
@@ -46,7 +64,6 @@ private:
   const geom::Vec3* cb_pos_;
 };
 
-
 }}//ns
 
 #endif
diff --git a/scoring/src/reduced_env_listener.cc b/scoring/src/reduced_env_listener.cc
index 1f85e50989b3b15c1ad505c1272dc688a24a2979..14025821515000582ab9144edf70db3abe4e6f31 100644
--- a/scoring/src/reduced_env_listener.cc
+++ b/scoring/src/reduced_env_listener.cc
@@ -23,33 +23,32 @@ void ReducedEnvListener::Init(const BackboneScoreEnv& base_env) {
     env_.Clear();
   }
 
-  const loop::IdxHandler* idx_handler = base_env.GetIdxHandlerData();
-  uint num_residues = idx_handler->GetNumResidues();
+  idx_handler_ = base_env.GetIdxHandlerData();
+  uint num_residues = idx_handler_->GetNumResidues();
   env_data_ = new ReducedSpatialOrganizerItem[num_residues];
   const ost::conop::AminoAcid* aa_data = base_env.GetAAData();
-
+  env_set_ = base_env.GetEnvSetData();
+  ca_pos_data_ = base_env.GetCAPosData();
+  c_pos_data_ = base_env.GetCPosData();
+  n_pos_data_ = base_env.GetNPosData();
+  
   for (uint i = 0; i < num_residues; ++i) {
     env_data_[i].idx = i;
     env_data_[i].aa = aa_data[i];
   }
 }
 
-void ReducedEnvListener::SetEnvironment(const BackboneScoreEnv& base_env, 
-                                        const std::vector<uint>& idx) {
+void ReducedEnvListener::SetEnvironment(const std::vector<uint>& idx) {
 
   core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
                                 "ReducedEnvListener::SetEnvironment", 2);
 
-  const geom::Vec3* ca_pos_data = base_env.GetCAPosData();
-  const geom::Vec3* c_pos_data = base_env.GetCPosData();
-  const geom::Vec3* n_pos_data = base_env.GetNPosData();
-
   geom::Vec3 ca_pos, c_pos, n_pos;
   for (std::vector<uint>::const_iterator i = idx.begin();
        i != idx.end(); ++i) {
-    ca_pos = ca_pos_data[*i];
-    c_pos = c_pos_data[*i];
-    n_pos = n_pos_data[*i];
+    ca_pos = ca_pos_data_[*i];
+    c_pos = c_pos_data_[*i];
+    n_pos = n_pos_data_[*i];
     env_data_[*i].pos = ca_pos;
     env_data_[*i].axis = geom::Normalize(geom::Normalize(ca_pos-n_pos) +
                                          geom::Normalize(ca_pos-c_pos));
@@ -57,23 +56,18 @@ void ReducedEnvListener::SetEnvironment(const BackboneScoreEnv& base_env,
   }
 }
 
-void ReducedEnvListener::ResetEnvironment(const BackboneScoreEnv& base_env,
-                                          const std::vector<uint>& idx) {
+void ReducedEnvListener::ResetEnvironment(const std::vector<uint>& idx) {
 
   core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
                                 "ReducedEnvListener::ResetEnvironment", 2);
 
-  const geom::Vec3* ca_pos_data = base_env.GetCAPosData();
-  const geom::Vec3* c_pos_data = base_env.GetCPosData();
-  const geom::Vec3* n_pos_data = base_env.GetNPosData();
-
   geom::Vec3 ca_pos, c_pos, n_pos, old_pos;
   for (std::vector<uint>::const_iterator i = idx.begin();
        i != idx.end(); ++i) {
     old_pos = env_data_[*i].pos;
-    ca_pos = ca_pos_data[*i];
-    c_pos = c_pos_data[*i];
-    n_pos = n_pos_data[*i];
+    ca_pos = ca_pos_data_[*i];
+    c_pos = c_pos_data_[*i];
+    n_pos = n_pos_data_[*i];
     env_data_[*i].pos = ca_pos;
     env_data_[*i].axis = geom::Normalize(geom::Normalize(ca_pos-n_pos) +
                                          geom::Normalize(ca_pos-c_pos));
@@ -81,8 +75,7 @@ void ReducedEnvListener::ResetEnvironment(const BackboneScoreEnv& base_env,
   }
 }
 
-void ReducedEnvListener::ClearEnvironment(const BackboneScoreEnv& base_env,
-                                          const std::vector<uint>& idx) {
+void ReducedEnvListener::ClearEnvironment(const std::vector<uint>& idx) {
 
   core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
                                 "ReducedEnvListener::ClearEnvironment", 2);
diff --git a/scoring/src/reduced_env_listener.hh b/scoring/src/reduced_env_listener.hh
index d693fd9dc19fa2ea2fe90fa465dd805b21f935b4..52d405e2ac27c5e427f85e1a5e0b9ea5308bd872 100644
--- a/scoring/src/reduced_env_listener.hh
+++ b/scoring/src/reduced_env_listener.hh
@@ -32,20 +32,22 @@ public:
 
   virtual void Init(const BackboneScoreEnv& base_env);
 
-  virtual void SetEnvironment(const BackboneScoreEnv& base_env, 
-                              const std::vector<uint>& idx);
+  virtual void SetEnvironment(const std::vector<uint>& idx);
 
-  virtual void ResetEnvironment(const BackboneScoreEnv& base_env, 
-                                const std::vector<uint>& idx);
+  virtual void ResetEnvironment(const std::vector<uint>& idx);
 
-  virtual void ClearEnvironment(const BackboneScoreEnv& base_env, 
-                                const std::vector<uint>& idx);
+  virtual void ClearEnvironment(const std::vector<uint>& idx);
 
   virtual String WhoAmI() const { return "ReducedEnvListener"; }
 
   const ReducedSpatialOrganizerItem& GetEnvData(uint idx) const {
     return env_data_[idx];
   }
+
+  const int* GetEnvSetData() { return env_set_; }
+
+  const loop::IdxHandler* GetIdxHandler() { return idx_handler_; }
+
   ReducedSpatialOrganizer::WithinResult FindWithin(const geom::Vec3& pos,
                                                    Real cutoff) const {
     return env_.FindWithin(pos, cutoff);
@@ -54,6 +56,14 @@ public:
 private:
   ReducedSpatialOrganizer env_;  
   ReducedSpatialOrganizerItem* env_data_;
+
+  // data ptrs fetched from base env at initialization
+  const int* env_set_;
+  const loop::IdxHandler* idx_handler_;
+  const geom::Vec3* ca_pos_data_;
+  const geom::Vec3* c_pos_data_;
+  const geom::Vec3* n_pos_data_;
+
 };
 
 }} //ns
diff --git a/scoring/src/reduced_score.cc b/scoring/src/reduced_score.cc
index 6098c3a1b38411f6dc2b6cff047200170463db80..a8e992ae8a68642a34d5fdf864ca5e6376945d91 100644
--- a/scoring/src/reduced_score.cc
+++ b/scoring/src/reduced_score.cc
@@ -8,7 +8,7 @@ namespace {
 
 inline void GetReducedAngles(const geom::Vec3& v1, const geom::Vec3& v2, 
                              const geom::Vec3& v3, Real& alpha, Real& beta,
-                             Real& gamma){
+                             Real& gamma) {
 
   // this function expects three vectors.
   // v1: normalized direction vector
@@ -50,7 +50,9 @@ ReducedScorer::ReducedScorer(Real cutoff, uint dist_bins, uint angle_bins,
                              angle_bins_(angle_bins),
                              dihedral_bins_(dihedral_bins),
                              seq_sep_(seq_sep),
-                             attached_environment_(false),
+                             do_internal_scores_(true),
+                             do_external_scores_(true),
+                             normalize_(true),
                              env_(NULL) {
 
   promod3::core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
@@ -241,125 +243,187 @@ void ReducedScorer::SetEnergy(ost::conop::AminoAcid a, ost::conop::AminoAcid b,
   }
 
   energies_[this->EIdx(a, b, dist_bin, alpha_bin, beta_bin, gamma_bin)] = e;
+  energies_[this->EIdx(b, a, dist_bin, beta_bin, alpha_bin, gamma_bin)] = e;
 }
 
 
-Real ReducedScorer::CalculateScore(const loop::BackboneList& bb_list, 
-                                   uint start_resnum, uint chain_idx) const {
+Real ReducedScorer::CalculateScore(uint start_resnum, uint num_residues,
+                                   uint chain_idx) const {
   
   promod3::core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
                                 "ReducedScorer::CalculateScore", 2);
 
+  if (env_ == NULL) {
+    String err = "Can only calculate score when environment is attached!";
+    throw promod3::Error(err);
+  }
+
+  // setup
+  std::vector<uint> idx_vector;
+  std::vector<bool> occupied;
+  env_->GetIdxHandler()->SetupScoreCalculation(start_resnum, num_residues, 
+                                               chain_idx, idx_vector, 
+                                               occupied);
+
   // get scores
-  std::vector<Real> scores;
+  std::vector<Real> external_scores;
   std::vector<Real> internal_scores;
-  std::vector<uint> counts;
-  std::vector<uint> internal_counts;
-  this->Score(bb_list, start_resnum, chain_idx, scores, internal_scores, 
-              counts, internal_counts);
+  this->Score(idx_vector, external_scores, internal_scores, occupied);
+
   // sum them
-  Real score = 0.0;
+  Real external_score = 0.0;
   Real internal_score = 0.0;
-  uint counter = 0;
-  uint internal_counter = 0;
-  for (uint i = 0; i < scores.size(); ++i) {
-    score += scores[i];
+  for (uint i = 0; i < external_scores.size(); ++i) {
+    external_score += external_scores[i];
     internal_score += internal_scores[i];
-    counter += counts[i];
-    internal_counter += internal_counts[i];
   }
-  // normalize: we count internal scores half as the same pair appears twice
-  score += Real(0.5) * internal_score;
-  const Real count = counter + Real(0.5) * internal_counter;
-  if (count > 0) return score / count;
-  else           return score;
+
+  // all interactions in internal_score have been observed twice!
+  external_score += Real(0.5)*internal_score;
+
+  if(normalize_ && !external_scores.empty()) {
+    external_score /= external_scores.size();
+  }
+
+  return external_score;
 }
 
 
-void ReducedScorer::CalculateScoreProfile(const loop::BackboneList& bb_list, 
-                                          uint start_resnum, uint chain_idx,
+void ReducedScorer::CalculateScoreProfile(uint start_resnum, uint num_residues,
+                                          uint chain_idx,
                                           std::vector<Real>& profile) const {
   
   promod3::core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
                                 "ReducedScorer::CalculateScoreProfile", 2);
 
-  std::vector<Real> scores;
+  if (env_ == NULL) {
+    String err = "Can only calculate score when environment is attached!";
+    throw promod3::Error(err);
+  }
+
+  // setup
+  std::vector<uint> idx_vector;
+  std::vector<bool> occupied;
+  env_->GetIdxHandler()->SetupScoreCalculation(start_resnum, num_residues, 
+                                               chain_idx, idx_vector, 
+                                               occupied);
+  // get scores
+  std::vector<Real> external_scores;
   std::vector<Real> internal_scores;
-  std::vector<uint> counts;
-  std::vector<uint> internal_counts;
+  this->Score(idx_vector, external_scores, internal_scores, occupied);
 
-  this->Score(bb_list, start_resnum, chain_idx, scores, internal_scores, 
-              counts, internal_counts);
+  profile.resize(external_scores.size());
+  for(uint i = 0; i < external_scores.size(); ++i) {
+    profile[i] = external_scores[i] + internal_scores[i];
+  }
+}
 
 
-  profile.clear();
-  for(uint i = 0; i < scores.size(); ++i){
-    uint count = counts[i] + internal_counts[i];
-    if(count > 0) profile.push_back((scores[i] + internal_scores[i]) / count);
-    else profile.push_back(scores[i] + internal_scores[i]);
+Real ReducedScorer::CalculateScore(const std::vector<uint>& start_resnum, 
+                                   const std::vector<uint>& num_residues,
+                                   const std::vector<uint>& chain_idx) const {
+  
+  promod3::core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
+                                "ReducedScorer::CalculateScore", 2);
+
+  if (env_ == NULL) {
+    String err = "Can only calculate score when environment is attached!";
+    throw promod3::Error(err);
+  }
+
+  // setup
+  std::vector<std::vector<uint> > indices_vec;
+  std::vector<bool> occupied; 
+  env_->GetIdxHandler()->SetupScoreCalculation(start_resnum, num_residues, 
+                                               chain_idx, indices_vec, 
+                                               occupied);
+
+  // get scores and sum them up
+  Real external_score = 0.0;
+  Real internal_score = 0.0;
+  uint n_scored_residues = 0;
+  for(uint i = 0; i < start_resnum.size(); ++i) {
+    std::vector<Real> external_scores;
+    std::vector<Real> internal_scores;
+    this->Score(indices_vec[i], external_scores, internal_scores, occupied);
+    for (uint j = 0; j < external_scores.size(); ++j) {
+      external_score += external_scores[j];
+      internal_score += internal_scores[j];
+    }
+    n_scored_residues += external_scores.size();
+  }
+
+  // all interactions in internal_score have been observed twice!
+  external_score += Real(0.5)*internal_score;
+
+  if(normalize_ && n_scored_residues > 0) {
+    external_score /= n_scored_residues;
   }
+
+  return external_score;
 }
 
 
-void ReducedScorer::Score(const loop::BackboneList& bb_list, 
-                          uint start_resnum, uint chain_idx,
-                          std::vector<Real>& scores,
-                          std::vector<Real>& internal_scores,
-                          std::vector<uint>& counts,
-                          std::vector<uint>& internal_counts) const {
+void ReducedScorer::CalculateScoreProfile(const std::vector<uint>& start_resnum, 
+                              const std::vector<uint>& num_residues,
+                              const std::vector<uint>& chain_idx,
+                              std::vector<std::vector<Real> >& profile) const {
   
   promod3::core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
-                                "ReducedScorer::Score", 2);
+                                "ReducedScorer::CalculateScore", 2);
 
-  // setup
-  if (!attached_environment_) {
+  if (env_ == NULL) {
     String err = "Can only calculate score when environment is attached!";
     throw promod3::Error(err);
   }
-  uint bb_list_size, start_idx, end_idx;
-  idx_handler_->SetupScoreCalculation(bb_list, start_resnum, chain_idx,
-                                      bb_list_size, start_idx, end_idx);
 
-  counts.assign(bb_list_size, 0);
-  scores.assign(bb_list_size, 0.0);
-  if(bb_list_size == 0) return;
+  // setup
+  std::vector<std::vector<uint> > indices_vec;
+  std::vector<bool> occupied; 
+  env_->GetIdxHandler()->SetupScoreCalculation(start_resnum, num_residues, 
+                                               chain_idx, indices_vec, 
+                                               occupied);
+
+  // get scores 
+  profile.resize(start_resnum.size());
+  for(uint i = 0; i < start_resnum.size(); ++i) {
+    std::vector<Real> external_scores;
+    std::vector<Real> internal_scores;
+    std::vector<Real>& current_profile = profile[i];
+    this->Score(indices_vec[i], current_profile, internal_scores, occupied);
+    for (uint j = 0; j < current_profile.size(); ++j) {
+      current_profile[j] += internal_scores[j];
+
+    }
+  }
+}
+
+
+void ReducedScorer::Score(const std::vector<uint>& indices,
+                          std::vector<Real>& external_scores,
+                          std::vector<Real>& internal_scores,
+                          std::vector<bool>& occupied) const {
+
+  
+  promod3::core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
+                                "ReducedScorer::Score", 2);
+
+  // setup
+  uint n_indices = indices.size();
+
+  external_scores.assign(n_indices, 0.0);
+  internal_scores.assign(n_indices, 0.0);
+
+  if(n_indices == 0) return;
 
   // let's reduce the cutoff a bit -> hack to ensure bin always within range
-  const Real squared_cutoff = cutoff_*cutoff_ - 0.001;
   const Real cutoff = cutoff_ - 0.001;
   // get inv sizes for binning
   const Real inv_dist_bin_size = dist_bins_ / cutoff_;
   const Real inv_angle_bin_size = angle_bins_ / Real(M_PI);
   const Real inv_dihedral_bin_size = dihedral_bins_ / (2 * Real(M_PI));
 
-  // let's precalculate the idx ranges we have to neglect
-  int min_idx_chain = idx_handler_->GetChainStartIdx(chain_idx);
-  int max_idx_chain = min_idx_chain + idx_handler_->GetChainSize(chain_idx) - 1;
-  std::vector<int> start_neglect(bb_list_size, start_idx);
-  std::vector<int> end_neglect(bb_list_size, end_idx);
-  int neglect_range = int(seq_sep_) - 1;
-
-  int max_i = std::min(neglect_range, static_cast<int>(bb_list_size));
-  for (int i = 0; i < max_i; ++i) {
-    start_neglect[i] =
-      std::max(min_idx_chain, start_neglect[i]-(neglect_range-i));
-    end_neglect[bb_list_size-1-i] =
-      std::min(max_idx_chain, end_neglect[i]+(neglect_range-i));
-  }
-
-  // extract bb_list data
-  std::vector<geom::Vec3> bb_list_axis(bb_list_size);
-  std::vector<geom::Vec3> bb_list_ca_pos(bb_list_size);
-  for (uint i = 0; i < bb_list_size; ++i) {
-    bb_list_ca_pos[i] = bb_list.GetCA(i);
-    bb_list_axis[i] = geom::Normalize(geom::Normalize(bb_list_ca_pos[i]
-                                                      -bb_list.GetN(i)) +
-                                      geom::Normalize(bb_list_ca_pos[i]
-                                                      -bb_list.GetC(i)));
-  }
-
-  // get score
-  Real dist;
+  // some param required in score calculation
   Real alpha;
   Real beta;
   Real gamma;
@@ -367,70 +431,62 @@ void ReducedScorer::Score(const loop::BackboneList& bb_list,
   uint alpha_bin;
   uint beta_bin;
   uint gamma_bin;
+  Real e;
   geom::Vec3 ca_vec;
+
   // let's go over every loop residue
   ReducedSpatialOrganizer::WithinResult within_result;
   std::pair<ReducedSpatialOrganizerItem*,Real>* a;
-  for (uint i = 0; i < bb_list_size; ++i) {
-    within_result = env_->FindWithin(bb_list_ca_pos[i], cutoff);
+  const loop::IdxHandler* idx_handler = env_->GetIdxHandler();
+  const int* env_set = env_->GetEnvSetData();
+  for (uint i = 0; i < n_indices; ++i) {
+    int my_idx = indices[i];
+
+    if(!env_set[my_idx]) {
+      throw promod3::Error("Must set environment before scoring!");
+    }
+
+    int my_chain_idx = idx_handler->GetChainIdx(my_idx);
+    ost::conop::AminoAcid my_aa = env_->GetEnvData(my_idx).aa;
+    geom::Vec3 my_pos = env_->GetEnvData(my_idx).pos;
+    geom::Vec3 my_axis = env_->GetEnvData(my_idx).axis;
+
+    within_result = env_->FindWithin(my_pos, cutoff);
     a = within_result.first;
-    const ost::conop::AminoAcid myaa = bb_list.GetAA(i);
+
     for (uint j = 0; j < within_result.second; ++j) {
-      const int my_idx = int(a[j].first->idx);
-      if (my_idx < start_neglect[i] || my_idx > end_neglect[i]) {
-        ca_vec = a[j].first->pos - bb_list_ca_pos[i];
+      int other_idx = int(a[j].first->idx);
+      int other_chain_idx = idx_handler->GetChainIdx(other_idx);
+
+      if (my_chain_idx != other_chain_idx || 
+          std::abs(my_idx - other_idx) >= seq_sep_) {
+        ca_vec = a[j].first->pos - my_pos;
         ca_vec *= (Real(1.0) / a[j].second);
-        GetReducedAngles(bb_list_axis[i], ca_vec, a[j].first->axis,
+        GetReducedAngles(my_axis, ca_vec, a[j].first->axis,
                          alpha, beta, gamma);
         dist_bin = a[j].second * inv_dist_bin_size;
         alpha_bin = alpha * inv_angle_bin_size;
         beta_bin = beta * inv_angle_bin_size;
         gamma_bin = gamma * inv_dihedral_bin_size;
-        scores[i] += energies_[this->EIdx(myaa, a[j].first->aa, dist_bin, 
-                                          alpha_bin, beta_bin, gamma_bin)];
-        counts[i] += 1;
-      }
-    }
-  }
-  // now all the loop internal interactions
-
-  internal_counts.assign(bb_list_size, 0);
-  internal_scores.assign(bb_list_size, 0.0);
-  if (bb_list_size >= seq_sep_) {
-    for (uint i = 0; i < bb_list_size-seq_sep_; ++i) {
-      const ost::conop::AminoAcid myaa = bb_list.GetAA(i);
-      for (uint j = i+seq_sep_; j < bb_list_size; ++j) {
-        ca_vec = bb_list_ca_pos[j] - bb_list_ca_pos[i];
-        dist = geom::Length2(ca_vec);
-        if (dist < squared_cutoff) {
-          dist = std::sqrt(dist);
-          ca_vec *= (Real(1.0) / dist);
-          GetReducedAngles(bb_list_axis[i], ca_vec, bb_list_axis[j],
-                           alpha, beta, gamma);
-          dist_bin = dist * inv_dist_bin_size;
-          alpha_bin = alpha * inv_angle_bin_size;
-          beta_bin = beta * inv_angle_bin_size;
-          gamma_bin = gamma * inv_dihedral_bin_size;
-
-          // go symmetric
-          internal_scores[i] += energies_[this->EIdx(myaa, bb_list.GetAA(j),
-                                                     dist_bin, alpha_bin,
-                                                     beta_bin, gamma_bin)];
-          internal_scores[j] += energies_[this->EIdx(bb_list.GetAA(j), myaa, 
-                                                     dist_bin, beta_bin,
-                                                     alpha_bin, gamma_bin)];
-          internal_counts[i] += 1;
-          internal_counts[j] += 1;
+
+        e = energies_[this->EIdx(my_aa, a[j].first->aa, dist_bin, 
+                                 alpha_bin, beta_bin, gamma_bin)];
+
+        if(occupied[other_idx] && do_internal_scores_) {
+          internal_scores[i] += e;
+        }
+
+        if(!occupied[other_idx] && do_external_scores_) {
+          external_scores[i] += e;
         }
       }
     }
   }
+  
 }
 
 void ReducedScorer::AttachEnvironment(BackboneScoreEnv& env) {
   env_ = env.UniqueListener<ReducedEnvListener>("ReducedEnvListener");
-  idx_handler_ = env.GetIdxHandlerData();
-  attached_environment_ = true;
 }
 
 }}
diff --git a/scoring/src/reduced_score.hh b/scoring/src/reduced_score.hh
index 41d40f0be1e86cc129b0578eb0c5218cf740301a..e41f784c28bfba0b9e053e11e594eb4105b9f24f 100644
--- a/scoring/src/reduced_score.hh
+++ b/scoring/src/reduced_score.hh
@@ -33,18 +33,34 @@ public:
                  uint dist_bin, uint alpha_bin, uint beta_bin, uint gamma_bin,
                  Real e);
 
-  virtual Real CalculateScore(const loop::BackboneList& bb_list,
-                              uint start_resnum, uint chain_idx) const;
+  void DoInternalScores(bool do_it) { do_internal_scores_ = do_it; }
 
-  virtual void CalculateScoreProfile(const loop::BackboneList& bb_list,
-                                     uint start_resnum, uint chain_idx,
+  void DoExternalScores(bool do_it) { do_external_scores_ = do_it; }
+
+  void DoNormalize(bool do_it) { normalize_ = do_it; }
+
+  virtual Real CalculateScore(uint start_resnum, uint num_residues,
+                              uint chain_idx) const;
+
+  virtual void CalculateScoreProfile(uint start_resnum, uint num_residues,
+                                     uint chain_idx,
                                      std::vector<Real>& profile) const;
 
+  virtual Real CalculateScore(const std::vector<uint>& start_resnum, 
+                              const std::vector<uint>& num_residues,
+                              const std::vector<uint>& chain_idx) const;
+
+  virtual void CalculateScoreProfile(const std::vector<uint>& start_resnum,
+                              const std::vector<uint>& num_residues, 
+                              const std::vector<uint>& chain_idx,
+                              std::vector<std::vector<Real> >& profile) const;
+
   void AttachEnvironment(BackboneScoreEnv& env);
 
 private:
 
-  ReducedScorer(): attached_environment_(false), env_(NULL) { }
+  ReducedScorer(): do_internal_scores_(true), do_external_scores_(true),
+                   normalize_(true), env_(NULL) { }
 
   inline uint EIdx(ost::conop::AminoAcid a, ost::conop::AminoAcid b,
                    uint dist_bin, uint alpha_bin, uint beta_bin,
@@ -58,13 +74,10 @@ private:
            * angle_bins_ * dihedral_bins_;
   }
 
-  void Score(const loop::BackboneList& bb_list, 
-             uint start_resnum, 
-             uint chain_idx,
-             std::vector<Real>& scores,
+  void Score(const std::vector<uint>& indices, 
+             std::vector<Real>& external_scores,
              std::vector<Real>& internal_scores,
-             std::vector<uint>& counts,
-             std::vector<uint>& internal_counts) const;
+             std::vector<bool>& occupied) const;
 
   // portable serialization (only stores data relevant for Load/Save!)
   // (cleanly element by element with fixed-width base-types)
@@ -87,14 +100,14 @@ private:
   uint angle_bins_;
   uint dihedral_bins_;
   uint seq_sep_;
-
   Real* energies_;
+  bool do_internal_scores_;
+  bool do_external_scores_;
+  bool normalize_;
 
   //environment specific information, that will be set upon calling 
   //AttachEnvironment
-  bool attached_environment_;
   ReducedEnvListener* env_;
-  const loop::IdxHandler* idx_handler_;
 };
 
 
diff --git a/scoring/src/scoring_object_loader.cc b/scoring/src/scoring_object_loader.cc
index 043225ba2c95a271f79f632fd8ce1a24ee403543..fff223a9fb260b0b4eddbad3d6fae500a45a42b5 100644
--- a/scoring/src/scoring_object_loader.cc
+++ b/scoring/src/scoring_object_loader.cc
@@ -3,7 +3,6 @@
 #include <promod3/core/runtime_profiling.hh>
 #include <promod3/scoring/clash_score.hh>
 #include <promod3/scoring/pairwise_score.hh>
-#include <promod3/scoring/density_score.hh>
 #include <promod3/scoring/all_atom_clash_score.hh>
 
 namespace promod3{ namespace scoring {
@@ -81,10 +80,8 @@ BackboneOverallScorerPtr LoadDefaultBackboneOverallScorer() {
   (*scorer)["reduced"] = LoadReducedScorer();
   (*scorer)["clash"] = ClashScorerPtr(new ClashScorer);
   (*scorer)["hbond"] = LoadHBondScorer();
-  (*scorer)["ss_agreement"] = LoadSSAgreementScorer();
   (*scorer)["torsion"] = LoadTorsionScorer();
   (*scorer)["pairwise"] = PairwiseScorerPtr(new PairwiseScorer);
-  (*scorer)["density"] = DensityScorerPtr(new DensityScorer);
 
   return scorer;
 }
diff --git a/scoring/src/scwrl3_energy_functions.hh b/scoring/src/scwrl3_energy_functions.hh
new file mode 100644
index 0000000000000000000000000000000000000000..7db72ebf5611fd7424e940a63f26c1de8b49222d
--- /dev/null
+++ b/scoring/src/scwrl3_energy_functions.hh
@@ -0,0 +1,49 @@
+#ifndef PM3_SCWRL3_ENERGY_FUNCTIONS_HH
+#define PM3_SCWRL3_ENERGY_FUNCTIONS_HH
+
+#include <ost/geom/vec3.hh>
+#include <ost/geom/vecmat3_op.hh>
+
+namespace promod3 { namespace scoring {
+
+inline Real SCWRL3PairwiseScore(Real d, Real Rij) {
+  Real e = 0.0;
+  if(d < Real(0.8254) * Rij) {
+    e = 10.0;
+  } else if(d <= Rij) {
+    e = 57.273 * (1 - d/Rij);
+  }
+  return e;
+}
+
+
+inline Real SCWRL3DisulfidScore(const geom::Vec3& ca_pos_one, 
+                         const geom::Vec3& cb_pos_one,
+                         const geom::Vec3& sg_pos_one, 
+                         const geom::Vec3& ca_pos_two, 
+                         const geom::Vec3& cb_pos_two, 
+                         const geom::Vec3& sg_pos_two) {
+
+  Real d = geom::Distance(sg_pos_one,sg_pos_two);
+  Real a1 = geom::Angle(cb_pos_one-sg_pos_one, sg_pos_two-sg_pos_one);
+  Real a2 = geom::Angle(sg_pos_one-sg_pos_two, cb_pos_two-sg_pos_two);
+  Real x2 = std::abs(geom::DihedralAngle(ca_pos_one, cb_pos_one, sg_pos_one,
+                                         sg_pos_two));
+  Real x3 = std::abs(geom::DihedralAngle(cb_pos_one, sg_pos_one, sg_pos_two,
+                                         cb_pos_two));
+  Real x4 = std::abs(geom::DihedralAngle(sg_pos_one, sg_pos_two, cb_pos_two,
+                                         ca_pos_two));
+
+  return std::abs(d-2) / Real(0.05)
+         + std::abs(a1-Real(1.8151)) / Real(0.087266)
+         + std::abs(a2-Real(1.8151)) / Real(0.087266)
+         + std::min(std::abs(x2-Real(1.3963)), std::abs(x2-Real(M_PI)))
+           / Real(0.17453)
+         + std::min(std::abs(x4-Real(1.3963)), std::abs(x4-Real(M_PI)))
+           / Real(0.17453)
+         + std::abs(x3-Real(M_PI)*Real(0.5)) / Real(0.34907);
+}
+
+}}//ns
+
+#endif
diff --git a/scoring/src/ss_agreement_env_listener.cc b/scoring/src/ss_agreement_env_listener.cc
index 7456098a432ae9de23a7fe66030dd39daef0f12c..e9a090ee09d03511f421b2d052773ae9798cb647 100644
--- a/scoring/src/ss_agreement_env_listener.cc
+++ b/scoring/src/ss_agreement_env_listener.cc
@@ -27,6 +27,13 @@ void SSAgreementEnvListener::Init(const BackboneScoreEnv& base_env) {
 
   env_data_ = new SSAgreementSpatialOrganizerItem[num_residues];
   env_set_ = base_env.GetEnvSetData();
+
+  psipred_pred_ = base_env.GetPsipredPredictionData();;
+  psipred_cfi_ = base_env.GetPsipredConfidenceData();
+  n_pos_data_ = base_env.GetNPosData();
+  ca_pos_data_ = base_env.GetCAPosData();
+  c_pos_data_ = base_env.GetCPosData();
+  o_pos_data_ = base_env.GetOPosData();
   
   
   const ost::conop::AminoAcid* aa_data = base_env.GetAAData();
@@ -42,75 +49,47 @@ void SSAgreementEnvListener::Init(const BackboneScoreEnv& base_env) {
   connected_to_next_.assign(num_residues, 0);
 }
 
-void SSAgreementEnvListener::SetEnvironment(const BackboneScoreEnv& base_env, 
-                                            const std::vector<uint>& idx) {
+void SSAgreementEnvListener::SetEnvironment(const std::vector<uint>& idx) {
 
   core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
                                 "SSAgreementEnvListener::SetEnvironment", 2);
 
-  if(!temp_indices_.empty()) {
-    throw promod3::Error("Cannot set SSAgreement environment when temporary"
-                         " data is set!");
-  }
-
-  const geom::Vec3* n_pos_data = base_env.GetNPosData();
-  const geom::Vec3* ca_pos_data = base_env.GetCAPosData();
-  const geom::Vec3* c_pos_data = base_env.GetCPosData();
-  const geom::Vec3* o_pos_data = base_env.GetOPosData();
-
   for(std::vector<uint>::const_iterator i = idx.begin();
   	  i != idx.end(); ++i){
-  	env_data_[*i].pos = ca_pos_data[*i];
-  	env_data_[*i].n_pos = n_pos_data[*i];
-  	env_data_[*i].c_pos = c_pos_data[*i];
-  	env_data_[*i].o_pos = o_pos_data[*i];
-  	env_.Add(&env_data_[*i], ca_pos_data[*i]);
+  	env_data_[*i].pos = ca_pos_data_[*i];
+  	env_data_[*i].n_pos = n_pos_data_[*i];
+  	env_data_[*i].c_pos = c_pos_data_[*i];
+  	env_data_[*i].o_pos = o_pos_data_[*i];
+  	env_.Add(&env_data_[*i], ca_pos_data_[*i]);
   }
 
   this->Update(idx);
 }
 
-void SSAgreementEnvListener::ResetEnvironment(const BackboneScoreEnv& base_env,
-	                                            const std::vector<uint>& idx) {
+void SSAgreementEnvListener::ResetEnvironment(const std::vector<uint>& idx) {
 
   core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
                                 "SSAgreementEnvListener::ResetEnvironment", 2);
 
-  if(!temp_indices_.empty()) {
-    throw promod3::Error("Cannot reset SSAgreement environment when temporary"
-                         " data is set!");
-  }
-
-  const geom::Vec3* n_pos_data = base_env.GetNPosData();
-  const geom::Vec3* ca_pos_data = base_env.GetCAPosData();
-  const geom::Vec3* c_pos_data = base_env.GetCPosData();
-  const geom::Vec3* o_pos_data = base_env.GetOPosData();
-
   geom::Vec3 old_pos;
   for(std::vector<uint>::const_iterator i = idx.begin();
   	  i != idx.end(); ++i){
   	old_pos = env_data_[*i].pos;
-    env_data_[*i].pos = ca_pos_data[*i];
-    env_data_[*i].n_pos = n_pos_data[*i];
-    env_data_[*i].c_pos = c_pos_data[*i];
-    env_data_[*i].o_pos = o_pos_data[*i];
-  	env_.Reset(&env_data_[*i], old_pos, ca_pos_data[*i]);
+    env_data_[*i].pos = ca_pos_data_[*i];
+    env_data_[*i].n_pos = n_pos_data_[*i];
+    env_data_[*i].c_pos = c_pos_data_[*i];
+    env_data_[*i].o_pos = o_pos_data_[*i];
+  	env_.Reset(&env_data_[*i], old_pos, ca_pos_data_[*i]);
   }
 
   this->Update(idx);
 }
 
-void SSAgreementEnvListener::ClearEnvironment(const BackboneScoreEnv& base_env,
-	                                            const std::vector<uint>& idx) {
+void SSAgreementEnvListener::ClearEnvironment(const std::vector<uint>& idx) {
 
   core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
                                 "SSAgreementEnvListener::ClearEnvironment", 2);
 
-  if(!temp_indices_.empty()) {
-    throw promod3::Error("Cannot clear SSAgreement environment when temporary"
-                         " data is set!");
-  }
-
   for(std::vector<uint>::const_iterator i = idx.begin();
   	  i != idx.end(); ++i){
     env_.Remove(&env_data_[*i], env_data_[*i].pos);
@@ -147,161 +126,6 @@ void SSAgreementEnvListener::ClearEnvironment(const BackboneScoreEnv& base_env,
   }
 }
 
-void SSAgreementEnvListener::SetTemporaryInteractions(
-                                const promod3::loop::BackboneList& bb_list,
-                                uint start_idx) {
-
-  temp_start_idx_ = start_idx;
-  temp_size_ = bb_list.size();
-
-  // lets first copy over all the data from the bb_list, as well as one before
-  // and one after
-  int idx = std::max(0, temp_start_idx_ - 1);
-  int end = std::min(static_cast<int>(idx_handler_->GetNumResidues()),
-                     temp_start_idx_ + temp_size_ + 1);
-
-  for(; idx < end; ++idx) {
-    temp_indices_.push_back(idx);
-    original_env_data_.push_back(env_data_[idx]);
-    original_ca_pos_.push_back(ca_positions_[idx]);
-    original_donor_for_one_.push_back(donor_for_one_[idx]);
-    original_donor_for_two_.push_back(donor_for_two_[idx]);
-    original_connected_to_next_.push_back(connected_to_next_[idx]);
-  }
-
-  // update the env_data_ vector and the spatial organizer
-  for(int i = 0; i < temp_size_; ++i) {
-
-    // if the env is set, we have to reset the spatial organizer
-    // we just add it otherwise
-    if(env_set_[temp_start_idx_+i]) {
-      env_.Reset(&env_data_[temp_start_idx_+i], 
-                 env_data_[temp_start_idx_+i].pos, bb_list.GetCA(i));
-    } else {
-      env_.Add(&env_data_[temp_start_idx_+i], bb_list.GetCA(i));
-    }
-
-    SSAgreementSpatialOrganizerItem& organizer_item = env_data_[temp_start_idx_+i];
-    organizer_item.pos = bb_list.GetCA(i);
-    organizer_item.n_pos = bb_list.GetN(i);
-    organizer_item.c_pos = bb_list.GetC(i);
-    organizer_item.o_pos = bb_list.GetO(i); 
-
-    // and directly copy over the ca position
-    ca_positions_[temp_start_idx_+i] = bb_list.GetCA(i);   
-  }
-
-  // lets update connectivity
-  
-  // first the residue before
-  if(temp_start_idx_ > 0 && env_set_[temp_start_idx_-1] &&
-     geom::Length2(env_data_[temp_start_idx_-1].c_pos - 
-                   env_data_[temp_start_idx_].n_pos) <= 6.25) {
-    connected_to_next_[temp_start_idx_-1] = 1;
-  } else {
-    connected_to_next_[temp_start_idx_-1] = 0;
-  }
-
-  // connection of bb_list itself
-  for(int i = 0; i < temp_size_ - 1; ++i) {
-    if(geom::Length2(bb_list.GetC(i) - bb_list.GetN(i+1)) <= 6.25) {
-      connected_to_next_[temp_start_idx_+i] = 1;
-    } else {
-      connected_to_next_[temp_start_idx_+i] = 0;
-    } 
-  }
-
-  // lets see whether the last residue is connected
-  if(temp_start_idx_ + temp_size_ < 
-     static_cast<int>(idx_handler_->GetNumResidues()) &&
-     env_set_[temp_start_idx_ + temp_size_] &&
-     geom::Length2(env_data_[temp_start_idx_+temp_size_-1].c_pos - 
-                   env_data_[temp_start_idx_+temp_size_].n_pos) <= 6.25) {
-    connected_to_next_[temp_start_idx_+temp_size_-1] = 1;
-  } else {
-    connected_to_next_[temp_start_idx_+temp_size_-1] = 0;
-  }
-
-  // set h positions of all loop residues, as well as the one
-  // residue after (if present)
-  idx = temp_start_idx_;
-  end = temp_start_idx_ + temp_size_;
-  if(static_cast<uint>(end) < idx_handler_->GetNumResidues()) ++end;
-  for(; idx < end; ++idx) {
-    // h_pos of this residue
-    if(!env_data_[idx].is_proline) {
-      if(idx > 0 && connected_to_next_[idx-1]) {
-        geom::Vec3 dir_vec = geom::Normalize(env_data_[idx-1].c_pos -
-                                             env_data_[idx-1].o_pos);
-        env_data_[idx].h_pos = env_data_[idx].n_pos + dir_vec;
-        env_data_[idx].valid_h_pos = true;
-      }
-      else {
-        env_data_[idx].valid_h_pos = false;
-      }
-    } 
-  }
-
-  // find the optimal donor for all bb_list residues
-  for(int i = 0; i < temp_size_; ++i) {
-    this->FindOptimalDonors(temp_start_idx_ + i, false);
-  }
-
-  // we have now everything for the bb_list itself! but we also need
-  // to update the donor information of close residue and store 
-  // their original values, so they can be restored!
-
-  std::set<int> close_residues;
-  for(int i = 0; i < temp_size_; ++i) {
-    this->AddCloseResidues(temp_start_idx_ + i, close_residues);
-  } 
-
-  for(std::set<int>::iterator i = close_residues.begin(); 
-      i != close_residues.end(); ++i) {
-    // the residues of the bb_list have already been handled
-    int idx = *i;
-    if(idx >= temp_start_idx_ && idx < temp_start_idx_ + temp_size_) continue;
-
-    temp_indices_.push_back(idx);
-    original_env_data_.push_back(env_data_[idx]);
-    original_ca_pos_.push_back(ca_positions_[idx]);
-    original_donor_for_one_.push_back(donor_for_one_[idx]);
-    original_donor_for_two_.push_back(donor_for_two_[idx]);
-    original_connected_to_next_.push_back(connected_to_next_[idx]);
-
-    this->FindOptimalDonors(idx);
-  }
-}
-
-void SSAgreementEnvListener::Restore() {
-
-  for(uint i = 0; i < temp_indices_.size(); ++i) {
-    int temp_idx = temp_indices_[i];
-    if(temp_idx >= temp_start_idx_ && temp_idx < temp_start_idx_ + temp_size_) {
-      // its in the temporarily set bb_list, so we have to handle the 
-      // spatial organizer
-      if(env_set_[temp_idx]) {
-        env_.Reset(&env_data_[temp_idx], 
-                   env_data_[temp_idx].pos, original_ca_pos_[i]);
-      } else {
-        env_.Remove(&env_data_[temp_idx], env_data_[temp_idx].pos);
-      }
-    }
-    env_data_[temp_idx] = original_env_data_[i];
-    ca_positions_[temp_idx] = original_ca_pos_[i];
-    donor_for_one_[temp_idx] = original_donor_for_one_[i];
-    donor_for_two_[temp_idx] = original_donor_for_two_[i];
-    connected_to_next_[temp_idx] = original_connected_to_next_[i];
-  }
-
-  temp_indices_.clear();
-  original_env_data_.clear();
-  original_ca_pos_.clear();
-  original_donor_for_one_.clear();
-  original_donor_for_two_.clear();
-  original_connected_to_next_.clear();
-}
-
 void SSAgreementEnvListener::AddCloseResidues(uint idx, 
                                       std::set<int>& close_residues) const {
   SSAgreementSpatialOrganizer::WithinResult within_result = 
@@ -312,13 +136,12 @@ void SSAgreementEnvListener::AddCloseResidues(uint idx,
   }
 }
 
-void SSAgreementEnvListener::FindOptimalDonors(uint idx, bool check_env_set) {
+void SSAgreementEnvListener::FindOptimalDonors(uint idx) {
 
   donor_for_one_[idx] = -1;
   donor_for_two_[idx] = -1;
 
   if(!env_data_[idx].valid_h_pos) return;
-  if(check_env_set && !env_set_[idx]) return;
 
   std::pair<Real, Real> donor_energies = 
   std::make_pair(std::numeric_limits<Real>::max(),
@@ -330,7 +153,7 @@ void SSAgreementEnvListener::FindOptimalDonors(uint idx, bool check_env_set) {
   std::pair<SSAgreementSpatialOrganizerItem*,Real>* a = within_result.first;
   for (uint j = 0; j < within_result.second; ++j) {
     const uint other_idx = a[j].first->idx;
-    if((other_idx < idx) || (other_idx > idx + 1)) {
+    if((idx > 0  && (other_idx < idx - 1)) || (other_idx > (idx + 1))) {
       Real e = ost::mol::alg::DSSPHBondEnergy(env_data_[idx].h_pos, 
                                               env_data_[idx].n_pos,
                                               env_data_[other_idx].c_pos, 
@@ -363,9 +186,10 @@ void SSAgreementEnvListener::Update(const std::vector<uint>& idx) {
   for(std::vector<uint>::const_iterator i = idx.begin(); i != idx.end(); ++i){
     
     ca_positions_[*i] = env_data_[*i].pos;
+    bool last_residue = (*i >= idx_handler_->GetNumResidues() - 1);
 
     // set connectivity of the residue itself
-    if(*i < idx_handler_->GetNumResidues() - 1 && env_set_[*i + 1] &&
+    if(!last_residue && env_set_[*i + 1] &&
        geom::Length2(env_data_[*i].c_pos - env_data_[*i+1].n_pos) <= 6.25) {
         connected_to_next_[*i] = 1;
     } else {
@@ -396,8 +220,6 @@ void SSAgreementEnvListener::Update(const std::vector<uint>& idx) {
     } 
 
     // the h_pos of the next residue might have changed
-    // no check for index validity of idx + 1... this informatin is contained
-    // in connected_to_next_
     if(connected_to_next_[*i]) {
       if(!env_data_[*i+1].is_proline) {
         geom::Vec3 dir_vec = geom::Normalize(env_data_[*i].c_pos -
@@ -407,6 +229,8 @@ void SSAgreementEnvListener::Update(const std::vector<uint>& idx) {
       } else {
         env_data_[*i+1].valid_h_pos = false;
       }
+    } else if(!last_residue) {
+      env_data_[*i+1].valid_h_pos = false;
     }
   }
 
diff --git a/scoring/src/ss_agreement_env_listener.hh b/scoring/src/ss_agreement_env_listener.hh
index 3d924e23419591bf88567186eaa6f1949cee9687..ad87b4e96753def90f56ff538fa63db1dc30361d 100644
--- a/scoring/src/ss_agreement_env_listener.hh
+++ b/scoring/src/ss_agreement_env_listener.hh
@@ -40,21 +40,21 @@ public:
 
   virtual void Init(const BackboneScoreEnv& base_env);
 
-  virtual void SetEnvironment(const BackboneScoreEnv& base_env, 
-                              const std::vector<uint>& idx);
+  virtual void SetEnvironment(const std::vector<uint>& idx);
 
-  virtual void ResetEnvironment(const BackboneScoreEnv& base_env, 
-                                const std::vector<uint>& idx);
+  virtual void ResetEnvironment(const std::vector<uint>& idx);
 
-  virtual void ClearEnvironment(const BackboneScoreEnv& base_env, 
-                                const std::vector<uint>& idx);
+  virtual void ClearEnvironment(const std::vector<uint>& idx);
 
   virtual String WhoAmI() const { return "SSAgreementEnvListener"; }
 
-  void SetTemporaryInteractions(const promod3::loop::BackboneList& bb_list,
-                                uint start_idx);
+  const int* GetEnvSetData() { return env_set_; }
 
-  void Restore();
+  const loop::IdxHandler* GetIdxHandler() { return idx_handler_; }
+
+  const char* GetPsipredPredData() { return psipred_pred_; }
+
+  const int* GetPsipredConfidenceData() { return psipred_cfi_; }
 
   const std::vector<geom::Vec3>& GetCAPositions() const { return ca_positions_; }
   const std::vector<int>& GetDonorForOne() const { return donor_for_one_; }
@@ -70,31 +70,26 @@ private:
 
   void AddCloseResidues(uint idx, std::set<int>& close_residues) const;
 
-  void FindOptimalDonors(uint idx, bool check_env_set = true);
+  void FindOptimalDonors(uint idx);
 
   SSAgreementSpatialOrganizer env_;  
   SSAgreementSpatialOrganizerItem* env_data_;
+
+  // data ptrs fetched from base env at initialization
   const int* env_set_;
   const loop::IdxHandler* idx_handler_;
-
+  const char* psipred_pred_;
+  const int* psipred_cfi_;
+  const geom::Vec3* n_pos_data_;
+  const geom::Vec3* ca_pos_data_;
+  const geom::Vec3* c_pos_data_;
+  const geom::Vec3* o_pos_data_;
+
+  // thats the input for the ost dssp implementation
   std::vector<geom::Vec3> ca_positions_;
   std::vector<int> donor_for_one_;
   std::vector<int> donor_for_two_;
   std::vector<int> connected_to_next_;
-  
-  // when temporary stuff gets set, the original values get
-  // stored in the vectors below. When calling Restore(),
-  // the stuff goes back into the original vectors
-
-  // the derived data
-  int temp_start_idx_;
-  int temp_size_;
-  std::vector<int> temp_indices_;
-  std::vector<SSAgreementSpatialOrganizerItem> original_env_data_;
-  std::vector<geom::Vec3> original_ca_pos_;
-  std::vector<int> original_donor_for_one_;
-  std::vector<int> original_donor_for_two_;
-  std::vector<int> original_connected_to_next_;
 }; 
 
 }} // ns
diff --git a/scoring/src/ss_agreement_score.cc b/scoring/src/ss_agreement_score.cc
index aae0afb5b176388714a7b952fce857a1ce723faf..be4d6640415ed05e6074a9fcdda8e5af5d2677d2 100644
--- a/scoring/src/ss_agreement_score.cc
+++ b/scoring/src/ss_agreement_score.cc
@@ -2,11 +2,11 @@
 
 namespace promod3 { namespace scoring {
 
-SSAgreementScorer::SSAgreementScorer(): attached_environment_(false),
+SSAgreementScorer::SSAgreementScorer(): normalize_(true),
                                         env_(NULL) {
   uint num_values = 3 * 10 * 8;
   scores_ = new Real[num_values];
-  memset(scores_,0,num_values*sizeof(Real));
+  memset(scores_, 0, num_values*sizeof(Real));
 }
 
 SSAgreementScorer::~SSAgreementScorer() {
@@ -159,83 +159,148 @@ void SSAgreementScorer::SetScore(char psipred_state, int psipred_cfi,
 }
 
 
-Real SSAgreementScorer::CalculateScore(const loop::BackboneList& bb_list, 
-                                       uint start_resnum, uint chain_idx) const{
+Real SSAgreementScorer::CalculateScore(uint start_resnum, uint num_residues,
+                                       uint chain_idx) const{
   
   promod3::core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
                                 "SSAgreementScorer::CalculateScore", 2);
 
-  std::vector<Real> scores;
+  std::vector<uint> v_start_resnum(1, start_resnum);
+  std::vector<uint> v_num_residues(1, num_residues);
+  std::vector<uint> v_chain_idx(1, chain_idx);
+  
+  return this->CalculateScore(v_start_resnum, v_num_residues, v_chain_idx);
+}
 
-  this->Score(bb_list, start_resnum, chain_idx, scores);
+void SSAgreementScorer::CalculateScoreProfile(uint start_resnum, uint num_residues,
+                                              uint chain_idx,
+                                              std::vector<Real>& profile) const{
+  
+  promod3::core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
+                                "SSAgreementScorer::CalculateScoreProfile", 2);
+
+  std::vector<uint> v_start_resnum(1, start_resnum);
+  std::vector<uint> v_num_residues(1, num_residues);
+  std::vector<uint> v_chain_idx(1, chain_idx);
+  std::vector<std::vector<Real> > scores;
+
+  this->CalculateScoreProfile(v_start_resnum, v_num_residues, v_chain_idx, 
+                              scores);
+  profile = scores[0];
+}
+
+
+Real SSAgreementScorer::CalculateScore(const std::vector<uint>& start_resnum, 
+                                    const std::vector<uint>& num_residues,
+                                    const std::vector<uint>& chain_idx) const {
+
+  promod3::core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
+                                "SSAgreementScorer::CalculateScore", 2);
+
+  std::vector<std::vector<Real> > scores;
+  this->CalculateScoreProfile(start_resnum, num_residues, chain_idx, scores);
 
   Real score = 0.0;
+  uint n = 0;
   for(uint i = 0; i < scores.size(); ++i){
-    score += scores[i];
+    for(uint j = 0; j < scores[i].size(); ++j) {
+      score += scores[i][j];
+    }
+    n += scores[i].size();
   }
 
-  if(!scores.empty()){
-    score /= scores.size();
+  if(normalize_ && n > 0) {
+    score /= n;
   }
 
   return score;
 }
 
-void SSAgreementScorer::CalculateScoreProfile(const loop::BackboneList& bb_list, 
-                                              uint start_resnum, uint chain_idx,
-                                              std::vector<Real>& profile) const{
-  
+void SSAgreementScorer::CalculateScoreProfile(
+                              const std::vector<uint>& start_resnum,
+                              const std::vector<uint>& num_residues, 
+                              const std::vector<uint>& chain_idx,
+                              std::vector<std::vector<Real> >& profile) const {
+
   promod3::core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
                                 "SSAgreementScorer::CalculateScoreProfile", 2);
 
-  this->Score(bb_list, start_resnum, chain_idx, profile);
-}
+  if (env_ == NULL) {
+    String err = "Can only calculate score when environment is attached!";
+    throw promod3::Error(err);
+  }
 
+  if(start_resnum.size() != num_residues.size()) {
+    throw promod3::Error("Inconsistent input data in Score Setup!");
+  }
 
+  if(start_resnum.size() != chain_idx.size()) {
+    throw promod3::Error("Inconsistent input data in Score Setup!");
+  }
 
-void SSAgreementScorer::Score(const loop::BackboneList& bb_list,
-                              uint start_resnum, uint chain_idx,
-                              std::vector<Real>& scores) const{
+  std::vector<uint> start_indices(start_resnum.size());
+  const loop::IdxHandler* idx_handler = env_->GetIdxHandler();
+  for(uint i = 0; i < start_resnum.size(); ++i) {
+    start_indices[i] = idx_handler->ToIdx(start_resnum[i], chain_idx[i]);
+    if(start_indices[i] + num_residues[i] - 1 > 
+       idx_handler->GetChainLastIdx(chain_idx[i])) {
+      throw promod3::Error("Invalid start_resnum and loop length!");
+    }
+  }
+
+  this->Score(start_indices, num_residues, profile);
+}
+
+
+void SSAgreementScorer::Score(const std::vector<uint>& start_indices,
+                              const std::vector<uint>& num_residues,
+                              std::vector<std::vector<Real> >& scores) const{
 
   promod3::core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
                                 "SSAgreementScorer::Score", 2);
 
-  if(!attached_environment_){
-    String err = "Can only calculate score when environment is attached!";
-    throw promod3::Error(err);
-  }
+  uint n_profiles = start_indices.size();
 
-  // setup
-  uint bb_list_size, start_idx, end_idx;
-  idx_handler_->SetupScoreCalculation(bb_list, start_resnum, chain_idx,
-                                      bb_list_size, start_idx, end_idx);
+  if(n_profiles == 0) return;
 
-  scores.assign(bb_list_size, 0.0);
-  if(bb_list_size == 0) return;
+  scores.assign(n_profiles, std::vector<Real>());
 
-  env_->SetTemporaryInteractions(bb_list, start_idx);
+  const int* env_set = env_->GetEnvSetData();
+  const char* psipred_pred = env_->GetPsipredPredData();
+  const int* psipred_cfi = env_->GetPsipredConfidenceData();
 
-  String ss  = ost::mol::alg::RawEstimateSS(env_->GetCAPositions(), 
-                                            start_idx, bb_list_size,
-	                                          env_->GetDonorForOne(), 
-                                            env_->GetDonorForTwo(),
-                                            env_->GetConnection());
-  env_->Restore();
+  // check whether the full env is set
+  for(uint i = 0; i < start_indices.size(); ++i) {
+    for(uint j = 0; j < num_residues[i]; ++j) {
+      if(!env_set[start_indices[i] + j]) {
+        throw promod3::Error("Must set environment before scoring!");
+      }
+    }
+    scores[i].assign(num_residues[i], 0.0);
+  }
 
-  for(uint i = 0; i < bb_list_size; ++i){
-    scores[i] = scores_[this->SIdx(GetPsipredIdx(psipred_pred_[start_idx + i]), 
-                                   psipred_cfi_[start_idx + i], 
-                                   GetDSSPIdx(ss[i]))];
+  
+  for(uint i = 0; i < n_profiles; ++i) {
+
+    if(num_residues[i] == 0) continue;
+
+    String ss  = ost::mol::alg::RawEstimateSS(env_->GetCAPositions(), 
+                                              start_indices[i], 
+                                              num_residues[i],
+	                                            env_->GetDonorForOne(), 
+                                              env_->GetDonorForTwo(),
+                                              env_->GetConnection());
+
+    for(uint j = 0; j < num_residues[i]; ++j){
+      scores[i][j] = scores_[this->SIdx(GetPsipredIdx(psipred_pred[start_indices[i] + j]), 
+                                        psipred_cfi[start_indices[i] + j], 
+                                        GetDSSPIdx(ss[j]))];
+    }
   }
 }
 
 void SSAgreementScorer::AttachEnvironment(BackboneScoreEnv& env) {
   env_ = env.UniqueListener<SSAgreementEnvListener>("SSAgreementEnvListener");
-  idx_handler_ = env.GetIdxHandlerData();
-  env_set_ = env.GetEnvSetData();
-  psipred_pred_ = env.GetPsipredPredictionData();
-  psipred_cfi_ = env.GetPsipredConfidenceData();
-  attached_environment_ = true;
 }
 
 }} // ns
diff --git a/scoring/src/ss_agreement_score.hh b/scoring/src/ss_agreement_score.hh
index 23bece022eb6766a464ee3a372b36d80b0471c8d..7e9960cffd65184225e68480da4755be32444282 100644
--- a/scoring/src/ss_agreement_score.hh
+++ b/scoring/src/ss_agreement_score.hh
@@ -59,15 +59,24 @@ public:
   void SetScore(char psipred_state, int psipred_cfi,
                 char dssp_state, Real score);
 
-  virtual Real CalculateScore(const loop::BackboneList& bb_list, 
-                              uint start_resnum, 
+  virtual Real CalculateScore(uint start_resnum, uint num_residues,
                               uint chain_idx) const;
 
-  virtual void CalculateScoreProfile(const loop::BackboneList& bb_list, 
-                                     uint start_resnum, 
+  virtual void CalculateScoreProfile(uint start_resnum, uint num_residues,
                                      uint chain_idx,
                                      std::vector<Real>& profile) const;
 
+  virtual Real CalculateScore(const std::vector<uint>& start_resnum, 
+                              const std::vector<uint>& num_residues,
+                              const std::vector<uint>& chain_idx) const;
+
+  virtual void CalculateScoreProfile(const std::vector<uint>& start_resnum,
+                              const std::vector<uint>& num_residues, 
+                              const std::vector<uint>& chain_idx,
+                              std::vector<std::vector<Real> >& profile) const;
+
+  void DoNormalize(bool do_it) { normalize_ = do_it; }
+
   void AttachEnvironment(BackboneScoreEnv& env);
 
 private:
@@ -79,10 +88,9 @@ private:
            dssp_idx;
   }
 
-  void Score(const loop::BackboneList& bb_list, 
-             uint start_resnum, 
-             uint chain_idx,
-             std::vector<Real>& scores) const;
+  void Score(const std::vector<uint>& start_indices,
+             const std::vector<uint>& num_residues,
+             std::vector<std::vector<Real> >& scores) const;
 
   // portable serialization (only stores data relevant for Load/Save!)
   // (cleanly element by element with fixed-width base-types)
@@ -100,15 +108,11 @@ private:
   }
 
   Real* scores_;
+  bool normalize_;
 
   //environment specific information, that will be set upon calling 
   //AttachEnvironment
-  bool attached_environment_;
   SSAgreementEnvListener* env_;
-  const loop::IdxHandler* idx_handler_;
-  const int* env_set_;
-  const char* psipred_pred_;
-  const int* psipred_cfi_;
 };
 
 }}//ns
diff --git a/scoring/src/torsion_score.cc b/scoring/src/torsion_score.cc
index 97ad3699a44c031d75072965291344f0b9e1b6cb..65cca939dda0a6a59d7ce1bf057a8b9e6329f5bb 100644
--- a/scoring/src/torsion_score.cc
+++ b/scoring/src/torsion_score.cc
@@ -8,13 +8,14 @@ TorsionScorer::TorsionScorer(std::vector<String>& group_definitions,
                              bins_per_dimension_(bins_per_dimension),
                              bins_squared_(bins_per_dimension * 
                                            bins_per_dimension),
+                             normalize_(true),
                              attached_environment_(false)
                                                  {
 
   promod3::core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
                                 "TorsionScorer::TorsionScorer", 2);
 
-  if(bins_per_dimension < 1){
+  if(bins_per_dimension < 1) {
     throw promod3::Error("Bins per dimension must be at least one!");
   }
 
@@ -25,9 +26,9 @@ TorsionScorer::TorsionScorer(std::vector<String>& group_definitions,
   //Let's check, whether all possible combinations of the 20 standard amino
   //acids are covered
   std::vector<String> single_ids(3);
-  for(int i = 0; i < ost::conop::XXX; ++i){
-    for(int j = 0; j < ost::conop::XXX; ++j){
-      for(int k = 0; k < ost::conop::XXX; ++k){
+  for(int i = 0; i < ost::conop::XXX; ++i) {
+    for(int j = 0; j < ost::conop::XXX; ++j) {
+      for(int k = 0; k < ost::conop::XXX; ++k) {
         single_ids[0] = ost::conop::AminoAcidToResidueName(ost::conop::AminoAcid(i));
         single_ids[1] = ost::conop::AminoAcidToResidueName(ost::conop::AminoAcid(j));
         single_ids[2] = ost::conop::AminoAcidToResidueName(ost::conop::AminoAcid(k));
@@ -35,33 +36,33 @@ TorsionScorer::TorsionScorer(std::vector<String>& group_definitions,
         bool match;
         bool found_id(false);
 
-        for(uint l = 0; l < group_definitions.size(); ++l){
+        for(uint l = 0; l < group_definitions.size(); ++l) {
 
           match=true;
           ost::StringRef gid(group_definitions[l].c_str(), group_definitions[l].length());
           std::vector<ost::StringRef> split_definition=gid.split('-'); //split ids
-          if(split_definition.size() != 3){
+          if(split_definition.size() != 3) {
             throw promod3::Error("Invalid torsion group definition encountered!");
           }
           //iterate over all three positions
-          for(int m=0;m<3;++m){
+          for(int m=0;m<3;++m) {
             //"all" matches every residue
-            if(split_definition[m].str().find("all")!=std::string::npos){
+            if(split_definition[m].str().find("all")!=std::string::npos) {
               continue;
             }
             //check, whether currrent residue matches current id position
-            if(split_definition[m].str().find(single_ids[m])==std::string::npos){
+            if(split_definition[m].str().find(single_ids[m])==std::string::npos) {
               match=false;
               break;
             }
           }
-          if(match){
+          if(match) {
             index_mapper_[i*400 + j*20 + k] = l;
             found_id = true;
             break;
           }
         }
-        if(!found_id){
+        if(!found_id) {
           std::stringstream ss;
           ss << "Could not match residues " << single_ids[0] << ", " << single_ids[1];
           ss << " and " << single_ids[2] << " to any of the group_identifiers";
@@ -77,11 +78,11 @@ TorsionScorer::TorsionScorer(std::vector<String>& group_definitions,
   memset(energies_, 0, num_values * sizeof(Real));
 }
 
-TorsionScorer::~TorsionScorer(){
+TorsionScorer::~TorsionScorer() {
   delete [] energies_;
 }
 
-TorsionScorerPtr TorsionScorer::Load(const String& filename){
+TorsionScorerPtr TorsionScorer::Load(const String& filename) {
 
   promod3::core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
                                 "TorsionScorer::Load", 2);
@@ -124,7 +125,7 @@ TorsionScorerPtr TorsionScorer::Load(const String& filename){
   return p;
 }
 
-void TorsionScorer::Save(const String& filename){
+void TorsionScorer::Save(const String& filename) {
 
   promod3::core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
                                 "TorsionScorer::Save", 2);
@@ -156,7 +157,7 @@ void TorsionScorer::Save(const String& filename){
   out_stream.write(reinterpret_cast<char*>(energies_), num_values * sizeof(Real));
 }
 
-TorsionScorerPtr TorsionScorer::LoadPortable(const String& filename){
+TorsionScorerPtr TorsionScorer::LoadPortable(const String& filename) {
 
   promod3::core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
                                 "TorsionScorer::LoadPortable", 2);
@@ -193,7 +194,7 @@ TorsionScorerPtr TorsionScorer::LoadPortable(const String& filename){
   return p;
 }
 
-void TorsionScorer::SavePortable(const String& filename){
+void TorsionScorer::SavePortable(const String& filename) {
 
   promod3::core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
                                 "TorsionScorer::SavePortable", 2);
@@ -223,13 +224,13 @@ void TorsionScorer::SavePortable(const String& filename){
   out_stream_.close();
 }
 
-void TorsionScorer::SetEnergy(uint group_idx, uint phi_bin, uint psi_bin, Real e){
+void TorsionScorer::SetEnergy(uint group_idx, uint phi_bin, uint psi_bin, Real e) {
 
-  if(group_idx >= num_groups_){
+  if(group_idx >= num_groups_) {
     throw promod3::Error("Invalid torsion group idx!");
   }
 
-  if(phi_bin >= bins_per_dimension_ || psi_bin >= bins_per_dimension_){
+  if(phi_bin >= bins_per_dimension_ || psi_bin >= bins_per_dimension_) {
     throw promod3::Error("Invalid dihedral angle bin!");
   }
 
@@ -237,190 +238,188 @@ void TorsionScorer::SetEnergy(uint group_idx, uint phi_bin, uint psi_bin, Real e
 }
 
 
-Real TorsionScorer::CalculateScore(const loop::BackboneList& bb_list, 
-                                   uint start_resnum, uint chain_idx) const {
+Real TorsionScorer::CalculateScore(uint start_resnum, uint num_residues,
+                                   uint chain_idx) const {
   
   promod3::core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
                                 "TorsionScorer::CalculateScore", 2);
 
-  std::vector<Real> scores;
-  std::vector<uint> counts;
+  if(!attached_environment_) {
+    String err = "Can only calculate score when environment is attached!";
+    throw promod3::Error(err);
+  }
 
-  this->Score(bb_list, start_resnum, chain_idx, scores, counts);
+  // setup
+  std::vector<uint> idx_vector;
+  idx_handler_->SetupScoreCalculation(start_resnum, num_residues, chain_idx,
+                                      idx_vector);
 
+  // get scores and sum them up
+  std::vector<Real> scores;
+  this->Score(idx_vector, scores);
   Real score = 0.0;
-  uint counter = 0;
-
-  for(uint i = 0; i < scores.size(); ++i){
+  for(uint i = 0; i < scores.size(); ++i) {
     score += scores[i];
-    counter += counts[i];
   }
 
-  if(counter > 0){
-    score /= counter;
+  if(normalize_ && !scores.empty()){
+    score /= scores.size();
   }
 
   return score;
 }
 
 
-void TorsionScorer::CalculateScoreProfile(const loop::BackboneList& bb_list, 
-                                          uint start_resnum, uint chain_idx,
+void TorsionScorer::CalculateScoreProfile(uint start_resnum, uint num_residues,
+                                          uint chain_idx,
                                           std::vector<Real>& profile) const {
   
   promod3::core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
                                 "TorsionScorer::CalculateScoreProfile", 2);
 
-  std::vector<Real> scores;
-  std::vector<uint> counts;
+  if(!attached_environment_) {
+    String err = "Can only calculate score when environment is attached!";
+    throw promod3::Error(err);
+  }
 
-  this->Score(bb_list, start_resnum, chain_idx, scores, counts);
+  // setup
+  std::vector<uint> idx_vector;
+  idx_handler_->SetupScoreCalculation(start_resnum, num_residues, chain_idx,
+                                      idx_vector);
 
-  profile.clear();
-  for(uint i = 0; i < scores.size(); ++i){
-    if(counts[i] > 0) profile.push_back(scores[i] / counts[i]);
-    else profile.push_back(scores[i]);
-  }
+  // score
+  this->Score(idx_vector, profile);
 }
 
+Real TorsionScorer::CalculateScore(const std::vector<uint>& start_resnum, 
+                                   const std::vector<uint>& num_residues,
+                                   const std::vector<uint>& chain_idx) const {
 
-void TorsionScorer::Score(const loop::BackboneList& bb_list, 
-                          uint start_resnum, uint chain_idx,
-                          std::vector<Real>& scores,
-                          std::vector<uint>& counts) const {
 
   promod3::core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
-                                "TorsionScorer::Score", 2);
+                                "TorsionScorer::CalculateScore", 2);
 
-  if(!attached_environment_){
+  if(!attached_environment_) {
     String err = "Can only calculate score when environment is attached!";
     throw promod3::Error(err);
   }
 
   // setup
-  uint bb_list_size, start_idx, end_idx;
-  idx_handler_->SetupScoreCalculation(bb_list, start_resnum, chain_idx, 
-                                      bb_list_size, start_idx, end_idx); 
+  std::vector<std::vector<uint> > indices_vec;
+  idx_handler_->SetupScoreCalculation(start_resnum, num_residues, chain_idx,
+                                      indices_vec);
 
-  scores.assign(bb_list_size, 0.0);
-  counts.assign(bb_list_size, 0);
-  if(bb_list_size == 0) return;
-
-  Real angle1, angle2;
-  uint bin1, bin2;
-  uint torsion_group_idx;
-
-  for(uint i = 1; i < bb_list_size - 1; ++i){
-    torsion_group_idx = torsion_group_indices_[start_idx + i];
-    angle1 = bb_list.GetPhiTorsion(i);
-    angle2 = bb_list.GetPsiTorsion(i);
-    bin1 = std::min(static_cast<uint>((angle1+Real(M_PI))/bin_size_),
-                                       bins_per_dimension_-1);
-    bin2 = std::min(static_cast<uint>((angle2+Real(M_PI))/bin_size_),
-                                       bins_per_dimension_-1);
-
-    scores[i] = 
-    energies_[this->EIdx(torsion_group_idx, bin1 * bins_per_dimension_ + bin2)];
-    counts[i] = 1;
+  // get scores and sum them up
+  Real score = 0.0;
+  uint n_scored_residues = 0;
+  for(uint i = 0; i < start_resnum.size(); ++i) {
+    std::vector<Real> scores;
+    this->Score(indices_vec[i], scores);
+    for (uint j = 0; j < scores.size(); ++j) {
+      score += scores[j];
+    }
+    n_scored_residues += scores.size();
   }
+  
+  if(normalize_ && n_scored_residues > 0) {
+    score /= n_scored_residues;
+  }
+
+  return score;
+}
 
-  // first handle the special case of bb_list being of size one
-  if(bb_list_size == 1){
 
-    if(start_resnum <= 1 || start_resnum >= idx_handler_->GetChainSize(chain_idx)){
-      //there's nothing we can do...
-      return;
-    }
+void TorsionScorer::CalculateScoreProfile(const std::vector<uint>& start_resnum, 
+                              const std::vector<uint>& num_residues,
+                              const std::vector<uint>& chain_idx,
+                              std::vector<std::vector<Real> >& profile) const {
+  
+  promod3::core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
+                                "TorsionScorer::CalculateScore", 2);
 
-    torsion_group_idx = torsion_group_indices_[start_idx];
+  if(!attached_environment_) {
+    String err = "Can only calculate score when environment is attached!";
+    throw promod3::Error(err);
+  }
 
-    angle1 = geom::DihedralAngle(c_pos_[start_idx - 1],
-                                 bb_list.GetN(0),
-                                 bb_list.GetCA(0), 
-                                 bb_list.GetC(0));
+  // setup
+  std::vector<std::vector<uint> > indices_vec;
+  idx_handler_->SetupScoreCalculation(start_resnum, num_residues, 
+                                      chain_idx, indices_vec);
+
+  // get scores 
+  profile.resize(start_resnum.size());
+  for(uint i = 0; i < start_resnum.size(); ++i) {
+    this->Score(indices_vec[i], profile[i]);
+  }
+}
 
-    angle2 = geom::DihedralAngle(bb_list.GetN(0),
-                                 bb_list.GetCA(0),
-                                 bb_list.GetC(0),
-                                 n_pos_[end_idx + 1]);
 
-    bin1 = std::min(static_cast<uint>((angle1+Real(M_PI))/bin_size_),
-                                       bins_per_dimension_-1);
-    bin2 = std::min(static_cast<uint>((angle2+Real(M_PI))/bin_size_),
-                                       bins_per_dimension_-1);
+void TorsionScorer::Score(const std::vector<uint>& indices,
+                          std::vector<Real>& scores) const {
 
-    scores[0] = 
-    energies_[this->EIdx(torsion_group_idx, bin1 * bins_per_dimension_ + bin2)];
-    counts[0] = 1;                                      
+  promod3::core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
+                                "TorsionScorer::Score", 2);
 
-    // that's it... since we just dealt with the only residue, the stuff below
-    // is not necessary anymore
-    return;
-  }
+  // setup
+  uint n_indices = indices.size();
 
+  scores.assign(n_indices, 0.0);
 
-  if(start_resnum > 1){
-    //check, whether the environment for the residue before the nstem is set
-    if(env_set_[start_idx - 1]){
-      torsion_group_idx = torsion_group_indices_[start_idx];
-    
-      //the data for the residues before and after get extracted from the env
-      angle1 = geom::DihedralAngle(c_pos_[start_idx - 1],
-                                   bb_list.GetN(0),
-                                   bb_list.GetCA(0), 
-                                   bb_list.GetC(0));
-        
-      angle2 = bb_list.GetPsiTorsion(0);
-      
-      bin1 = std::min(static_cast<uint>((angle1+Real(M_PI))/bin_size_),
-                                         bins_per_dimension_-1);
-      bin2 = std::min(static_cast<uint>((angle2+Real(M_PI))/bin_size_),
-                                         bins_per_dimension_-1);
+  if(n_indices == 0) return;
+
+  Real angle1, angle2;
+  uint bin1, bin2;
 
-      scores[0] = 
-      energies_[this->EIdx(torsion_group_idx, bin1 * bins_per_dimension_ + 
-                                              bin2)];
-      counts[0] = 1;
+  for(uint i = 0; i < n_indices; ++i) {
+    int my_idx = indices[i];
+
+    if(!env_set_[my_idx]) {
+      throw promod3::Error("Must set environment before scoring!");
     }
-  }
 
-  if((start_resnum + bb_list_size - 1) < idx_handler_->GetChainSize(chain_idx)){
-    //check, whether the environment for the residue after the cstem is set
-    if(env_set_[end_idx + 1]){
-      torsion_group_idx = torsion_group_indices_[end_idx];
-      
-      //the data for the residues before and after get extracted from the env
-      angle1 = bb_list.GetPhiTorsion(bb_list_size-1);
-      angle2 = geom::DihedralAngle(bb_list.GetN(bb_list_size-1),
-                                   bb_list.GetCA(bb_list_size-1),
-                                   bb_list.GetC(bb_list_size-1),
-                                   n_pos_[end_idx + 1]);
+    int my_chain_idx = idx_handler_->GetChainIdx(my_idx);
+    int my_chain_first_idx = idx_handler_->GetChainStartIdx(my_chain_idx);
+    int my_chain_last_idx = idx_handler_->GetChainLastIdx(my_chain_idx);
+
+    if(my_idx > my_chain_first_idx && env_set_[my_idx - 1] &&
+       my_idx < my_chain_last_idx && env_set_[my_idx + 1]) {
+
+      angle1 = geom::DihedralAngle(c_pos_[my_idx - 1],
+                                   n_pos_[my_idx],
+                                   ca_pos_[my_idx], 
+                                   c_pos_[my_idx]);
+
+      angle2 = geom::DihedralAngle(n_pos_[my_idx],
+                                   ca_pos_[my_idx], 
+                                   c_pos_[my_idx],
+                                   n_pos_[my_idx + 1]);
+
       bin1 = std::min(static_cast<uint>((angle1+Real(M_PI))/bin_size_),
                                          bins_per_dimension_-1);
       bin2 = std::min(static_cast<uint>((angle2+Real(M_PI))/bin_size_),
                                          bins_per_dimension_-1);
 
-      scores[bb_list_size - 1] = 
-      energies_[this->EIdx(torsion_group_idx, bin1 * bins_per_dimension_ + 
-                                              bin2)];
-      counts[bb_list_size - 1] = 1;
+      scores[i] = energies_[this->EIdx(torsion_group_indices_[my_idx], 
+                                       bin1 * bins_per_dimension_ + bin2)];   
     }
   }
 }
 
-void TorsionScorer::AttachEnvironment(BackboneScoreEnv& env){
+void TorsionScorer::AttachEnvironment(BackboneScoreEnv& env) {
 
   idx_handler_ = env.GetIdxHandlerData();
   env_set_ = env.GetEnvSetData();
   n_pos_ = env.GetNPosData();
+  ca_pos_ = env.GetCAPosData();
   c_pos_ = env.GetCPosData();
   torsion_group_indices_.assign(idx_handler_->GetNumResidues(),0);
 
   const ost::conop::AminoAcid* aa_data = env.GetAAData();
   ost::conop::AminoAcid aa_one, aa_two, aa_three;
   uint actual_idx;
-  for(uint i = 0; i < idx_handler_->GetNumChains(); ++i){
-    for(uint j = 1; j < idx_handler_->GetChainSize(i)-1; ++j){
+  for(uint i = 0; i < idx_handler_->GetNumChains(); ++i) {
+    for(uint j = 1; j < idx_handler_->GetChainSize(i)-1; ++j) {
       actual_idx = idx_handler_->GetChainStartIdx(i) + j;
       aa_one = aa_data[actual_idx - 1];
       aa_two = aa_data[actual_idx];
diff --git a/scoring/src/torsion_score.hh b/scoring/src/torsion_score.hh
index ac9f92a19a20bfe894e6a3fbccbe3bfdd2c1900a..4cd298c83dab5097d0544b8825e636b540064a3d 100644
--- a/scoring/src/torsion_score.hh
+++ b/scoring/src/torsion_score.hh
@@ -33,28 +33,36 @@ public:
 
   void SetEnergy(uint group_idx, uint phi_bin, uint psi_bin, Real e);
 
-  virtual Real CalculateScore(const loop::BackboneList& bb_list, 
-                              uint start_resnum, uint chain_idx) const;
+  virtual Real CalculateScore(uint start_resnum, uint num_residues,
+                              uint chain_idx) const;
 
-  virtual void CalculateScoreProfile(const loop::BackboneList& bb_list,
-                                     uint start_resnum, uint chain_idx,
+  virtual void CalculateScoreProfile(uint start_resnum, uint num_residues,
+                                     uint chain_idx,
                                      std::vector<Real>& profile) const;
 
+  virtual Real CalculateScore(const std::vector<uint>& start_resnum, 
+                              const std::vector<uint>& num_residues,
+                              const std::vector<uint>& chain_idx) const;
+
+  virtual void CalculateScoreProfile(const std::vector<uint>& start_resnum,
+                              const std::vector<uint>& num_residues, 
+                              const std::vector<uint>& chain_idx,
+                              std::vector<std::vector<Real> >& profile) const;
+
+  void DoNormalize(bool do_it) { normalize_ = do_it; }
+
   void AttachEnvironment(BackboneScoreEnv& env);
 
 private:
 
-  TorsionScorer(): attached_environment_(false) { }
+  TorsionScorer(): normalize_(true), attached_environment_(false) { }
 
   inline uint EIdx(uint group_idx, uint torsion_bin) const{ 
     return group_idx * bins_squared_ + torsion_bin;
   }
 
-  void Score(const loop::BackboneList& bb_list, 
-             uint start_resnum, 
-             uint chain_idx,
-             std::vector<Real>& scores,
-             std::vector<uint>& counts) const;
+  void Score(const std::vector<uint>& indices, 
+             std::vector<Real>& scores) const;
 
   // portable serialization (only stores data relevant for Load/Save!)
   // (cleanly element by element with fixed-width base-types)
@@ -83,13 +91,15 @@ private:
   Real bin_size_;
   uint index_mapper_[8000];
   Real* energies_;
+  bool normalize_;
 
-  //environment specific information, that will be set upon calling 
-  //AttachEnvironment
+  // environment specific information, that will be set upon calling 
+  // AttachEnvironment
   bool attached_environment_;
   const loop::IdxHandler* idx_handler_;
   const int* env_set_;
   const geom::Vec3* n_pos_;
+  const geom::Vec3* ca_pos_;
   const geom::Vec3* c_pos_;
   std::vector<uint> torsion_group_indices_;
 };
diff --git a/scoring/tests/test_all_atom_scorer.cc b/scoring/tests/test_all_atom_scorer.cc
index fda63b33197461508df7c1b3f70bf0606075eedf..e1736b216d42e8cd8d70ef564a89e74f45bdcf2c 100644
--- a/scoring/tests/test_all_atom_scorer.cc
+++ b/scoring/tests/test_all_atom_scorer.cc
@@ -82,7 +82,7 @@ void CheckScorer(AllAtomScorerPtr scorer, const Real exp_score) {
   BOOST_CHECK_THROW(scorer->CalculateScore(-1, 9, 0), promod3::Error);
   BOOST_CHECK_THROW(scorer->CalculateScore(1000, 9, 0), promod3::Error);
   // the first resnum, where 9 residues don't fit anymore...
-  BOOST_CHECK_THROW(scorer->CalculateScore(255, 9, 0), promod3::Error)
+  BOOST_CHECK_THROW(scorer->CalculateScore(255, 9, 0), promod3::Error);
 
   // test the actual score outcome
   BOOST_CHECK_CLOSE(scorer->CalculateScore(214, 9, 0), exp_score, Real(1e-3));
@@ -125,14 +125,14 @@ BOOST_AUTO_TEST_CASE(test_aa_interaction_score) {
   AllAtomInteractionScorerPtr scorer = LoadAllAtomInteractionScorer();
   scorer->AttachEnvironment(env);
   // NOTE: not comparable to QMEAN anymore as we halve internal ones...
-  CheckScorer(scorer, -0.00717731751502);
+  CheckScorer(scorer, -3.58627);
 }
 
 BOOST_AUTO_TEST_CASE(test_aa_packing_score) {
   promod3::loop::AllAtomEnv env = GenerateAllAtomEnv();
   AllAtomPackingScorerPtr scorer = LoadAllAtomPackingScorer();
   scorer->AttachEnvironment(env);
-  CheckScorer(scorer, -0.367893904448);
+  CheckScorer(scorer, -2.90227);
 }
 
 BOOST_AUTO_TEST_CASE(test_aa_clash_score) {
@@ -149,7 +149,7 @@ BOOST_AUTO_TEST_CASE(test_aa_clash_score2) {
   AllAtomClashScorerPtr scorer(new AllAtomClashScorer);
   scorer->AttachEnvironment(env);
   Real clash_score = scorer->CalculateScore(35, 5, 0);
-  BOOST_CHECK_CLOSE(clash_score, 1.73935568333, Real(1e-3));
+  BOOST_CHECK_CLOSE(clash_score, 14.2627, Real(1e-3));
 }
 
 BOOST_AUTO_TEST_CASE(test_aa_clash_score3) {
@@ -162,6 +162,7 @@ BOOST_AUTO_TEST_CASE(test_aa_clash_score3) {
   BOOST_CHECK_CLOSE(clash_score, 0.0, Real(1e-3));
 }
 
+
 BOOST_AUTO_TEST_CASE(test_aa_overall_scorer) {
   // setup env
   promod3::loop::AllAtomEnv env = GenerateAllAtomEnv();
@@ -188,10 +189,10 @@ BOOST_AUTO_TEST_CASE(test_aa_overall_scorer) {
                "aa_clash");
   
   // check final score// exp. score from single ones above
-  Real exp_score = 0.1 * -0.367893904448 + 0.2 * -0.00717731751502
+  Real exp_score = 0.1 * -2.90227 + 0.2 * -3.58627
                  + 0.3 * 0.0 + 1.0;
-  BOOST_CHECK_CLOSE(scorer.CalculateLinearCombination(weights, 214, 9, 0),
-                    exp_score, Real(1e-3));
+  Real calculated_score = scorer.CalculateLinearCombination(weights, 214, 9, 0);
+  BOOST_CHECK(std::abs(calculated_score - exp_score) < Real(0.00001));
 
   // check for more errors
   BOOST_CHECK(!scorer.Contains("meh"));
@@ -199,7 +200,141 @@ BOOST_AUTO_TEST_CASE(test_aa_overall_scorer) {
   weights["meh"] = 5.0;
   BOOST_CHECK_THROW(scorer.CalculateLinearCombination(weights, 214, 9, 0),
                     promod3::Error);
+}
+
+BOOST_AUTO_TEST_CASE(test_aa_normalize) {
+
+  // setup env with something that clashes
+  String pdb_name = "data/clash_test.pdb";
+  promod3::loop::AllAtomEnv env = GenerateAllAtomEnv(pdb_name, "");
+
+  // setup scorer
+  AllAtomOverallScorer scorer;
+  // setup weights
+  std::map<String, Real> weights;
+  weights["aa_packing"] = 1.0;
+  weights["aa_interaction"] = 1.0;
+  weights["aa_clash"] = 1.0;
+
+  AllAtomPackingScorerPtr packing_scorer = LoadAllAtomPackingScorer();
+  AllAtomInteractionScorerPtr interaction_scorer = LoadAllAtomInteractionScorer();
+  AllAtomClashScorerPtr clash_scorer = AllAtomClashScorerPtr(new AllAtomClashScorer);  
+
+  scorer["aa_packing"] = packing_scorer;
+  scorer["aa_interaction"] = interaction_scorer;
+  scorer["aa_clash"] = clash_scorer;
+
+  scorer.AttachEnvironment(env);
+
+  Real exp_score = scorer.CalculateLinearCombination(weights, 2, 44, 0);
+
+  packing_scorer->DoNormalize(false);
+  interaction_scorer->DoNormalize(false);
+  clash_scorer->DoNormalize(false);
+
+  BOOST_CHECK_CLOSE(scorer.CalculateLinearCombination(weights, 2, 44, 0), 
+                    44 * exp_score, 1e-3);
+}
+
+
+BOOST_AUTO_TEST_CASE(test_aa_internal_external) {
+
+  // setup env with something that clashes
+  String pdb_name = "data/clash_test.pdb";
+  promod3::loop::AllAtomEnv env = GenerateAllAtomEnv(pdb_name, "");
+
+  // load scorere (only the ones that provide the internal / external mechanism)
+  AllAtomInteractionScorerPtr interaction_scorer = 
+  LoadAllAtomInteractionScorer();
+  AllAtomClashScorerPtr clash_scorer = 
+  AllAtomClashScorerPtr(new AllAtomClashScorer);
+  interaction_scorer->AttachEnvironment(env);
+  clash_scorer->AttachEnvironment(env);
+
+  // lets do the overall score... this should be well tested by now
+  Real interaction_score = interaction_scorer->CalculateScore(2, 44, 0);
+  Real clash_score = clash_scorer->CalculateScore(2, 44, 0);
+
+  // lets do the internal scores
+  interaction_scorer->DoExternalScores(false);
+  clash_scorer->DoExternalScores(false);
+  Real internal_interaction_score = 
+  interaction_scorer->CalculateScore(2, 44, 0);
+  Real internal_clash_score =
+  clash_scorer->CalculateScore(2, 44, 0);
+
+  // lets do the external scores
+  interaction_scorer->DoExternalScores(true);
+  clash_scorer->DoExternalScores(true);
+  interaction_scorer->DoInternalScores(false);
+  clash_scorer->DoInternalScores(false);
+  Real external_interaction_score = 
+  interaction_scorer->CalculateScore(2, 44, 0);
+  Real external_clash_score =
+  clash_scorer->CalculateScore(2, 44, 0);
+
+  // the sum between the internal and external score must be the total score
+  BOOST_CHECK_CLOSE(internal_interaction_score + external_interaction_score, 
+                    interaction_score, Real(1e-3));
+  BOOST_CHECK_CLOSE(internal_clash_score + external_clash_score, 
+                    clash_score, Real(1e-3));
+
+  // Do internal AND external scores and kill the full environment except the 
+  // actual loop to score. As a result, we should get the previously calculated
+  // INTERNAL score.
+  interaction_scorer->DoInternalScores(true);
+  clash_scorer->DoExternalScores(true);
+  interaction_scorer->DoInternalScores(true);
+  clash_scorer->DoExternalScores(true); 
+  promod3::loop::AllAtomEnvPositionsPtr env_pos_only_loop = 
+  env.GetEnvironment(2, 44, 0);
+  env.ClearEnvironment(1, env.GetIdxHandlerData()->GetChainSize(0), 0);
+  env.SetEnvironment(*env_pos_only_loop);
+  BOOST_CHECK_CLOSE(interaction_scorer->CalculateScore(2, 44, 0),
+                    internal_interaction_score, Real(1e-3));
+  BOOST_CHECK_CLOSE(clash_scorer->CalculateScore(2, 44, 0),
+                    internal_clash_score, Real(1e-3));
+}
+
+BOOST_AUTO_TEST_CASE(test_aa_multiple_stretches) {
+
+  // setup env with something that clashes
+  String pdb_name = "data/clash_test.pdb";
+  promod3::loop::AllAtomEnv env = GenerateAllAtomEnv(pdb_name, "");
+
+  // setup scorer
+  AllAtomOverallScorer scorer;
+  // setup weights
+  std::map<String, Real> weights;
+  weights["aa_packing"] = 1.0;
+  weights["aa_interaction"] = 1.0;
+  weights["aa_clash"] = 1.0;
+
+  AllAtomPackingScorerPtr packing_scorer = LoadAllAtomPackingScorer();
+  AllAtomInteractionScorerPtr interaction_scorer = LoadAllAtomInteractionScorer();
+  AllAtomClashScorerPtr clash_scorer = AllAtomClashScorerPtr(new AllAtomClashScorer);  
+
+  scorer["aa_packing"] = packing_scorer;
+  scorer["aa_interaction"] = interaction_scorer;
+  scorer["aa_clash"] = clash_scorer;
+
+  scorer.AttachEnvironment(env);
+
+  Real exp_score = scorer.CalculateLinearCombination(weights, 2, 44, 0);
+
+  std::vector<uint> start_resnums;
+  std::vector<uint> stretch_lengths;
+  std::vector<uint> chain_indices;
+  uint first_stretch_length = 20;
+  start_resnums.push_back(2);
+  start_resnums.push_back(2 + first_stretch_length);
+  stretch_lengths.push_back(first_stretch_length);
+  stretch_lengths.push_back(44 - first_stretch_length);
+  chain_indices.push_back(0);
+  chain_indices.push_back(0);
 
+  BOOST_CHECK_CLOSE(scorer.CalculateLinearCombination(weights, start_resnums,
+                    stretch_lengths, chain_indices), exp_score, 1e-3);
 }
 
 BOOST_AUTO_TEST_SUITE_END();
diff --git a/scoring/tests/test_backbone_scorer.cc b/scoring/tests/test_backbone_scorer.cc
index 6886e0e13a806553755137927b6c2334b6f613bc..49922b4b65c3292dcf9b519bb4d96c2b0d80ba4c 100644
--- a/scoring/tests/test_backbone_scorer.cc
+++ b/scoring/tests/test_backbone_scorer.cc
@@ -119,27 +119,61 @@ void SetPsipredPrediction(BackboneScoreEnv& env) {
 // check scorer calls for def. bb_list
 void CheckScorerThrows(const promod3::loop::BackboneList& bb_list,
                        BackboneScorerPtr scorer) {
+
   // test check of chain_idx
-  BOOST_CHECK_THROW(scorer->CalculateScore(bb_list, 214, -1), promod3::Error);
-  BOOST_CHECK_THROW(scorer->CalculateScore(bb_list, 214, 1), promod3::Error);
+  BOOST_CHECK_THROW(scorer->CalculateScore(214, bb_list.size(), -1), promod3::Error);
+  BOOST_CHECK_THROW(scorer->CalculateScore(214, bb_list.size(), 1), promod3::Error);
 
   // test check of start resnum
-  BOOST_CHECK_THROW(scorer->CalculateScore(bb_list, 0, 0), promod3::Error);
-  BOOST_CHECK_THROW(scorer->CalculateScore(bb_list, -1, 0), promod3::Error);
-  BOOST_CHECK_THROW(scorer->CalculateScore(bb_list, 1000, 0), promod3::Error);
+  BOOST_CHECK_THROW(scorer->CalculateScore(0, bb_list.size(),  0), promod3::Error);
+  BOOST_CHECK_THROW(scorer->CalculateScore(-1, bb_list.size(),  0), promod3::Error);
+  BOOST_CHECK_THROW(scorer->CalculateScore(1000, bb_list.size(),  0), promod3::Error);
   // the first resnum, where the bb_list doesn't fit anymore...
-  BOOST_CHECK_THROW(scorer->CalculateScore(bb_list, 255, 0), promod3::Error)
+  BOOST_CHECK_THROW(scorer->CalculateScore(255, bb_list.size(), 0), promod3::Error);
 
   // check that empty BB list gives score of 0 (always)
   promod3::loop::BackboneList sub_bb_list;
-  BOOST_CHECK_EQUAL(scorer->CalculateScore(sub_bb_list, 214, 0), Real(0));
+  BOOST_CHECK_EQUAL(scorer->CalculateScore(214, sub_bb_list.size(), 0), Real(0));
   // check that border cases don't break
   if (bb_list.size() > 1) {
     sub_bb_list = bb_list.Extract(0, 1);
-    BOOST_CHECK_NO_THROW(scorer->CalculateScore(sub_bb_list, 214, 0));
+    BOOST_CHECK_NO_THROW(scorer->CalculateScore(214, sub_bb_list.size(), 0));
     sub_bb_list = bb_list.Extract(0, 2);
-    BOOST_CHECK_NO_THROW(scorer->CalculateScore(sub_bb_list, 214, 0));
+    BOOST_CHECK_NO_THROW(scorer->CalculateScore(214, sub_bb_list.size(), 0));
   }
+
+  std::vector<uint> start_resnum(1);
+  std::vector<uint> chain_idx(1);
+  std::vector<uint> num_residues(1);
+  num_residues[0] = bb_list.size();
+
+  // test check of chain_idx
+  start_resnum[0] = 214;
+  chain_idx[0] = -1;
+  BOOST_CHECK_THROW(scorer->CalculateScore(start_resnum, num_residues, chain_idx), 
+                                           promod3::Error);
+  chain_idx[0] = 1;
+  BOOST_CHECK_THROW(scorer->CalculateScore(start_resnum, num_residues, chain_idx), 
+                                           promod3::Error);
+
+  // test check of start resnum
+  chain_idx[0] = 0;
+  start_resnum[0] = 0;
+  BOOST_CHECK_THROW(scorer->CalculateScore(start_resnum, num_residues, chain_idx), 
+                                           promod3::Error); 
+
+  start_resnum[0] = -1;
+  BOOST_CHECK_THROW(scorer->CalculateScore(start_resnum, num_residues, chain_idx), 
+                                           promod3::Error);  
+
+  start_resnum[0] = 1000;
+  BOOST_CHECK_THROW(scorer->CalculateScore(start_resnum, num_residues, chain_idx), 
+                                           promod3::Error);  
+
+  start_resnum[0] = 255;
+  // the first resnum, where the bb_list doesn't fit anymore...
+  BOOST_CHECK_THROW(scorer->CalculateScore(start_resnum, num_residues, chain_idx), 
+                                           promod3::Error);
 }
 
 // check overall scorer on a single score
@@ -148,12 +182,12 @@ void SanityCheckOverallScorer(BackboneOverallScorer& scorer,
                               const promod3::loop::BackboneList& bb_list,
                               const String& key) {
   // ref = single score
-  Real ref_score = single_scorer->CalculateScore(bb_list, 214, 0);
-  Real score = scorer.Calculate(key, bb_list, 214, 0);
+  Real ref_score = single_scorer->CalculateScore(214, bb_list.size(), 0);
+  Real score = scorer.Calculate(key, 214, bb_list.size(), 0);
   BOOST_CHECK_CLOSE(score, ref_score, Real(1e-3));
   std::map<String, Real> weights;
   weights[key] = 1.0;
-  score = scorer.CalculateLinearCombination(weights, bb_list, 214, 0);
+  score = scorer.CalculateLinearCombination(weights, 214, bb_list.size(), 0);
   BOOST_CHECK_CLOSE(score, ref_score, Real(1e-3));
 }
 
@@ -228,36 +262,37 @@ BOOST_AUTO_TEST_CASE(qmean_comparison) {
   orig_cb_packing.push_back(-0.6673);
   
   std::vector<Real> orig_cb;
-  orig_cb.push_back(-0.0190);
-  orig_cb.push_back(0.0398);
-  orig_cb.push_back(-0.0456);
-  orig_cb.push_back(0.0262);
-  orig_cb.push_back(-0.0427);
-  orig_cb.push_back(-0.0237);
-  orig_cb.push_back(-0.0228);
-  orig_cb.push_back(-0.0182);
-  orig_cb.push_back(0.0809);
-  orig_cb.push_back(0.0577);
-  orig_cb.push_back(0.0107);
-  orig_cb.push_back(-0.0284);
-  orig_cb.push_back(-0.0311);
-  orig_cb.push_back(0.0025);
+  orig_cb.push_back(-0.342035);
+  orig_cb.push_back(0.238565);
+  orig_cb.push_back(-0.410386);
+  orig_cb.push_back(0.340058);
+  orig_cb.push_back(-0.341305);
+  orig_cb.push_back(-0.0710439);
+  orig_cb.push_back(-0.0911381);
+  orig_cb.push_back(-0.0181578);
+  orig_cb.push_back(0.808517);
+  orig_cb.push_back(0.461206);
+  orig_cb.push_back(0.139356);
+  orig_cb.push_back(-0.482617);
+  orig_cb.push_back(-0.497085);
+  orig_cb.push_back(0.0492029);
+
   
   std::vector<Real> orig_reduced;
-  orig_reduced.push_back(-0.2539);
-  orig_reduced.push_back(0.0478);
-  orig_reduced.push_back(-0.5097);
-  orig_reduced.push_back(-0.4198);
-  orig_reduced.push_back(-0.2336);
-  orig_reduced.push_back(-0.3308);
-  orig_reduced.push_back(0.1811);
-  orig_reduced.push_back(-0.9057);
-  orig_reduced.push_back(-0.0299);
-  orig_reduced.push_back(-0.3473);
-  orig_reduced.push_back(-0.2229);
-  orig_reduced.push_back(-0.2734);
-  orig_reduced.push_back(-0.4254);
-  orig_reduced.push_back(-0.5835);
+  orig_reduced.push_back(-3.55399);
+  orig_reduced.push_back(0.52569);
+  orig_reduced.push_back(-5.0972);
+  orig_reduced.push_back(-5.45686);
+  orig_reduced.push_back(-1.86842);
+  orig_reduced.push_back(-0.992303);
+  orig_reduced.push_back(0.543362);
+  orig_reduced.push_back(-3.62267);
+  orig_reduced.push_back(-0.268999);
+  orig_reduced.push_back(-4.16786);
+  orig_reduced.push_back(-2.89717);
+  orig_reduced.push_back(-4.37486);
+  orig_reduced.push_back(-7.23112);
+  orig_reduced.push_back(-10.5035);
   
   std::vector<Real> orig_torsion;
   orig_torsion.push_back(0.4922);
@@ -323,37 +358,37 @@ BOOST_AUTO_TEST_CASE(qmean_comparison) {
   reset_cb_packing.push_back(-0.4551);
   reset_cb_packing.push_back(-0.6673);
   
-  std::vector<Real> reset_cb;
-  reset_cb.push_back(-0.0164);
-  reset_cb.push_back(0.0530);
-  reset_cb.push_back(-0.0599);
-  reset_cb.push_back(-0.0247);
-  reset_cb.push_back(-0.0476);
-  reset_cb.push_back(-0.0220);
-  reset_cb.push_back(-0.0719);
-  reset_cb.push_back(-0.0463);
-  reset_cb.push_back(-0.0082);
-  reset_cb.push_back(0.0286);
-  reset_cb.push_back(0.0067);
-  reset_cb.push_back(-0.0284);
-  reset_cb.push_back(-0.0311);
-  reset_cb.push_back(0.0025);
-  
+  std::vector<Real> reset_cb;  
+  reset_cb.push_back(-0.32877);
+  reset_cb.push_back(0.371232);
+  reset_cb.push_back(-0.479475);
+  reset_cb.push_back(-0.369955);
+  reset_cb.push_back(-0.428097);
+  reset_cb.push_back(-0.0879088);
+  reset_cb.push_back(-0.43112);
+  reset_cb.push_back(-0.324168);
+  reset_cb.push_back(-0.0822164);
+  reset_cb.push_back(0.228412);
+  reset_cb.push_back(0.0871677);
+  reset_cb.push_back(-0.510713);
+  reset_cb.push_back(-0.497085);
+  reset_cb.push_back(0.0492029);
+
   std::vector<Real> reset_reduced;
-  reset_reduced.push_back(-0.2078);
-  reset_reduced.push_back(0.1609);
-  reset_reduced.push_back(-0.1293);
-  reset_reduced.push_back(-0.3096);
-  reset_reduced.push_back(-0.1068);
-  reset_reduced.push_back(-0.0871);
-  reset_reduced.push_back(0.1635);
-  reset_reduced.push_back(0.3477);
-  reset_reduced.push_back(-0.1095);
-  reset_reduced.push_back(-0.2002);
-  reset_reduced.push_back(-0.2179);
-  reset_reduced.push_back(-0.2680);
-  reset_reduced.push_back(-0.4254);
-  reset_reduced.push_back(-0.5835);
+  reset_reduced.push_back(-3.32411);
+  reset_reduced.push_back(1.60945);
+  reset_reduced.push_back(-1.03455);
+  reset_reduced.push_back(-4.02522);
+  reset_reduced.push_back(-0.961522);
+  reset_reduced.push_back(-0.435582);
+  reset_reduced.push_back(0.653847);
+  reset_reduced.push_back(1.73842);
+  reset_reduced.push_back(-0.985268);
+  reset_reduced.push_back(-2.20225);
+  reset_reduced.push_back(-2.83298);
+  reset_reduced.push_back(-4.28751);
+  reset_reduced.push_back(-7.23112);
+  reset_reduced.push_back(-10.5035);
   
   std::vector<Real> reset_torsion;
   reset_torsion.push_back(1.0555);
@@ -420,36 +455,37 @@ BOOST_AUTO_TEST_CASE(qmean_comparison) {
   deleted_cb_packing.push_back(-0.9996);
   
   std::vector<Real> deleted_cb;
-  deleted_cb.push_back(-0.0237);
-  deleted_cb.push_back(0.0723);
-  deleted_cb.push_back(-0.0599);
-  deleted_cb.push_back(-0.0199);
-  deleted_cb.push_back(-0.0552);
-  deleted_cb.push_back(-0.0220);
-  deleted_cb.push_back(-0.0719);
-  deleted_cb.push_back(-0.0342);
-  deleted_cb.push_back(-0.0096);
-  deleted_cb.push_back(0.0040);
-  deleted_cb.push_back(-0.0154);
-  deleted_cb.push_back(-0.0371);
-  deleted_cb.push_back(-0.0592);
-  deleted_cb.push_back(0.0104);
+  deleted_cb.push_back(-0.379758);
+  deleted_cb.push_back(0.433782);
+  deleted_cb.push_back(-0.479475);
+  deleted_cb.push_back(-0.27818);
+  deleted_cb.push_back(-0.386644);
+  deleted_cb.push_back(-0.0879088);
+  deleted_cb.push_back(-0.43112);
+  deleted_cb.push_back(-0.20509);
+  deleted_cb.push_back(-0.0771105);
+  deleted_cb.push_back(0.0200806);
+  deleted_cb.push_back(-0.122916);
+  deleted_cb.push_back(-0.482669);
+  deleted_cb.push_back(-0.710032);
+  deleted_cb.push_back(0.175955);
+
   
   std::vector<Real> deleted_reduced;
-  deleted_reduced.push_back(-0.1452);
-  deleted_reduced.push_back(0.1925);
-  deleted_reduced.push_back(-0.1293);
-  deleted_reduced.push_back(-0.2941);
-  deleted_reduced.push_back(-0.1385);
-  deleted_reduced.push_back(-0.0871);
-  deleted_reduced.push_back(0.1635);
-  deleted_reduced.push_back(0.3477);
-  deleted_reduced.push_back(-0.0969);
-  deleted_reduced.push_back(-0.0898);
-  deleted_reduced.push_back(-0.0146);
-  deleted_reduced.push_back(-0.2886);
-  deleted_reduced.push_back(-0.4334);
-  deleted_reduced.push_back(-0.4495);
+  deleted_reduced.push_back(-1.88819);
+  deleted_reduced.push_back(1.73243);
+  deleted_reduced.push_back(-1.03455);
+  deleted_reduced.push_back(-3.52878);
+  deleted_reduced.push_back(-0.96916);
+  deleted_reduced.push_back(-0.435582);
+  deleted_reduced.push_back(0.653847);
+  deleted_reduced.push_back(1.73842);
+  deleted_reduced.push_back(-0.678642);
+  deleted_reduced.push_back(-0.628393);
+  deleted_reduced.push_back(-0.116555);
+  deleted_reduced.push_back(-3.17463);
+  deleted_reduced.push_back(-5.63371);
+  deleted_reduced.push_back(-6.74281);
   
   std::vector<Real> deleted_torsion;
   deleted_torsion.push_back(1.0555);
@@ -507,18 +543,19 @@ BOOST_AUTO_TEST_CASE(qmean_comparison) {
   std::vector<Real> ss_agreement_profile;
 
   // compare the orig values
-  cb_packing_scorer->CalculateScoreProfile(bb_list, 26, 0, 
+  cb_packing_scorer->CalculateScoreProfile(26, bb_list.size(), 0, 
                                            cb_packing_profile);
-  cb_scorer->CalculateScoreProfile(bb_list, 26, 0, 
+  cb_scorer->CalculateScoreProfile(26, bb_list.size(), 0, 
                                    cb_profile);
-  reduced_scorer->CalculateScoreProfile(bb_list, 26, 0, 
+  reduced_scorer->CalculateScoreProfile(26, bb_list.size(), 0, 
                                         reduced_profile);
-  torsion_scorer->CalculateScoreProfile(bb_list, 26, 0, 
+  torsion_scorer->CalculateScoreProfile(26, bb_list.size(), 0, 
                                         torsion_profile);
-  hbond_scorer->CalculateScoreProfile(bb_list, 26, 0, 
+  hbond_scorer->CalculateScoreProfile(26, bb_list.size(), 0, 
                                       hbond_profile);
-  ss_agreement_scorer->CalculateScoreProfile(bb_list, 26, 0, 
+  ss_agreement_scorer->CalculateScoreProfile(26, bb_list.size(), 0, 
                                              ss_agreement_profile);
+
   Real eps = 0.0001;
   for(uint i = 0; i < bb_list.size(); ++i) {
     BOOST_CHECK_SMALL(std::abs(orig_cb_packing[i] - 
@@ -545,18 +582,21 @@ BOOST_AUTO_TEST_CASE(qmean_comparison) {
   bb_list.ReplaceFragment(bb_list_helix, 0, false);
 
   // compare the reset values
-  cb_packing_scorer->CalculateScoreProfile(bb_list, 26, 0, 
+  cb_packing_scorer->CalculateScoreProfile(26, bb_list.size(), 0, 
                                            cb_packing_profile);
-  cb_scorer->CalculateScoreProfile(bb_list, 26, 0, 
+  cb_scorer->CalculateScoreProfile(26, bb_list.size(), 0, 
                                    cb_profile);
-  reduced_scorer->CalculateScoreProfile(bb_list, 26, 0, 
+  reduced_scorer->CalculateScoreProfile(26, bb_list.size(), 0, 
                                         reduced_profile);
-  torsion_scorer->CalculateScoreProfile(bb_list, 26, 0, 
+  torsion_scorer->CalculateScoreProfile(26, bb_list.size(), 0, 
                                         torsion_profile);
-  hbond_scorer->CalculateScoreProfile(bb_list, 26, 0, 
+  hbond_scorer->CalculateScoreProfile(26, bb_list.size(), 0, 
                                       hbond_profile);
-  ss_agreement_scorer->CalculateScoreProfile(bb_list, 26, 0, 
+
+  ss_agreement_scorer->CalculateScoreProfile(26, bb_list.size(), 0, 
                                              ss_agreement_profile);
+
+
   for(uint i = 0; i < bb_list.size(); ++i) {
     BOOST_CHECK_SMALL(std::abs(reset_cb_packing[i] - 
                                cb_packing_profile[i]), eps);
@@ -576,18 +616,20 @@ BOOST_AUTO_TEST_CASE(qmean_comparison) {
   env.ClearEnvironment(83, 6);
 
   // compare the delete values
-  cb_packing_scorer->CalculateScoreProfile(bb_list, 26, 0, 
+  cb_packing_scorer->CalculateScoreProfile(26, bb_list.size(), 0, 
                                            cb_packing_profile);
-  cb_scorer->CalculateScoreProfile(bb_list, 26, 0, 
+  cb_scorer->CalculateScoreProfile(26, bb_list.size(), 0, 
                                    cb_profile);
-  reduced_scorer->CalculateScoreProfile(bb_list, 26, 0, 
+  reduced_scorer->CalculateScoreProfile(26, bb_list.size(), 0, 
                                         reduced_profile);
-  torsion_scorer->CalculateScoreProfile(bb_list, 26, 0, 
+  torsion_scorer->CalculateScoreProfile(26, bb_list.size(), 0, 
                                         torsion_profile);
-  hbond_scorer->CalculateScoreProfile(bb_list, 26, 0, 
+  hbond_scorer->CalculateScoreProfile(26, bb_list.size(), 0, 
                                       hbond_profile);
-  ss_agreement_scorer->CalculateScoreProfile(bb_list, 26, 0, 
+  ss_agreement_scorer->CalculateScoreProfile(26, bb_list.size(), 0, 
                                              ss_agreement_profile);
+
+
   for(uint i = 0; i < bb_list.size(); ++i) {
     BOOST_CHECK_SMALL(std::abs(deleted_cb_packing[i] - 
                                cb_packing_profile[i]), eps);
@@ -604,6 +646,377 @@ BOOST_AUTO_TEST_CASE(qmean_comparison) {
   }                                  
 }
 
+BOOST_AUTO_TEST_CASE(test_env_stashing) {
+
+  // Same test as above, but this time we use some stash / pop
+  // magic from the BackboneScoreEnv
+  BackboneScoreEnv env = GenerateBackboneEnv();
+  promod3::loop::BackboneList bb_list = GenerateTestBBList("data/3DEFA.pdb",
+                                                           26, 40);
+
+  CBPackingScorerPtr cb_packing_scorer = LoadCBPackingScorer();
+  CBetaScorerPtr cb_scorer = LoadCBetaScorer();
+  ReducedScorerPtr reduced_scorer = LoadReducedScorer();
+  HBondScorerPtr hbond_scorer = LoadHBondScorer();
+  SSAgreementScorerPtr ss_agreement_scorer = LoadSSAgreementScorer();
+  SetPsipredPrediction(env);
+  TorsionScorerPtr torsion_scorer = LoadTorsionScorer();
+
+  cb_packing_scorer->AttachEnvironment(env);
+  cb_scorer->AttachEnvironment(env);
+  reduced_scorer->AttachEnvironment(env);
+  hbond_scorer->AttachEnvironment(env);
+  ss_agreement_scorer->AttachEnvironment(env);
+  torsion_scorer->AttachEnvironment(env);
+
+  // orig means: the current environment
+  // reset means: 8 residues starting from resnum 26 are replaced by a helix as 
+  //              it is constructed in the default constructor of the
+  //              BackboneList. Positioning is performed by superposing first
+  //              helix residue on current residue 26    
+
+  std::vector<Real> orig_cb_packing;
+  orig_cb_packing.push_back(-1.0796);
+  orig_cb_packing.push_back(-0.5889);
+  orig_cb_packing.push_back(-0.8458);
+  orig_cb_packing.push_back(-0.9514);
+  orig_cb_packing.push_back(-0.6117);
+  orig_cb_packing.push_back(-0.7100);
+  orig_cb_packing.push_back(-0.9639);
+  orig_cb_packing.push_back(-0.5944);
+  orig_cb_packing.push_back(-0.5149);
+  orig_cb_packing.push_back(-1.0095);
+  orig_cb_packing.push_back(-0.8998);
+  orig_cb_packing.push_back(-0.9830);
+  orig_cb_packing.push_back(-0.4551);
+  orig_cb_packing.push_back(-0.6673);
+  
+  std::vector<Real> orig_cb;
+  orig_cb.push_back(-0.342035);
+  orig_cb.push_back(0.238565);
+  orig_cb.push_back(-0.410386);
+  orig_cb.push_back(0.340058);
+  orig_cb.push_back(-0.341305);
+  orig_cb.push_back(-0.0710439);
+  orig_cb.push_back(-0.0911381);
+  orig_cb.push_back(-0.0181578);
+  orig_cb.push_back(0.808517);
+  orig_cb.push_back(0.461206);
+  orig_cb.push_back(0.139356);
+  orig_cb.push_back(-0.482617);
+  orig_cb.push_back(-0.497085);
+  orig_cb.push_back(0.0492029);
+
+  
+  std::vector<Real> orig_reduced;
+  orig_reduced.push_back(-3.55399);
+  orig_reduced.push_back(0.52569);
+  orig_reduced.push_back(-5.0972);
+  orig_reduced.push_back(-5.45686);
+  orig_reduced.push_back(-1.86842);
+  orig_reduced.push_back(-0.992303);
+  orig_reduced.push_back(0.543362);
+  orig_reduced.push_back(-3.62267);
+  orig_reduced.push_back(-0.268999);
+  orig_reduced.push_back(-4.16786);
+  orig_reduced.push_back(-2.89717);
+  orig_reduced.push_back(-4.37486);
+  orig_reduced.push_back(-7.23112);
+  orig_reduced.push_back(-10.5035);
+  
+  std::vector<Real> orig_torsion;
+  orig_torsion.push_back(0.4922);
+  orig_torsion.push_back(0.4896);
+  orig_torsion.push_back(0.9574);
+  orig_torsion.push_back(-0.4831);
+  orig_torsion.push_back(-0.5004);
+  orig_torsion.push_back(-0.4875);
+  orig_torsion.push_back(-0.4739);
+  orig_torsion.push_back(-0.7882);
+  orig_torsion.push_back(0.3369);
+  orig_torsion.push_back(-0.8233);
+  orig_torsion.push_back(-0.4457);
+  orig_torsion.push_back(-0.4084);
+  orig_torsion.push_back(-1.1914);
+  orig_torsion.push_back(-1.1170);
+  
+  std::vector<Real> orig_hbond;
+  orig_hbond.push_back(-1.5817);
+  orig_hbond.push_back(-1.4568);
+  orig_hbond.push_back(-2.7138);
+  orig_hbond.push_back(-2.9179);
+  orig_hbond.push_back(-1.4514);
+  orig_hbond.push_back(-1.1016);
+  orig_hbond.push_back(-2.6790);
+  orig_hbond.push_back(-0.4062);
+  orig_hbond.push_back(-0.9520);
+  orig_hbond.push_back(-0.9263);
+  orig_hbond.push_back(0.0000);
+  orig_hbond.push_back(-1.6571);
+  orig_hbond.push_back(-1.0162);
+  orig_hbond.push_back(-1.7538);
+  
+  std::vector<Real> orig_ss_agreement;
+  orig_ss_agreement.push_back(1.0960);
+  orig_ss_agreement.push_back(1.0960);
+  orig_ss_agreement.push_back(1.0960);
+  orig_ss_agreement.push_back(0.9231);
+  orig_ss_agreement.push_back(0.9231);
+  orig_ss_agreement.push_back(0.6663);
+  orig_ss_agreement.push_back(0.2756);
+  orig_ss_agreement.push_back(0.4928);
+  orig_ss_agreement.push_back(0.7852);
+  orig_ss_agreement.push_back(0.7852);
+  orig_ss_agreement.push_back(-0.9896);
+  orig_ss_agreement.push_back(-0.1106);
+  orig_ss_agreement.push_back(1.3440);
+  orig_ss_agreement.push_back(1.4422);
+  
+  std::vector<Real> reset_cb_packing;
+  reset_cb_packing.push_back(-1.0796);
+  reset_cb_packing.push_back(-0.4539);
+  reset_cb_packing.push_back(-1.0485);
+  reset_cb_packing.push_back(-0.9514);
+  reset_cb_packing.push_back(-0.6117);
+  reset_cb_packing.push_back(-0.7100);
+  reset_cb_packing.push_back(-0.9639);
+  reset_cb_packing.push_back(-0.9962);
+  reset_cb_packing.push_back(-0.5149);
+  reset_cb_packing.push_back(-0.7859);
+  reset_cb_packing.push_back(-0.8998);
+  reset_cb_packing.push_back(-0.9830);
+  reset_cb_packing.push_back(-0.4551);
+  reset_cb_packing.push_back(-0.6673);
+  
+  std::vector<Real> reset_cb;  
+  reset_cb.push_back(-0.32877);
+  reset_cb.push_back(0.371232);
+  reset_cb.push_back(-0.479475);
+  reset_cb.push_back(-0.369955);
+  reset_cb.push_back(-0.428097);
+  reset_cb.push_back(-0.0879088);
+  reset_cb.push_back(-0.43112);
+  reset_cb.push_back(-0.324168);
+  reset_cb.push_back(-0.0822164);
+  reset_cb.push_back(0.228412);
+  reset_cb.push_back(0.0871677);
+  reset_cb.push_back(-0.510713);
+  reset_cb.push_back(-0.497085);
+  reset_cb.push_back(0.0492029);
+
+  std::vector<Real> reset_reduced;
+  reset_reduced.push_back(-3.32411);
+  reset_reduced.push_back(1.60945);
+  reset_reduced.push_back(-1.03455);
+  reset_reduced.push_back(-4.02522);
+  reset_reduced.push_back(-0.961522);
+  reset_reduced.push_back(-0.435582);
+  reset_reduced.push_back(0.653847);
+  reset_reduced.push_back(1.73842);
+  reset_reduced.push_back(-0.985268);
+  reset_reduced.push_back(-2.20225);
+  reset_reduced.push_back(-2.83298);
+  reset_reduced.push_back(-4.28751);
+  reset_reduced.push_back(-7.23112);
+  reset_reduced.push_back(-10.5035);
+  
+  std::vector<Real> reset_torsion;
+  reset_torsion.push_back(1.0555);
+  reset_torsion.push_back(0.5257);
+  reset_torsion.push_back(0.6707);
+  reset_torsion.push_back(-0.4831);
+  reset_torsion.push_back(-0.4842);
+  reset_torsion.push_back(-0.4924);
+  reset_torsion.push_back(0.1419);
+  reset_torsion.push_back(4.7277);
+  reset_torsion.push_back(4.5157);
+  reset_torsion.push_back(-0.8233);
+  reset_torsion.push_back(-0.4457);
+  reset_torsion.push_back(-0.4084);
+  reset_torsion.push_back(-1.1914);
+  reset_torsion.push_back(-1.1170);
+  
+  std::vector<Real> reset_hbond;
+  reset_hbond.push_back(-1.3101);
+  reset_hbond.push_back(-0.9559);
+  reset_hbond.push_back(-1.2444);
+  reset_hbond.push_back(-1.8388);
+  reset_hbond.push_back(-0.9559);
+  reset_hbond.push_back(-0.9559);
+  reset_hbond.push_back(-0.9559);
+  reset_hbond.push_back(-0.4811);
+  reset_hbond.push_back(0.0000);
+  reset_hbond.push_back(-0.9263);
+  reset_hbond.push_back(0.0000);
+  reset_hbond.push_back(-1.6571);
+  reset_hbond.push_back(-1.0162);
+  reset_hbond.push_back(-1.7538);
+  
+  std::vector<Real> reset_ss_agreement;
+  reset_ss_agreement.push_back(1.0960);
+  reset_ss_agreement.push_back(1.0960);
+  reset_ss_agreement.push_back(1.0960);
+  reset_ss_agreement.push_back(0.9231);
+  reset_ss_agreement.push_back(0.9231);
+  reset_ss_agreement.push_back(0.6663);
+  reset_ss_agreement.push_back(-0.7839);
+  reset_ss_agreement.push_back(0.5699);
+  reset_ss_agreement.push_back(0.7852);
+  reset_ss_agreement.push_back(0.7852);
+  reset_ss_agreement.push_back(-0.9896);
+  reset_ss_agreement.push_back(-0.1106);
+  reset_ss_agreement.push_back(1.3440);
+  reset_ss_agreement.push_back(1.4422);
+  
+  std::vector<Real> cb_packing_profile;
+  std::vector<Real> cb_profile;
+  std::vector<Real> reduced_profile;
+  std::vector<Real> torsion_profile;
+  std::vector<Real> hbond_profile;
+  std::vector<Real> ss_agreement_profile;
+
+  // compare the orig values
+  cb_packing_scorer->CalculateScoreProfile(26, bb_list.size(), 0, 
+                                           cb_packing_profile);
+  cb_scorer->CalculateScoreProfile(26, bb_list.size(), 0, 
+                                   cb_profile);
+  reduced_scorer->CalculateScoreProfile(26, bb_list.size(), 0, 
+                                        reduced_profile);
+  torsion_scorer->CalculateScoreProfile(26, bb_list.size(), 0, 
+                                        torsion_profile);
+  hbond_scorer->CalculateScoreProfile(26, bb_list.size(), 0, 
+                                      hbond_profile);
+  ss_agreement_scorer->CalculateScoreProfile(26, bb_list.size(), 0, 
+                                             ss_agreement_profile);
+
+  Real eps = 0.0001;
+  for(uint i = 0; i < bb_list.size(); ++i) {
+    BOOST_CHECK_SMALL(std::abs(orig_cb_packing[i] - 
+                               cb_packing_profile[i]), eps);
+    BOOST_CHECK_SMALL(std::abs(orig_cb[i] - 
+                               cb_profile[i]), eps);
+    BOOST_CHECK_SMALL(std::abs(orig_reduced[i] - 
+                               reduced_profile[i]), eps);
+    BOOST_CHECK_SMALL(std::abs(orig_torsion[i] - 
+                               torsion_profile[i]), eps);
+    BOOST_CHECK_SMALL(std::abs(orig_hbond[i] - 
+                               hbond_profile[i]), eps);
+    BOOST_CHECK_SMALL(std::abs(orig_ss_agreement[i] - 
+                               ss_agreement_profile[i]), eps);
+  }
+
+
+  //////////////////////////////////////////////////////////////////////////
+  // PERFORM A STASH OPERATION AND CHECK, WHETHER THE SCORING RESULTS ARE //
+  // STILL THE SAME                                                       //
+  //////////////////////////////////////////////////////////////////////////
+
+  env.Stash(26, bb_list.size(), 0);
+
+  cb_packing_scorer->CalculateScoreProfile(26, bb_list.size(), 0, 
+                                           cb_packing_profile);
+  cb_scorer->CalculateScoreProfile(26, bb_list.size(), 0, 
+                                   cb_profile);
+  reduced_scorer->CalculateScoreProfile(26, bb_list.size(), 0, 
+                                        reduced_profile);
+  torsion_scorer->CalculateScoreProfile(26, bb_list.size(), 0, 
+                                        torsion_profile);
+  hbond_scorer->CalculateScoreProfile(26, bb_list.size(), 0, 
+                                      hbond_profile);
+  ss_agreement_scorer->CalculateScoreProfile(26, bb_list.size(), 0, 
+                                             ss_agreement_profile);
+
+  for(uint i = 0; i < bb_list.size(); ++i) {
+    BOOST_CHECK_SMALL(std::abs(orig_cb_packing[i] - 
+                               cb_packing_profile[i]), eps);
+    BOOST_CHECK_SMALL(std::abs(orig_cb[i] - 
+                               cb_profile[i]), eps);
+    BOOST_CHECK_SMALL(std::abs(orig_reduced[i] - 
+                               reduced_profile[i]), eps);
+    BOOST_CHECK_SMALL(std::abs(orig_torsion[i] - 
+                               torsion_profile[i]), eps);
+    BOOST_CHECK_SMALL(std::abs(orig_hbond[i] - 
+                               hbond_profile[i]), eps);
+    BOOST_CHECK_SMALL(std::abs(orig_ss_agreement[i] - 
+                               ss_agreement_profile[i]), eps);
+  }
+
+  // lets perform the described reset action
+  String helix_sequence = "FGKLKQKD";
+  promod3::loop::BackboneList bb_list_helix = 
+  promod3::loop::BackboneList(helix_sequence);
+  geom::Mat4 transform = bb_list_helix.GetTransform(0, bb_list, 0);
+  bb_list_helix.ApplyTransform(transform);
+  env.SetEnvironment(bb_list_helix, 26);
+  bb_list.ReplaceFragment(bb_list_helix, 0, false);
+
+  // compare the reset values
+  cb_packing_scorer->CalculateScoreProfile(26, bb_list.size(), 0, 
+                                           cb_packing_profile);
+  cb_scorer->CalculateScoreProfile(26, bb_list.size(), 0, 
+                                   cb_profile);
+  reduced_scorer->CalculateScoreProfile(26, bb_list.size(), 0, 
+                                        reduced_profile);
+  torsion_scorer->CalculateScoreProfile(26, bb_list.size(), 0, 
+                                        torsion_profile);
+  hbond_scorer->CalculateScoreProfile(26, bb_list.size(), 0, 
+                                      hbond_profile);
+
+  ss_agreement_scorer->CalculateScoreProfile(26, bb_list.size(), 0, 
+                                             ss_agreement_profile);
+
+
+  for(uint i = 0; i < bb_list.size(); ++i) {
+    BOOST_CHECK_SMALL(std::abs(reset_cb_packing[i] - 
+                               cb_packing_profile[i]), eps);
+    BOOST_CHECK_SMALL(std::abs(reset_cb[i] - 
+                               cb_profile[i]), eps);
+    BOOST_CHECK_SMALL(std::abs(reset_reduced[i] - 
+                               reduced_profile[i]), eps);
+    BOOST_CHECK_SMALL(std::abs(reset_torsion[i] - 
+                               torsion_profile[i]), eps);
+    BOOST_CHECK_SMALL(std::abs(reset_hbond[i] - 
+                               hbond_profile[i]), eps);
+    BOOST_CHECK_SMALL(std::abs(reset_ss_agreement[i] - 
+                               ss_agreement_profile[i]), eps);
+  }
+
+  ////////////////////////////////////////////////////////////////////////////
+  // WE PERFORM A POP ACTION AND CHECK WHETHER THE SCORES CORRESPOND TO THE //
+  // ORIGINAL SCORES AGAIN                                                  //
+  ////////////////////////////////////////////////////////////////////////////
+
+  env.Pop();
+
+  cb_packing_scorer->CalculateScoreProfile(26, bb_list.size(), 0, 
+                                           cb_packing_profile);
+  cb_scorer->CalculateScoreProfile(26, bb_list.size(), 0, 
+                                   cb_profile);
+  reduced_scorer->CalculateScoreProfile(26, bb_list.size(), 0, 
+                                        reduced_profile);
+  torsion_scorer->CalculateScoreProfile(26, bb_list.size(), 0, 
+                                        torsion_profile);
+  hbond_scorer->CalculateScoreProfile(26, bb_list.size(), 0, 
+                                      hbond_profile);
+  ss_agreement_scorer->CalculateScoreProfile(26, bb_list.size(), 0, 
+                                             ss_agreement_profile);
+
+  for(uint i = 0; i < bb_list.size(); ++i) {
+    BOOST_CHECK_SMALL(std::abs(orig_cb_packing[i] - 
+                               cb_packing_profile[i]), eps);
+    BOOST_CHECK_SMALL(std::abs(orig_cb[i] - 
+                               cb_profile[i]), eps);
+    BOOST_CHECK_SMALL(std::abs(orig_reduced[i] - 
+                               reduced_profile[i]), eps);
+    BOOST_CHECK_SMALL(std::abs(orig_torsion[i] - 
+                               torsion_profile[i]), eps);
+    BOOST_CHECK_SMALL(std::abs(orig_hbond[i] - 
+                               hbond_profile[i]), eps);
+    BOOST_CHECK_SMALL(std::abs(orig_ss_agreement[i] - 
+                               ss_agreement_profile[i]), eps);
+  }
+}
+
 BOOST_AUTO_TEST_CASE(test_clash_score) {
   BackboneScoreEnv env = GenerateBackboneEnv();
   promod3::loop::BackboneList bb_list = GenerateTestBBList();
@@ -620,8 +1033,13 @@ BOOST_AUTO_TEST_CASE(test_clash_score2) {
   promod3::loop::BackboneList bb_list = GenerateTestBBList(pdb_name, 35, 40);
   ClashScorerPtr scorer(new ClashScorer);
   scorer->AttachEnvironment(env);
-  Real clash_score = scorer->CalculateScore(bb_list, 35, 0);
+  Real clash_score = scorer->CalculateScore(35, bb_list.size(), 0);
   BOOST_CHECK_CLOSE(clash_score, 0.107386872172, Real(1e-3));
+
+  // test for normalization, additionally to the one in test_normalize
+  scorer->DoNormalize(false);
+  clash_score = scorer->CalculateScore(35, bb_list.size(), 0);
+  BOOST_CHECK_CLOSE(clash_score, bb_list.size() * 0.107386872172, Real(1e-3)); 
 }
 
 BOOST_AUTO_TEST_CASE(test_pairwise_score) {
@@ -633,7 +1051,7 @@ BOOST_AUTO_TEST_CASE(test_pairwise_score) {
   //CheckScorer(bb_list, scorer, 0.0);
   CheckScorerThrows(bb_list, scorer);
   
-  BOOST_CHECK_CLOSE(scorer->CalculateScore(bb_list, 214, 0), 0.0,
+  BOOST_CHECK_CLOSE(scorer->CalculateScore(214, bb_list.size(), 0), 0.0,
                     Real(1e-3));
 
 
@@ -658,7 +1076,7 @@ BOOST_AUTO_TEST_CASE(test_pairwise_score) {
                                                 //scorer should give 0.0
 
   //CheckScorer(bb_list, scorer, 0.0);  
-  BOOST_CHECK_CLOSE(scorer->CalculateScore(bb_list, 214, 0), 0.0,
+  BOOST_CHECK_CLOSE(scorer->CalculateScore(214, bb_list.size(), 0), 0.0,
                     Real(1e-3));
 
 
@@ -669,7 +1087,7 @@ BOOST_AUTO_TEST_CASE(test_pairwise_score) {
 
 
   //CheckScorer(bb_list, scorer, 0.36586231);
-  BOOST_CHECK_CLOSE(scorer->CalculateScore(bb_list, 214, 0), 0.36586231,
+  BOOST_CHECK_CLOSE(scorer->CalculateScore(214, bb_list.size(), 0), 0.36586231,
                     Real(1e-3));
 
 
@@ -677,7 +1095,7 @@ BOOST_AUTO_TEST_CASE(test_pairwise_score) {
                                                 //that should also have an influence
 
   //CheckScorer(bb_list, scorer, 1.12155807);
-  BOOST_CHECK_CLOSE(scorer->CalculateScore(bb_list, 214, 0), 1.12155807,
+  BOOST_CHECK_CLOSE(scorer->CalculateScore(214, bb_list.size(), 0), 1.12155807,
                     Real(1e-3));                                                         
 
   //let's finally try to add a contact function
@@ -690,7 +1108,7 @@ BOOST_AUTO_TEST_CASE(test_pairwise_score) {
                                             //compared to previous check 
 
   //CheckScorer(bb_list, scorer, 1.12155807);
-  BOOST_CHECK_CLOSE(scorer->CalculateScore(bb_list, 214, 0), 1.12155807,
+  BOOST_CHECK_CLOSE(scorer->CalculateScore(214, bb_list.size(), 0), 1.12155807,
                     Real(1e-3));  
 
 
@@ -699,7 +1117,7 @@ BOOST_AUTO_TEST_CASE(test_pairwise_score) {
                                             //therefore doesn't influence the score
  
   //CheckScorer(bb_list, scorer, 1.12155807);
-  BOOST_CHECK_CLOSE(scorer->CalculateScore(bb_list, 214, 0), 1.12155807,
+  BOOST_CHECK_CLOSE(scorer->CalculateScore(214, bb_list.size(), 0), 1.12155807,
                     Real(1e-3));  
 
   env.ApplyPairwiseFunction(0,216,0,228,3); //the cb positions of residues 216
@@ -707,8 +1125,13 @@ BOOST_AUTO_TEST_CASE(test_pairwise_score) {
                                             //therefore influences the score
 
   //CheckScorer(bb_list, scorer, 6.67711401);
-  BOOST_CHECK_CLOSE(scorer->CalculateScore(bb_list, 214, 0), 6.67711401,
-                    Real(1e-3));  
+  BOOST_CHECK_CLOSE(scorer->CalculateScore(214, bb_list.size(), 0), 6.67711401,
+                    Real(1e-3));    
+
+  // test for normalization, additionally to the one in test_normalize
+  scorer->DoNormalize(false);
+  BOOST_CHECK_CLOSE(scorer->CalculateScore(214, bb_list.size(), 0), 
+                    bb_list.size() * 6.67711401, Real(1e-3));    
 }
 
 BOOST_AUTO_TEST_CASE(test_density_score){
@@ -727,21 +1150,8 @@ BOOST_AUTO_TEST_CASE(test_density_score){
   ost::img::MapHandle map = full_bb_list.ToDensity(10.0,geom::Vec3(1.0,1.0,1.0),
                                                    5.0, true);
 
-  DensityScorerPtr scorer(new DensityScorer);
-
-  //check if error gets thrown when no environment is attached
-  BOOST_CHECK_THROW(scorer->CalculateScore(bb_list,5,0), promod3::Error);
-
-  scorer->AttachEnvironment(env);
-  //check if error gets thrown when no density map is set in the environment
-  BOOST_CHECK_THROW(scorer->CalculateScore(bb_list,5,0), promod3::Error);
-
-  env.SetMap(map, 5.0, true);
-
-  //The CheckScorer function cannot be used, since the resnum and chain idx
-  //checks are not permormed in the density scorer
-  BOOST_CHECK_CLOSE(scorer->CalculateScore(bb_list, 1, 0), 0.352861583,
-                    Real(1e-3));
+  BOOST_CHECK_CLOSE(promod3::scoring::DensityScore(bb_list, map, 5.0, true),
+                                                   0.352861583, Real(1e-3));
 }
 
 BOOST_AUTO_TEST_CASE(test_overall_scorer) {
@@ -763,8 +1173,8 @@ BOOST_AUTO_TEST_CASE(test_overall_scorer) {
   weights["torsion"] = 0.7;
   weights["intercept"] = 1.0;
   // check for errors
-  BOOST_CHECK_THROW(scorer.Calculate("hbond", bb_list, 214, 0), promod3::Error);
-  BOOST_CHECK_THROW(scorer.CalculateLinearCombination(weights, bb_list, 214, 0),
+  BOOST_CHECK_THROW(scorer.Calculate("hbond", 214, bb_list.size(), 0), promod3::Error);
+  BOOST_CHECK_THROW(scorer.CalculateLinearCombination(weights, 214, bb_list.size(), 0),
                     promod3::Error);
 
   // attach and sanity check single scores
@@ -775,15 +1185,232 @@ BOOST_AUTO_TEST_CASE(test_overall_scorer) {
   AttachScorer(scorer, LoadHBondScorer(), bb_list, env, "hbond");
   AttachScorer(scorer, LoadSSAgreementScorer(), bb_list, env, "ss_agreement");
   AttachScorer(scorer, LoadTorsionScorer(), bb_list, env, "torsion");
-  
+
   // check final score// exp. score from single ones above
-  Real exp_score = 0.1 * -0.657944619656 + 0.2 * 0.00201001879759
-                 + 0.3 * -0.066393442452 + 0.4 * 0.0 + 0.5 * -0.482397
+  Real exp_score = 0.1 * -0.657944619656 + 0.2 * 0.0189835
+                 + 0.3 * -0.64918 + 0.4 * 0.0 + 0.5 * -0.482397
                  + 0.6 * 0.498321 + 0.7 * -0.143922114538 + 1.0;
-  BOOST_CHECK_CLOSE(scorer.CalculateLinearCombination(weights, bb_list, 214, 0),
+  BOOST_CHECK_CLOSE(scorer.CalculateLinearCombination(weights, 214, bb_list.size(), 0),
                     exp_score, Real(1e-3));
   // check for more errors
-  BOOST_CHECK_THROW(scorer.Calculate("meh", bb_list, 214, 0), promod3::Error);
+  BOOST_CHECK_THROW(scorer.Calculate("meh", 214, bb_list.size(), 0), promod3::Error);
+}
+
+
+BOOST_AUTO_TEST_CASE(test_normalize) {
+
+  // The normalization of the pairwise scorer is tested in the
+  // pairwise specific function where we've set actual constraints
+  // Also in case of the clash score, a test has been added there
+  // since zero is not necessarily an ideal score to test normalization.
+
+  // setup env
+  BackboneScoreEnv env = GenerateBackboneEnv();
+  promod3::loop::BackboneList bb_list = GenerateTestBBList();
+  SetPsipredPrediction(env);
+
+  // setup scorer
+  BackboneOverallScorer scorer;
+  // setup weights
+  std::map<String, Real> weights;
+  weights["cb_packing"] = 1.0;
+  weights["cbeta"] = 1.0;
+  weights["reduced"] = 1.0;
+  weights["clash"] = 1.0;
+  weights["hbond"] = 1.0;
+  weights["ss_agreement"] = 1.0;
+  weights["torsion"] = 1.0;
+
+  // attach and sanity check single scores
+
+  // load scorers
+  CBPackingScorerPtr cb_packing_scorer = LoadCBPackingScorer();
+  CBetaScorerPtr cbeta_scorer = LoadCBetaScorer();
+  ReducedScorerPtr reduced_scorer = LoadReducedScorer();
+  ClashScorerPtr clash_scorer = ClashScorerPtr(new ClashScorer);
+  HBondScorerPtr hbond_scorer = LoadHBondScorer();
+  SSAgreementScorerPtr ss_agreement_scorer = LoadSSAgreementScorer();
+  TorsionScorerPtr torsion_scorer = LoadTorsionScorer();
+
+  AttachScorer(scorer, cb_packing_scorer, bb_list, env, "cb_packing");
+  AttachScorer(scorer, cbeta_scorer, bb_list, env, "cbeta");
+  AttachScorer(scorer, reduced_scorer, bb_list, env, "reduced");
+  AttachScorer(scorer, clash_scorer, bb_list, env, "clash");
+  AttachScorer(scorer, hbond_scorer, bb_list, env, "hbond");
+  AttachScorer(scorer, ss_agreement_scorer, bb_list, env, "ss_agreement");
+  AttachScorer(scorer, torsion_scorer, bb_list, env, "torsion");
+
+  // check final score// exp. score from single ones above
+  Real exp_score = - 0.657944619656 + 0.0189835
+                   - 0.64918 + 0.0 - 0.482397
+                   + 0.498321 - 0.143922114538;
+
+  BOOST_CHECK_CLOSE(scorer.CalculateLinearCombination(weights, 214, bb_list.size(), 0),
+                    exp_score, Real(1e-3));
+
+  cb_packing_scorer->DoNormalize(false);
+  cbeta_scorer->DoNormalize(false);
+  reduced_scorer->DoNormalize(false);
+  clash_scorer->DoNormalize(false);
+  hbond_scorer->DoNormalize(false);
+  ss_agreement_scorer->DoNormalize(false);
+  torsion_scorer->DoNormalize(false);
+
+  exp_score *= bb_list.size();
+
+  BOOST_CHECK_CLOSE(scorer.CalculateLinearCombination(weights, 214, bb_list.size(), 0),
+                    exp_score, Real(1e-3));
+}
+
+
+BOOST_AUTO_TEST_CASE(test_internal_external) {
+
+  // check sthg with actual clashes
+  String pdb_name = "data/clash_test.pdb";
+  BackboneScoreEnv env = GenerateBackboneEnv(pdb_name, "");
+  promod3::loop::BackboneList bb_list = GenerateTestBBList(pdb_name, 32, 40);
+  BackboneScoreEnv empty_env(env.GetSeqres());
+
+  // load scorers (only the ones that provide an internal / external mechanism)
+  CBetaScorerPtr cbeta_scorer = LoadCBetaScorer();
+  ReducedScorerPtr reduced_scorer = LoadReducedScorer();
+  ClashScorerPtr clash_scorer = ClashScorerPtr(new ClashScorer);
+  HBondScorerPtr hbond_scorer = LoadHBondScorer();
+  cbeta_scorer->AttachEnvironment(env);
+  reduced_scorer->AttachEnvironment(env);
+  clash_scorer->AttachEnvironment(env);
+  hbond_scorer->AttachEnvironment(env);
+
+  // lets do the overall score... this should be well tested by now
+  Real cbeta_score = cbeta_scorer->CalculateScore(32, bb_list.size(), 0);
+  Real reduced_score = reduced_scorer->CalculateScore(32, bb_list.size(), 0);
+  Real clash_score = clash_scorer->CalculateScore(32, bb_list.size(), 0);
+  Real hbond_score = hbond_scorer->CalculateScore(32, bb_list.size(), 0);
+
+  // lets do the internal scores... except clash, they should all be non zero
+  cbeta_scorer->DoExternalScores(false);
+  reduced_scorer->DoExternalScores(false);
+  clash_scorer->DoExternalScores(false);
+  hbond_scorer->DoExternalScores(false);
+  Real internal_cbeta_score = 
+  cbeta_scorer->CalculateScore(32, bb_list.size(), 0);
+  Real internal_reduced_score = 
+  reduced_scorer->CalculateScore(32, bb_list.size(), 0);
+  Real internal_clash_score = 
+  clash_scorer->CalculateScore(32, bb_list.size(), 0);
+  Real internal_hbond_score = 
+  hbond_scorer->CalculateScore(32, bb_list.size(), 0);
+
+  // lets do the external scores
+  cbeta_scorer->DoExternalScores(true);
+  reduced_scorer->DoExternalScores(true);
+  clash_scorer->DoExternalScores(true);
+  hbond_scorer->DoExternalScores(true);
+  cbeta_scorer->DoInternalScores(false);
+  reduced_scorer->DoInternalScores(false);
+  clash_scorer->DoInternalScores(false);
+  hbond_scorer->DoInternalScores(false);
+  Real external_cbeta_score = 
+  cbeta_scorer->CalculateScore(32, bb_list.size(), 0);
+  Real external_reduced_score = 
+  reduced_scorer->CalculateScore(32, bb_list.size(), 0);
+  Real external_clash_score = 
+  clash_scorer->CalculateScore(32, bb_list.size(), 0);
+  Real external_hbond_score = 
+  hbond_scorer->CalculateScore(32, bb_list.size(), 0);
+
+  // the sum between the internal and external score must be the total score
+  BOOST_CHECK_CLOSE(internal_cbeta_score + external_cbeta_score, 
+                    cbeta_score, Real(1e-3));
+  BOOST_CHECK_CLOSE(internal_reduced_score + external_reduced_score, 
+                    reduced_score, Real(1e-3));
+  BOOST_CHECK_CLOSE(internal_clash_score + external_clash_score, 
+                    clash_score, Real(1e-3));
+  BOOST_CHECK_CLOSE(internal_hbond_score + external_hbond_score, 
+                    hbond_score, Real(1e-3));
+
+  // we load new scorers that we attach to the empty env
+  CBetaScorerPtr empty_cbeta_scorer = LoadCBetaScorer();
+  ReducedScorerPtr empty_reduced_scorer = LoadReducedScorer();
+  ClashScorerPtr empty_clash_scorer = ClashScorerPtr(new ClashScorer);
+  HBondScorerPtr empty_hbond_scorer = LoadHBondScorer();
+  empty_cbeta_scorer->AttachEnvironment(empty_env);
+  empty_reduced_scorer->AttachEnvironment(empty_env);
+  empty_clash_scorer->AttachEnvironment(empty_env);
+  empty_hbond_scorer->AttachEnvironment(empty_env);
+
+  // we do set the actual bb_list in the empty_env
+  empty_env.SetEnvironment(bb_list, 32, 0);
+
+  // if everything went well, the full scores should be equal to the previously
+  // calculated internal scores
+  BOOST_CHECK_CLOSE(empty_cbeta_scorer->CalculateScore(32, bb_list.size(), 0),
+                    internal_cbeta_score, Real(1e-3));
+  BOOST_CHECK_CLOSE(empty_reduced_scorer->CalculateScore(32, bb_list.size(), 0),
+                    internal_reduced_score, Real(1e-3));
+  BOOST_CHECK_CLOSE(empty_clash_scorer->CalculateScore(32, bb_list.size(), 0),
+                    internal_clash_score, Real(1e-3));
+  BOOST_CHECK_CLOSE(empty_hbond_scorer->CalculateScore(32, bb_list.size(), 0),
+                    internal_hbond_score, Real(1e-3));
+}
+
+
+BOOST_AUTO_TEST_CASE(test_multiple_stretches) {
+
+  // check sthg with actual clashes
+  String pdb_name = "data/clash_test.pdb";
+  BackboneScoreEnv env = GenerateBackboneEnv(pdb_name, "");
+  promod3::loop::BackboneList bb_list = GenerateTestBBList(pdb_name, 32, 45);
+  BackboneScoreEnv empty_env(env.GetSeqres());
+
+  // load scorers
+  CBPackingScorerPtr cb_packing_scorer = LoadCBPackingScorer();
+  CBetaScorerPtr cbeta_scorer = LoadCBetaScorer();
+  ReducedScorerPtr reduced_scorer = LoadReducedScorer();
+  ClashScorerPtr clash_scorer = ClashScorerPtr(new ClashScorer);
+  HBondScorerPtr hbond_scorer = LoadHBondScorer();
+  SSAgreementScorerPtr ss_agreement_scorer = LoadSSAgreementScorer();
+  TorsionScorerPtr torsion_scorer = LoadTorsionScorer();
+
+  // setup scorer
+  BackboneOverallScorer scorer;
+  // setup weights
+  std::map<String, Real> weights;
+  weights["cb_packing"] = 1.0;
+  weights["cbeta"] = 1.0;
+  weights["reduced"] = 1.0;
+  weights["clash"] = 1.0;
+  weights["hbond"] = 1.0;
+  weights["ss_agreement"] = 1.0;
+  weights["torsion"] = 1.0;
+
+  scorer["cb_packing"] = cb_packing_scorer;
+  scorer["cbeta"] = cbeta_scorer;
+  scorer["reduced"] = reduced_scorer;
+  scorer["clash"] = clash_scorer;
+  scorer["hbond"] = hbond_scorer;
+  scorer["ss_agreement"] = ss_agreement_scorer;
+  scorer["torsion"] = torsion_scorer;
+  scorer.AttachEnvironment(env);
+  
+  std::vector<uint> start_resnums;
+  std::vector<uint> stretch_lengths;
+  std::vector<uint> chain_indices;
+  uint first_stretch_length = 6;
+  start_resnums.push_back(32);
+  start_resnums.push_back(32 + first_stretch_length);
+  stretch_lengths.push_back(first_stretch_length);
+  stretch_lengths.push_back(bb_list.size() - first_stretch_length);
+  chain_indices.push_back(0);
+  chain_indices.push_back(0);
+
+  Real full_score = scorer.CalculateLinearCombination(weights, 32, 
+                                                      bb_list.size(), 0);
+  Real patchy_score = scorer.CalculateLinearCombination(weights, start_resnums, 
+                                                        stretch_lengths, 
+                                                        chain_indices);
+
+  BOOST_CHECK_CLOSE(full_score, patchy_score, Real(1e-3));
 }
 
 BOOST_AUTO_TEST_SUITE_END();
diff --git a/sidechain/doc/disulfid.rst b/sidechain/doc/disulfid.rst
index 5b330287975708bdf84fa008b20d2e63315f4895..1cee3075640728b8c205c8bf9d9ff0128d6eeb9d 100644
--- a/sidechain/doc/disulfid.rst
+++ b/sidechain/doc/disulfid.rst
@@ -7,8 +7,9 @@ When calculating the pairwise interaction energy between two rotamers building
 a disulfid bond, one would get an unfavourable energy due to "clashes" between
 the sulfur atoms. It is possible to improve performance in sidechain
 reconstruction regarding cysteins when finding and separately handle
-disulfid bonds. PROMOD3 implements a simple geometrical description 
-[canutescu2003b]_ . The paper proposes two rotamers to be in a disulfid
+disulfid bonds. The scoring module implements an empirically derived disulfid
+score (:func:`promod3.scoring.SCWRL3DisulfidScore`) as defined in 
+[canutescu2003b]_. The paper proposes two rotamers to be in a disulfid
 bonded state, if the resulting disulfid score plus the self energies of the 
 involved rotamers is below 45. If there are several cysteines close together,
 this problem gets another layer of complexity. One has to assure, that
@@ -16,38 +17,18 @@ every cysteine only participates in one disulfid bond but the network
 of disulfid bonds is geometrically optimal. SCWRL4 proposes an approach,
 that has also been implemented here.
 
-.. method:: DisulfidRawScore(ca_pos_one, cb_pos_one, sg_pos_one, \
-                             ca_pos_two, cb_pos_two, sg_pos_two)
-
-  Evaluates the geometric expression based on the input positions
-
-  :param ca_pos_one:    The CA position of first rotamer
-  :param cb_pos_one:    The CB position of first rotamer
-  :param sg_pos_one:    The gamma sulfur position of first rotamer
-  :param ca_pos_two:    The CA position of second rotamer
-  :param cb_pos_two:    The CB position of second rotamer
-  :param sg_pos_two:    The gamma sulfur position of second rotamer
-
-  :type ca_pos_one:     :class:`ost.geom.Vec3`
-  :type cb_pos_one:     :class:`ost.geom.Vec3`
-  :type sg_pos_one:     :class:`ost.geom.Vec3`
-  :type ca_pos_two:     :class:`ost.geom.Vec3`
-  :type cb_pos_two:     :class:`ost.geom.Vec3`
-  :type sg_pos_two:     :class:`ost.geom.Vec3`
-
-  :returns:             The result of the raw score
-
-  
 
 .. method:: DisulfidScore(rotamer_one, rotamer_two, ca_pos_one, cb_pos_one, \
                           ca_pos_two, cb_pos_two)
 
   Directly extracts the positions of the gamma sulfurs from the rotamers by
-  searching for particles with the name "SG". In case of :class:`RRMRotamer`
-  It expects exactly one gamma sulfur per rotamer. In case of
-  :class:`FRMRotamer` there can be an arbitrary number of gamma sulfurs per
-  rotamer (at least one), it then evaluates the score for all possible
-  combinations of gamma sulfurs and takes the minimum score.
+  searching for particles with the name "SG".
+  The found positions are then passed to 
+  :func:`promod3.scoring.SCWRL3DisulfidScore`. 
+  In case of :class:`RRMRotamer` it expects exactly one gamma sulfur per 
+  rotamer. In case of :class:`FRMRotamer` there can be an arbitrary number 
+  of gamma sulfurs per rotamer (at least one), it then evaluates the score 
+  for all possible combinations of gamma sulfurs and takes the minimum score.
   To get a final DisulfidScore, it finally adds the self energies of the
   rotamers to the result of the geometric expression.
 
@@ -108,6 +89,3 @@ that has also been implemented here.
             The tuples in the first list describe the indices of cysteins 
             participating in disulfid bonds. The tuples in the second list 
             describe the optimal rotamers in the according rotamer groups.
-
-
-.. [canutescu2003b] Canutescu AA, Shelenkov AA, Dunbrack RL Jr. (2003). A graph-theory algorithm for rapid protein side-chain prediction. Protein Sci (2003).
diff --git a/sidechain/doc/graph.rst b/sidechain/doc/graph.rst
index 33f3da97bd5f34cd341d31a25f09b733b3b015df..118c72eabb98ed98acdc13eafcb6f3af4bbbb867 100644
--- a/sidechain/doc/graph.rst
+++ b/sidechain/doc/graph.rst
@@ -6,15 +6,15 @@ Rotamer Graph
 Once having a frame representing the rigid parts, the internal energies in
 rotamer groups can be calculated. To come to a final solution of the sidechain
 modelling problem, the pairwise energies also have to be evaluated and an
-overall solution has to be found. PROMOD3 implements an interaction graph that
-takes a list of rotamer groups, calculates the pairwise energies, does edge
-decomposition and dead end elimination. Solutions can finally be found 
-using Tree decomposition, AStar or Monte Carlo approaches. 
+overall solution has to be found. PROMOD3 implements a
+:class:`promod3.core.GraphMinimizer` that allows to find solutions using
+tree decomposition, A* and Monte Carlo algorithms.
 
 .. class:: RotamerGraph
 
-  The Graph object has no constructor exported to python. It is meant to be
-  constructed using the static create functions.
+  The :class:`RotamerGraph` objects inherits from 
+  :class:`promod3.core.GraphMinimizer` and extends the minimizer by static
+  initialization functions.
 
   .. staticmethod:: CreateFromRRMList(rotamer_groups)
 
@@ -27,276 +27,3 @@ using Tree decomposition, AStar or Monte Carlo approaches.
     :type rotamer_groups:  :class:`list`
 
 
-  .. method:: Prune(epsilon, [e_cut=0.0, consider_all_nodes=False])
-
-    Performs edge decomposition followed by dead end elimination in an
-    iterative manner until no changes can be observed anymore given 
-    **epsilon**.
-
-    :param epsilon:     The energy threshold to perform edge decomposition.
-
-    :param e_cut:       Parameter to control dead end elimination. If set to
-                        0.0, the default goldstein criterion is applied =>
-                        the rotamer gets removed if it's dominated by all other
-                        rotamers in the same node. If you increase this value,
-                        a rotamer must be dominated by at least this **e_cut**.
-
-
-    :param consider_all_nodes: Flag, wether the dead end elimination should be
-                               applied to all nodes, or only those who are
-                               connected with an edge removed by edge 
-                               decomposition. This is useful if already a Prune
-                               operation has been performed => only those nodes
-                               connected to a removed edge have the chance for
-                               successful dead end elimination.
-
-    :type epsilon:      :class:`float`
-    :type e_cut:        :class:`float`
-    :type consider_all_nodes: :class:`bool`
-
-
-  .. method:: ApplyDEE(node_idx, [e_cut=0.0])
-
-    Applies dead end elimination on one particular node and potentially
-    deactivates certain rotamers.
-
-    :param node_idx:    Node to apply dead end elimination
-    :param e_cut:       If set to
-                        0.0, the default goldstein criterion is applied =>
-                        the rotamer gets removed if it's dominated by all other
-                        rotamers in the same node. If you increase this value,
-                        a rotamer must be dominated by at least this **e_cut**.
-
-    :type node_idx:     :class:`int`
-    :type e_cut:        :class:`float`
-
-    :returns:           :class:`bool` whether any rotamer has been deactivated.
-
-
-
-  .. method:: ApplyEdgeDecomposition(edge_idx, epsilon)
-
-    Applies edge decomposition on one particular edge and potentially
-    deactivates it.
-
-
-    :param edge_idx:    Edge to decompose. 
-                        the idx relates to the list you get back
-                        when calling the :meth:`GetEdges` function.
-
-    :param epsilon:     The energy threshold to perform edge decomposition.
-
-    :type edge_idx:     :class:`int`
-    :type epsilon:      :class:`float`
-
-
-    :returns:           :class:`bool` whether the edge has been decomposed and 
-                        deactivated 
-                        
-
-  .. method:: Reset()
-
-    Resets the graph by undoing any pruning operation (DEE and edge decomposition)
-
-
-  .. method:: TreeSolve([max_complexity=inf, initial_epsilon=0.02])
-
-    The method solves a rotamer graph using a minimal width tree decomposition
-    approach in an iterative manner. In every iteration, the algorithm performs
-    a pruning step (DEE / Edge Decomposition) and subsequently tries to solve 
-    each connected component in the graph separately. 
-    If the number of possible enumerations in the tree constructetd from a 
-    particular connected component is is larger **max_complexity**, 
-    this component is solved in a later iteration. The algorithm iterates until 
-    all connected components are solved and steadily increases the epsilon value 
-    resulting in a more and more agressive edge decomposition. This function
-    assumes all self energies of the rotamers to be calculated and properly set!
-
-    :param max_complexity: Max number of possible permutations, that have to 
-                           be enumerated in the resulting tree after tree
-                           decomposition.
-
-    :param initial_epsilon: The initial energy threshold to perform edge
-                            decomposition.
-
-    :type max_complexity: :class:`int`
-    :type initial_epsilon: :class:`float`
-
-    :returns:           A tuple with the first element being a list of indices 
-                        representing the single rotamers minimizing
-                        the overall energy functions from every rotamer group.
-                        The second element is the according energy value.
-
-
-  .. method:: AStarSolve(e_thresh, [max_n=100, max_visited_nodes=100000000])
-
-    The method solves a rotamer graph using the A\* algorithm. Besides creating
-    minimal energy solution, the function produces a maximum of **max_n**
-    solutions sorted by energy. It aborts as soon as it sees the first solution
-    with an energy difference of **e_thresh** to the optimal solution or hits
-    **max_n**. If you're only interested in the optimal solution you should use
-    the TreeSolve function since it's much faster and uses less memory.
-    There is no automatic pruning of the graph using DEE or edge decomposition, 
-    so you have to do it by yourself, otherwise you'll have a looooooong 
-    runtime or even hit the **max_visited_nodes** parameter that caps the memory
-    usage. 
-    To have a valid solution you have to take care that you set the **e_cut** 
-    parameter in the pruning function to **e_tresh**.
-    This function assumes all self energies of the rotamers to be calculated 
-    and properly set!
-
-    :param e_thresh:    Maximal energy difference of a solution to the
-                        optimal solution to be considered.
-
-    :param max_n:       The maximum number of solutions that will be generated.
-
-    :param  max_visited_nodes: Caps the memory usage of the algorithm. Besides
-                               The memory used for pairwise energies and self
-                               energies, the algorithm uses about 
-                               **max_visited_nodes** * 20 bytes.
-
-
-    :type e_thresh:      :class:`float`
-    :type max_n:        :class:`int`
-    :type max_visited_nodes: :class:`int`
-
-    :returns:           A tuple with the first element being a list of 
-                        solutions with indices representing the single rotamers 
-                        selected for that solution. The second element is a list
-                        of energies for the according solutions.
-
-
-  .. method:: MCSolve([n=100, mc_steps=100000, start_temperature=1000.0, \\
-                       change_frequency=1000, cooling_factor=0.9, seed=0]) 
-
-    Does a total of **n** Monte Carlo runs to find low energy solutions
-    of the RotamerGraph. Each run starts with a random rotamer
-    configuration. At each of the **mc_steps** steps, a random location and
-    a random rotamer at that location is selected and an energy difference 
-    of that random selection relative to the current configuration is 
-    estimated. If the difference in energy is negative, the step is 
-    accepted. If not, the step is accepted with a probability given by
-    the temperature dependent Metropolis criterion (exp(-ediff/T)).
-    The temperature for every run starts with **start_temperature** 
-    and is multiplied every **change_frequency** steps with **cooling_factor**
-    to achieve a simulated annealing effect.
-    There is no automatic pruning of the graph using DEE or edge decomposition,
-    you have to do that by yourself.
-    This function assumes all self energies of the rotamers to be calculated 
-    and properly set!
-    
-    :param n:           Number of Monte Carlo runs 
-    :param mc_steps:    Number of Monte Carlo steps per run
-    :param start_temperature: Start temperature for the temperature dependent
-                              Metropolis criterion
-    :param change_frequency: Number of steps the temperature stays the same
-    :param cooling_factor: Factor to multiply temperature each 
-                          **change_frequency** steps
-    :param seed:        Seed for random number generator 
-
-    :type n:            :class:`int`
-    :type mc_steps:     :class:`int`
-    :type start_temperature: :class:`float`
-    :type change_frequency: :class:`int`
-    :type cooling_factor: :class:`float`
-    :type seed:         :class:`float`
-
-    :returns:           A tuple with the first element being a list of 
-                        solutions with indices representing the single rotamers 
-                        selected for that solution. The second element is a list
-                        of energies for the according solutions.
-
-
-
-  .. method:: GetNumNodes()
-
-    :returns:           The number of nodes in the graph
-                        => every RotamerGroup is a node
-
-
-  .. method:: GetNumEdges()
-
-    :returns:           The number of edges in the graph, representing
-                        connections between nodes with at least one
-                        nonzero interaction
-
-
-  .. method:: GetNumActiveNodes()
-
-    :returns:           The number of nodes having more than one active rotamer, 
-                        even after performing pruning operations
-
-
-  .. method:: GetNumActiveEdges()
-
-    :returns:           The number of edges representing nonzero interactions,
-                        even after performing pruning operations
-
-
-  .. method:: GetNumRotamers()
-
-    :returns:           The total number of rotamers in the graph
-
-
-  .. method:: GetNumActiveRotamers()
-
-    :returns:           The total number of active rotamers (Total number of 
-                        rotamers minus those that have been deactivated by DEE)
-
-
-  .. method:: GetEdges()
-
-    :returns:           A list of tuples describing the edges 
-                        connecting nodes with nonzero pairwise interactions   
-
-
-  .. method:: GetActiveEdges()
-    
-    :returns:           A :class:`list` of :class:`tuples` describing the edges 
-                        connecting nodes with nonzero pairwise interactions 
-                        (All edges minus those that have been deactived by edge 
-                        decomposition)
-
-
-  .. method:: GetActiveRotamers(node_idx)
-
-    :param node_idx:    Specifies node from which the active rotamers should be 
-                        extracted
-
-    :type node_idx:     :class:`int`
-
-    :returns:           list of the rotamers that are active
-                        in specified node (all rotamers minus those that have 
-                        been deactivated using DEE) 
-
-
-  .. method:: GetSelfEnergies(node_idx)
-
-    :param node_idx:    Specifies node from which the self energies should be 
-                        extracted
-
-    :type node_idx:     :class:`int`
-
-    :returns:           list of self energies for all rotamers in 
-                        specified node as they are fed into the solving 
-                        algorithms. Note, that they might slightly differ 
-                        from the original self energies in the input rotamers
-                        because of approximations introduced in edge 
-                        decomposition.
-
-
-  .. method:: GetPairwiseEnergies(edge_idx)
-
-    :param edge_idx:    Specifies edge from which the pairwise energies should
-                        be extracted, the idx relates to the list you get back
-                        when calling the :meth:`GetEdges` function.
-
-    :type edge_idx:     :class:`int`
-
-    :returns:           list of list where you can extract 
-                        the energy of rotamer i in the first node in the
-                        edge with rotamer j in the second node in the edge 
-                        with: e = pairwise_energies[i][j]
-                         
-
-                       
diff --git a/sidechain/doc/rotamer.rst b/sidechain/doc/rotamer.rst
index a62ca72acb66bab21f99740b7d46912eba07b18a..40f882320bb51f59b604a6ea7de7106d8582ca2a 100644
--- a/sidechain/doc/rotamer.rst
+++ b/sidechain/doc/rotamer.rst
@@ -156,7 +156,8 @@ Rotamers
 
     Iterates over every particle and searches for the according atom in
     **res**. If it's present, the position gets reset to the particle position.
-    If not, a new atom gets added to **res**. 
+    If not, a new atom gets added to **res**. No atoms are removed from **res**
+    in this process. 
 
     :param res:         Residue to be reconstructed
     :param consider_hydrogens: Flag, whether polar hydrogens should be added to 
@@ -313,6 +314,7 @@ Rotamers
     Iterates over every particle of the active subrotamer and searches for the 
     according atom in **res**. If it's present, the position gets reset to the 
     particle position. If not, a new atom gets added to **res**. 
+    No atoms are removed from **res** in this process. 
 
     :param res:         Residue to be reconstructed
     :param consider_hydrogens: Flag, whether polar hydrogens should be added to 
diff --git a/sidechain/doc/rotamer_constructor.rst b/sidechain/doc/rotamer_constructor.rst
index 316c0aba0559e2c0061d8a5ed23641967093a00f..36c76a2c0857dc5bdbd5b3257e24e8b2bde5eaac 100644
--- a/sidechain/doc/rotamer_constructor.rst
+++ b/sidechain/doc/rotamer_constructor.rst
@@ -11,22 +11,33 @@ Constructing Rotamers and Frame Residues
 --------------------------------------------------------------------------------
 
 
-.. class:: SCWRLRotamerConstructor()
+.. class:: SCWRLRotamerConstructor(cb_in_sidechain)
 
   Constructing rotamers and frame residues that are parametrized according to
   the SCWRL4 method. They contain all heavy atoms, but also the
-  polar hydrogens. The rotamers start after the CB atom (typically CG). 
+  polar hydrogens. 
   In case of the :class:`FrameResidue` construction, the
   constructor distinguishes between backbone and sidechain frame residues.
 
+  :param cb_in_sidechain: If set to true, all constructed rotamers will contain 
+                          the cb atom. This flag also affects the construction 
+                          of frame residues and controls whether the cb atom 
+                          shows up in the backbone frame residues or sidechain 
+                          frame residues.
+                          This is useful when you want to represent ALA or 
+                          GLY with actual rotamers, but be aware of increased 
+                          runtime. This flag can be set to False for most
+                          modeling applications and you just don't generate
+                          any rotamers for ALA and GLY.
+
+  :type cb_in_sidechain: :class:`bool`
+
+
   .. method:: ConstructRRMRotamerGroup(res, id, residue_index, rot_lib,\
                                        [probability_cutoff = 0.98])
   .. method:: ConstructRRMRotamerGroup(all_atom_pos, aa_res_idx, id,\
                                        residue_index, rot_lib,\
                                        [probability_cutoff = 0.98])
-  .. method:: ConstructRRMRotamerGroup(n_pos, ca_pos, cb_pos, id,\
-                                       residue_index, rot_lib,\          
-                                       [probability_cutoff = 0.98])
   .. method:: ConstructRRMRotamerGroup(res, id, residue_index, rot_lib,\
                                        [phi = -1.0472, psi = -0.7854,\
                                         probability_cutoff = 0.98])
@@ -34,29 +45,19 @@ Constructing Rotamers and Frame Residues
                                        residue_index, rot_lib,\
                                        [phi = -1.0472, psi = -0.7854,\
                                         probability_cutoff = 0.98])
-  .. method:: ConstructRRMRotamerGroup(n_pos, ca_pos, cb_pos, id,\
-                                       residue_index, rot_lib,\
-                                       [phi = -1.0472, psi = -0.7854,\
-                                        probability_cutoff = 0.98])
   .. method:: ConstructRRMRotamerGroup(res, id, residue_index, rot_lib_entries,\
                                        [probability_cutoff = 0.98])
   .. method:: ConstructRRMRotamerGroup(all_atom_pos, aa_res_idx, id,\
                                        residue_index, rot_lib_entries,\
                                        [probability_cutoff = 0.98])
-  .. method:: ConstructRRMRotamerGroup(n_pos, ca_pos, cb_pos, id,\
-                                       residue_index, rot_lib_entries,\          
-                                       [probability_cutoff = 0.98])
 
     All functions are also avaible for their flexible rotamer model counterpart.
     =>ConstructFRMRotamerGroup(...) with exactly the same parameters. 
 
-    :param res:         To extract the N, CA, CB backbone anchor
-    :param all_atom_pos: To extract the N, CA, CB backbone anchor
+    :param res:         To extract the required backbone atoms
+    :param all_atom_pos: To extract the required backbone atoms
     :param aa_res_idx:  Index of residue in **all_atom_pos** from which to
-                        extract the backbone anchor
-    :param n_pos:       To directly feed in the backbone anchor positions
-    :param ca_pos:      To directly feed in the backbone anchor positions
-    :param cb_pos:      To directly feed in the backbone anchor positions
+                        extract the required backbone atoms
     :param id:          Identifies the sidechain.
     :param residue_index: Important for the energy calculations towards the 
                           :class:`Frame` you don't want to calculate a pairwise
@@ -82,9 +83,6 @@ Constructing Rotamers and Frame Residues
     :type res:          :class:`ost.mol.ResidueHandle`
     :type all_atom_pos: :class:`promod3.loop.AllAtomPositions`
     :type aa_res_idx:   :class:`int`
-    :type n_pos:        :class:`ost.geom.Vec3`
-    :type ca_pos:       :class:`ost.geom.Vec3`
-    :type cb_pos:       :class:`ost.geom.Vec3`
     :type id:           :class:`RotamerID`
     :type residue_index: :class:`int`
     :type rot_lib:      :class:`RotamerLib` / :class:`BBDepRotamerLib`
@@ -93,9 +91,8 @@ Constructing Rotamers and Frame Residues
     :rtype:             :class:`RRMRotamerGroup`
 
     :raises:  :exc:`~exceptions.RuntimeError` when not all required backbone
-              atoms are present in **residue**, not all required atom
-              positions are set in **all_atom_pos** or when the rotamer library
-              does not contain any entries for **id**
+              atoms are present in **residue** or not all required atom
+              positions are set in **all_atom_pos**
 
 
   .. method:: ConstructBackboneFrameResidue(res, id, residue_index, Real phi,\
@@ -105,13 +102,8 @@ Constructing Rotamers and Frame Residues
                                             residue_index, Real phi,\
                                             [n_ter = False, c_ter = False])
 
-  .. method:: ConstructBackboneFrameResidue(n_pos, ca_pos, c_pos, o_pos, cb_pos,\ 
-                                            id, residue_index, Real phi,\
-                                            [n_ter = False, c_ter = False])
-
-    Constructs backbone frame residues for amino acid residues. It extracts
-    the n, ca, c, o and cb positions and constructs a frame residue based on
-    the parametrizations of SCWRL4. In case of **n_ter**, there are additional
+    Constructs backbone frame residues for amino acid residues based on the 
+    parametrizations of SCWRL4. In case of **n_ter**, there are additional
     hydrogens added at the nitrogen to represent a proper n-terminus. The same
     is true for **c_ter**, an additional oxygen is built instead. In any case,
     a single hydrogen is added to the nitrogen (except proline), this is
@@ -121,11 +113,6 @@ Constructing Rotamers and Frame Residues
     :param all_atom_pos: To extract the backbone positions
     :param aa_res_idx:  Index of residue in **all_atom_pos** from which to 
                         extract the backbone positions
-    :param n_pos:       To directly feed in the backbone positions
-    :param ca_pos:      To directly feed in the backbone positions
-    :param c_pos:       To directly feed in the backbone positions
-    :param o_pos:       To directly feed in the backbone positions
-    :param cb_pos:      To directly feed in the backbone positions
     :param id:          Identifies the sidechain
     :param residue_index: Important for the energy calculations towards the 
                           :class:`Frame` you don't want to calculate a pairwise
@@ -141,11 +128,6 @@ Constructing Rotamers and Frame Residues
     :type res:          :class:`ost.mol.ResidueHandle`
     :type all_atom_pos: :class:`promod3.loop.AllAtomPositions`
     :type aa_res_idx:   :class:`int`
-    :type n_pos:        :class:`ost.geom.Vec3`
-    :type ca_pos:       :class:`ost.geom.Vec3`
-    :type c_pos:        :class:`ost.geom.Vec3`
-    :type o_pos:        :class:`ost.geom.Vec3`
-    :type cb_pos:       :class:`ost.geom.Vec3`
     :type id:           :class:`RotamerID`
     :type residue_index: :class:`int`
     :type phi:          :class:`float`
@@ -156,7 +138,7 @@ Constructing Rotamers and Frame Residues
 
 
     :raises:  :exc:`~exceptions.RuntimeError` when not all required backbone
-              atoms are present in **residue**, not all required atom
+              atoms are present in **residue** or not all required atom
               positions are set in **all_atom_pos**.
 
 
diff --git a/sidechain/pymod/CMakeLists.txt b/sidechain/pymod/CMakeLists.txt
index df22822d3ac6a7be57ccc00fcdcf588d77ecf03d..06d95aee0b95b8e331a2ed0581e21c067456d815 100644
--- a/sidechain/pymod/CMakeLists.txt
+++ b/sidechain/pymod/CMakeLists.txt
@@ -2,7 +2,7 @@ set(SIDECHAIN_CPP
 export_connector.cc
 export_disulfid.cc
 export_frame.cc
-export_graph.cc
+export_rotamer_graph.cc
 export_particle.cc
 export_rotamer.cc
 export_rotamer_cruncher.cc
diff --git a/sidechain/pymod/export_disulfid.cc b/sidechain/pymod/export_disulfid.cc
index 72ea6c3c91febe9133ecdfde62ecb92951c63875..b346dc8e834f462a09cdd0a0391775fba05df7d8 100644
--- a/sidechain/pymod/export_disulfid.cc
+++ b/sidechain/pymod/export_disulfid.cc
@@ -82,13 +82,6 @@ boost::python::tuple WrapResolveCysteins(const boost::python::list& rot_groups,
 
 void export_Disulfid(){
 
-  def("DisulfidRawScore", &DisulfidRawScore, (arg("ca_pos_one"), 
-                                              arg("cb_pos_one"),
-                                              arg("sg_pos_one"),
-                                              arg("ca_pos_two"),
-                                              arg("cb_pos_two"),
-                                              arg("sg_pos_two")));
-
   def("DisulfidScore",&WrapDisulfidOne,(arg("rotamer_one"), arg("rotamer_two"),
                                         arg("ca_pos_one"), arg("cb_pos_one"),
                                         arg("ca_pos_two"), arg("cb_pos_two")));
diff --git a/sidechain/pymod/export_graph.cc b/sidechain/pymod/export_graph.cc
deleted file mode 100644
index e48adbb78d2e5de251505a52ded4ea6c8da50de7..0000000000000000000000000000000000000000
--- a/sidechain/pymod/export_graph.cc
+++ /dev/null
@@ -1,170 +0,0 @@
-#include <boost/python.hpp>
-#include <boost/python/register_ptr_to_python.hpp>
-#include <promod3/sidechain/rotamer_graph.hh>
-#include <promod3/core/export_helper.hh>
-
-using namespace boost::python;
-using namespace promod3::sidechain;
-using namespace promod3;
-
-namespace {
-
-RotamerGraphPtr WrapRRMList(boost::python::list& rotamer_groups) {
-  std::vector<RRMRotamerGroupPtr> v_rotamer_groups;
-  core::ConvertListToVector(rotamer_groups, v_rotamer_groups);
-  return RotamerGraph::CreateFromRRMList(v_rotamer_groups);
-}
-
-RotamerGraphPtr WrapFRMList(boost::python::list& rotamer_groups) {
-  std::vector<FRMRotamerGroupPtr> v_rotamer_groups;
-  core::ConvertListToVector(rotamer_groups, v_rotamer_groups);
-  return RotamerGraph::CreateFromFRMList(v_rotamer_groups);
-}
-
-boost::python::tuple WrapTreeSolve(RotamerGraphPtr graph, uint64_t max_complexity,
-                                   Real initial_epsilon) {
-  std::pair<std::vector<int>, Real> 
-  full_solution = graph->TreeSolve(max_complexity,initial_epsilon);
-  std::vector<int> solution = full_solution.first;
-  Real energy = full_solution.second;
-  boost::python::list return_list;
-  core::AppendVectorToList(solution, return_list);
-  return boost::python::make_tuple(return_list, energy);
-}
-
-boost::python::tuple WrapAStarSolve(RotamerGraphPtr graph,
-                                    Real e_thresh, uint max_n, 
-                                    uint max_visited_nodes) {
-  std::pair<std::vector<std::vector<int> >, std::vector<Real> > 
-  full_solution = graph->AStarSolve(e_thresh, max_n, max_visited_nodes);
-
-  std::vector<std::vector<int> > solutions = full_solution.first;
-  std::vector<Real> energies = full_solution.second;
-
-  boost::python::list solution_list;
-  boost::python::list energy_list;
-
-  for(uint i = 0; i < solutions.size(); ++i){
-    boost::python::list actual_solution;
-    core::AppendVectorToList(solutions[i], actual_solution);
-    solution_list.append(actual_solution);
-  }
-  core::AppendVectorToList(energies, energy_list);
-
-  return boost::python::make_tuple(solution_list, energy_list);
-}
-
-boost::python::tuple WrapMCSolve(RotamerGraphPtr graph, int n,
-                                 int mc_steps, Real start_temperature,
-                                 int change_frequency, Real cooling_factor,
-                                 int seed) {
-
-  std::pair<std::vector<std::vector<int> >, std::vector<Real> > 
-  full_solution = graph->MCSolve(n, mc_steps, start_temperature, 
-                                 change_frequency, cooling_factor,
-                                 seed);
-
-  std::vector<std::vector<int> > solutions = full_solution.first;
-  std::vector<Real> energies = full_solution.second;
-
-  boost::python::list solution_list;
-  boost::python::list energy_list;
-
-  for(uint i = 0; i < solutions.size(); ++i){
-    boost::python::list actual_solution;
-    core::AppendVectorToList(solutions[i], actual_solution);
-    solution_list.append(actual_solution);
-  }
-  core::AppendVectorToList(energies, energy_list);
-
-  return boost::python::make_tuple(solution_list, energy_list);
-}
-
-boost::python::list WrapGetActiveRotamers(RotamerGraphPtr graph,
-                                          int idx) {
-  std::vector<int> active_rotamers;
-  graph->GetActiveRotamers(idx, active_rotamers);
-  boost::python::list return_list;
-  core::AppendVectorToList(active_rotamers, return_list);
-  return return_list;
-}
-
-boost::python::list WrapGetEdges(RotamerGraphPtr graph,
-                                 int idx) {
-  std::vector<std::pair<int,int> > edges;
-  graph->GetEdges(edges);
-  boost::python::list return_list;
-  core::AppendVectorToList(edges, return_list);
-  return return_list;
-}
-
-boost::python::list WrapGetActiveEdges(RotamerGraphPtr graph,
-                                       int idx) {
-  std::vector<std::pair<int,int> > edges;
-  graph->GetActiveEdges(edges);
-  boost::python::list return_list;
-  core::AppendVectorToList(edges, return_list);
-  return return_list;
-}
-
-boost::python::list WrapGetSelfEnergies(RotamerGraphPtr graph,
-                                        int idx) {
-  std::vector<Real> self_energies;
-  graph->GetSelfEnergies(idx, self_energies);
-  boost::python::list return_list;
-  core::AppendVectorToList(self_energies, return_list);
-  return return_list;
-}
-
-boost::python::list WrapGetPairwiseEnergies(RotamerGraphPtr graph,
-                                            int idx) {
-  std::vector<std::vector<Real> > pairwise_energies;
-  graph->GetPairwiseEnergies(idx, pairwise_energies);
-  boost::python::list return_list;
-
-  for(uint i = 0; i < pairwise_energies.size(); ++i) {
-    boost::python::list row;
-    core::AppendVectorToList(pairwise_energies[i], row);
-    return_list.append(row);
-  }
-
-  return return_list;
-}
-
-
-}
-
-
-void export_Graph()
-{
-  class_<RotamerGraph, boost::noncopyable>("RotamerGraph", no_init)
-    .def("CreateFromRRMList", &WrapRRMList, (arg("rotamer_groups")))
-    .staticmethod("CreateFromRRMList")
-    .def("CreateFromFRMList", &WrapFRMList, (arg("rotamer_groups")))
-    .staticmethod("CreateFromFRMList")
-    .def("Prune", &RotamerGraph::Prune,
-         (arg("epsilon"), arg("e_cut")=0.0, arg("consider_all_nodes")=false))
-    .def("Reset", &RotamerGraph::Reset)
-    .def("GetNumNodes", &RotamerGraph::GetNumNodes)
-    .def("GetNumEdges", &RotamerGraph::GetNumEdges)
-    .def("GetNumActiveNodes", &RotamerGraph::GetNumActiveNodes)
-    .def("GetNumActiveEdges", &RotamerGraph::GetNumActiveEdges)
-    .def("GetActiveRotamers", &WrapGetActiveRotamers, (arg("node_idx")))
-    .def("GetEdges", &WrapGetEdges)
-    .def("GetActiveEdges", &WrapGetActiveEdges)
-    .def("GetSelfEnergies", &WrapGetSelfEnergies, (arg("node_idx")))
-    .def("GetPairwiseEnergies", &WrapGetPairwiseEnergies,(arg("edge_idx")))
-    .def("ApplyDEE", &RotamerGraph::ApplyDEE,(arg("node_idx"), arg("e_thresh")=0.0))
-    .def("ApplyEdgeDecomposition", &RotamerGraph::ApplyEdgeDecomposition,(arg("edge_idx"), arg("e_thresh")=0.02))
-    .def("TreeSolve", &WrapTreeSolve,
-         (arg("max_complexity")=std::numeric_limits<uint64_t>::max(),
-          arg("initial_epsilon")=0.02))
-    .def("AStarSolve", &WrapAStarSolve,
-         (arg("e_thresh"), arg("max_n")=100, arg("max_visited_nodes")=100000000))
-    .def("MCSolve", &WrapMCSolve,
-         (arg("n")=100, arg("mc_steps")=100000, arg("start_temperature")=1000.0,
-          arg("change_frequency")=1000, arg("cooling_factor")=0.9, arg("seed")=0))
-  ;  
-
-  register_ptr_to_python<RotamerGraphPtr>();
-}
diff --git a/sidechain/pymod/export_rotamer_graph.cc b/sidechain/pymod/export_rotamer_graph.cc
new file mode 100644
index 0000000000000000000000000000000000000000..782d0e81d070cf83c1ee3220d5483f80e09e6998
--- /dev/null
+++ b/sidechain/pymod/export_rotamer_graph.cc
@@ -0,0 +1,39 @@
+#include <boost/python.hpp>
+#include <boost/python/register_ptr_to_python.hpp>
+#include <promod3/core/graph_minimizer.hh>
+#include <promod3/sidechain/rotamer_graph.hh>
+#include <promod3/core/export_helper.hh>
+
+using namespace boost::python;
+using namespace promod3::sidechain;
+using namespace promod3;
+
+namespace {
+
+RotamerGraphPtr WrapRRMList(boost::python::list& rotamer_groups) {
+  std::vector<RRMRotamerGroupPtr> v_rotamer_groups;
+  core::ConvertListToVector(rotamer_groups, v_rotamer_groups);
+  return RotamerGraph::CreateFromList(v_rotamer_groups);
+}
+
+RotamerGraphPtr WrapFRMList(boost::python::list& rotamer_groups) {
+  std::vector<FRMRotamerGroupPtr> v_rotamer_groups;
+  core::ConvertListToVector(rotamer_groups, v_rotamer_groups);
+  return RotamerGraph::CreateFromList(v_rotamer_groups);
+}
+
+}
+
+
+void export_RotamerGraph() {
+
+
+  class_<RotamerGraph,  
+         bases<promod3::core::GraphMinimizer> >("RotamerGraph", init<>())
+
+    .def("CreateFromRRMList", &WrapRRMList, (arg("rotamer_groups"))).staticmethod("CreateFromRRMList")
+    .def("CreateFromFRMList", &WrapFRMList, (arg("rotamer_groups"))).staticmethod("CreateFromFRMList")
+  ;  
+
+  register_ptr_to_python<RotamerGraphPtr>();
+}
diff --git a/sidechain/pymod/export_scwrl_rotamer_constructor.cc b/sidechain/pymod/export_scwrl_rotamer_constructor.cc
index 1d9cda258ed7f3fe39127025f2e2765aa3f8a0ae..539288e3e6363cee544e8815c484c83da32e6971 100644
--- a/sidechain/pymod/export_scwrl_rotamer_constructor.cc
+++ b/sidechain/pymod/export_scwrl_rotamer_constructor.cc
@@ -13,6 +13,10 @@ using namespace promod3;
 
 namespace{
 
+SCWRLRotamerConstructorPtr WrapSCWRLRotamerConstructorInit(bool cb_in_sidechain) {
+  SCWRLRotamerConstructorPtr p(new SCWRLRotamerConstructor(cb_in_sidechain));
+  return p;
+}
 
 RRMRotamerGroupPtr WrapRRMGroup_res(SCWRLRotamerConstructor& constructor,
                                     const ost::mol::ResidueHandle& res,
@@ -36,18 +40,6 @@ RRMRotamerGroupPtr WrapRRMGroup_aa(SCWRLRotamerConstructor& constructor,
                                               rot_lib, probability_cutoff);
 }
 
-RRMRotamerGroupPtr WrapRRMGroup_pos(SCWRLRotamerConstructor& constructor,
-                                    const geom::Vec3& n_pos, const geom::Vec3& ca_pos,
-                                    const geom::Vec3& cb_pos,
-                                    RotamerID rotamer_id,
-                                    uint residue_idx,
-                                    RotamerLibPtr rot_lib,
-                                    Real probability_cutoff){
-  return constructor.ConstructRRMRotamerGroup(n_pos, ca_pos, cb_pos,
-                                              rotamer_id, residue_idx,
-                                              rot_lib, probability_cutoff);
-}
-
 FRMRotamerGroupPtr WrapFRMGroup_res(SCWRLRotamerConstructor& constructor,
                                     const ost::mol::ResidueHandle& res,
                                     RotamerID id,
@@ -70,18 +62,6 @@ FRMRotamerGroupPtr WrapFRMGroup_aa(SCWRLRotamerConstructor& constructor,
                                               rot_lib, probability_cutoff);
 }
 
-FRMRotamerGroupPtr WrapFRMGroup_pos(SCWRLRotamerConstructor& constructor,
-                                    const geom::Vec3& n_pos, const geom::Vec3& ca_pos,
-                                    const geom::Vec3& cb_pos,
-                                    RotamerID rotamer_id,
-                                    uint residue_idx,
-                                    RotamerLibPtr rot_lib,
-                                    Real probability_cutoff){
-  return constructor.ConstructFRMRotamerGroup(n_pos, ca_pos, cb_pos,
-                                              rotamer_id, residue_idx,
-                                              rot_lib, probability_cutoff);
-}
-
 RRMRotamerGroupPtr WrapRRMGroup_bbdep_res(SCWRLRotamerConstructor& constructor,
                                           const ost::mol::ResidueHandle& res,
                                           RotamerID id,
@@ -108,20 +88,6 @@ RRMRotamerGroupPtr WrapRRMGroup_bbdep_aa(SCWRLRotamerConstructor& constructor,
                                               probability_cutoff);
 }
 
-RRMRotamerGroupPtr WrapRRMGroup_bbdep_pos(SCWRLRotamerConstructor& constructor,
-                                          const geom::Vec3& n_pos, const geom::Vec3& ca_pos,
-                                          const geom::Vec3& cb_pos,
-                                          RotamerID rotamer_id,
-                                          uint residue_idx,
-                                          BBDepRotamerLibPtr rot_lib,
-                                          Real phi, Real  psi,
-                                          Real probability_cutoff){
-  return constructor.ConstructRRMRotamerGroup(n_pos, ca_pos, cb_pos,
-                                              rotamer_id, residue_idx,
-                                              rot_lib, phi, psi, 
-                                              probability_cutoff);
-}
-
 FRMRotamerGroupPtr WrapFRMGroup_bbdep_res(SCWRLRotamerConstructor& constructor,
                                           const ost::mol::ResidueHandle& res,
                                           RotamerID id,
@@ -148,20 +114,6 @@ FRMRotamerGroupPtr WrapFRMGroup_bbdep_aa(SCWRLRotamerConstructor& constructor,
                                               probability_cutoff);
 }
 
-FRMRotamerGroupPtr WrapFRMGroup_bbdep_pos(SCWRLRotamerConstructor& constructor,
-                                          const geom::Vec3& n_pos, const geom::Vec3& ca_pos,
-                                          const geom::Vec3& cb_pos,
-                                          RotamerID rotamer_id,
-                                          uint residue_idx,
-                                          BBDepRotamerLibPtr rot_lib,
-                                          Real phi, Real  psi,
-                                          Real probability_cutoff){
-  return constructor.ConstructFRMRotamerGroup(n_pos, ca_pos, cb_pos,
-                                              rotamer_id, residue_idx,
-                                              rot_lib, phi, psi, 
-                                              probability_cutoff);
-}
-
 RRMRotamerGroupPtr WrapRRMGroup_entries_res(SCWRLRotamerConstructor& constructor,
                                             const ost::mol::ResidueHandle& res,
                                             RotamerID id,
@@ -190,22 +142,6 @@ RRMRotamerGroupPtr WrapRRMGroup_entries_aa(SCWRLRotamerConstructor& constructor,
                                               probability_cutoff);
 }
 
-RRMRotamerGroupPtr WrapRRMGroup_entries_pos(SCWRLRotamerConstructor& constructor,
-                                            const geom::Vec3& n_pos,
-                                            const geom::Vec3& ca_pos,
-                                            const geom::Vec3& cb_pos,
-                                            RotamerID rotamer_id,
-                                            uint residue_idx,
-                                            const boost::python::list& entries,
-                                            Real probability_cutoff){
-  std::vector<RotamerLibEntry> v_entries;
-  core::ConvertListToVector(entries, v_entries);
-  return constructor.ConstructRRMRotamerGroup(n_pos, ca_pos, cb_pos,
-                                              rotamer_id, residue_idx,
-                                              v_entries, 
-                                              probability_cutoff);
-}
-
 FRMRotamerGroupPtr WrapFRMGroup_entries_res(SCWRLRotamerConstructor& constructor,
                                             const ost::mol::ResidueHandle& res,
                                             RotamerID id,
@@ -234,23 +170,6 @@ FRMRotamerGroupPtr WrapFRMGroup_entries_aa(SCWRLRotamerConstructor& constructor,
                                               probability_cutoff);
 }
 
-FRMRotamerGroupPtr WrapFRMGroup_entries_pos(SCWRLRotamerConstructor& constructor,
-                                            const geom::Vec3& n_pos,
-                                            const geom::Vec3& ca_pos,
-                                            const geom::Vec3& cb_pos,
-                                            RotamerID rotamer_id,
-                                            uint residue_idx,
-                                            const boost::python::list& entries,
-                                            Real probability_cutoff){
-  std::vector<RotamerLibEntry> v_entries;
-  core::ConvertListToVector(entries, v_entries);
-  return constructor.ConstructFRMRotamerGroup(n_pos, ca_pos, cb_pos,
-                                              rotamer_id, residue_idx,
-                                              v_entries, 
-                                              probability_cutoff);
-}
-
-
 FrameResiduePtr WrapBBFrame_res(SCWRLRotamerConstructor& constructor,
                                 const ost::mol::ResidueHandle& residue,
                                 RotamerID id, uint residue_index,
@@ -269,19 +188,6 @@ FrameResiduePtr WrapBBFrame_aa(SCWRLRotamerConstructor& constructor,
                                                      phi, n_ter, c_ter);
 }
 
-FrameResiduePtr WrapBBFrame_pos(SCWRLRotamerConstructor& constructor,
-                               const geom::Vec3& n_pos,
-                               const geom::Vec3& ca_pos,
-                               const geom::Vec3& c_pos,
-                               const geom::Vec3& o_pos,
-                               const geom::Vec3& cb_pos,
-                               RotamerID id, uint residue_index,
-                               Real phi, bool n_ter, bool c_ter){
-    return constructor.ConstructBackboneFrameResidue(n_pos, ca_pos, c_pos, 
-                                                     o_pos, cb_pos, id, 
-                                                     residue_index,
-                                                     phi, n_ter, c_ter);
-}
 
 FrameResiduePtr WrapSCFrame_res(SCWRLRotamerConstructor& constructor,
                                 const ost::mol::ResidueHandle& residue,
@@ -313,7 +219,8 @@ void AssignInternalEnergiesFRM(const SCWRLRotamerConstructor& constructor,
 
 void export_SCWRLRotamerConstructor(){
 
-  class_<SCWRLRotamerConstructor>("SCWRLRotamerConstructor", init<>())
+  class_<SCWRLRotamerConstructor, SCWRLRotamerConstructorPtr>("SCWRLRotamerConstructor", no_init)
+    .def("__init__", boost::python::make_constructor(&WrapSCWRLRotamerConstructorInit))
     .def("ConstructRRMRotamerGroup", &WrapRRMGroup_res,(arg("residue"),
                                                         arg("rotamer_id"),
                                                         arg("residue_idx"),
@@ -325,13 +232,6 @@ void export_SCWRLRotamerConstructor(){
                                                        arg("residue_idx"),
                                                        arg("rot_lib"),
                                                        arg("probability_cutoff") = 0.98))
-    .def("ConstructRRMRotamerGroup", &WrapRRMGroup_pos,(arg("n_pos"),
-                                                        arg("ca_pos"),
-                                                        arg("cb_pos"),
-                                                        arg("rotamer_id"),
-                                                        arg("residue_idx"),
-                                                        arg("rot_lib"),
-                                                        arg("probability_cutoff") = 0.98))
     .def("ConstructFRMRotamerGroup", &WrapFRMGroup_res,(arg("residue"),
                                                         arg("rotamer_id"),
                                                         arg("residue_idx"),
@@ -343,13 +243,6 @@ void export_SCWRLRotamerConstructor(){
                                                        arg("residue_idx"),
                                                        arg("rot_lib"),
                                                        arg("probability_cutoff") = 0.98))
-    .def("ConstructFRMRotamerGroup", &WrapFRMGroup_pos,(arg("n_pos"),
-                                                        arg("ca_pos"),
-                                                        arg("cb_pos"),
-                                                        arg("rotamer_id"),
-                                                        arg("residue_idx"),
-                                                        arg("rot_lib"),
-                                                        arg("probability_cutoff") = 0.98))
     .def("ConstructRRMRotamerGroup", &WrapRRMGroup_bbdep_res,(arg("residue"),
                                                               arg("rotamer_id"),
                                                               arg("residue_idx"),
@@ -365,15 +258,6 @@ void export_SCWRLRotamerConstructor(){
                                                              arg("phi") = -1.0472,
                                                              arg("psi") = -0.7854,
                                                              arg("probability_cutoff") = 0.98))
-    .def("ConstructRRMRotamerGroup", &WrapRRMGroup_bbdep_pos,(arg("n_pos"),
-                                                              arg("ca_pos"),
-                                                              arg("cb_pos"),
-                                                              arg("rotamer_id"),
-                                                              arg("residue_idx"),
-                                                              arg("rot_lib"),
-                                                              arg("phi") = -1.0472,
-                                                              arg("psi") = -0.7854,
-                                                              arg("probability_cutoff") = 0.98))
     .def("ConstructFRMRotamerGroup", &WrapFRMGroup_bbdep_res,(arg("residue"),
                                                               arg("rotamer_id"),
                                                               arg("residue_idx"),
@@ -389,15 +273,6 @@ void export_SCWRLRotamerConstructor(){
                                                              arg("phi") = -1.0472,
                                                              arg("psi") = -0.7854,
                                                              arg("probability_cutoff") = 0.98))
-    .def("ConstructFRMRotamerGroup", &WrapFRMGroup_bbdep_pos,(arg("n_pos"),
-                                                              arg("ca_pos"),
-                                                              arg("cb_pos"),
-                                                              arg("rotamer_id"),
-                                                              arg("residue_idx"),
-                                                              arg("rot_lib"),
-                                                              arg("phi") = -1.0472,
-                                                              arg("psi") = -0.7854,
-                                                              arg("probability_cutoff") = 0.98))
     .def("ConstructRRMRotamerGroup", &WrapRRMGroup_entries_res,(arg("residue"),
                                                                 arg("rotamer_id"),
                                                                 arg("residue_idx"),
@@ -409,13 +284,6 @@ void export_SCWRLRotamerConstructor(){
                                                                arg("residue_idx"),
                                                                arg("entries"),
                                                                arg("probability_cutoff") = 0.98))
-    .def("ConstructRRMRotamerGroup", &WrapRRMGroup_entries_pos,(arg("n_pos"),
-                                                                arg("ca_pos"),
-                                                                arg("cb_pos"),
-                                                                arg("rotamer_id"),
-                                                                arg("residue_idx"),
-                                                                arg("entries"),
-                                                                arg("probability_cutoff") = 0.98))
     .def("ConstructFRMRotamerGroup", &WrapFRMGroup_entries_res,(arg("residue"),
                                                                 arg("rotamer_id"),
                                                                 arg("residue_idx"),
@@ -427,13 +295,6 @@ void export_SCWRLRotamerConstructor(){
                                                                arg("residue_idx"),
                                                                arg("entries"),
                                                                arg("probability_cutoff") = 0.98))
-    .def("ConstructFRMRotamerGroup", &WrapFRMGroup_entries_pos,(arg("n_pos"),
-                                                                arg("ca_pos"),
-                                                                arg("cb_pos"),
-                                                                arg("rotamer_id"),
-                                                                arg("residue_idx"),
-                                                                arg("entries"),
-                                                                arg("probability_cutoff") = 0.98))
     .def("ConstructBackboneFrameResidue", &WrapBBFrame_res,(arg("residue"),
                                                             arg("rotamer_id"),
                                                             arg("residue_index"),
@@ -447,16 +308,6 @@ void export_SCWRLRotamerConstructor(){
                                                            arg("phi"),
                                                            arg("n_ter")=false,
                                                            arg("c_ter")=false))
-    .def("ConstructBackboneFrameResidue", &WrapBBFrame_pos,(arg("n_pos"),
-                                                            arg("ca_pos"),
-                                                            arg("c_pos"),
-                                                            arg("o_pos"),
-                                                            arg("cb_pos"),
-                                                            arg("rotamer_id"),
-                                                            arg("residue_index"),
-                                                            arg("phi"),
-                                                            arg("n_ter")=false,
-                                                            arg("c_ter")=false))
     .def("ConstructSidechainFrameResidue", &WrapSCFrame_res,(arg("residue"),
                                                              arg("rotamer_id"),
                                                              arg("residue_index")))
diff --git a/sidechain/pymod/wrap_sidechain.cc b/sidechain/pymod/wrap_sidechain.cc
index 14a3fc9b574d295b970f0fdd6eb874bed7328e81..840b5d3b405eab5f532b7f6cd2de1eccf1a34c4b 100644
--- a/sidechain/pymod/wrap_sidechain.cc
+++ b/sidechain/pymod/wrap_sidechain.cc
@@ -3,7 +3,7 @@
 void export_Connector();
 void export_Disulfid();
 void export_Frame();
-void export_Graph();
+void export_RotamerGraph();
 void export_Particle();
 void export_Rotamer();
 void export_RotamerCruncher();
@@ -21,7 +21,7 @@ BOOST_PYTHON_MODULE(_sidechain)
   export_Connector();
   export_Disulfid();
   export_Frame();
-  export_Graph();
+  export_RotamerGraph();
   export_Particle();
   export_Rotamer();
   export_RotamerCruncher();
diff --git a/sidechain/src/CMakeLists.txt b/sidechain/src/CMakeLists.txt
index dfa815fc9ea3d7b5580e11caa46f4eac78534a2b..e6fb514dc9675c86125a23cca4680696761f1010 100644
--- a/sidechain/src/CMakeLists.txt
+++ b/sidechain/src/CMakeLists.txt
@@ -22,7 +22,6 @@ set(SIDECHAIN_SOURCES
   bb_dep_rotamer_lib.cc
   disulfid.cc
   frame.cc
-  rotamer_graph.cc
   particle.cc
   rotamer.cc
   rotamer_cruncher.cc
diff --git a/sidechain/src/bb_dep_rotamer_lib.cc b/sidechain/src/bb_dep_rotamer_lib.cc
index 8abeaf7b1c4e2f0af58fe96e1d35c85c6f61fbe8..20bbe7ee31b36798e84440f46939eef176d00b86 100644
--- a/sidechain/src/bb_dep_rotamer_lib.cc
+++ b/sidechain/src/bb_dep_rotamer_lib.cc
@@ -394,13 +394,13 @@ std::pair<RotamerLibEntry*,uint> BBDepRotamerLib::QueryLib(RotamerID id, Real ph
     }
   }
 
+  result_buffer_.clear();
+
   std::map<RotamerID,std::pair<uint64_t,uint> >::const_iterator it = static_data_helper_.find(id);
   if(it == static_data_helper_.end()){
-    throw promod3::Error("No rotamers for given id...");
+    return std::make_pair(reinterpret_cast<RotamerLibEntry*>(NULL), 0);
   } 
 
-  result_buffer_.clear();
-
   if(interpolate_){
 
     uint bin00,bin10,bin01,bin11;
diff --git a/sidechain/src/disulfid.cc b/sidechain/src/disulfid.cc
index 388894b0ecc25573898b7326d107c10647a08eaf..620658f2e17954b972d0b996dd3664a9db293b53 100644
--- a/sidechain/src/disulfid.cc
+++ b/sidechain/src/disulfid.cc
@@ -3,6 +3,7 @@
 #include <promod3/sidechain/particle.hh>
 #include <promod3/core/graph.hh>
 #include <promod3/core/enumerator.hh>
+#include <promod3/scoring/scwrl3_energy_functions.hh>
 #include <vector>
 
 namespace{
@@ -10,18 +11,18 @@ namespace{
 template <typename T>
 void ExtractCYSSG(T rot_one, T rot_two,
              std::vector<geom::Vec3>& pos_one,
-             std::vector<geom::Vec3>& pos_two){
+             std::vector<geom::Vec3>& pos_two) {
 
   for(typename T::iterator i = rot_one.begin(); 
-      i != rot_one.end(); ++i){
-    if(i->GetName() == "SG"){
+      i != rot_one.end(); ++i) {
+    if(i->GetName() == "SG") {
       pos_one.push_back(i->GetPos());
     }
   }
 
   for(typename T::iterator i = rot_two.begin(); 
-      i != rot_two.end(); ++i){
-    if(i->GetName() == "SG"){
+      i != rot_two.end(); ++i) {
+    if(i->GetName() == "SG") {
       pos_two.push_back(i->GetPos());
     }
   }
@@ -42,16 +43,16 @@ void SingleResolve(const std::vector<Real>& scores,
 
     Real current_score = 0.0;
 
-    for(int i = 0; i < size; ++i){
+    for(int i = 0; i < size; ++i) {
       current_score += current_combination[i] * scores[i];
-      for(int j = 0; j < size; ++j){
+      for(int j = 0; j < size; ++j) {
         if(i != j) current_score += graph.IsConnected(i, j) * 
                                     current_combination[i] * 
                                     current_combination[j] * Real(1000000.0);
       }
     } 
 
-    if(current_score < optimal_score){
+    if(current_score < optimal_score) {
       optimal_score = current_score;
       active_bonds = current_combination;
     }
@@ -62,7 +63,7 @@ void SingleResolve(const std::vector<Real>& scores,
 void Resolve(const std::vector<Real>& scores, 
              const promod3::core::Graph& graph,
              uint max_problem_size, 
-             std::vector<int>& active_bonds){
+             std::vector<int>& active_bonds) {
 
   uint size = scores.size();
 
@@ -80,7 +81,7 @@ void Resolve(const std::vector<Real>& scores,
   std::vector<std::vector<int> > connected_components(1);
   
   // at the beginning everything is in the same component
-  for(int i = 0; i < graph.NumNodes(); ++i){
+  for(int i = 0; i < graph.NumNodes(); ++i) {
     connected_components.back().push_back(i);
   }
 
@@ -90,9 +91,9 @@ void Resolve(const std::vector<Real>& scores,
     uint largest_idx = 0;
 
     // search for the largest component
-    for(uint i = 0; i < connected_components.size(); ++i){
+    for(uint i = 0; i < connected_components.size(); ++i) {
       uint current_size = connected_components[i].size();
-      if(current_size > largest_size){
+      if(current_size > largest_size) {
         largest_size = current_size;
         largest_idx = i;
       }
@@ -101,25 +102,26 @@ void Resolve(const std::vector<Real>& scores,
     // is it small enough?
     if(largest_size <= max_problem_size) break;
 
-    const std::vector<int>& largest_component = connected_components[largest_idx];
+    const std::vector<int>& largest_component = 
+    connected_components[largest_idx];
 
     // let's search for the item with the worst score
     Real worst_score = -std::numeric_limits<Real>::max();
     Real worst_score_idx = 0;
 
-    for(uint i = 0; i < largest_component.size(); ++i){
+    for(uint i = 0; i < largest_component.size(); ++i) {
       Real actual_score = scores[largest_component[i]]; 
-      if(actual_score > worst_score){
+      if(actual_score > worst_score) {
         worst_score = actual_score;
         worst_score_idx = i;
       }
     }
 
     std::vector<int> indices_to_keep;
-    for(uint i = 0; i < worst_score_idx; ++i){
+    for(uint i = 0; i < worst_score_idx; ++i) {
       indices_to_keep.push_back(largest_component[i]);
     }
-    for(uint i = worst_score_idx + 1; i < largest_size; ++i){
+    for(uint i = worst_score_idx + 1; i < largest_size; ++i) {
       indices_to_keep.push_back(largest_component[i]);
     }
 
@@ -128,9 +130,9 @@ void Resolve(const std::vector<Real>& scores,
     subgraph.ConnectedComponents(new_components);
     
     // reorganize connected components
-    for(uint i = 0; i < new_components.size(); ++i){
+    for(uint i = 0; i < new_components.size(); ++i) {
       connected_components.push_back(std::vector<int>());
-      for(uint j = 0; j < new_components[i].size(); ++j){
+      for(uint j = 0; j < new_components[i].size(); ++j) {
         int idx_to_add = indices_to_keep[new_components[i][j]];
         connected_components.back().push_back(idx_to_add);
       }
@@ -140,20 +142,21 @@ void Resolve(const std::vector<Real>& scores,
 
   // all components are now solvable... let's do it!
   active_bonds.assign(scores.size(), 0);
-  for(uint i = 0; i < connected_components.size(); ++i){
+  for(uint i = 0; i < connected_components.size(); ++i) {
     uint component_size = connected_components[i].size();
-    if(component_size == 1){
+    if(component_size == 1) {
       active_bonds[connected_components[i][0]] = 1;
     }
     else{
       std::vector<Real> component_scores(component_size, 0.0);
-      for(uint j = 0; j < component_size; ++j){
+      for(uint j = 0; j < component_size; ++j) {
         component_scores[j] = scores[connected_components[i][j]];
       }
-      promod3::core::Graph component_graph = graph.SubGraph(connected_components[i]);
+      promod3::core::Graph component_graph = 
+      graph.SubGraph(connected_components[i]);
       std::vector<int> component_active_bonds;
       SingleResolve(component_scores, component_graph, component_active_bonds);
-      for(uint j = 0; j < component_size; ++j){
+      for(uint j = 0; j < component_size; ++j) {
         active_bonds[connected_components[i][j]] = component_active_bonds[j];
       }
     }
@@ -162,24 +165,24 @@ void Resolve(const std::vector<Real>& scores,
 
 
 template <typename T>
-void CysteineResolve(const std::vector<T>& rot_groups,
+void CysteinResolve(const std::vector<T>& rot_groups,
                      const std::vector<geom::Vec3>& ca_pos,
                      const std::vector<geom::Vec3>& cb_pos,
                      Real disulfid_score_thresh,
                      std::vector<std::pair<uint, uint> >& disulfid_indices,
-                     std::vector<std::pair<uint, uint> >& rotamer_indices){
+                     std::vector<std::pair<uint, uint> >& rotamer_indices) {
 
   // do the trivial cases...
-  if(rot_groups.size() <= 1){
+  if(rot_groups.size() <= 1) {
     return;
   }
 
   // do some input checks
-  if(ca_pos.size() != cb_pos.size()){
+  if(ca_pos.size() != cb_pos.size()) {
     throw promod3::Error("Inconsistency in size of input lists observed!");
   }
 
-  if(ca_pos.size() != rot_groups.size()){
+  if(ca_pos.size() != rot_groups.size()) {
     throw promod3::Error("Inconsistency in size of input lists observed!");
   }
 
@@ -189,21 +192,21 @@ void CysteineResolve(const std::vector<T>& rot_groups,
   std::vector<std::pair<uint, uint> > optimal_rotamers;
   uint num_rotamer_groups = rot_groups.size();
 
-  for(uint i = 0; i < num_rotamer_groups; ++i){
-    for(uint j = i + 1; j < num_rotamer_groups; ++j){
-      if(geom::Distance(ca_pos[i], ca_pos[j]) < Real(8.0)){
+  for(uint i = 0; i < num_rotamer_groups; ++i) {
+    for(uint j = i + 1; j < num_rotamer_groups; ++j) {
+      if(geom::Distance(ca_pos[i], ca_pos[j]) < Real(8.0)) {
         // they are close and potentially build a disulfid bond...
         Real min_score = std::numeric_limits<Real>::max();
         uint min_k = 0;
         uint min_l = 0;
         Real score;
-        for(uint k = 0; k < rot_groups[i]->size(); ++k){
-          for(uint l = 0; l < rot_groups[j]->size(); ++l){
+        for(uint k = 0; k < rot_groups[i]->size(); ++k) {
+          for(uint l = 0; l < rot_groups[j]->size(); ++l) {
             score = promod3::sidechain::DisulfidScore((*rot_groups[i])[k], 
                                                       (*rot_groups[j])[l],
                                                       ca_pos[i], cb_pos[i], 
                                                       ca_pos[j], cb_pos[j]);
-            if(score < min_score){
+            if(score < min_score) {
               min_score = score;
               min_k = k;
               min_l = l;
@@ -211,7 +214,7 @@ void CysteineResolve(const std::vector<T>& rot_groups,
           }
         }
 
-        if(min_score < disulfid_score_thresh){
+        if(min_score < disulfid_score_thresh) {
           // just found a potential disulfid bond!
           scores.push_back(min_score - disulfid_score_thresh);
           disulfids.push_back(std::make_pair(i, j));
@@ -224,16 +227,16 @@ void CysteineResolve(const std::vector<T>& rot_groups,
  // in here we fill all indices of the active disulfid bonds...
   std::vector<int> final_disulfids;
 
-  if(disulfids.size() > 1){
+  if(disulfids.size() > 1) {
     // resolve disambiguities
     promod3::core::Graph graph(disulfids.size());
-    for(uint i = 0; i < disulfids.size(); ++i){
-      for(uint j = i + 1; j < disulfids.size(); ++j){
+    for(uint i = 0; i < disulfids.size(); ++i) {
+      for(uint j = i + 1; j < disulfids.size(); ++j) {
         // check whether same rotamer group is involved in two disulfid bonds
         if(disulfids[j].first == disulfids[i].first ||
            disulfids[j].first == disulfids[i].second ||
            disulfids[j].second == disulfids[i].first ||
-           disulfids[j].second == disulfids[i].second){
+           disulfids[j].second == disulfids[i].second) {
           graph.Connect(i, j);
         }
       }
@@ -243,23 +246,23 @@ void CysteineResolve(const std::vector<T>& rot_groups,
     graph.ConnectedComponents(connected_components);
 
     for(uint component_idx = 0; component_idx < connected_components.size();
-        ++component_idx){
+        ++component_idx) {
 
       const std::vector<int>& connected_component = 
       connected_components[component_idx];
 
-      if(connected_component.size() > 1){
+      if(connected_component.size() > 1) {
         
         std::vector<Real> component_scores;
-        for(uint i = 0; i < connected_component.size(); ++i){
+        for(uint i = 0; i < connected_component.size(); ++i) {
           component_scores.push_back(scores[connected_component[i]]);
         }
         promod3::core::Graph component_graph = 
         graph.SubGraph(connected_component);
         std::vector<int> active_bonds;
         Resolve(component_scores, component_graph, 15, active_bonds);
-        for(uint i = 0; i < active_bonds.size(); ++i){
-          if(active_bonds[i] == 1){
+        for(uint i = 0; i < active_bonds.size(); ++i) {
+          if(active_bonds[i] == 1) {
             final_disulfids.push_back(connected_component[i]);
           }
         }
@@ -269,13 +272,13 @@ void CysteineResolve(const std::vector<T>& rot_groups,
       }
     }
   }
-  else if(disulfids.size() == 1){
+  else if(disulfids.size() == 1) {
     final_disulfids.push_back(0);
   }
 
   // fill output
   for(std::vector<int>::iterator i = final_disulfids.begin();
-      i != final_disulfids.end(); ++i){
+      i != final_disulfids.end(); ++i) {
     uint group_idx_one = disulfids[*i].first;
     uint group_idx_two = disulfids[*i].second;
     uint rot_idx_one = optimal_rotamers[*i].first;
@@ -285,43 +288,6 @@ void CysteineResolve(const std::vector<T>& rot_groups,
   }
 }
 
-}
-
-
-namespace promod3{ namespace sidechain{
-
-
-Real DisulfidRawScore(const geom::Vec3& ca_pos_one, 
-                      const geom::Vec3& cb_pos_one,
-                      const geom::Vec3& sg_pos_one, 
-                      const geom::Vec3& ca_pos_two, 
-                      const geom::Vec3& cb_pos_two, 
-                      const geom::Vec3& sg_pos_two){
-
-  Real d = geom::Distance(sg_pos_one,sg_pos_two);
-  Real a1 = geom::Angle(cb_pos_one-sg_pos_one, sg_pos_two-sg_pos_one);
-  Real a2 = geom::Angle(sg_pos_one-sg_pos_two, cb_pos_two-sg_pos_two);
-  Real x2 = std::abs(geom::DihedralAngle(ca_pos_one, cb_pos_one, sg_pos_one,
-                                         sg_pos_two));
-  Real x3 = std::abs(geom::DihedralAngle(cb_pos_one, sg_pos_one, sg_pos_two,
-                                         cb_pos_two));
-  Real x4 = std::abs(geom::DihedralAngle(sg_pos_one, sg_pos_two, cb_pos_two,
-                                         ca_pos_two));
-
-  return std::abs(d-2) / Real(0.05)
-         + std::abs(a1-Real(1.8151)) / Real(0.087266)
-         + std::abs(a2-Real(1.8151)) / Real(0.087266)
-         + std::min(std::abs(x2-Real(1.3963)), std::abs(x2-Real(M_PI)))
-           / Real(0.17453)
-         + std::min(std::abs(x4-Real(1.3963)), std::abs(x4-Real(M_PI)))
-           / Real(0.17453)
-         + std::abs(x3-Real(M_PI)*Real(0.5)) / Real(0.34907);
-}
-
-
-namespace{
-
-// this is only in here because it requires the DisulfidRawScore function..
 void SetOptimalSubrotamer(promod3::sidechain::FRMRotamerPtr rot_one, 
                           promod3::sidechain::FRMRotamerPtr rot_two,
                           const geom::Vec3& ca_pos_one, 
@@ -333,7 +299,7 @@ void SetOptimalSubrotamer(promod3::sidechain::FRMRotamerPtr rot_one,
   ExtractCYSSG(*rot_one, *rot_two, sg_pos_one, sg_pos_two);
 
   if(sg_pos_one.size() != rot_one->subrotamer_size() || 
-     sg_pos_two.size() != rot_two->subrotamer_size() ){
+     sg_pos_two.size() != rot_two->subrotamer_size() ) {
     throw promod3::Error("Expect cysteins to have exactly one gamma sulfur "
                          "per subrotamer!");
   }
@@ -342,13 +308,16 @@ void SetOptimalSubrotamer(promod3::sidechain::FRMRotamerPtr rot_one,
   uint min_i = 0;
   uint min_j = 0;
 
-  for(uint i = 0; i < sg_pos_one.size(); ++i){
-    for(uint j = 0; j < sg_pos_two.size(); ++j){
+  for(uint i = 0; i < sg_pos_one.size(); ++i) {
+    for(uint j = 0; j < sg_pos_two.size(); ++j) {
 
-      Real score = DisulfidRawScore(ca_pos_one,cb_pos_one,
-                                    sg_pos_one[i], ca_pos_two,
-                                    cb_pos_two,sg_pos_two[j]);
-      if(score < min_score){
+      Real score = promod3::scoring::SCWRL3DisulfidScore(ca_pos_one,
+                                                         cb_pos_one,
+                                                         sg_pos_one[i], 
+                                                         ca_pos_two,
+                                                         cb_pos_two,
+                                                         sg_pos_two[j]);
+      if(score < min_score) {
         min_score = score;
         min_i = i;
         min_j = j;
@@ -356,7 +325,7 @@ void SetOptimalSubrotamer(promod3::sidechain::FRMRotamerPtr rot_one,
     }
   }
 
-  if(min_score < std::numeric_limits<Real>::max()){
+  if(min_score < std::numeric_limits<Real>::max()) {
     rot_one->SetActiveSubrotamer(min_i);
     rot_two->SetActiveSubrotamer(min_j);
   }
@@ -365,20 +334,28 @@ void SetOptimalSubrotamer(promod3::sidechain::FRMRotamerPtr rot_one,
 }
 
 
+namespace promod3{ namespace sidechain{
+
+
 Real DisulfidScore(RRMRotamerPtr rot_one, RRMRotamerPtr rot_two, 
                    const geom::Vec3& ca_pos_one, const geom::Vec3& cb_pos_one, 
-                   const geom::Vec3& ca_pos_two, const geom::Vec3& cb_pos_two){
+                   const geom::Vec3& ca_pos_two, const geom::Vec3& cb_pos_two) {
 
   std::vector<geom::Vec3> sg_pos_one, sg_pos_two;
   ExtractCYSSG(*rot_one, *rot_two, sg_pos_one, sg_pos_two);
 
-  if(sg_pos_one.size() != 1 || sg_pos_two.size() != 1){
+  if(sg_pos_one.size() != 1 || sg_pos_two.size() != 1) {
     throw promod3::Error("Expect rigid rotamers to have exactly one gamma "
                          "sulfur particle!");
   }
 
-  Real raw_score = DisulfidRawScore(ca_pos_one, cb_pos_one, sg_pos_one[0],
-                                    ca_pos_two, cb_pos_two, sg_pos_two[0]); 
+  Real raw_score = promod3::scoring::SCWRL3DisulfidScore(ca_pos_one, 
+                                                         cb_pos_one, 
+                                                         sg_pos_one[0], 
+                                                         ca_pos_two, 
+                                                         cb_pos_two, 
+                                                         sg_pos_two[0]); 
+
   Real self_energy = rot_one->GetSelfEnergy() + rot_two->GetSelfEnergy();
   self_energy *= Real(0.5);
   return raw_score + self_energy;
@@ -386,25 +363,28 @@ Real DisulfidScore(RRMRotamerPtr rot_one, RRMRotamerPtr rot_two,
 
 Real DisulfidScore(FRMRotamerPtr rot_one, FRMRotamerPtr rot_two, 
                    const geom::Vec3& ca_pos_one, const geom::Vec3& cb_pos_one, 
-                   const geom::Vec3& ca_pos_two, const geom::Vec3& cb_pos_two){
+                   const geom::Vec3& ca_pos_two, const geom::Vec3& cb_pos_two) {
 
   std::vector<geom::Vec3> sg_pos_one, sg_pos_two;
   ExtractCYSSG(*rot_one, *rot_two, sg_pos_one, sg_pos_two);
 
-  if(sg_pos_one.empty() || sg_pos_two.empty()){
+  if(sg_pos_one.empty() || sg_pos_two.empty()) {
     throw promod3::Error("Expect flexible rotamers to have at least one gamma "
                          "sulfur particle!");
   }
 
   Real min_raw_score = std::numeric_limits<Real>::max();
 
-  for(uint i = 0; i < sg_pos_one.size(); ++i){
-    for(uint j = 0; j < sg_pos_two.size(); ++j){
+  for(uint i = 0; i < sg_pos_one.size(); ++i) {
+    for(uint j = 0; j < sg_pos_two.size(); ++j) {
 
-      min_raw_score = std::min(DisulfidRawScore(ca_pos_one,cb_pos_one,
-                                                sg_pos_one[i], ca_pos_two,
-                                                cb_pos_two,sg_pos_two[j])
-                               ,min_raw_score);
+      min_raw_score = std::min(promod3::scoring::SCWRL3DisulfidScore(ca_pos_one,
+                                                                  cb_pos_one,
+                                                                  sg_pos_one[i], 
+                                                                  ca_pos_two,
+                                                                  cb_pos_two,
+                                                                  sg_pos_two[j])
+                                                                ,min_raw_score);
     }
   }
 
@@ -421,9 +401,9 @@ void ResolveCysteins(
       const std::vector<geom::Vec3>& cb_pos,
       Real disulfid_score_thresh, bool optimize_subrotamers,
       std::vector<std::pair<uint, uint> >& disulfid_indices,
-      std::vector<std::pair<uint, uint> >& rotamer_indices){
+      std::vector<std::pair<uint, uint> >& rotamer_indices) {
 
-  CysteineResolve<RRMRotamerGroupPtr>(rot_groups, ca_pos, cb_pos,
+  CysteinResolve<RRMRotamerGroupPtr>(rot_groups, ca_pos, cb_pos,
                                       disulfid_score_thresh, disulfid_indices, 
                                       rotamer_indices);
 
@@ -432,17 +412,17 @@ void ResolveCysteins(
 void ResolveCysteins(const std::vector<FRMRotamerGroupPtr>& rot_groups,
                      const std::vector<geom::Vec3>& ca_pos,
                      const std::vector<geom::Vec3>& cb_pos,
-                     Real disulfid_score_thresh, bool optimize_rotamers,
+                     Real disulfid_score_thresh, bool optimize_subrotamers,
                      std::vector<std::pair<uint, uint> >& disulfid_indices,
-                     std::vector<std::pair<uint, uint> >& rotamer_indices){
+                     std::vector<std::pair<uint, uint> >& rotamer_indices) {
 
-  CysteineResolve<FRMRotamerGroupPtr>(rot_groups, ca_pos, cb_pos,
+  CysteinResolve<FRMRotamerGroupPtr>(rot_groups, ca_pos, cb_pos,
                                       disulfid_score_thresh, disulfid_indices,
                                       rotamer_indices);
 
-  if(optimize_rotamers){
+  if(optimize_subrotamers) {
 
-    for(uint i = 0; i < disulfid_indices.size(); ++i){
+    for(uint i = 0; i < disulfid_indices.size(); ++i) {
 
       const std::pair<uint, uint>& group_pair = disulfid_indices[i];
       const std::pair<uint, uint>& rotamer_pair = rotamer_indices[i];
@@ -458,4 +438,4 @@ void ResolveCysteins(const std::vector<FRMRotamerGroupPtr>& rot_groups,
 }
 
 
-}} //ns
+}} // ns
diff --git a/sidechain/src/disulfid.hh b/sidechain/src/disulfid.hh
index 84f98aaed96b86342031e10b9f30ad1cafc4016d..ac6aa87e196c4e4f0873c9068e7e932798021aca 100644
--- a/sidechain/src/disulfid.hh
+++ b/sidechain/src/disulfid.hh
@@ -10,13 +10,6 @@
 namespace promod3{ namespace sidechain{
 
 
-Real DisulfidRawScore(const geom::Vec3& ca_pos_one, 
-                      const geom::Vec3& cb_pos_one,
-                      const geom::Vec3& sg_pos_one, 
-                      const geom::Vec3& ca_pos_two, 
-                      const geom::Vec3& cb_pos_two, 
-                      const geom::Vec3& sg_pos_two);
-
 Real DisulfidScore(RRMRotamerPtr rot_one, RRMRotamerPtr rot_two, 
                    const geom::Vec3& ca_pos_one, const geom::Vec3& cb_pos_one, 
                    const geom::Vec3& ca_pos_two, const geom::Vec3& cb_pos_two);
@@ -39,6 +32,6 @@ Real DisulfidScore(FRMRotamerPtr rot_one, FRMRotamerPtr rot_two,
                       std::vector<std::pair<uint, uint> >& disulfid_indices,
                       std::vector<std::pair<uint, uint> >& rotamer_indices);
 
-}}//ns
+}} // ns
 
 #endif
diff --git a/sidechain/src/rotamer.cc b/sidechain/src/rotamer.cc
index 0167bec90866fd8e070298b29eeaf5a16e2b73c0..71443cb8feb51f25abc7805f41a5973777f51e99 100644
--- a/sidechain/src/rotamer.cc
+++ b/sidechain/src/rotamer.cc
@@ -7,8 +7,10 @@ namespace promod3{ namespace sidechain{
 RRMRotamer::RRMRotamer(const std::vector<Particle>& particles, 
                        Real probability, Real internal_e_prefactor):
                        particles_(particles), n_particles_(particles.size()), 
-                       internal_energy_(0.0), frame_energy_(0.0), probability_(probability),
-                       internal_e_prefactor_(internal_e_prefactor){ }
+                       internal_energy_(0.0), frame_energy_(0.0), 
+                       probability_(probability),
+                       internal_e_prefactor_(internal_e_prefactor) { }
+
 
 void RRMRotamer::ApplyOnResidue(ost::mol::ResidueHandle& res,
                                 bool consider_hydrogens,
@@ -18,7 +20,7 @@ void RRMRotamer::ApplyOnResidue(ost::mol::ResidueHandle& res,
                                 "RRMRotamer::ApplyOnResidue", 2);
 
   ost::mol::XCSEditor ed = res.GetEntity().EditXCS(ost::mol::BUFFERED_EDIT);
-  for(uint i = 0; i < n_particles_; ++i){
+  for(uint i = 0; i < n_particles_; ++i) {
     const Particle& p=particles_[i];
     const String& particle_name =p.GetName();
     if(particle_name[0] == 'H' && !consider_hydrogens) continue;
@@ -38,6 +40,7 @@ void RRMRotamer::ApplyOnResidue(ost::mol::ResidueHandle& res,
   }
 }
 
+
 void RRMRotamer::ApplyOnResidue(loop::AllAtomPositions& all_atom,
                                 uint res_idx) const {
 
@@ -55,38 +58,43 @@ void RRMRotamer::ApplyOnResidue(loop::AllAtomPositions& all_atom,
   }
 }
 
+
 FrameResiduePtr RRMRotamer::ToFrameResidue(uint res_idx) const {
 
   FrameResiduePtr frame_res(new FrameResidue(particles_, res_idx));
   return frame_res;
 }
 
+
 FRMRotamer::FRMRotamer(const std::vector<Particle>& particles, Real T, 
                        Real probability, Real internal_e_prefactor):
                        particles_(particles), n_particles_(particles.size()),
                        active_subrotamer_(0), internal_energy_(0.0),
                        frame_energy_(0.0), T_(T), probability_(probability),
-                       internal_e_prefactor_(internal_e_prefactor){
+                       internal_e_prefactor_(internal_e_prefactor) {
   subrotamer_associations_.resize(n_particles_,std::vector<int>());
 }
 
-void FRMRotamer::AddSubrotamerDefinition(const std::vector<int>& definition){
+
+void FRMRotamer::AddSubrotamerDefinition(const std::vector<int>& definition) {
   uint subrotamer_index = subrotamer_definitions_.size();
   subrotamer_definitions_.push_back(definition);
   for(std::vector<int>::const_iterator i = definition.begin(); 
-      i != definition.end();++i){
+      i != definition.end();++i) {
     subrotamer_associations_[*i].push_back(subrotamer_index);
   }
   frame_energies_.push_back(0.0);
 }
 
+
 void FRMRotamer::SetActiveSubrotamer(uint idx) {
-  if(idx >= subrotamer_definitions_.size()){
+  if(idx >= subrotamer_definitions_.size()) {
     throw promod3::Error("Invalid subrotamer idx provided!");
   }
   active_subrotamer_ = idx;
 }
 
+
 void FRMRotamer::ApplyOnResidue(ost::mol::ResidueHandle& res,
                                 bool consider_hydrogens,
                                 const String& new_res_name) const {
@@ -94,11 +102,11 @@ void FRMRotamer::ApplyOnResidue(ost::mol::ResidueHandle& res,
   core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
                                 "FRMRotamer::ApplyOnResidue", 2);
 
-  if(subrotamer_definitions_.empty()){
+  if(subrotamer_definitions_.empty()) {
     throw promod3::Error("At least one subrotamer must be set in FRM rotamer!");
   }
 
-  if(active_subrotamer_ >= subrotamer_definitions_.size()){
+  if(active_subrotamer_ >= subrotamer_definitions_.size()) {
     throw promod3::Error("Need to add subrotamer definitions to "
                          "apply FRMRotamer to residue!");
   }
@@ -112,7 +120,7 @@ void FRMRotamer::ApplyOnResidue(ost::mol::ResidueHandle& res,
     const String& particle_name = p.GetName();
     if(particle_name[0] == 'H' && !consider_hydrogens) continue;
     a = res.FindAtom(particle_name);
-    if (a.IsValid()){
+    if (a.IsValid()) {
       // weirdly enough, the commented out command is significantly slower 
       // (at least on el schdaudoputer) There is no obvious reason for that...
       ed.DeleteAtom(a);
@@ -124,20 +132,21 @@ void FRMRotamer::ApplyOnResidue(ost::mol::ResidueHandle& res,
     }
   }
 
-  if(new_res_name != ""){
+  if(new_res_name != "") {
     ed.RenameResidue(res,new_res_name);
     res.SetOneLetterCode(ost::conop::ResidueNameToOneLetterCode(new_res_name));
   }
   ed.UpdateICS();
 }
 
+
 void FRMRotamer::ApplyOnResidue(loop::AllAtomPositions& all_atom,
                                 uint res_idx) const {
 
   core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
                                 "FRMRotamer::ApplyOnResidueAA", 2);
 
-  if(active_subrotamer_ >= subrotamer_definitions_.size()){
+  if(active_subrotamer_ >= subrotamer_definitions_.size()) {
     throw promod3::Error("Need to add subrotamer definitions to "
                          "apply FRMRotamer to residue!");
   }
@@ -145,7 +154,8 @@ void FRMRotamer::ApplyOnResidue(loop::AllAtomPositions& all_atom,
   // check res_idx
   all_atom.CheckResidueIndex(res_idx);
   // reset all heavy atoms
-  const std::vector<int>& sub_def_ = subrotamer_definitions_[active_subrotamer_];
+  const std::vector<int>& sub_def_ = 
+  subrotamer_definitions_[active_subrotamer_];
   for (uint i = 0; i < sub_def_.size(); ++i) {
     const Particle& p = particles_[sub_def_[i]];
     const String& particle_name = p.GetName();
@@ -158,36 +168,38 @@ void FRMRotamer::ApplyOnResidue(loop::AllAtomPositions& all_atom,
 
 FrameResiduePtr FRMRotamer::ToFrameResidue(uint res_idx) const {
 
-  if(active_subrotamer_ >= subrotamer_definitions_.size()){
+  if(active_subrotamer_ >= subrotamer_definitions_.size()) {
     throw promod3::Error("Need to add subrotamer definitions to "
                          "generate FrameResidue!");
   }
 
   const std::vector<int>& sub_def = subrotamer_definitions_[active_subrotamer_];
   std::vector<Particle> particles(sub_def.size());
-  for(uint i = 0; i < sub_def.size(); ++i){
+  for(uint i = 0; i < sub_def.size(); ++i) {
     particles[i] = particles_[sub_def[i]];
   }
   FrameResiduePtr frame_res(new FrameResidue(particles, res_idx));
   return frame_res;
 }
 
+
 RRMRotamerPtr FRMRotamer::ToRRMRotamer() const {
 
-  if(active_subrotamer_ >= subrotamer_definitions_.size()){
+  if(active_subrotamer_ >= subrotamer_definitions_.size()) {
     throw promod3::Error("Need to add subrotamer definitions to "
                          "to generate RRMRotamer!");
   }
 
   const std::vector<int>& sub_def = subrotamer_definitions_[active_subrotamer_];
   std::vector<Particle> particles(sub_def.size());
-  for(uint i = 0; i < sub_def.size(); ++i){
+  for(uint i = 0; i < sub_def.size(); ++i) {
     particles[i] = particles_[sub_def[i]];
   }
-  RRMRotamerPtr rot(new RRMRotamer(particles, probability_, internal_e_prefactor_));
+  RRMRotamerPtr rot(new RRMRotamer(particles, probability_, 
+                                   internal_e_prefactor_));
   rot->SetFrameEnergy(frame_energies_[active_subrotamer_]);
   rot->SetInternalEnergy(internal_energy_);
   return rot;
 }
 
-}}//ns
+}} // ns
diff --git a/sidechain/src/rotamer.hh b/sidechain/src/rotamer.hh
index 14a38769a9b5a2e51e67a714dd0eb5c9a6196412..45ce313939a798828f47988b1158678907f7c0d2 100644
--- a/sidechain/src/rotamer.hh
+++ b/sidechain/src/rotamer.hh
@@ -153,10 +153,12 @@ public:
   typedef std::vector<Particle>::iterator iterator;
   typedef std::vector<Particle>::const_iterator const_iterator;
 
-  typedef std::vector<std::vector<int> >::const_iterator const_subrotamer_iterator;
+  typedef std::vector<std::vector<int> >::const_iterator 
+  const_subrotamer_iterator;
   typedef std::vector<std::vector<int> >::iterator subrotamer_iterator;
 
-  typedef std::vector<int>::const_iterator const_subrotamer_association_iterator;
+  typedef std::vector<int>::const_iterator 
+  const_subrotamer_association_iterator;
   typedef std::vector<int>::iterator subrotamer_association_iterator;
   
   iterator begin() { return particles_.begin(); }
@@ -210,6 +212,6 @@ private:
   Real internal_e_prefactor_;
 };
 
-}}//ns
+}} // ns
 
 #endif
diff --git a/sidechain/src/rotamer_graph.cc b/sidechain/src/rotamer_graph.cc
index 43df7f611b5b97d6288015a334b3af4338c841e1..dff604b654ce11ec96ba155db7812207cfd3330f 100644
--- a/sidechain/src/rotamer_graph.cc
+++ b/sidechain/src/rotamer_graph.cc
@@ -1,2024 +1,44 @@
-#include <algorithm>
-#include <queue>
-#include <limits>
-
 #include <promod3/sidechain/rotamer_graph.hh>
-#include <promod3/core/tree.hh>
-#include <promod3/core/runtime_profiling.hh>
-#include <promod3/core/enumerator.hh>
-#include <promod3/core/message.hh>
-
-#include <boost/random/mersenne_twister.hpp>
-#include <boost/random/uniform_01.hpp>
-
-
-namespace{
-
-bool active_rotamer_sorter(std::pair<uint,Real> a, std::pair<uint,Real> b){
-  return a.second < b.second;
-}
-
-
-
-////////////////////////////////////////////////////////////////
-//FUNCTIONS AND DATA STRUCTURES FOR THE TREE SOLVING ALGORITHM//
-////////////////////////////////////////////////////////////////
-
-typedef promod3::core::TreeBag<int> TreeBag;
-
-//calculates a linear idx for a certain combination in the lset
-struct LSetIdxCalculator{
-
-  LSetIdxCalculator() { }
-
-  LSetIdxCalculator(const std::vector<unsigned short>& num_candidates){
-    lset_size = num_candidates.size();
-    for(int i = 0; i < lset_size; ++i){
-      int temp = 1;
-      for(int j = i + 1; j < lset_size; ++j){
-        temp *= num_candidates[j];
-      }
-      idx_helper.push_back(temp);
-    }
-    idx_helper.push_back(1);
-  }
-
-  inline int GetLIdx(const std::vector<unsigned short>& indices) const{
-    int idx = 0;
-    for(int i = 0; i < lset_size; ++i){
-      idx += idx_helper[i] * indices[i];
-    }
-    return idx;
-  }
-
-  inline int GetIdxHelper(int idx){
-    return idx_helper[idx];
-  }
-
-  std::vector<int> idx_helper;
-  int lset_size;
-};
-
-//wrapper around pairwise rotamer energies considering the fact, 
-//that the node with lower idx is by construction defining the row, 
-//whereas the other defines the column
-struct PairwiseEWrapper{
-
-  PairwiseEWrapper(int node_one,
-                   int node_two,
-                   int num_rotamers_one,
-                   int num_rotamers_two,
-                   Real* e) {
-
-    if(node_two > node_one) {
-      multiplicator_one = num_rotamers_two;
-      multiplicator_two = 1;
-    }
-    else {
-      multiplicator_one = 1;
-      multiplicator_two = num_rotamers_one;
-    }
-
-    energies = e;
-  }
-
-  inline Real GetEnergy(int rotamer_one, int rotamer_two) const{
-    return energies[rotamer_one * multiplicator_one + 
-                    rotamer_two * multiplicator_two];
-  }
-
-  int multiplicator_one;
-  int multiplicator_two;
-  Real* energies;
-};
-
-
-
-struct BagData{
-
-  //members of the bag that are also present in parent bag
-  std::vector<int> lset;
-  //members of the bag that are not present in parent bag
-  std::vector<int> rset;
-
-  //number of rotamers for every entry in lset/rset
-  uint num_l_combinations;
-  uint num_r_combinations;
-  std::vector<unsigned short> num_l_rotamers;
-  std::vector<unsigned short> num_r_rotamers;
-
-  // optimal solution in r set given a certain combination in l
-  // the index for a certain combination in l can be estimated with
-  // l_set_idx_calculator
-  // assuming an l_idx of x, the according optimal rset data starts
-  // at x * rset.size()
-  std::vector<unsigned short> optimal_rset_combination;
-
-  //the according score
-  std::vector<Real> optimal_r_score;
-
-  //calculates an index in optimal_r_combination/optimal_r_score
-  //given a certain combination in l
-  LSetIdxCalculator lset_idx_calculator;
-
-  //the bag data indices for the children attached to this bag
-  std::vector<int> children_indices;
-  int num_children;
-
-  //super complicated mapping structure of getting stuff out from the children
-  //the idea is, that we can calculate the lset idx in several steps in the
-  //enumeration procedure...
-
-  //for every child we have a vector of with indices describing the
-  //elements in the current lset being part of the childrens lset
-  std::vector<std::vector<int> > lset_child_l_indices;
-  //the number it has to be multiplied to construct the index for
-  //that particular child lset
-  std::vector<std::vector<int> > lset_child_l_index_helpers;
-  //store the size of the stuff above for every child
-  std::vector<int> num_lset_child_l;
-
-  //equivalent for the current rset
-  std::vector<std::vector<int> > rset_child_l_indices;
-  std::vector<std::vector<int> > rset_child_l_index_helpers;
-  std::vector<int> num_rset_child_l; 
-
-  //this data structure will be altered during the calculation and is a
-  //placeholder to query optimal solutions for certain lsets of the children
-  std::vector<std::vector<int> > children_l_combinations;
-
-  //self energies of the rset
-  std::vector<Real*> r_self_energies;
-
-  //stuff for lr and rl pairwise energies
-  std::vector<PairwiseEWrapper> lr_energies;
-  std::vector<int> lr_index_in_I;
-  std::vector<int> lr_index_in_R;
-
-  //stuff for rr pairwise energies
-  std::vector<PairwiseEWrapper> rr_energies;
-  std::vector<int> rr_index_in_R_one;
-  std::vector<int> rr_index_in_R_two;
-}; 
-
-//Fills only the bare minimum of data into the BagData vector and already
-//estimates the complexity of the tree solving procedure. All other data
-//gets filled in the FillBagData function
-uint64_t FillRawBagData(const std::vector<TreeBag*>& traversal,
-                        const std::vector<int>& num_active_rotamers,
-                        std::vector<BagData>& bag_data){
-
-  uint64_t complexity = 0;
-
-  bag_data.clear();
-  bag_data.resize(traversal.size());
-
-  for(uint bag_idx = 0; bag_idx < traversal.size(); ++bag_idx){
-
-    TreeBag* bag = traversal[bag_idx];
-    TreeBag* parent = traversal[bag_idx]->GetParent();
-
-    //assign rset and lset
-    if(parent == NULL){
-      //it's the root, lets shuffle all to rset
-      bag_data[bag_idx].rset.assign(bag->members_begin(),
-                                    bag->members_end());
-    }
-    else{
-      for(TreeBag::const_member_iterator it = bag->members_begin(); 
-          it != bag->members_end(); ++it){
-        if(parent->HasMember(*it)) bag_data[bag_idx].lset.push_back(*it);
-        else bag_data[bag_idx].rset.push_back(*it);
-      }
-    }
-
-    //figure out how many rotamers there are
-    bag_data[bag_idx].num_l_combinations = 1;
-    bag_data[bag_idx].num_r_combinations = 1;
-
-    for(std::vector<int>::iterator i = bag_data[bag_idx].lset.begin(); 
-        i != bag_data[bag_idx].lset.end(); ++i){
-      bag_data[bag_idx].num_l_rotamers.push_back(num_active_rotamers[*i]);
-      bag_data[bag_idx].num_l_combinations *= num_active_rotamers[*i];
-    }
-
-    for(std::vector<int>::iterator i = bag_data[bag_idx].rset.begin(); 
-        i != bag_data[bag_idx].rset.end(); ++i){
-      bag_data[bag_idx].num_r_rotamers.push_back(num_active_rotamers[*i]);
-      bag_data[bag_idx].num_r_combinations *= num_active_rotamers[*i];
-    }
-
-    complexity += (bag_data[bag_idx].num_l_combinations * 
-                   bag_data[bag_idx].num_r_combinations);
-  }
-
-  return complexity;
-}  
-
-
-void FillBagData(const std::vector<TreeBag*>& traversal,
-                 std::vector<Real*> self_energies,
-                 std::map<std::pair<int,int>, Real*> pairwise_energies,
-                 std::vector<BagData>& bag_data){
-  
-  for(uint bag_idx = 0; bag_idx < traversal.size(); ++bag_idx){
-
-    TreeBag* bag = traversal[bag_idx];
-    BagData& current_data = bag_data[bag_idx];
-
-    //allocate required space for optimal r combinations for every possible lset
-    current_data.optimal_rset_combination.resize(current_data.num_l_combinations *
-                                                 current_data.rset.size());    
-    current_data.optimal_r_score.resize(current_data.num_l_combinations);
-
-    //generate a new lset idxgenerator...
-    current_data.lset_idx_calculator = 
-    LSetIdxCalculator(current_data.num_l_rotamers);
-
-    //get all the children stuff right
-    for(TreeBag::const_child_iterator it = bag->children_begin(); 
-        it != bag->children_end(); ++it){
-      current_data.children_indices.push_back((*it)->GetIdx());
-    }
-    current_data.num_children = current_data.children_indices.size();
-
-    //handle current lset
-    current_data.lset_child_l_indices.resize(current_data.num_children);
-    current_data.lset_child_l_index_helpers.resize(current_data.num_children);
-    for(uint i = 0; i < current_data.lset.size(); ++i){
-      int val = current_data.lset[i];
-      //go through all children
-      for(int j = 0; j < current_data.num_children; ++j){
-        int ch_idx = current_data.children_indices[j];
-        //we can be sure of the children lsets being set due to the postorder
-        //traversal of the tree
-        const std::vector<int>& child_lset = bag_data[ch_idx].lset;
-        std::vector<int>::const_iterator it = std::find(child_lset.begin(), 
-                                                        child_lset.end(), 
-                                                        val);
-        if(it != child_lset.end()){
-          //its in the childs lset!
-          int idx_in_child_l = it - child_lset.begin();
-          current_data.lset_child_l_indices[j].push_back(i);
-          int helper = bag_data[ch_idx].lset_idx_calculator.GetIdxHelper(idx_in_child_l);
-          current_data.lset_child_l_index_helpers[j].push_back(helper);
-        }
-      }
-    }
-    for(int i = 0; i < current_data.num_children; ++i){
-      current_data.num_lset_child_l.push_back(current_data.lset_child_l_indices[i].size());
-    }
-
-    //do the same for the rset
-    current_data.rset_child_l_indices.resize(current_data.num_children);
-    current_data.rset_child_l_index_helpers.resize(current_data.num_children);
-    for(uint i = 0; i < current_data.rset.size(); ++i){
-      int val = current_data.rset[i];
-      //go through all children
-      for(int j = 0; j < current_data.num_children; ++j){
-        int ch_idx = current_data.children_indices[j];
-        //we can be sure of the children lsets being set due to the postorder
-        //traversal of the tree
-        const std::vector<int>& child_lset = bag_data[ch_idx].lset;
-        std::vector<int>::const_iterator it = std::find(child_lset.begin(), 
-                                                        child_lset.end(), 
-                                                        val);
-        if(it != child_lset.end()){
-          //its in the childs lset!
-          int idx_in_child_l = it - child_lset.begin();
-          current_data.rset_child_l_indices[j].push_back(i);
-          int helper = bag_data[ch_idx].lset_idx_calculator.GetIdxHelper(idx_in_child_l);
-          current_data.rset_child_l_index_helpers[j].push_back(helper);
-        }
-      }
-    }
-    for(int i = 0; i < current_data.num_children; ++i){
-      current_data.num_rset_child_l.push_back(current_data.rset_child_l_indices[i].size());
-    }
-
-    //prepare the lset combinations
-    for(std::vector<int>::iterator i = current_data.children_indices.begin();
-        i != current_data.children_indices.end(); ++i){
-      int size = bag_data[*i].lset.size();
-      current_data.children_l_combinations.push_back(std::vector<int>(size,0));
-    }
-
-    //fill the rset self energies
-    for(std::vector<int>::iterator i = current_data.rset.begin();
-        i != current_data.rset.end(); ++i){
-      current_data.r_self_energies.push_back(self_energies[*i]);
-    }
-
-    //fill the lr pairwise energies
-    for(uint i = 0; i < current_data.lset.size(); ++i){
-      for(uint j = 0; j < current_data.rset.size(); ++j){
-        std::pair<int,int> idx_pair = std::make_pair(current_data.lset[i],
-                                                     current_data.rset[j]); 
-        std::map<std::pair<int,int>, Real*>::iterator e_it =
-        pairwise_energies.find(idx_pair);
-        if(e_it != pairwise_energies.end()){
-          current_data.lr_energies.push_back(PairwiseEWrapper(current_data.lset[i],
-                                                              current_data.rset[j],
-                                                              current_data.num_l_rotamers[i],
-                                                              current_data.num_r_rotamers[j],
-                                                              e_it->second));
-          current_data.lr_index_in_I.push_back(i);
-          current_data.lr_index_in_R.push_back(j);
-          continue;
-        }
-        idx_pair = std::make_pair(current_data.rset[j], current_data.lset[i]); 
-        e_it = pairwise_energies.find(idx_pair);
-        if(e_it != pairwise_energies.end()){
-          current_data.lr_energies.push_back(PairwiseEWrapper(current_data.lset[i],
-                                                              current_data.rset[j],
-                                                              current_data.num_l_rotamers[i],
-                                                              current_data.num_r_rotamers[j],
-                                                              e_it->second));
-          current_data.lr_index_in_I.push_back(i);
-          current_data.lr_index_in_R.push_back(j);
-        }
-      }
-    }
-
-    //fill the rr pairwise energies
-    for(uint i = 0; i < current_data.rset.size(); ++i){
-      for(uint j = i + 1; j < current_data.rset.size(); ++j){
-
-        std::pair<int,int> idx_pair = std::make_pair(current_data.rset[i],
-                                                     current_data.rset[j]); 
-        std::map<std::pair<int,int>, Real*>::iterator e_it =
-        pairwise_energies.find(idx_pair);
-        if(e_it != pairwise_energies.end()){
-          current_data.rr_energies.push_back(PairwiseEWrapper(current_data.rset[i],
-                                                              current_data.rset[j],
-                                                              current_data.num_r_rotamers[i],
-                                                              current_data.num_r_rotamers[j],
-                                                              e_it->second));
-          current_data.rr_index_in_R_one.push_back(i);
-          current_data.rr_index_in_R_two.push_back(j);
-          continue;
-        }
-        idx_pair = std::make_pair(current_data.rset[j], current_data.rset[i]); 
-        e_it = pairwise_energies.find(idx_pair);
-        if(e_it != pairwise_energies.end()){
-          current_data.rr_energies.push_back(PairwiseEWrapper(current_data.rset[i],
-                                                              current_data.rset[j],
-                                                              current_data.num_r_rotamers[i],
-                                                              current_data.num_r_rotamers[j],
-                                                              e_it->second));
-          current_data.rr_index_in_R_one.push_back(i);
-          current_data.rr_index_in_R_two.push_back(j);
-        }
-      }
-    }
-  }
-}
-
-void EnumerateBagData(std::vector<BagData>& bag_data){
-
-  for(uint bag_idx = 0; bag_idx < bag_data.size(); ++bag_idx){
-
-    //data of the current bag
-    BagData& data = bag_data[bag_idx];
-    int rset_size = data.rset.size();
-    int num_lr_energies = data.lr_energies.size();
-    int num_rr_energies = data.rr_energies.size();
-
-    //the lset of this bag we have to enumerate
-    promod3::core::Enumerator<unsigned short> 
-    l_set_enumerator(data.num_l_rotamers);
-    std::vector<unsigned short>& current_l_enum = 
-    l_set_enumerator.CurrentEnum();
-
-    int num_children = data.children_indices.size();
-    int partial_l_indices[num_children];
-
-    do {      
-
-      memset(partial_l_indices, 0 , num_children * sizeof(int));
-      for(int j = 0; j < num_children; ++j){
-        for(int k = 0; k < data.num_lset_child_l[j]; ++k){
-          partial_l_indices[j] += 
-          (current_l_enum[data.lset_child_l_indices[j][k]] *
-          data.lset_child_l_index_helpers[j][k]);
-        }
-      }
-
-      promod3::core::Enumerator<unsigned short> 
-      r_set_enumerator(data.num_r_rotamers);  
-      std::vector<unsigned short>& current_r_enum = 
-      r_set_enumerator.CurrentEnum();
-
-      Real score;
-      Real best_score = std::numeric_limits<Real>::max();
-      std::vector<unsigned short> best_rset = current_r_enum;
-
-      //let's find the optimal r combination given the current l combination... 
-      do {      
-
-        score = 0;
-
-        //sum up the r self energies
-        for(int i = 0; i < rset_size; ++i){
-          score += data.r_self_energies[i][current_r_enum[i]];
-        }
-
-        //sum up the lr pairwise energies
-        for(int i = 0; i < num_lr_energies; ++i){
-          score += 
-          data.lr_energies[i].GetEnergy(current_l_enum[data.lr_index_in_I[i]],
-                                        current_r_enum[data.lr_index_in_R[i]]);
-        }
-
-        //sum up the rr pairwise energies
-        for(int i = 0; i < num_rr_energies; ++i){
-          score += 
-          data.rr_energies[i].GetEnergy(current_r_enum[data.rr_index_in_R_one[i]],
-                                        current_r_enum[data.rr_index_in_R_two[i]]);
-        }
-
-        for(int i = 0; i < num_children; ++i){
-          int l_idx = partial_l_indices[i];
-          for(int j = 0; j < data.num_rset_child_l[i]; ++j){
-            l_idx += (current_r_enum[data.rset_child_l_indices[i][j]] *
-                      data.rset_child_l_index_helpers[i][j]);
-          }
-          score += bag_data[data.children_indices[i]].optimal_r_score[l_idx];
-        }
-
-        if(score < best_score){
-          best_score = score;
-          best_rset = current_r_enum;
-        }
-
-      } while(r_set_enumerator.Next());
-
-      int l_idx = data.lset_idx_calculator.GetLIdx(current_l_enum);
-      memcpy(&data.optimal_rset_combination[l_idx*rset_size],
-             &best_rset[0], rset_size * sizeof(unsigned short));
-      data.optimal_r_score[l_idx] = best_score;
-
-    } while(l_set_enumerator.Next());
-  } 
-}
-
-void CollectSolutionFromBagData(const std::vector<BagData>& bag_data,
-                                int bag_idx, std::vector<int>& solution){
-
-  const BagData& bag = bag_data[bag_idx];
-
-  //collect the lset values from the solution
-  std::vector<unsigned short> l_solution(bag.lset.size(), 0);
-  for(uint i = 0; i < l_solution.size(); ++i){
-    l_solution[i] = solution[bag.lset[i]];
-  }
-
-  //get the index of the ideal r_combination given that l solution
-  int r_idx = bag.lset_idx_calculator.GetLIdx(l_solution);
-  //and fill the according values into the solution
-  int rset_size = bag.rset.size();
-  int data_start_idx = r_idx * rset_size;
-  for(int i = 0; i < rset_size; ++i){
-    solution[bag.rset[i]] = bag.optimal_rset_combination[data_start_idx+i];
-  }
-
-  //recursively call this function for all the children
-  for(std::vector<int>::const_iterator i = bag.children_indices.begin();
-      i != bag.children_indices.end(); ++i){
-    CollectSolutionFromBagData(bag_data, *i, solution);
-  }
-}
-
-/////////////////////////////////////////////////////////////////
-//FUNCTIONS AND DATA STRUCTURES FOR THE ASTAR SOLVING ALGORITHM//
-/////////////////////////////////////////////////////////////////
-struct AStarNode{
-
-  AStarNode(uint idx, uint p_idx, unsigned short r_idx, 
-            unsigned short t_d, Real gs, Real hs): node_idx(idx),
-                                                   parent_idx(p_idx),
-                                                   rotamer_idx(r_idx),
-                                                   tree_depth(t_d),
-                                                   gstar(gs),
-                                                   hstar(hs) { }
-
-  uint node_idx;
-  uint parent_idx;
-  unsigned short rotamer_idx;
-  unsigned short tree_depth;
-  Real gstar;
-  Real hstar;
-};
-
-class CompareAStarNodes{
-public:
-    bool operator() (AStarNode* a, AStarNode* b){
-        return (a->gstar + a->hstar) > (b->gstar + b->hstar);
-    }
-};
 
-void ReconstructSearchTreePath(const std::vector<AStarNode>& node_array,
-                               uint start_idx, 
-                               std::vector<int>& path){
 
-  path.resize(node_array[start_idx].tree_depth);
-  uint current_node_idx = start_idx;
+namespace promod3 { namespace sidechain {
 
-  while(current_node_idx != 0){
-    path[node_array[current_node_idx].tree_depth-1] = 
-    node_array[current_node_idx].rotamer_idx;
-    current_node_idx = node_array[current_node_idx].parent_idx;
-  }
-}
-
-/////////////////////////////////////////////////////////////////
-//FUNCTIONS AND DATA STRUCTURES FOR THE MC SOLVING ALGORITHM//
-/////////////////////////////////////////////////////////////////
-
-Real GetRotamerEnergy(int node_idx, int rot_idx,
-            const std::vector<int>& current_configuration,
-            const std::vector<Real*>& self_energies,
-            const std::vector<std::vector<std::pair<int, PairwiseEWrapper> > >& 
-            pairwise_energies) {
-
-  Real e = self_energies[node_idx][rot_idx];
-
-  for(std::vector<std::pair<int, PairwiseEWrapper> >::const_iterator
-      it = pairwise_energies[node_idx].begin(); 
-      it != pairwise_energies[node_idx].end(); ++it) {
-    e += it->second.GetEnergy(rot_idx, current_configuration[it->first]);
-  }
-
-  return e;
-}
-
-Real GetGlobalEnergy(const std::vector<int>& solution,
-               const std::vector<Real*> self_energies,
-               const std::vector<std::vector<std::pair<int, PairwiseEWrapper> > >& 
-               pairwise_energies) {
-
-  Real e = 0.0;
-  int num_nodes = solution.size();
-  for(int i = 0; i < num_nodes; ++i) {
-    e += self_energies[i][solution[i]];
-  }
-
-  for(int i = 0; i < num_nodes; ++i) {
-    for(std::vector<std::pair<int, PairwiseEWrapper> >::const_iterator 
-        j = pairwise_energies[i].begin(); j != pairwise_energies[i].end(); ++j) {
-      int other_node = j->first;
-      if(other_node > i) {
-        const PairwiseEWrapper& e_wrapper = j->second;
-        e += e_wrapper.GetEnergy(solution[i], solution[other_node]);
-      }
-    }
-  }
-
-  return e;
-}
-
-struct RotamerSelector {
-
-  RotamerSelector(std::vector<int> num_rotamers, int random_seed): 
-                                     n(num_rotamers.size()),
-                                     n_rot(num_rotamers),
-                                     rng(random_seed),
-                                     zeroone(rng) { }
-
-  int SelectNode() {
-    return static_cast<int>(zeroone() * n);
-  }
-
-  int SelectRotamer(int node_idx) {
-    return static_cast<int>(zeroone() * n_rot[node_idx]);
-  }
-
-  void InitRotamerSelection(std::vector<int>& current_solution) {
-    current_solution.resize(n);
-    for(int i = 0; i < n; ++i) {
-      current_solution[i] = this->SelectRotamer(i);
-    }
-  }
-
-  Real GetRandomNumber() {
-    return zeroone();
-  }
-
-  int n;
-  std::vector<int> n_rot;
-  boost::mt19937 rng;
-  boost::uniform_01<boost::mt19937&> zeroone;
-};
-
-
-} // anon ns
-
-namespace promod3{ namespace sidechain{
-
-RotamerGraphEdge::RotamerGraphEdge(uint index, 
-                                   RotamerGraphNode* node1, 
-                                   RotamerGraphNode* node2, 
-                                   uint num_i, uint num_j, 
-                                   Real* pairwise_energies):  index_(index),
-                                                              active_(true),
-                                                              node1_(node1), 
-                                                              node2_(node2),
-                                                              maxi_(num_i), 
-                                                              maxj_(num_j),
-                                                              pairwise_energies_(pairwise_energies){
-
-}
-
-RotamerGraphEdge::~RotamerGraphEdge(){
-  delete [] pairwise_energies_;
-  //Nodes don't get deleted here!
-  //It is assumed, that this happens in the graph object
-}
-
-void RotamerGraphEdge::Reset(){
-  active_ = true;
-}
-
-void RotamerGraphEdge::Deactivate(){
-  if(!active_) return;
-  active_ = false;
-}
-
-bool RotamerGraphEdge::Decompose(Real thresh){
-
-  if(!active_) return false;
-
-  Real summed_e = 0.0;
-  uint m = node1_->GetNumActiveRotamers();
-  uint n = node2_->GetNumActiveRotamers();
-  uint n_total = node2_->GetNumRotamers();
-  int temp;
-
-  for(RotamerGraphNode::iterator i = node1_->active_rotamers_begin();
-      i != node1_->active_rotamers_end(); ++i){
-    temp = (*i) * n_total;
-    for(RotamerGraphNode::iterator j = node2_->active_rotamers_begin();
-        j != node2_->active_rotamers_end(); ++j){
-      summed_e += pairwise_energies_[temp + (*j)];
-    }
-  }
-
-  Real avg_value = summed_e/(2*n*m);
-
-  std::vector<Real> ak(m);
-  std::vector<Real> bl(n);
-
-  uint m_counter = 0;
-  for(RotamerGraphNode::iterator i = node1_->active_rotamers_begin();
-      i != node1_->active_rotamers_end(); ++i){
-    summed_e = 0.0;
-    int temp = (*i) * n_total;
-    for(RotamerGraphNode::iterator j = node2_->active_rotamers_begin();
-        j != node2_->active_rotamers_end(); ++j){
-      summed_e += pairwise_energies_[temp + (*j)];
-    }
-    ak[m_counter] = summed_e/n - avg_value;
-    ++m_counter;
-  }
-
-  Real e;
-  uint n_counter = 0;
-  for(RotamerGraphNode::iterator i = node2_->active_rotamers_begin();
-      i != node2_->active_rotamers_end(); ++i){
-    summed_e = 0.0;
-    for(RotamerGraphNode::iterator j = node1_->active_rotamers_begin();
-        j != node1_->active_rotamers_end(); ++j){
-      summed_e += pairwise_energies_[(*j) * node2_->GetNumRotamers() + (*i)];
-    }
-    bl[n_counter] = summed_e/m - avg_value;
-
-    m_counter = 0;
-    for(RotamerGraphNode::iterator j = node1_->active_rotamers_begin();
-        j != node1_->active_rotamers_end(); ++j){
-      e = std::abs(pairwise_energies_[(*j)*n_total+(*i)]-
-                   ak[m_counter]-bl[n_counter]);
-      if(e > thresh) return false;
-      ++m_counter;
-    }
-    ++n_counter;
-  }
-
-  for(uint i = 0; i < m; ++i){
-    for(RotamerGraphNode::iterator j = node1_->active_rotamers_begin(); 
-        j != node1_->active_rotamers_end(); ++j){
-      node1_->AddValue(*j,ak[i]);
-    }
-  }
-
-  for(uint i = 0; i < n; ++i){
-    for(RotamerGraphNode::iterator j = node2_->active_rotamers_begin(); 
-        j != node2_->active_rotamers_end(); ++j){
-      node2_->AddValue(*j,bl[i]);
-    }
-  }
-  this->Deactivate();
-  node1_->RemoveFromActiveEdges(this);
-  node2_->RemoveFromActiveEdges(this);
-  return true;
-}
-
-Real RotamerGraphEdge::EMinDiff(const RotamerGraphNode* node_ptr, 
-                                uint idx1, uint idx2) const{
-
-  Real min = std::numeric_limits<Real>::max();
-  if(node_ptr == node1_){
-    int temp1 = idx1 * node2_->GetNumRotamers();
-    int temp2 = idx2 * node2_->GetNumRotamers();
-    for(RotamerGraphNode::const_iterator i = node2_->active_rotamers_begin();
-        i != node2_->active_rotamers_end(); ++i){
-      min = std::min(min,pairwise_energies_[temp1 + (*i)] - 
-                         pairwise_energies_[temp2 + (*i)]);
-    }
-    return min;
-  }
-  else if(node_ptr == node2_){
-    int num = node2_->GetNumRotamers();
-    for(RotamerGraphNode::const_iterator i = node1_->active_rotamers_begin();
-        i != node1_->active_rotamers_end(); ++i){
-      min = std::min(min,pairwise_energies_[(*i)*num + idx1] - 
-                         pairwise_energies_[(*i)*num + idx2]);
-    }
-    return min;
-  }
-  String err = "Cannot evaluate Node which is unconnected to the edge of ";
-  err += "interest!";
-  throw promod3::Error(err);
-}
-
-void RotamerGraphEdge::FillActiveEnergies(Real* pairwise_energies) const{
-  for(RotamerGraphNode::const_iterator i = node1_->active_rotamers_begin();
-      i != node1_->active_rotamers_end(); ++i){
-    for(RotamerGraphNode::const_iterator j = node2_->active_rotamers_begin();
-        j != node2_->active_rotamers_end(); ++j){
-      *pairwise_energies = pairwise_energies_[*i*node2_->GetNumRotamers() + *j];
-      ++pairwise_energies;
-    }
-  }
-}
-
-RotamerGraphNode* RotamerGraphEdge::GetOtherNode(RotamerGraphNode* node){
-  if(node == node1_) return node2_;
-  if(node == node2_) return node1_;
-  throw promod3::Error("Node does not belong to edge!");
-}
-
-RotamerGraphNode::RotamerGraphNode(uint index,
-           uint num_rotamers,
-           Real* internal_energies,
-           Real* frame_energies): active_(true),index_(index),
-                                   num_rotamers_(num_rotamers),
-                                   internal_energies_(internal_energies),
-                                   frame_energies_(frame_energies){
-
-  self_energies_ = new Real[num_rotamers_];
-
-  for(uint i = 0; i < num_rotamers_; ++i){
-    active_rotamers_.push_back(i);
-    self_energies_[i] = internal_energies_[i] + frame_energies_[i];
-    sorted_active_rotamers_.push_back(std::make_pair(i,self_energies_[i]));
-  }
-
-  std::sort(sorted_active_rotamers_.begin(), sorted_active_rotamers_.end(),
-            active_rotamer_sorter);
-}
-
-RotamerGraphNode::~RotamerGraphNode(){
-  delete [] internal_energies_;
-  delete [] frame_energies_;
-  delete [] self_energies_;
-}
-
-void RotamerGraphNode::Reset(){
-
-  //clear everything
-  active_rotamers_.clear();
-  active_edges_.clear();
-  sorted_active_rotamers_.clear();
-  active_ = true;
-
-  //and refill
-  for(uint i = 0; i < num_rotamers_; ++i){
-    active_rotamers_.push_back(i);
-    self_energies_[i] = internal_energies_[i] + frame_energies_[i];
-    sorted_active_rotamers_.push_back(std::make_pair(i,self_energies_[i]));
-  }
-  std::sort(sorted_active_rotamers_.begin(), sorted_active_rotamers_.end(),
-            active_rotamer_sorter);
-
-  for(uint i = 0; i < edges_.size(); ++i){
-    active_edges_.push_back(i);
-  }
-
-  for(std::vector<RotamerGraphEdge*>::iterator i = edges_.begin(); 
-      i != edges_.end(); ++i){ 
-    (*i)->Reset();
-  }
-}
-
-void RotamerGraphNode::Deactivate(int index){
-  if(!active_) return;
-  active_ = false;
+RotamerGraph::~RotamerGraph() { }
 
-  //if the given index is -1 (default), we simply search for the
-  //the rotamer with the lowest self energy as the last active rotamer,
-  //a.k.a. the solution for this node.
-  //In all other cases we take the rotamer at given index as solution.
-  if(index == -1){
-    //lets first figure out which is the lowest energy
-    //rotamer and set it to the only active rotamer
-    Real e_min = std::numeric_limits<Real>::max();
-    index = 0;
-    for(uint i = 0; i < active_rotamers_.size(); ++i){
-      if(self_energies_[active_rotamers_[i]] < e_min){
-        e_min = self_energies_[active_rotamers_[i]];
-        index = active_rotamers_[i];
-      }
-    }
-  }
-
-  active_rotamers_.resize(1);
-  active_rotamers_[0] = index;
-  
-  //deactivate all edges connected to this node
-  for(iterator i = this->active_edges_begin(); 
-      i != this->active_edges_end(); ++i){
-    RotamerGraphNode* other = edges_[*i]->GetOtherNode(this);
-    other->RemoveFromActiveEdges(edges_[*i]);
-    edges_[*i]->Deactivate();
-  } 
-  active_edges_.clear();
-}
-
-void RotamerGraphNode::AddEdge(RotamerGraphEdge* edge){
-  edges_.push_back(edge);
-  active_edges_.push_back(edges_.size()-1);
-}
+template<typename RotamerGroupPtr>
+RotamerGraphPtr RotamerGraph::CreateFromList(
+                const std::vector<RotamerGroupPtr>& rotamer_groups) {
 
-void RotamerGraphNode::AddValue(Real value){
-  for(std::vector<uint>::iterator i = active_rotamers_.begin();
-      i != active_rotamers_.end(); ++i){
-    self_energies_[*i] += value;
-  }
-}
+  core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
+                                "RotamerGraph::CreateFromList", 2);
 
-void RotamerGraphNode::AddValue(uint node_idx, Real value){
-  self_energies_[node_idx] += value;
-}
+  RotamerGraphPtr graph(new RotamerGraph);
 
-void RotamerGraphNode::RemoveFromActiveEdges(RotamerGraphEdge* edge){
+  // let's create the nodes
   uint counter = 0;
-  for(; counter < edges_.size(); ++counter){
-    if(edge == edges_[counter]){
-      iterator i = std::find(active_edges_.begin(), active_edges_.end(), 
-                             counter);
-      if(i != active_edges_.end()) active_edges_.erase(i);
-      return;
+  std::vector<Real> self_energies;
+  for(uint i = 0; i < rotamer_groups.size(); ++i) {
+    RotamerGroupPtr rot_group = rotamer_groups[i];
+    self_energies.resize(rot_group->size());
+    for(uint j = 0; j < rot_group->size(); ++j){
+      self_energies[j] = (*rot_group)[j]->GetSelfEnergy();
     }
+    graph->AddNode(self_energies);
   }
-}
-
-bool RotamerGraphNode::DEE(Real e_cut){
 
-  if(active_rotamers_.size() <= 1) return false;
-
-  bool something_happened = false; 
-  Real sum;
-  int rotamer_to_eliminate = sorted_active_rotamers_.size()-1;
-  while(rotamer_to_eliminate >= 0){
-    for(int i = 0; i < static_cast<int>(active_rotamers_.size()); ++i){
-      if(i == rotamer_to_eliminate) continue;
-      sum = self_energies_[sorted_active_rotamers_[rotamer_to_eliminate].first] -
-            self_energies_[sorted_active_rotamers_[i].first];
-      for(iterator j = this->active_edges_.begin(); 
-          j != this->active_edges_.end(); ++j){
-        sum += edges_[*j]->EMinDiff(this,
-                                    sorted_active_rotamers_[rotamer_to_eliminate].first,
-                                    sorted_active_rotamers_[i].first);
-      }
-      if(sum >= e_cut){
-        something_happened = true;
-        std::vector<uint>::iterator it = std::find(active_rotamers_.begin(),
-                                                   active_rotamers_.end(),
-                                                   sorted_active_rotamers_[rotamer_to_eliminate].first);
-        active_rotamers_.erase(it);
-        sorted_active_rotamers_.erase(sorted_active_rotamers_.begin() + 
-                                      rotamer_to_eliminate);
-        break;
+  // let's create the edges
+  for(uint i = 0; i < rotamer_groups.size(); ++i){
+    for(uint j = i+1; j < rotamer_groups.size(); ++j){
+      promod3::core::EMatXX emat;
+      if(rotamer_groups[i]->CalculatePairwiseEnergies(rotamer_groups[j],
+                                                      0.01, emat)) {
+        graph->AddEdge(i, j, emat);
       }
     }
-    --rotamer_to_eliminate;
-  }
-
-  return something_happened;
-}
-
-void RotamerGraphNode::FillActiveSelfEnergies(Real* self_energies) const{
-  for(const_iterator i = this->active_rotamers_begin();
-      i != this->active_rotamers_end(); ++i){
-    *self_energies = self_energies_[*i];
-    ++self_energies;
-  }
-}
-
-RotamerGraph::~RotamerGraph(){
-  for(std::vector<RotamerGraphNode*>::iterator i = nodes_.begin(); 
-      i != nodes_.end(); ++i){
-    delete *i;
   }
 
-  for(std::vector<RotamerGraphEdge*>::iterator i = edges_.begin(); 
-      i != edges_.end(); ++i){
-    delete *i;
-  }
+  return graph;
 }
 
-RotamerGraphPtr RotamerGraph::CreateFromRRMList(
-                const std::vector<RRMRotamerGroupPtr>& rotamer_groups) {
-
-  core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
-                                "Graph::CreateFromRRMList", 2);
-
-  RotamerGraphPtr graph(new RotamerGraph);
-
-  //let's create the nodes
-  graph->nodes_.resize(rotamer_groups.size());
-  uint counter = 0;
-  Real* internal_energies;
-  Real* frame_energies;
-  for(std::vector<RRMRotamerGroupPtr>::const_iterator i = rotamer_groups.begin(); 
-      i != rotamer_groups.end(); ++i, ++counter){
-    internal_energies = new Real[(*i)->size()];
-    frame_energies = new Real[(*i)->size()];
-    for(uint j = 0; j < (*i)->size(); ++j){
-      internal_energies[j] = (**i)[j]->GetInternalEnergy();
-      frame_energies[j] = (**i)[j]->GetFrameEnergy();
-    }
-    graph->nodes_[counter] = new RotamerGraphNode(counter,
-                                                  (*i)->size(),
-                                                  internal_energies,
-                                                  frame_energies);
-  }
-
-  //let's create the edges and directly add them to the corresponding nodes
-
-  for(uint i = 0; i < rotamer_groups.size(); ++i){
-    for(uint j = i+1; j < rotamer_groups.size(); ++j){
-      Real* pairwise_energies = 
-      rotamer_groups[i]->CalculatePairwiseEnergies(rotamer_groups[j],0.01);
-      if(pairwise_energies!=NULL){
-        RotamerGraphEdge* edge = new RotamerGraphEdge(graph->edges_.size(),
-                              graph->nodes_[i],graph->nodes_[j],
-                              rotamer_groups[i]->size(),
-                              rotamer_groups[j]->size(),
-                              pairwise_energies);
-        graph->nodes_[i]->AddEdge(edge);
-        graph->nodes_[j]->AddEdge(edge);
-        graph->edges_.push_back(edge);
-      }
-    }
-  }
-
-  return graph;
-}
-
-
-RotamerGraphPtr RotamerGraph::CreateFromFRMList(
-                const std::vector<FRMRotamerGroupPtr>& rotamer_groups) {
-
-  core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
-                                "Graph::CreateFromFRMList", 2);
-
-  RotamerGraphPtr graph(new RotamerGraph);
-
-  //let's create the nodes
-  graph->nodes_.resize(rotamer_groups.size());
-  uint counter = 0;
-  Real* internal_energies;
-  Real* frame_energies;
-  for(std::vector<FRMRotamerGroupPtr>::const_iterator i = rotamer_groups.begin(); 
-      i != rotamer_groups.end(); ++i, ++counter){
-    internal_energies = new Real[(*i)->size()];
-    frame_energies = new Real[(*i)->size()];
-    for(uint j = 0; j < (*i)->size(); ++j){
-      internal_energies[j] = (**i)[j]->GetInternalEnergy();
-      frame_energies[j] = (**i)[j]->GetFrameEnergy();
-    }
-    graph->nodes_[counter] = new RotamerGraphNode(counter,
-                                                  (*i)->size(),
-                                                  internal_energies,
-                                                  frame_energies);
-  }
-
-  //let's create the edges and directly add them to the corresponding nodes
-  for(uint i = 0; i < rotamer_groups.size(); ++i){
-    for(uint j = i+1; j < rotamer_groups.size(); ++j){
-      Real* pairwise_energies = 
-      rotamer_groups[i]->CalculatePairwiseEnergies(rotamer_groups[j],0.01);
-      if(pairwise_energies != NULL){
-        RotamerGraphEdge* edge = new RotamerGraphEdge(graph->edges_.size(),
-                              graph->nodes_[i],
-                              graph->nodes_[j],
-                              rotamer_groups[i]->size(),
-                              rotamer_groups[j]->size(),
-                              pairwise_energies);
-        graph->nodes_[i]->AddEdge(edge);
-        graph->nodes_[j]->AddEdge(edge);
-        graph->edges_.push_back(edge);          
-      }
-    }
-  }
-
-  return graph;
-}
-
-RotamerGraphPtr RotamerGraph::CreateFromArbitrarySource(
-                const std::vector<uint>& node_sizes,
-                const std::vector<Real*>& internal_energies,   
-                const std::vector<Real*>& frame_energies,
-                const std::vector<std::pair<uint,uint> >& edges,
-                const std::vector<Real*>& pairwise_energies) {
-
-  core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
-                                "Graph::CreateArbitrarySource", 2);
-
-  // That's how it should look like:
-  // for every graph node one element in node_sizes, internal_energies
-  // and frame_energies is expected. The frame_energies and internal_energies
-  // are Real* allocated with new => number of element corresponds to according
-  // node size! The RotamerGraphNodes take the ownership of the pointers
-  // => stuff gets deleted when the RotamerGraph is deleted...
-  // 
-  // For every edge, one element in edges and pairwise_energies is expected
-  // The elements in edges are pairs of integers defining the involved nodes
-  // note, that the first idx is expected to be smaller!
-  // The pairwise energies are Real* allocated with new.
-  // lets assume to have node A and B and the corresponding size_a and size_b
-  // if we want to extract the pairwise energies between the elements a and b
-  // we write: S(a,b) = real_ptr[a * size_a + b]
-  // The RotamerGraphEdge takes ownership over the pointers
-  // => stuff gets deleted when the RotamerGraph is deleted...
-
-  uint num_nodes = node_sizes.size();
-  uint num_edges = edges.size();
-
-  // check the input data
-  if(node_sizes.size() != internal_energies.size() || 
-     node_sizes.size() != frame_energies.size()) {
-    throw promod3::Error("node_sizes, internal_energies and frame_energies "
-                         "must have the same number of elements!");
-  }
-
-  if(edges.size() != pairwise_energies.size()) {
-    throw promod3::Error("Expect to have one pairwise energy value per edge!");
-  }
-
-  for(uint i = 0; i < num_edges; ++i) {
-    // first element of node idx pair must be smaller
-    if(edges[i].first >= edges[i].second) {
-      throw promod3::Error("The first element of the edge definition must "
-                           "always be smaller than the second one!");
-    }
-
-    // check whether they're too large
-    if(edges[i].first >= num_nodes || edges[i].second >= num_nodes) {
-      throw promod3::Error("Observed invalid idx in edge definition!");
-    }
-  }
-
-  RotamerGraphPtr graph(new RotamerGraph);
-
-  //let's create the nodes
-  graph->nodes_.resize(num_nodes);
-
-  for(uint i = 0; i < num_nodes; ++i){
-    graph->nodes_[i] = new RotamerGraphNode(i, node_sizes[i],
-                                           internal_energies[i],
-                                           frame_energies[i]);
-  }
-
-  //let's create the edges and directly add them to the corresponding nodes
-  for(uint i = 0; i < num_edges; ++i) {
-    uint idx_one = edges[i].first;
-    uint idx_two = edges[i].second;
-
-    RotamerGraphEdge* edge = new RotamerGraphEdge(i,graph->nodes_[idx_one],
-                                                  graph->nodes_[idx_two],
-                                                  node_sizes[idx_one],
-                                                  node_sizes[idx_two],
-                                                  pairwise_energies[i]);
-    graph->nodes_[idx_one]->AddEdge(edge);
-    graph->nodes_[idx_two]->AddEdge(edge);
-    graph->edges_.push_back(edge); 
-  }
-
-  return graph;
-}
-
-
-size_t RotamerGraph::GetNumActiveRotamers() const{
-  size_t num_rotamers = 0;
-  for(std::vector<RotamerGraphNode*>::const_iterator i = nodes_.begin(); 
-      i != nodes_.end(); ++i){
-    if(!(*i)->IsActive()) continue;
-    num_rotamers += (*i)->GetNumActiveRotamers();
-  }
-  return num_rotamers;
-}
-
-size_t RotamerGraph::GetNumActiveEdges() const{
-  size_t num_edges = 0;
-  for(std::vector<RotamerGraphEdge*>::const_iterator i = edges_.begin(); 
-      i != edges_.end(); ++i){
-    if((*i)->IsActive()) ++num_edges;
-  }
-  return num_edges; 
-}
-
-size_t RotamerGraph::GetNumActiveNodes() const{
-  size_t num_nodes = 0;
-  for(std::vector<RotamerGraphNode*>::const_iterator i = nodes_.begin(); 
-      i != nodes_.end(); ++i){
-    if((*i)->IsActive()) ++num_nodes;
-  }
-  return num_nodes;
-}
-
-size_t RotamerGraph::GetNumRotamers() const{
-  size_t num_rotamers = 0;
-  for(std::vector<RotamerGraphNode*>::const_iterator i = nodes_.begin(); 
-      i != nodes_.end(); ++i){
-    num_rotamers += (*i)->GetNumRotamers();
-  }
-  return num_rotamers;
-}
-
-void RotamerGraph::GetNumRotamers(std::vector<int>& num_rotamers) const{
-  num_rotamers.resize(nodes_.size());
-  for(uint i = 0; i < nodes_.size(); ++i){
-    num_rotamers[i] = nodes_[i]->GetNumRotamers();
-  }
-}
-
-void RotamerGraph::GetNumActiveRotamers(std::vector<int>& num_rotamers) const{
-  num_rotamers.resize(nodes_.size());
-  for(uint i = 0; i < nodes_.size(); ++i){
-    num_rotamers[i] = nodes_[i]->GetNumActiveRotamers();
-  }
-}
-
-void RotamerGraph::GetActiveRotamers(uint idx, 
-                                     std::vector<int>& active_rotamers) const {
-
-  if(idx >= nodes_.size()) {
-    throw promod3::Error("Invalid Index observed when extracting active "
-                         "rotamers!");
-  }
-
-  active_rotamers.clear();
-  active_rotamers.reserve(nodes_[idx]->GetNumActiveRotamers());
-
-  for(RotamerGraphNode::const_iterator i = nodes_[idx]->active_rotamers_begin();
-      i != nodes_[idx]->active_rotamers_end(); ++i) {
-    active_rotamers.push_back(*i);
-  }
-}
-
-void RotamerGraph::GetEdges(std::vector<std::pair<int,int> >& edges) const{
-
-  edges.clear();
-  edges.reserve(edges_.size());
-  for(uint i = 0; i < edges_.size(); ++i) {
-    int idx_one = edges_[i]->GetNode1()->GetIndex();
-    int idx_two = edges_[i]->GetNode2()->GetIndex();
-    edges.push_back(std::make_pair(idx_one,idx_two));
-  }
-}
-
-void RotamerGraph::GetActiveEdges(std::vector<std::pair<int,int> >& active_edges) const{
-
-  active_edges.clear();
-  active_edges.reserve(edges_.size());
-  for(uint i = 0; i < edges_.size(); ++i) {
-    if(edges_[i]->IsActive()) {
-      int idx_one = edges_[i]->GetNode1()->GetIndex();
-      int idx_two = edges_[i]->GetNode2()->GetIndex();
-      active_edges.push_back(std::make_pair(idx_one,idx_two));
-    }
-  }
-}
-
-void RotamerGraph::GetSelfEnergies(uint idx, 
-                                   std::vector<Real>& energies) const{
-  if(idx >= nodes_.size()) {
-    throw promod3::Error("Invalid Index observed when extracting self "
-                         "energies!");
-  }
-
-  int num_rotamers = nodes_[idx]->GetNumRotamers();
-
-  energies.clear();
-  energies.reserve(num_rotamers);
-
-  for(int i = 0; i < num_rotamers; ++i) {
-    energies.push_back(nodes_[idx]->GetSelfEnergy(i));
-  }
-}
-
-void RotamerGraph::GetPairwiseEnergies(uint idx,
-                              std::vector<std::vector<Real> >& energies) const {
-
-  if(idx >= edges_.size()) {
-    throw promod3::Error("Invalid Index observed when extracting pairwise "
-                         "energies!");
-  }
-
-  RotamerGraphEdge* edge = edges_[idx];
-  int num_rotamers_one = edge->GetNode1()->GetNumRotamers();
-  int num_rotamers_two = edge->GetNode2()->GetNumRotamers();
-
-  energies.clear();
-  energies.resize(num_rotamers_one);
-
-  for(int i = 0; i < num_rotamers_one; ++i) {
-    energies[i].resize(num_rotamers_two);
-    for(int j = 0; j < num_rotamers_two; ++j) {
-      energies[i][j] = edge->GetPairwiseEnergy(i, j);
-    }
-  }
-}
-
-bool RotamerGraph::ApplyDEE(uint idx, Real e_thresh) {
-
-  if(idx >= nodes_.size()) {
-    throw promod3::Error("Invalid Index observed when applying DEE!");
-  }
-
-  return nodes_[idx]->DEE(e_thresh);
-}
-
-bool RotamerGraph::ApplyEdgeDecomposition(uint idx, Real e_thresh) {
-
-  if(idx >= edges_.size()) {
-    throw promod3::Error("Invalid Index observed when applying Edge "
-                         "Decomposition!");
-  }
-
-  return edges_[idx]->Decompose(e_thresh);
-}
-
-void RotamerGraph::Prune(Real epsilon, Real e_cut, bool consider_all_nodes){
-
-  //nodes/edges, where something happened
-  std::vector<bool> hot_edges(edges_.size(),true);
-  std::vector<bool> hot_nodes;
-  if(consider_all_nodes)hot_nodes.resize(nodes_.size(),true);   
-  else hot_nodes.resize(nodes_.size(),false);
-
-  bool something_happened = true;
-  while(something_happened){
-    something_happened = false;
-    //let's first do edge decomposition
-    for(uint i = 0; i < hot_edges.size(); ++i){
-      if(!hot_edges[i]) continue;
-      if(this->ApplyEdgeDecomposition(i, epsilon)){
-        //let's set the status hot to the nodes connected by the
-        //edge
-        hot_nodes[edges_[i]->GetNode1()->GetIndex()] = true;
-        hot_nodes[edges_[i]->GetNode2()->GetIndex()] = true;
-        something_happened = true;
-      }
-      //either nothing happened, or successfully decomposed...
-      //edge is not hot anymore
-      hot_edges[i] = false;
-    }
-    //let's do DEE
-    for(uint i = 0; i < hot_nodes.size(); ++i){
-      if(!hot_nodes[i]) continue;
-      if(this->ApplyDEE(i, e_cut)){
-        //let's set the status hot to the edges, as well as other
-        //nodes connected to that node
-        for(RotamerGraphNode::iterator j = nodes_[i]->active_edges_begin();
-            j != nodes_[i]->active_edges_end(); ++j){
-          RotamerGraphEdge* current_edge = nodes_[i]->GetEdge(*j);
-          hot_edges[current_edge->GetIndex()] = true;
-          //one of the following connected node is the checked node
-          //itself... will be set to false again...
-          hot_nodes[current_edge->GetNode1()->GetIndex()] = true;
-          hot_nodes[current_edge->GetNode2()->GetIndex()] = true;
-        }
-        something_happened = true;
-      }
-      //either nothing happened, or successful DEE...
-      //node is not hot anymore
-      hot_nodes[i] = false;
-    }
-  }
-}
-
-void RotamerGraph::Reset(){
-  for(node_iterator i = nodes_begin(); i != nodes_end(); ++i){
-    (*i)->Reset();
-  }
-  for(edge_iterator i = edges_begin(); i != edges_end(); ++i){
-    (*i)->Reset();
-  }
-}
-
-promod3::core::Graph RotamerGraph::ToRawGraph() const{
-  promod3::core::Graph raw_graph(this->GetNumNodes());
-  std::map<RotamerGraphNode*, int> ptr_mapper;
-  for(uint i = 0; i < nodes_.size(); ++i){
-    ptr_mapper[nodes_[i]] = i;
-  }
-  for(std::vector<RotamerGraphEdge*>::const_iterator i = edges_.begin();
-      i != edges_.end(); ++i){
-    if((*i)->IsActive()){
-      int idx_one = ptr_mapper[(*i)->GetNode1()];
-      int idx_two = ptr_mapper[(*i)->GetNode2()];
-      raw_graph.Connect(idx_one,idx_two);
-    }
-  }
-  return raw_graph;
-}
-
-std::pair<std::vector<int>, Real> 
-RotamerGraph::TreeSolve(uint64_t max_complexity, Real initial_epsilon) {
-
-  core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
-                                "RotamerGraph::TreeSolve", 2);
-
-  // all nodes must be active in the beginning
-  for(std::vector<RotamerGraphNode*>::iterator i = nodes_.begin();
-      i != nodes_.end(); ++i){
-    if(!(*i)->IsActive()){
-      String err = "All nodes of graph must be active for TreeSolving.";
-      err += " Either construct a new graph or reset the current one!";
-      throw promod3::Error(err);
-    }
-  }
-
-  std::vector<int> overall_solution(this->GetNumNodes(), 0);
-  Real overall_energy = 0.0;
-
-  // handle the case where graph is empty
-  if(this->GetNumNodes() == 0){
-    return std::make_pair(overall_solution, overall_energy);
-  }
-
-  // handle the case where graph only contains one item
-  if(this->GetNumNodes() == 1){
-    nodes_[0]->Deactivate();
-    overall_solution[0] = nodes_[0]->GetOverallIndex(0); 
-    overall_energy += nodes_[0]->GetSelfEnergy(overall_solution[0]);
-    return std::make_pair(overall_solution, overall_energy);
-  }
-
-  bool first_iteration = true;
-  
-  do{
-    this->Prune(initial_epsilon, 0.0, first_iteration);
-
-    //build raw graph and extract connected components
-    promod3::core::Graph raw_graph = this->ToRawGraph();
-
-    //generate the connected components
-    std::vector<std::vector<int> > connected_components;
-    raw_graph.ConnectedComponents(connected_components);
-    
-    //solve the connected components seperately if the according
-    //complexity is feasible
-
-    Real size_one_energy = 0;
-
-    for(uint component_idx = 0; component_idx < connected_components.size();
-        ++component_idx){
-
-      const std::vector<int>& component = connected_components[component_idx];
-
-      if(component.size() == 1){
-        if(nodes_[component[0]]->IsActive()){
-          nodes_[component[0]]->Deactivate();
-          int overall_idx = nodes_[component[0]]->GetOverallIndex(0);          
-          overall_solution[component[0]] = overall_idx;
-          overall_energy += nodes_[component[0]]->GetSelfEnergy(overall_idx);
-          size_one_energy += nodes_[component[0]]->GetSelfEnergy(overall_idx);
-        }
-        continue;
-      }
-
-      //create initial data required to solve the enumeration problem
-      std::vector<int> num_active_rotamers(component.size());
-      for(uint i = 0; i < component.size(); ++i){
-        // Check, whether any of the rotamer groups has too many rotamers
-        // (due to memory reasons we use unsigned shorts as rotamer 
-        //  identifier in the tree solving algorithms)
-        if(nodes_[component[i]]->GetNumActiveRotamers() > 
-           std::numeric_limits<unsigned short>::max()){
-          std::stringstream ss;
-          ss << "Due to technical reasons the maximum number of rotamers per ";
-          ss << "position is limited to ";
-          ss << std::numeric_limits<unsigned short>::max();
-          ss << ". Observed a location with ";
-          ss << nodes_[component[i]]->GetNumActiveRotamers();
-          ss << " rotamers. Either use less rotamers or perform more pruning ";
-          ss << "operations before using the TreeSolve algorithm.";
-          throw promod3::Error(ss.str());
-        }
-        num_active_rotamers[i] = nodes_[component[i]]->GetNumActiveRotamers(); 
-      }
-
-      promod3::core::Graph component_graph = raw_graph.SubGraph(component);
-
-      TreeBag* component_tree = 
-      promod3::core::GenerateMinimalWidthTree(component_graph);
-
-      //generate post order traversal of previously constructed tree
-      std::vector<TreeBag* > traversal = 
-      promod3::core::PostOrderTraversal(component_tree);
-
-      std::vector<BagData> bag_data;
-      uint64_t component_complexity = FillRawBagData(traversal,
-                                                     num_active_rotamers,
-                                                     bag_data);
-
-      //check whether complexity of current connected component is solvable...
-      //if not, we simply perform another iteration of pruning.
-      if(component_complexity > max_complexity){
-        if(initial_epsilon <= 0.0){
-          std::stringstream ss;
-          ss << "One of the connected components in the RotamerGraph ";
-          ss << "reaches a complexity of "<< component_complexity;
-          ss << ", which is above the max_complexity of "<<max_complexity;
-          ss << ". The idea is to prune more and more aggressively by ";
-          ss << "multiplying the initial_epsilon value by a factor of 2.";
-          ss << "Your initial_epsilon is "<<initial_epsilon;
-          ss << ", the complexity of this connected ";
-          ss << "component will therefore never fall below max_complexity. ";
-          ss << "To successfully solve the RotamerGraph you either have to ";
-          ss << "give initial_epsilon a value above 0.0 or increase ";
-          ss << "max_complexity";
-          throw promod3::Error(ss.str());
-        }
-        continue;
-      }
-
-      //The complexity is low enough... let's fill remaining data and
-      //solve it!
-
-      //first we have to extract the energies
-      std::vector<Real*> self_energies;
-      std::map<std::pair<int,int>, Real*> pairwise_energies;
-
-      for(uint i = 0; i < component.size(); ++i){
-        Real* self_e = new Real[num_active_rotamers[i]];
-        nodes_[component[i]]->FillActiveSelfEnergies(self_e);
-        self_energies.push_back(self_e);
-      }
-
-      for(uint i = 0; i < edges_.size(); ++i){
-        RotamerGraphEdge* edge = edges_[i];
-
-        // is the edge active?
-        if(!edge->IsActive()) continue;
-
-        //does it affect the current component?
-        int a = edge->GetNode1()->GetIndex();
-        int b = edge->GetNode2()->GetIndex();
-
-        std::vector<int>::const_iterator a_it = std::find(component.begin(), 
-                                                          component.end(), a);
-        if(a_it == component.end()) continue; //it's not part of the component
-
-        std::vector<int>::const_iterator b_it = std::find(component.begin(), 
-                                                          component.end(), b);
-        if(b_it == component.end()) continue; //it's not part of the component
-
-        int a_in_component = a_it - component.begin();
-        int b_in_component = b_it - component.begin();
-
-        Real* pairwise_e = new Real[num_active_rotamers[a_in_component] * 
-                                    num_active_rotamers[b_in_component]];
-        edge->FillActiveEnergies(pairwise_e);
-
-        std::pair<int,int> edge_pair = std::make_pair(a_in_component,
-                                                      b_in_component);
-
-        pairwise_energies[edge_pair] = pairwise_e;
-      }
-
-      //let's fill in remaining data
-      FillBagData(traversal, self_energies, pairwise_energies, bag_data);      
-
-      //let's do the whole enumeration game
-      EnumerateBagData(bag_data);
-
-      //let's get the solution out
-      std::vector<int> component_solution(component.size(), 0);
-      CollectSolutionFromBagData(bag_data, bag_data.size() - 1, 
-                                 component_solution);
-
-      overall_energy += bag_data.back().optimal_r_score[0];
-
-      //alter the graph accordingly
-      for(uint i = 0; i < component.size(); ++i){
-        uint overall_idx = 
-        nodes_[component[i]]->GetOverallIndex(component_solution[i]);
-        nodes_[component[i]]->Deactivate(overall_idx);
-        overall_solution[component[i]] = overall_idx;
-      }
-      
-      //the energies are not needed anymore
-      for(std::vector<Real*>::iterator i = self_energies.begin(); 
-          i != self_energies.end(); ++i){
-        delete [] (*i);
-      }
-
-      for(std::map<std::pair<int,int>, Real* >::iterator i = 
-          pairwise_energies.begin(); i != pairwise_energies.end(); ++i){
-        delete [] i->second;
-      }
-    }
-
-    first_iteration = false;
-    initial_epsilon *= 2;
-
-  }while(this->GetNumActiveNodes() > 0);
-
-  return std::make_pair(overall_solution, overall_energy);
-}
-
-
-std::pair<std::vector<std::vector<int> >, std::vector<Real> > 
-RotamerGraph::AStarSolve(Real e_thresh, uint max_n, uint max_visited_nodes){
-
-  core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
-                                "RotamerGraph::AStarSolve", 2);
-
-  //all nodes must be active in the beginning
-  for(std::vector<RotamerGraphNode*>::iterator i = nodes_.begin();
-      i != nodes_.end(); ++i){
-    if(!(*i)->IsActive()){
-      String err = "All nodes of graph must be active for TreeSolving.";
-      err += " Either construct a new graph or reset the current one!";
-      throw promod3::Error(err);
-    }
-  }
-
-  //e_thresh and max_n must be positive
-  if(e_thresh < 0.0) throw promod3::Error("e_thresh must be positive!");
-  if(max_n <= 0) throw promod3::Error("max_n must be positive!");
-  
-  std::vector<std::vector<int> > solutions;
-  std::vector<Real> solution_energies;
-  int num_graph_nodes = this->GetNumNodes();
-  int num_graph_edges = this->GetNumEdges();
-
-  //handle the case where graph is empty
-  if(num_graph_nodes == 0){
-    return std::make_pair(solutions, solution_energies);
-  }
-
-  //handle the case where graph only contains one item
-  if(num_graph_nodes == 1){
-    uint num_active_rotamers = nodes_[0]->GetNumActiveRotamers();
-    if(num_active_rotamers == 0){
-      return std::make_pair(solutions, solution_energies);
-    }
-    std::vector<std::pair<Real,int> > sorted_rotamers;
-    sorted_rotamers.reserve(num_active_rotamers);
-    Real* active_energies = new Real[num_active_rotamers];
-    nodes_[0]->FillActiveSelfEnergies(active_energies);
-    for(uint i = 0; i < num_active_rotamers; ++i){
-      sorted_rotamers.push_back(std::make_pair(active_energies[i], i));
-    }
-    delete [] active_energies;
-    std::sort(sorted_rotamers.begin(), sorted_rotamers.end());
-    Real emin = sorted_rotamers[0].first;
-    for(uint i = 0; i < std::min(max_n, num_active_rotamers); ++i){
-      if((sorted_rotamers[i].first - emin) > e_thresh) break;
-      int overall_idx = nodes_[0]->GetOverallIndex(sorted_rotamers[i].second);
-      solutions.push_back(std::vector<int>(1, overall_idx));
-      solution_energies.push_back(sorted_rotamers[i].first);
-    }
-    return std::make_pair(solutions, solution_energies);
-  }
-
-  //extract the energies of the active rotamers
-  std::vector<int> num_active_rotamers;
-  int max_num_active_rotamers = 0;
-  std::vector<Real*> self_energies;
-  std::vector<std::vector<std::pair<int,Real*> > > 
-  pairwise_energies(num_graph_nodes, std::vector<std::pair<int,Real*> >());
-  std::vector<int> num_pairwise_energies(num_graph_nodes, 0);
-  
-  for(int i = 0; i < num_graph_nodes; ++i){
-    num_active_rotamers.push_back(nodes_[i]->GetNumActiveRotamers());
-    max_num_active_rotamers = std::max(max_num_active_rotamers, 
-                                       num_active_rotamers.back());
-  }
-
-  for(int i = 0; i < num_graph_nodes; ++i){
-    Real* self_e = new Real[num_active_rotamers[i]];
-    nodes_[i]->FillActiveSelfEnergies(self_e);
-    self_energies.push_back(self_e);
-  }
-
-  Real* e_buffer = new Real[max_num_active_rotamers * 
-                            max_num_active_rotamers];
-
-  for(int i = 0; i < num_graph_edges; ++i){
-    if(edges_[i]->IsActive()){
-      RotamerGraphEdge* edge = edges_[i];
-      int a = edge->GetNode1()->GetIndex();
-      int b = edge->GetNode2()->GetIndex();
-      if(a < b){
-
-        Real* pairwise_e_inverted = new Real[num_active_rotamers[a] *
-                                             num_active_rotamers[b]]; 
-      
-        edge->FillActiveEnergies(e_buffer);
-        this->Invert(e_buffer, pairwise_e_inverted, 
-                     num_active_rotamers[a], num_active_rotamers[b]);
-
-        pairwise_energies[b].push_back(std::make_pair(a,pairwise_e_inverted));
-      }
-      else{
-        throw promod3::Error("Expect always first node in graph to have lower "
-                             "idx! The graph construction somehow fucked up...");
-      }
-    }
-  }
-
-  delete [] e_buffer;
-
-  for(int i = 0; i < num_graph_nodes; ++i){
-    num_pairwise_energies[i] = pairwise_energies[i].size();
-  }
-
-  //following data structure is a precalculation to increase the speed
-  //of hstar calculation...
-
-  //for every every position there is a vector for every rotamer at 
-  //that position. Every element in that vector contains the minimal 
-  //energy towards every position that comes before, zero if no 
-  //interaction is observed
-  std::vector<std::vector<std::vector<Real> > > 
-  min_pairwise_e_before(num_graph_nodes, std::vector<std::vector<Real> >());
-
-  for(int i = 0; i < num_graph_nodes; ++i){
-    min_pairwise_e_before[i].resize(num_active_rotamers[i]);
-    for(int j = 0; j < num_active_rotamers[i]; ++j){
-      min_pairwise_e_before[i][j].assign(i,0.0);
-      for(int k = 0; k < num_pairwise_energies[i]; ++k){
-        int other_node = pairwise_energies[i][k].first;
-        Real* e_ptr = pairwise_energies[i][k].second;
-        e_ptr = &e_ptr[j * num_active_rotamers[other_node]];
-        Real e_min = std::numeric_limits<Real>::max();
-        for(int l = 0; l < num_active_rotamers[other_node]; ++l){
-          e_min = std::min(e_min, e_ptr[l]);
-        }
-        min_pairwise_e_before[i][j][other_node] = e_min;
-      }
-    }
-  }
-
-  //Data structures to hold the visited nodes and sort them in a priority queue
-  std::priority_queue<AStarNode*,std::vector<AStarNode*>,CompareAStarNodes> node_queue;
-  std::vector<AStarNode> node_array;
-  //we already have to reserve node_array, since we deal with pointers
-  //to it and reallocations are a bit bad in these cases...
-  node_array.reserve(max_visited_nodes);
-
-  //we first add the root node with g* = 0.0 and h* = max_real
-  node_array.push_back(AStarNode(0, 0, 0, 0, 0.0, 
-                                 std::numeric_limits<Real>::max()));
-
-  node_queue.push(&node_array[0]);
-  Real min_energy = std::numeric_limits<Real>::max();
-
-  while(!node_queue.empty()){
-
-    AStarNode* current_node = node_queue.top();
-    node_queue.pop();
-
-    std::vector<int> path;
-    ReconstructSearchTreePath(node_array, current_node->node_idx, path);
-
-    if(current_node->tree_depth >= num_graph_nodes){
-      //it is a solution!!!!!
-      Real fstar = current_node->gstar; //note, that hstar must be zero...
-      if(solutions.empty()){
-        //it's the first solution and therefore the GMEC
-        //(Global Minimum Energy Conformation Fuck Yeah...)
-        min_energy = fstar;
-      }
-      else{
-        //there is at least one solution around! let's check whether
-        //the current solution is within e_thresh
-        if(fstar - min_energy > e_thresh) break;
-      }
-
-      //let's add it
-      solutions.push_back(path);
-      solution_energies.push_back(fstar);
-
-      //check whether we have enough solutions
-      if(solutions.size() >= max_n) break; 
-
-      continue;
-    }
-
-    //current node has to be expanded 
-    //=> new node for every single rotamer in node
-
-    //we first check whether we become bigger than max_visited_nodes
-    if(node_array.size() + num_active_rotamers[current_node->tree_depth] > 
-       max_visited_nodes){
-      //clean up
-      for(std::vector<Real*>::iterator i = self_energies.begin(); 
-          i != self_energies.end(); ++i){
-        delete [] (*i);
-      }
-
-      for(std::vector<std::vector<std::pair<int,Real*> > >::iterator i = 
-          pairwise_energies.begin(); i != pairwise_energies.end(); ++i){
-        for(std::vector<std::pair<int,Real*> >::iterator j = i->begin();
-            j != i->end(); ++j)
-        delete [] j->second;
-      }
-      //and throw an error
-      throw promod3::Error("Reached max_visited_nodes => increase this"
-                           "parameter or reduce the problem size!");
-    }
-
-    //following variables will be the same for all expaned nodes
-    int pos_in_graph = current_node->tree_depth;
-    uint parent_idx = current_node->node_idx;
-    unsigned short tree_depth = current_node->tree_depth + 1;
-
-    //We already add an element to the path for the node to be expaned.
-    //This saves an if in the hstar calculation
-    path.push_back(0);
-
-    for(int rotamer_idx = 0; rotamer_idx < num_active_rotamers[pos_in_graph];
-        ++rotamer_idx){
-
-      //set the hacky last element of the path
-      path.back() = rotamer_idx;
-
-      //variable specific for expanded node
-      uint node_idx = node_array.size();
-      Real gstar = current_node->gstar;
-      Real hstar = 0.0;
-
-      //we still need to adapt the energy values (gstar and hstar)
-
-      //in case of gstar we have to add the self energy of the current
-      //rotamer and the pairwise energy towards all previous rotamers in
-      //the path towards this node
-
-      //let's add the self energy
-      gstar += self_energies[pos_in_graph][rotamer_idx];
-
-      //let's add all pairwise energies towards the already set rotamers
-      for(int i = 0; i < num_pairwise_energies[pos_in_graph]; ++i){
-        int other_node = pairwise_energies[pos_in_graph][i].first;
-        Real* e = pairwise_energies[pos_in_graph][i].second;
-        gstar += e[rotamer_idx * num_active_rotamers[other_node] + 
-                   path[other_node]];
-      }
-
-      //in case of hstar we have to add the minimal pairwise energy towards
-      //all nodes still to be determined
-      int last_path_idx = path.size()-1;
-      for(int non_set_pos_idx = pos_in_graph + 1; 
-          non_set_pos_idx < num_graph_nodes; ++non_set_pos_idx){
-
-        Real min_e = std::numeric_limits<Real>::max();
-
-        //iterate over all possible rotamers at position non_set_pos_idx
-        for(int i = 0; i < num_active_rotamers[non_set_pos_idx]; ++i){
-
-          //start with its self energy
-          Real actual_e = self_energies[non_set_pos_idx][i];
-
-          //add all pairwise energies towards rotamers that have already been
-          //set in this path, the according minimal energy that could be achieved
-          //respectively
-          for(int j = 0; j < num_pairwise_energies[non_set_pos_idx]; ++j){
-            int other_node = pairwise_energies[non_set_pos_idx][j].first;
-            if(other_node <= last_path_idx){
-              //add the energy to the already determined energy from the path
-              Real* e = pairwise_energies[non_set_pos_idx][j].second;
-              actual_e += e[i * num_active_rotamers[other_node] +
-                            path[other_node]];
-            }
-            else{
-              //add the minimal possible energy...
-              actual_e += min_pairwise_e_before[non_set_pos_idx][i][other_node];
-            }
-          }
-          min_e = std::min(min_e, actual_e);
-        }
-        hstar += min_e;
-      }
-
-      node_array.push_back(AStarNode(node_idx, parent_idx,
-                                     rotamer_idx, tree_depth, gstar,
-                                     hstar));
-
-      //it's all done, we finally have to insert it into the priority queue
-      node_queue.push(&node_array[node_idx]);
-    }
-  }
-
-  //the solutions are relative to the active rotamers, we still have to 
-  //translate them into overall indices
-  for(uint i = 0; i < solutions.size(); ++i){
-    for(uint j = 0; j < solutions[i].size(); ++j){
-      solutions[i][j] = nodes_[j]->GetOverallIndex(solutions[i][j]);
-    }
-  }
-
-  //final cleanup
-  for(std::vector<Real*>::iterator i = self_energies.begin(); 
-      i != self_energies.end(); ++i){
-    delete [] (*i);
-  }
-
-  for(std::vector<std::vector<std::pair<int,Real*> > >::iterator i = 
-      pairwise_energies.begin(); i != pairwise_energies.end(); ++i){
-    for(std::vector<std::pair<int,Real*> >::iterator j = i->begin();
-        j != i->end(); ++j)
-    delete [] j->second;
-  }  
-
-  return std::make_pair(solutions, solution_energies);
-}
-
-
-std::pair<std::vector<std::vector<int> >, std::vector<Real> > 
-RotamerGraph::MCSolve(int n, int mc_steps, Real start_temperature, 
-                      int change_frequency, Real cooling_factor, int seed) {
-
-  core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
-                                "RotamerGraph::MCSolve", 2);
-
-  //all nodes must be active in the beginning
-  for(std::vector<RotamerGraphNode*>::iterator i = nodes_.begin();
-      i != nodes_.end(); ++i){
-    if(!(*i)->IsActive()){
-      String err = "All nodes of graph must be active for TreeSolving.";
-      err += " Either construct a new graph or reset the current one!";
-      throw promod3::Error(err);
-    }
-  }
-
-  std::vector<std::vector<int> > solutions;
-  std::vector<Real> solution_energies;
-  int num_graph_nodes = this->GetNumNodes();
-  int num_graph_edges = this->GetNumEdges();
-
-  //handle the case where graph is empty
-  if(num_graph_nodes == 0){
-    throw promod3::Error("Cannot run MCSolve on an empty RotamerGraph!");
-  }
-
-  //handle the case where graph only contains one item
-  if(num_graph_nodes == 1){
-    throw promod3::Error("Cannot run MCSolve on a RotamerGraph with only "
-                         "one entry!");
-  }
-
-  //extract the energies of the active rotamers
-  std::vector<int> num_active_rotamers;
-  std::vector<Real*> self_energies;
-  std::vector<std::vector<std::pair<int, PairwiseEWrapper> > > pairwise_energies;
-  pairwise_energies.resize(num_graph_nodes);
-  std::vector<Real*> pairwise_energies_ptrs;
-  
-  for(int i = 0; i < num_graph_nodes; ++i){
-    num_active_rotamers.push_back(nodes_[i]->GetNumActiveRotamers());
-  }
-
-  for(int i = 0; i < num_graph_nodes; ++i){
-    Real* self_e = new Real[num_active_rotamers[i]];
-    nodes_[i]->FillActiveSelfEnergies(self_e);
-    self_energies.push_back(self_e);
-  }
-
-  for(int i = 0; i < num_graph_edges; ++i){
-    if(edges_[i]->IsActive()){
-      RotamerGraphEdge* edge = edges_[i];
-      int a = edge->GetNode1()->GetIndex();
-      int b = edge->GetNode2()->GetIndex();
-      if(a < b){
-
-        Real* pairwise_e = new Real[num_active_rotamers[a] * 
-                                    num_active_rotamers[b]]; 
-        edge->FillActiveEnergies(pairwise_e);
-        pairwise_energies_ptrs.push_back(pairwise_e);
-
-        PairwiseEWrapper wrapper_one(a, b, num_active_rotamers[a],
-                                     num_active_rotamers[b], 
-                                     pairwise_energies_ptrs.back());
-        PairwiseEWrapper wrapper_two(b, a, num_active_rotamers[b],
-                                     num_active_rotamers[a], 
-                                     pairwise_energies_ptrs.back());
-        pairwise_energies[a].push_back(std::make_pair(b, wrapper_one));
-        pairwise_energies[b].push_back(std::make_pair(a, wrapper_two));
-      }
-      else{
-        throw promod3::Error("Expect always first node in graph to have lower "
-                             "idx! The graph construction somehow fucked up...");
-      }
-    }
-  }
-
-  // let the sampling begin!
-  RotamerSelector rotamer_selector(num_active_rotamers, seed);
-
-  for(int trajectory_idx = 0; trajectory_idx < n; ++trajectory_idx) {
-  
-    std::vector<int> current_solution;
-    rotamer_selector.InitRotamerSelection(current_solution);
-    Real temperature = start_temperature / cooling_factor;
-
-    for(int current_step = 0; current_step < mc_steps; ++current_step) {
-
-      if (current_step % change_frequency == 0) {
-        temperature *= cooling_factor;
-      }
-
-      Real e_current, e_new, e_diff;
-      
-      int node_idx = rotamer_selector.SelectNode();
-      int rot_idx = current_solution[node_idx];
-      e_current = GetRotamerEnergy(node_idx, rot_idx, current_solution, 
-                                   self_energies, pairwise_energies);
-
-      rot_idx = rotamer_selector.SelectRotamer(node_idx);
-      e_new = GetRotamerEnergy(node_idx, rot_idx, current_solution, 
-                               self_energies, pairwise_energies);
-
-      e_diff = e_new - e_current;
-
-      if (e_diff <= Real(0.0)) {
-        current_solution[node_idx] = rot_idx;
-      }
-
-      else {
-        Real acceptance_probability = std::exp(-e_diff/temperature);
-        if (rotamer_selector.GetRandomNumber() < acceptance_probability) {
-          current_solution[node_idx] = rot_idx;
-        }
-      }
-    }
-
-    //the trajectory solution!!!
-    Real e = GetGlobalEnergy(current_solution, self_energies, pairwise_energies);
-    solution_energies.push_back(e); 
-    solutions.push_back(current_solution);
-  }
-  
-  //the solutions are relative to the active rotamers, we still have to 
-  //translate them into overall indices
-  for(uint i = 0; i < solutions.size(); ++i){
-    for(uint j = 0; j < solutions[i].size(); ++j){
-      solutions[i][j] = nodes_[j]->GetOverallIndex(solutions[i][j]);
-    }
-  }
-
-  //final cleanup
-  for(std::vector<Real*>::iterator i = self_energies.begin(); 
-      i != self_energies.end(); ++i) {
-    delete [] (*i);
-  }
-
-  for(std::vector<Real*>::iterator i = pairwise_energies_ptrs.begin(); 
-      i != pairwise_energies_ptrs.end(); ++i) {
-    delete [] (*i);
-  } 
-
-  return std::make_pair(solutions, solution_energies);
-}
-
-void RotamerGraph::Invert(Real* energies, Real* inverted_energies, 
-                          int i_size, int j_size){
-  Real* e_ptr = energies;
-  for(int i = 0; i < i_size; ++i){
-    for(int j = 0; j < j_size; ++j){
-      inverted_energies[j*i_size+i] = *e_ptr;
-      ++e_ptr;
-    }
-  }
-}
-
-
 }}//ns
 
diff --git a/sidechain/src/rotamer_graph.hh b/sidechain/src/rotamer_graph.hh
index 92ea26405a524ad3fb25bfdf22ef57eafa7c40b4..4e447b684191e0b33b7ab4ef4c8aae860ba3aebd 100644
--- a/sidechain/src/rotamer_graph.hh
+++ b/sidechain/src/rotamer_graph.hh
@@ -7,239 +7,61 @@
 #include <boost/shared_ptr.hpp>
 
 #include <promod3/sidechain/rotamer_group.hh>
-#include <promod3/core/graph.hh>
+#include <promod3/core/graph_minimizer.hh>
 
-namespace promod3{ namespace sidechain{
 
-class RotamerGraphEdge;
-class RotamerGraphNode;
-class RotamerGraph;
+namespace promod3 { namespace sidechain {
 
+class RotamerGraph;
 typedef boost::shared_ptr<RotamerGraph> RotamerGraphPtr;
 
-class RotamerGraphEdge{
-
-public:
-  RotamerGraphEdge(uint index, RotamerGraphNode* node1, RotamerGraphNode* node2, 
-                   uint num_i, uint num_j, Real* pairwise_energies_);
-
-  ~RotamerGraphEdge();
-
-  void Reset();
-
-  void Deactivate();
-
-  bool IsActive() const { return active_; }
-
-  uint GetIndex() const { return index_; }
-
-  bool Decompose(Real thresh);
 
-  Real GetPairwiseEnergy(uint i, uint j) const { return pairwise_energies_[i * maxj_ + j]; }
-
-  RotamerGraphNode* GetNode1() const { return node1_; }
-
-  RotamerGraphNode* GetNode2() const { return node2_; }
-
-  RotamerGraphNode* GetOtherNode(RotamerGraphNode* node);
-
-  //resolves the expression  min_x(EPair(idx1,x)-EPair(idx2,x))
-  //in the DEE formalism, where x only considers the active
-  //rotamers from the OTHER node than node_ptr
-  Real EMinDiff(const RotamerGraphNode* node_ptr, uint idx1, uint idx2) const;
-
-  void FillActiveEnergies(Real* pairwise_energies) const;
-
-private:
-  uint index_;
-  bool active_;
-  RotamerGraphNode* node1_;
-  RotamerGraphNode* node2_;
-  uint maxi_;
-  uint maxj_;
-  Real* pairwise_energies_;
-};
-
-class RotamerGraphNode{
+class RotamerGraph : public promod3::core::GraphMinimizer {
 
 public:
-  RotamerGraphNode(uint index,
-                   uint num_rotamers,
-                   Real* internal_energies,
-                   Real* frame_energies);
-
-  ~RotamerGraphNode();
-
-  void Reset();
-
-  void Deactivate(int index = -1);
-
-  bool IsActive() const { return active_; }
-
-  uint GetIndex() const { return index_; }
-
-  void AddEdge(RotamerGraphEdge* edge);
-
-  RotamerGraphEdge* GetEdge(uint index) const { return edges_.at(index); }
-
-  void RemoveFromActiveEdges(RotamerGraphEdge* edge);
-
-  void AddValue(Real val);
-
-  void AddValue(uint node_idx, Real val);
-
-  bool DEE(Real e_cut = 0.0);
-
-  uint GetOverallIndex(uint active_index) const { return active_rotamers_.at(active_index); }
-
-  size_t GetNumActiveRotamers() const { return active_rotamers_.size(); }
-
-  size_t GetNumActiveEdges() const { return active_edges_.size(); }
-
-  size_t GetNumRotamers() const { return num_rotamers_; }
-
-  size_t GetNumEdges() const { return edges_.size(); }
-
-  Real GetSelfEnergy(uint index) const { return self_energies_[index]; }
-
-  void FillActiveSelfEnergies(Real* self_energies) const;
-
-  typedef std::vector<uint>::const_iterator const_iterator;
-  typedef std::vector<uint>::iterator iterator;
-  
-  iterator active_rotamers_begin() { return active_rotamers_.begin(); }
-  iterator active_rotamers_end() { return active_rotamers_.end(); }
-  iterator active_edges_begin() { return active_edges_.begin(); }
-  iterator active_edges_end() { return active_edges_.end(); }
-
-  const_iterator active_rotamers_begin() const { return active_rotamers_.begin(); }
-  const_iterator active_rotamers_end() const { return active_rotamers_.end(); }
-  const_iterator active_edges_begin() const { return active_edges_.begin(); }
-  const_iterator active_edges_end() const { return active_edges_.end(); }
 
-private:
-
-  bool active_;
-  uint index_;
-  uint num_rotamers_;
-  Real* internal_energies_;
-  Real* frame_energies_;
-  Real* self_energies_;
-  std::vector<uint> active_rotamers_;
-  std::vector<uint> active_edges_;
-  std::vector<std::pair<uint,Real> > sorted_active_rotamers_;
-  std::vector<RotamerGraphEdge*> edges_;
-};
-
-class RotamerGraph{
-
-public:
-
-  ~RotamerGraph();
-
-  static RotamerGraphPtr CreateFromRRMList(
-                        const std::vector<RRMRotamerGroupPtr>& rotamer_groups);
-
-  static RotamerGraphPtr CreateFromFRMList(
-                        const std::vector<FRMRotamerGroupPtr>& rotamer_groups);
-
-  // for convenience
-  static RotamerGraphPtr CreateFromList(
-                        const std::vector<RRMRotamerGroupPtr>& rotamer_groups) {
-    return CreateFromRRMList(rotamer_groups);
+  virtual ~RotamerGraph() { }
+
+  template<typename RotamerGroupPtr>
+  static RotamerGraphPtr CreateFromList(const std::vector<RotamerGroupPtr>& 
+                                        rotamer_groups) {
+
+    core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
+                                  "RotamerGraph::CreateFromList", 2);
+
+    RotamerGraphPtr graph(new RotamerGraph);
+
+    // let's create the nodes
+    std::vector<Real> self_energies;
+    for(uint i = 0; i < rotamer_groups.size(); ++i) {
+      RotamerGroupPtr rot_group = rotamer_groups[i];
+      self_energies.resize(rot_group->size());
+      for(uint j = 0; j < rot_group->size(); ++j){
+        self_energies[j] = (*rot_group)[j]->GetInternalEnergy() + 
+                           (*rot_group)[j]->GetFrameEnergy();
+      }
+
+      graph->AddNode(self_energies);
+    }
+
+    // let's create the edges
+    for(uint i = 0; i < rotamer_groups.size(); ++i){
+      for(uint j = i+1; j < rotamer_groups.size(); ++j){
+        promod3::core::EMatXX emat;
+        if(rotamer_groups[i]->CalculatePairwiseEnergies(rotamer_groups[j],
+                                                        0.01, emat)) {
+          graph->AddEdge(i, j, emat);
+        }
+      }
+    }
+
+    return graph;
   }
-  static RotamerGraphPtr CreateFromList(
-                        const std::vector<FRMRotamerGroupPtr>& rotamer_groups) {
-    return CreateFromFRMList(rotamer_groups);
-  }
-
-  // for hacky access... more info in function definition
-  static RotamerGraphPtr CreateFromArbitrarySource(const std::vector<uint>& node_sizes,
-                                        const std::vector<Real*>& internal_energies,   
-                                        const std::vector<Real*>& frame_energies,
-                                        const std::vector<std::pair<uint,uint> >& edges,
-                                        const std::vector<Real*>& pairwise_energies);
-
-  size_t GetNumActiveRotamers() const;
-
-  size_t GetNumActiveEdges() const;
-
-  size_t GetNumActiveNodes() const;
-
-  size_t GetNumNodes() const { return nodes_.size(); }
-
-  size_t GetNumEdges() const { return edges_.size(); }
-
-  size_t GetNumRotamers() const;
-
-  void GetNumRotamers(std::vector<int>& num_rotamers) const;
-
-  void GetNumActiveRotamers(std::vector<int>& num_rotamers) const;
-
-  void GetActiveRotamers(uint idx, std::vector<int>& active_rotamers) const;
-
-  void GetEdges(std::vector<std::pair<int, int> >& edges) const;
-
-  void GetActiveEdges(std::vector<std::pair<int, int> >& edges) const;
-
-  void GetSelfEnergies(uint idx, std::vector<Real>& energies) const;
-
-  void GetPairwiseEnergies(uint idx, 
-                           std::vector<std::vector<Real> >& energies) const;
-
-  bool ApplyDEE(uint idx, Real e_thresh = 0.0);
-
-  bool ApplyEdgeDecomposition(uint idx, Real e_tresh);
-
-  void Prune(Real epsilon, Real e_cut = 0.0, bool consider_all_nodes = true);
-
-  void Reset();
-
-  promod3::core::Graph ToRawGraph() const;
-
-  std::pair<std::vector<int>, Real> 
-  TreeSolve(uint64_t max_complexity = std::numeric_limits<uint64_t>::max(),
-            Real intial_epsilon = 0.02);
-
-  std::pair<std::vector<std::vector<int> >, std::vector<Real> > 
-  AStarSolve(Real e_thresh, uint max_n = 100, 
-             uint max_visited_nodes = 100000000);
-
-  std::pair<std::vector<std::vector<int> >, std::vector<Real> > 
-  MCSolve(int n = 10, int mc_steps = 1000, Real start_temperature = 100.0, 
-          int change_frequency = 100, Real cooling_factor = 0.9, 
-          int seed = 0);
-
-  RotamerGraphNode* GetNode(uint index) { return nodes_.at(index); }
-
-  RotamerGraphEdge* GetEdge(uint index) { return edges_.at(index); }
-
-  typedef std::vector<RotamerGraphNode*>::const_iterator const_node_iterator;
-  typedef std::vector<RotamerGraphNode*>::iterator node_iterator;
-
-  typedef std::vector<RotamerGraphEdge*>::const_iterator const_edge_iterator;
-  typedef std::vector<RotamerGraphEdge*>::iterator edge_iterator;
-  
-  node_iterator nodes_begin() { return nodes_.begin(); }
-  node_iterator nodes_end() { return nodes_.end(); }
-  edge_iterator edges_begin() { return edges_.begin(); }
-  edge_iterator edges_end() { return edges_.end(); } 
-
-  const_node_iterator nodes_begin() const{ return nodes_.begin(); }
-  const_node_iterator nodes_end() const{ return nodes_.end(); }
-  const_edge_iterator edges_begin() const{ return edges_.begin(); }
-  const_edge_iterator edges_end() const{ return edges_.end(); } 
 
 private:
-  RotamerGraph() { }
 
-  RotamerGraph(const RotamerGraph& other) { }
 
-  static void Invert(Real* energies, Real* inverted_energies, 
-                     int i_size , int j_size);
 
-  std::vector<RotamerGraphNode*> nodes_;
-  std::vector<RotamerGraphEdge*> edges_;
 };
 
 }}//ns
diff --git a/sidechain/src/rotamer_group.cc b/sidechain/src/rotamer_group.cc
index 33219f103b5ad2018bb371600686477d40fbd7e5..dd20d27cb85307258a8b00c7693430a018bf49ce 100644
--- a/sidechain/src/rotamer_group.cc
+++ b/sidechain/src/rotamer_group.cc
@@ -3,19 +3,19 @@
 
 namespace{
 
-Real LogSumExp(double* values, int n){
+Real LogSumExp(double* values, int n) {
 
   double min = std::numeric_limits<double>::max();
   double max = -std::numeric_limits<double>::max();
 
-  for(int i = 0; i < n; ++i){
+  for(int i = 0; i < n; ++i) {
     min = std::min(min, values[i]);
     max = std::max(max, values[i]);
   }
 
   double range = max - min;
 
-  if(range > double(100.0)){
+  if(range > double(100.0)) {
     // The log sum exp function (LSE) is bound by
     // max(x1, x2, ..., xn) <= LSE(x1, x2, ..., xn) <= 
     // max(x1, x2, ..., xn) + log(n)
@@ -36,6 +36,7 @@ Real LogSumExp(double* values, int n){
 
 namespace promod3 { namespace sidechain {
 
+
 RRMRotamerGroup::RRMRotamerGroup(const std::vector<RRMRotamerPtr>& rotamers,
                                  uint residue_index)
                                  : rotamers_(rotamers)
@@ -52,6 +53,7 @@ RRMRotamerGroup::RRMRotamerGroup(const std::vector<RRMRotamerPtr>& rotamers,
   this->Init();
 }
 
+
 void RRMRotamerGroup::ApplyOnResidue(uint rotamer_index,
                                      ost::mol::ResidueHandle& res, 
                                      bool consider_hydrogens,
@@ -63,6 +65,7 @@ void RRMRotamerGroup::ApplyOnResidue(uint rotamer_index,
                                            new_res_name);
 }
 
+
 void RRMRotamerGroup::ApplyOnResidue(uint rotamer_index,
                                      loop::AllAtomPositions& all_atom,
                                      uint res_idx) const {
@@ -72,14 +75,16 @@ void RRMRotamerGroup::ApplyOnResidue(uint rotamer_index,
   rotamers_[rotamer_index]->ApplyOnResidue(all_atom, res_idx);
 }
 
+
 void RRMRotamerGroup::SetFrameEnergy(FramePtr frame) {
 
-  for(iterator i = this->begin(); i != this->end(); ++i){
+  for(iterator i = this->begin(); i != this->end(); ++i) {
     (*i)->SetFrameEnergy(0.0);
   }
   this->AddFrameEnergy(frame);
 }
 
+
 void RRMRotamerGroup::AddFrameEnergy(FramePtr frame) {
 
   core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
@@ -92,28 +97,31 @@ void RRMRotamerGroup::AddFrameEnergy(FramePtr frame) {
   const std::vector<uint>& frame_residue_indices = frame->GetResidueIndices();
   const std::vector<Particle*>& frame_particles = frame->GetParticles();
   std::vector<Real> frame_energies(this->size(), 0.0);
-  Real energy;
 
-  for(std::vector<std::pair<int,int> >::iterator i = overlapping_particles.begin(),
-      e = overlapping_particles.end(); i != e; ++i){
-    if(frame_residue_indices[i->second] != residue_index_){
-      energy = particles_[i->first]->PairwiseEnergy(frame_particles[i->second]);
+  for(std::vector<std::pair<int,int> >::iterator i = 
+      overlapping_particles.begin(),
+      e = overlapping_particles.end(); i != e; ++i) {
+    if(frame_residue_indices[i->second] != residue_index_) {
+      Real energy = 
+      particles_[i->first]->PairwiseEnergy(frame_particles[i->second]);
       frame_energies[rotamer_indices_[i->first]] += energy;
     }
   }
 
-  for(uint i = 0; i < this->size(); ++i){
+  for(uint i = 0; i < this->size(); ++i) {
     rotamers_[i]->AddFrameEnergy(frame_energies[i]);
   }
 }
 
-Real* RRMRotamerGroup::CalculatePairwiseEnergies(RRMRotamerGroupPtr other,
-                                                 Real threshold) {
+
+bool RRMRotamerGroup::CalculatePairwiseEnergies(RRMRotamerGroupPtr other,
+                                                Real threshold,
+                                                promod3::core::EMatXX& emat) {
 
   core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
                                "RRMRotamerGroup::CalculatePairwiseEnergies", 2);
 
-  if(!collision_tree_.Overlap(other->GetCollisionTree())) return NULL;
+  if(!collision_tree_.Overlap(other->GetCollisionTree())) return false;
 
   std::vector<std::pair<int,int> > overlapping_particles;
   overlapping_particles.reserve(4000);
@@ -121,39 +129,34 @@ Real* RRMRotamerGroup::CalculatePairwiseEnergies(RRMRotamerGroupPtr other,
   collision_tree_.OverlappingPolytopes(other->GetCollisionTree(), 
                                        overlapping_particles);
 
-  if(overlapping_particles.empty()) return NULL;
+  if(overlapping_particles.empty()) return false;
   
-  int this_size = this->size();
-  int other_size = other->size();
-  Real* data = new Real[this_size * other_size];
-  memset(data, 0, this_size*other_size*sizeof(Real));
-  Real energy;
+  emat = promod3::core::EMatXX::Zero(this->size(), other->size());
 
-  for(std::vector<std::pair<int,int> >::iterator i = overlapping_particles.begin(),
-      e = overlapping_particles.end(); i!= e; ++i){
-    energy = particles_[i->first]->PairwiseEnergy(other->particles_[i->second]);
-    if(energy != Real(0.0)){
-      data[rotamer_indices_[i->first]*other_size + 
-           other->rotamer_indices_[i->second]] += energy;
-    }
-  }
+  for(std::vector<std::pair<int,int> >::iterator i = 
+      overlapping_particles.begin(),
+      e = overlapping_particles.end(); i!= e; ++i) {
+
+    Real energy = 
+    particles_[i->first]->PairwiseEnergy(other->particles_[i->second]);
 
-  Real max_e = 0.0;
-  for(int i = 0; i < this_size*other_size; ++i){
-    max_e = (max_e < data[i]) ? data[i] : max_e;
+    if(energy != Real(0.0)) {
+      emat(rotamer_indices_[i->first], other->rotamer_indices_[i->second]) += 
+      energy;
+    }
   }
 
-  if(max_e < threshold){
-    delete [] data;
-    return NULL;
+  if(emat.cwiseAbs().maxCoeff() < threshold) {
+    return false;
   }
 
-  return data;
+  return true;
 }
 
-Real RRMRotamerGroup::GetMaxP() const{
+
+Real RRMRotamerGroup::GetMaxP() const {
   Real max_p = std::numeric_limits<Real>::min();
-  for(const_iterator i = this->begin(); i != this->end(); ++i){
+  for(const_iterator i = this->begin(); i != this->end(); ++i) {
     max_p = std::max(max_p,(*i)->GetProbability());
   }
   return max_p;
@@ -167,20 +170,20 @@ void RRMRotamerGroup::ApplySelfEnergyThresh(Real self_energy_thresh) {
 
   if(rotamers_.size() <= 1) return;
 
-  //find the lowest energy
+  // find the lowest energy
   Real e_min = std::numeric_limits<Real>::max();
   for(std::vector<RRMRotamerPtr>::iterator i = rotamers_.begin();
-      i != rotamers_.end(); ++i){
+      i != rotamers_.end(); ++i) {
     if( (*i)->GetSelfEnergy() < e_min) e_min = (*i)->GetSelfEnergy();
   }
 
-  //define threshold relative to it
+  // define threshold relative to it
   Real thresh = e_min + self_energy_thresh;
 
-  //kill all rotamers with self energies worse than thresh
+  // kill all rotamers with self energies worse than thresh
   for(std::vector<RRMRotamerPtr>::iterator i = rotamers_.begin(); 
-      i != rotamers_.end(); ++i){
-    if((*i)->GetSelfEnergy() > thresh){
+      i != rotamers_.end(); ++i) {
+    if((*i)->GetSelfEnergy() > thresh) {
       i = rotamers_.erase(i);
       --i;
     }
@@ -189,18 +192,21 @@ void RRMRotamerGroup::ApplySelfEnergyThresh(Real self_energy_thresh) {
   this->Init();
 }
 
-void RRMRotamerGroup::Merge(const RRMRotamerGroupPtr other){
-  for(RRMRotamerGroup::const_iterator i = other->begin(); i != other->end(); ++i){
+
+void RRMRotamerGroup::Merge(const RRMRotamerGroupPtr other) {
+  for(RRMRotamerGroup::const_iterator i = other->begin(); 
+      i != other->end(); ++i) {
     rotamers_.push_back(*i);
   }
   this->Init();
 }
 
-void RRMRotamerGroup::Init(){
+
+void RRMRotamerGroup::Init() {
 
   int overall_size = 0;
   for(std::vector<RRMRotamerPtr>::iterator i = rotamers_.begin(); 
-      i != rotamers_.end(); ++i){
+      i != rotamers_.end(); ++i) {
     overall_size += (*i)->size();
   }
 
@@ -217,9 +223,9 @@ void RRMRotamerGroup::Init(){
   geom::Vec3 pos;
 
   for(std::vector<RRMRotamerPtr>::iterator i = rotamers_.begin(); 
-      i != rotamers_.end(); ++i){
+      i != rotamers_.end(); ++i) {
 
-    for(uint j = 0; j < (*i)->size(); ++j){
+    for(uint j = 0; j < (*i)->size(); ++j) {
       Particle& p = (**i)[j];
       particles_[actual_position] = &p;
       rotamer_indices_[actual_position] = actual_rotamer;
@@ -239,6 +245,7 @@ void RRMRotamerGroup::Init(){
                             collision_distances);
 }
 
+
 FRMRotamerGroup::FRMRotamerGroup(const std::vector<FRMRotamerPtr>& rotamers,
                                  uint residue_index)
                                  : rotamers_(rotamers)
@@ -255,6 +262,7 @@ FRMRotamerGroup::FRMRotamerGroup(const std::vector<FRMRotamerPtr>& rotamers,
   this->Init();
 }
 
+
 void FRMRotamerGroup::ApplyOnResidue(uint rotamer_index,
                                      ost::mol::ResidueHandle& res, 
                                      bool consider_hydrogens,
@@ -266,6 +274,7 @@ void FRMRotamerGroup::ApplyOnResidue(uint rotamer_index,
                                            new_res_name);
 }
 
+
 void FRMRotamerGroup::ApplyOnResidue(uint rotamer_index,
                                      loop::AllAtomPositions& all_atom,
                                      uint res_idx) const {
@@ -275,25 +284,29 @@ void FRMRotamerGroup::ApplyOnResidue(uint rotamer_index,
   rotamers_[rotamer_index]->ApplyOnResidue(all_atom, res_idx);
 }
 
-void FRMRotamerGroup::Merge(const FRMRotamerGroupPtr other){
-  for(FRMRotamerGroup::const_iterator i = other->begin(); i != other->end(); ++i){
+
+void FRMRotamerGroup::Merge(const FRMRotamerGroupPtr other) {
+  for(FRMRotamerGroup::const_iterator i = other->begin(); 
+      i != other->end(); ++i) {
     rotamers_.push_back(*i);
   }
   this->Init();
 }
 
-void FRMRotamerGroup::SetFrameEnergy(FramePtr frame){
 
-  for(iterator i = this->begin(); i != this->end(); ++i){
+void FRMRotamerGroup::SetFrameEnergy(FramePtr frame) {
+
+  for(iterator i = this->begin(); i != this->end(); ++i) {
     (*i)->SetFrameEnergy(0);
-    for(uint j = 0, e = (*i)->subrotamer_size(); j < e; ++j){
+    for(uint j = 0; j < (*i)->subrotamer_size(); ++j) {
       (*i)->SetFrameEnergy(0,j);
     }
   }
   this->AddFrameEnergy(frame);
 }
 
-void FRMRotamerGroup::AddFrameEnergy(FramePtr frame){
+
+void FRMRotamerGroup::AddFrameEnergy(FramePtr frame) {
 
   core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
                                 "FRMRotamerGroup::AddFrameEnergy", 2);
@@ -305,38 +318,40 @@ void FRMRotamerGroup::AddFrameEnergy(FramePtr frame){
   const std::vector<uint>& frame_residue_indices = frame->GetResidueIndices();
   const std::vector<Particle*>& frame_particles = frame->GetParticles();
 
-  //reserve the memory
-  Real** frame_energies = new Real*[this->size()];
-  int counter = 0;
-  int subrotamer_size;
+  std::vector<int> subrotamer_sizes(this->size());
   int max_subrotamer_size = 0;
-  for(iterator i = this->begin(); i != this->end(); ++i){
-    subrotamer_size = (*i)->subrotamer_size();
-    frame_energies[counter] = new Real[subrotamer_size];
-    //set the subrotamer frame energies to the already existing
-    //energies
-    for(int j = 0; j < subrotamer_size; ++j){
-      frame_energies[counter][j] = (*i)->GetFrameEnergy(j);
-    }
-    max_subrotamer_size = std::max(max_subrotamer_size, subrotamer_size);
-    ++counter;
+  for(uint i = 0; i < this->size(); ++i) {
+    subrotamer_sizes[i] = rotamers_[i]->subrotamer_size();
+    max_subrotamer_size = std::max(max_subrotamer_size,
+                                   subrotamer_sizes[i]);
   }
 
-  Real energy;
-  Real* e_ptr;
-  for(std::vector<std::pair<int,int> >::iterator i = overlapping_particles.begin(),
-      e = overlapping_particles.end(); i != e ; ++i){
+  promod3::core::EMatXX frame_energies = 
+  promod3::core::EMatXX::Zero(this->size(), max_subrotamer_size);
 
-    if(frame_residue_indices[i->second] != residue_index_){
-      energy = particles_[i->first]->PairwiseEnergy(frame_particles[i->second]);
+  int counter = 0;
+  for(iterator i = this->begin(); i != this->end(); ++i, ++counter) {
+    // set the subrotamer frame energies to the already existing
+    // energies
+    for(int j = 0; j < subrotamer_sizes[counter]; ++j) {
+      frame_energies(counter,j) = (*i)->GetFrameEnergy(j);
+    }
+  }
 
-      if(energy != Real(0.0)){
+  for(std::vector<std::pair<int,int> >::iterator i = 
+      overlapping_particles.begin(),
+      e = overlapping_particles.end(); i != e ; ++i) {
 
-        e_ptr = frame_energies[rotamer_indices_[i->first]];
+    if(frame_residue_indices[i->second] != residue_index_) {
 
-        for(FRMRotamer::subrotamer_association_iterator j = ass_ind_b_[i->first];
-            j != ass_ind_e_[i->first]; ++j){
-          e_ptr[*j] += energy;
+      Real energy = 
+      particles_[i->first]->PairwiseEnergy(frame_particles[i->second]);
+
+      if(energy != Real(0.0)) {
+        int row_idx = rotamer_indices_[i->first];
+        for(FRMRotamer::subrotamer_association_iterator j = 
+            ass_ind_b_[i->first]; j != ass_ind_e_[i->first]; ++j) {
+          frame_energies(row_idx, *j) += energy;
         }
       }
     }
@@ -344,37 +359,29 @@ void FRMRotamerGroup::AddFrameEnergy(FramePtr frame){
 
   std::vector<double> exp_buffer(max_subrotamer_size, 0.0);
   counter = 0;
-  Real T;
-  Real one_over_T;
-  int actual_subrotamer_size;
-
-  for(iterator i = this->begin(), e = this->end(); i != e; ++i){
-    actual_subrotamer_size = (*i)->subrotamer_size(); 
-    e_ptr = frame_energies[counter];
-    T = (*i)->GetTemperature();
-    one_over_T = 1.0/T;
-    for(int j = 0; j < actual_subrotamer_size; ++j){
-      (*i)->SetFrameEnergy(e_ptr[j],j);
-      exp_buffer[j] = -e_ptr[j]*one_over_T;
-    }
-    (*i)->SetFrameEnergy(-T*LogSumExp(&exp_buffer[0], actual_subrotamer_size));
-    ++counter;
-  }
 
-  for(uint i = 0; i < this->size(); ++i){
-    delete [] frame_energies[i];
+  for(iterator i = this->begin(), e = this->end(); i != e; ++i, ++counter) {
+    Real T = (*i)->GetTemperature();
+    Real one_over_T = 1.0 / T;
+    for(int j = 0; j < subrotamer_sizes[counter]; ++j) {
+      Real energy = frame_energies(counter, j);
+      (*i)->SetFrameEnergy(energy, j);
+      exp_buffer[j] = -energy * one_over_T;
+    }
+    (*i)->SetFrameEnergy(-T*LogSumExp(&exp_buffer[0], 
+                                      subrotamer_sizes[counter]));
   }
-  delete [] frame_energies;
-
 }
 
-Real* FRMRotamerGroup::CalculatePairwiseEnergies(FRMRotamerGroupPtr other,
-                                                 Real threshold) {
+
+bool FRMRotamerGroup::CalculatePairwiseEnergies(FRMRotamerGroupPtr other,
+                                                Real threshold,
+                                                promod3::core::EMatXX& emat) {
 
   core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
                                "FRMRotamerGroup::CalculatePairwiseEnergies", 2);
 
-  if(!collision_tree_.Overlap(other->GetCollisionTree())) return NULL;
+  if(!collision_tree_.Overlap(other->GetCollisionTree())) return false;
 
   std::vector<std::pair<int,int> > overlapping_particles;
   overlapping_particles.reserve(100000);
@@ -382,96 +389,91 @@ Real* FRMRotamerGroup::CalculatePairwiseEnergies(FRMRotamerGroupPtr other,
   collision_tree_.OverlappingPolytopes(other->GetCollisionTree(),
                                        overlapping_particles);
 
-  if(overlapping_particles.empty()) return NULL;
+  if(overlapping_particles.empty()) return false;
 
   int this_size = this->size();
   int other_size = other->size();
   int rotamer_combinations = this_size * other_size;
-  Real* data = new Real[rotamer_combinations];
+  emat = promod3::core::EMatXX::Zero(this_size, other_size);
 
-  int other_subrotamer_sizes[other_size];
+  std::vector<int> other_subrotamer_sizes(other_size);
   int total_other_subrotamers = 0;
-  for(int i = 0; i < other_size; ++i){
+  for(int i = 0; i < other_size; ++i) {
     other_subrotamer_sizes[i] = other->rotamers_[i]->subrotamer_size();   
     total_other_subrotamers += other_subrotamer_sizes[i];
   }
 
-  int subrotamer_combinations[rotamer_combinations];
-  int max_subrotamer_combinations=0;
-  int* int_ptr = &subrotamer_combinations[0];
-  int temp;
+  // lets figure out what is the maximum number of subrotamer combinations
+  // among all the rotamer combinations
+  int max_subrotamers_i = 0;
+  int max_subrotamers_j = 0;
 
-  for(int i = 0; i < this_size; ++i){
-    temp = rotamers_[i]->subrotamer_size();
-    for(int j = 0; j < other_size; ++j){
-      *int_ptr = temp * other_subrotamer_sizes[j];
-      max_subrotamer_combinations = (max_subrotamer_combinations<(*int_ptr))?(*int_ptr):max_subrotamer_combinations;
-      ++int_ptr;
-    }
+  for(int i = 0; i < this_size; ++i) {
+    max_subrotamers_i = std::max(max_subrotamers_i,
+                        static_cast<int>(rotamers_[i]->subrotamer_size()));
   }
 
-  Real** subrotamer_energies = new Real*[rotamer_combinations];
-  for(int i = 0; i < rotamer_combinations; ++i){
-    subrotamer_energies[i] = new Real[subrotamer_combinations[i]];
-    memset(subrotamer_energies[i],0,subrotamer_combinations[i]*sizeof(Real));
+  for(int i = 0; i < other_size; ++i) {
+    max_subrotamers_j = std::max(max_subrotamers_j,
+                                 other_subrotamer_sizes[i]);
   }
 
+  int max_subrotamer_combinations = max_subrotamers_i * max_subrotamers_j;
+
+  // All pairwise subrotamer energies will be stored in the 
+  // subrotamer_energies matrix.
+  // In principle this would be a 4 dimensional problem.
+  // This is how we store it:
+  // Rows: one row per combination of rotamers...
+  //       row for combination i,j is at (i * other_size + j) 
+  // Cols: the actual subrotamer energies for rotamer pair i,j
+  //       it follows the same row-major principle as above
+  //       energy for subrotamer combination k, l of rotamers i, j 
+  //       is stored at col: k * other_subrotamer_sizes[j] + l
+  promod3::core::EMatXX subrotamer_energies = 
+  promod3::core::EMatXX::Zero(rotamer_combinations, 
+                              max_subrotamer_combinations);
+
   Real energy;
   int r_index_j;
+  int e_row_idx, e_col_idx;
   int other_subrotamer_size;
-  Real* e_ptr;
-
-  FRMRotamer::subrotamer_association_iterator j_b,j_e,k_b,k_e,temp_it;
+  FRMRotamer::subrotamer_association_iterator subrot_i_b, subrot_i_e,
+                                              subrot_j_b, subrot_j_e, temp_it;
 
-  for(std::vector<std::pair<int,int> >::iterator i = overlapping_particles.begin(),
-      e = overlapping_particles.end(); i != e; ++i){
+  for(std::vector<std::pair<int,int> >::iterator i = 
+      overlapping_particles.begin(),
+      e = overlapping_particles.end(); i != e; ++i) {
     
     energy = particles_[i->first]->PairwiseEnergy(other->particles_[i->second]);
 
-    if(energy != Real(0.0)){
+    if(energy != Real(0.0)) {
 
+      // we have to add this energy to all combinations of subrotamers where
+      // this pair of particles is involved in...
       r_index_j = other->rotamer_indices_[i->second];
-
+      e_row_idx = rotamer_indices_[i->first] * other_size + r_index_j;
       other_subrotamer_size = other_subrotamer_sizes[r_index_j];
-
-      j_b = ass_ind_b_[i->first];
-      j_e = ass_ind_e_[i->first];
+      subrot_i_b = ass_ind_b_[i->first];
+      subrot_i_e = ass_ind_e_[i->first];
       temp_it = other->ass_ind_b_[i->second];
-      k_e = other->ass_ind_e_[i->second];
+      subrot_j_e = other->ass_ind_e_[i->second];
 
-      e_ptr = subrotamer_energies[rotamer_indices_[i->first]*other_size+r_index_j];
-
-      for(;j_b != j_e; ++j_b){
-        k_b = temp_it;
-        temp = (*j_b)*other_subrotamer_size;
-        for(;k_b != k_e; ++k_b){
-          e_ptr[temp+(*k_b)] += energy;
+      for(;subrot_i_b != subrot_i_e; ++subrot_i_b) {
+        subrot_j_b = temp_it;
+        int temp = (*subrot_i_b) * other_subrotamer_size;
+        for(;subrot_j_b != subrot_j_e; ++subrot_j_b) {
+          subrotamer_energies(e_row_idx, temp + (*subrot_j_b)) += energy;
         }
       }
     }
   }
 
-  Real max_e = 0.0;
-  for(int i = 0; i < rotamer_combinations; ++i){
-    e_ptr = subrotamer_energies[i];
-    for(int j = 0; j < subrotamer_combinations[i]; ++j){
-      max_e = (max_e<std::abs(e_ptr[j]))?std::abs(e_ptr[j]):max_e;
-    }
-  }
-  if(max_e < threshold){
-    for(int i = 0; i < rotamer_combinations; ++i){
-      delete [] subrotamer_energies[i];
-    }
-    delete [] subrotamer_energies;
-    delete [] data;
-    return NULL;
+  if(subrotamer_energies.cwiseAbs().maxCoeff() < threshold) {
+    return false;
   }
 
   std::vector<double> exp_buffer(max_subrotamer_combinations, 0.0);
-  Real* energy_ptr;
-  Real* data_ptr = &data[0];
-  double* double_ptr;
-  Real* Real_ptr;
   int a,b;
   Real T;
   Real one_over_T;
@@ -479,66 +481,65 @@ Real* FRMRotamerGroup::CalculatePairwiseEnergies(FRMRotamerGroupPtr other,
 
   Real i_frame_energy;
   Real k_subrotamer_frame_energy;
-  Real j_frame_energies[other_size];
-  Real j_temperatures[other_size];
-  Real other_subrotamer_frame_energies[total_other_subrotamers];
+  std::vector<Real> j_frame_energies(other_size);
+  std::vector<Real> j_temperatures(other_size);
+  std::vector<Real> other_subrotamer_frame_energies(total_other_subrotamers);
 
+  // do some caching...
   a = 0;
-  Real_ptr = &other_subrotamer_frame_energies[0];
-  for(iterator i = other->begin(); i != other->end(); ++i,++a){
+  b = 0;
+  for(iterator i = other->begin(); i != other->end(); ++i,++a) {
     j_frame_energies[a] = (*i)->GetFrameEnergy();
     j_temperatures[a] = (*i)->GetTemperature();
 
-    for(uint j = 0; j < (*i)->subrotamer_size(); ++j){
-      *Real_ptr = (*i)->GetFrameEnergy(j);
-      ++Real_ptr;
+    for(uint j = 0; j < (*i)->subrotamer_size(); ++j, ++b) {
+      other_subrotamer_frame_energies[b] = (*i)->GetFrameEnergy(j);
     }
   }
 
-  for(int i = 0; i < this_size; ++i){
+  // Everything is in place, the show can start...
+  for(int i = 0; i < this_size; ++i) {
     i_frame_energy = rotamers_[i]->GetFrameEnergy();
     a = rotamers_[i]->subrotamer_size();
     T_i = rotamers_[i]->GetTemperature();
-    temp = i*other_size;
-    Real_ptr = &other_subrotamer_frame_energies[0];
-    for(int j = 0; j < other_size; ++j){
-      energy_ptr = subrotamer_energies[temp+j];
+    Real* other_subrotamer_frame_energy_ptr = 
+    &other_subrotamer_frame_energies[0];
+    for(int j = 0; j < other_size; ++j) {
+      e_row_idx = i * other_size + j;
+      e_col_idx = 0;
       T = 0.5 * (T_i + j_temperatures[j]);
       one_over_T = 1.0/T;
-      double_ptr = &exp_buffer[0];
       b = other_subrotamer_sizes[j];
-
-      for(int k = 0; k < a; ++k){
+      for(int k = 0; k < a; ++k) {
         k_subrotamer_frame_energy = rotamers_[i]->GetFrameEnergy(k);
-        for(int l = 0; l < b; ++l){
-          *double_ptr = -(k_subrotamer_frame_energy+Real_ptr[l]+(*energy_ptr))*one_over_T;
-          ++double_ptr;
-          ++energy_ptr;
+        for(int l = 0; l < b; ++l, ++e_col_idx) {
+          exp_buffer[e_col_idx] = -(k_subrotamer_frame_energy + 
+                                    other_subrotamer_frame_energy_ptr[l] + 
+                                    subrotamer_energies(e_row_idx, e_col_idx)) *
+                                    one_over_T;
         }
       }
 
-      *data_ptr = -T*LogSumExp(&exp_buffer[0], a*b) - i_frame_energy - j_frame_energies[j];
-      ++data_ptr;
-      Real_ptr+=b;
-    }
-  }
+      emat(i, j) = -T*LogSumExp(&exp_buffer[0], a*b) - 
+                    i_frame_energy - j_frame_energies[j]; 
 
-  for(int i = 0; i < rotamer_combinations; ++i){
-    delete [] subrotamer_energies[i];
+      other_subrotamer_frame_energy_ptr += b;
+    }
   }
-  delete [] subrotamer_energies;
 
-  return data;
+  return true;
 }
 
-Real FRMRotamerGroup::GetMaxP() const{
+
+Real FRMRotamerGroup::GetMaxP() const {
   Real max_p = std::numeric_limits<Real>::min();
-  for(const_iterator i = this->begin(); i != this->end(); ++i){
+  for(const_iterator i = this->begin(); i != this->end(); ++i) {
     max_p = std::max(max_p,(*i)->GetProbability());
   }
   return max_p;
 }
 
+
 void FRMRotamerGroup::ApplySelfEnergyThresh(Real self_energy_thresh) {
 
   core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
@@ -547,37 +548,38 @@ void FRMRotamerGroup::ApplySelfEnergyThresh(Real self_energy_thresh) {
   if(rotamers_.size() <= 1) return;
 
   bool something_happened = false;
-  //find the lowest energy
+  // find the lowest energy
   Real e_min = std::numeric_limits<Real>::max();
   for(std::vector<FRMRotamerPtr>::iterator i = rotamers_.begin();
-      i != rotamers_.end(); ++i){
+      i != rotamers_.end(); ++i) {
     e_min = std::min(e_min,(*i)->GetSelfEnergy());
   }
 
-  //define threshold relative to it
+  // define threshold relative to it
   Real thresh = e_min + self_energy_thresh;
 
-  //kill all rotamers with self energies worse than thresh
+  // kill all rotamers with self energies worse than thresh
   for(std::vector<FRMRotamerPtr>::iterator i = rotamers_.begin(); 
-      i != rotamers_.end(); ++i){
-    if((*i)->GetSelfEnergy() > thresh){
+      i != rotamers_.end(); ++i) {
+    if((*i)->GetSelfEnergy() > thresh) {
       i = rotamers_.erase(i);
       --i;
       something_happened = true;
     }
   }
 
-  if(something_happened){
+  if(something_happened) {
     this->Init();
   }
 }
 
-void FRMRotamerGroup::Init(){
+
+void FRMRotamerGroup::Init() {
 
   int overall_size = 0;
 
   for(std::vector<FRMRotamerPtr>::iterator i = rotamers_.begin(); 
-      i != rotamers_.end(); ++i){
+      i != rotamers_.end(); ++i) {
     overall_size += (*i)->size();
   }
 
@@ -598,16 +600,18 @@ void FRMRotamerGroup::Init(){
   geom::Vec3 pos;
 
   for(std::vector<FRMRotamerPtr>::iterator i = rotamers_.begin(); 
-      i != rotamers_.end(); ++i){
+      i != rotamers_.end(); ++i) {
 
     actual_internal_index = 0;
 
-    for(uint j = 0; j < (*i)->size(); ++j){
+    for(uint j = 0; j < (*i)->size(); ++j) {
       Particle& p = (**i)[j];
       particles_[actual_position] = &p;
       rotamer_indices_[actual_position] = actual_rotamer;
-      ass_ind_b_[actual_position] = (*i)->subrotamer_association_begin(actual_internal_index);
-      ass_ind_e_[actual_position] = (*i)->subrotamer_association_end(actual_internal_index);
+      ass_ind_b_[actual_position] = 
+      (*i)->subrotamer_association_begin(actual_internal_index);
+      ass_ind_e_[actual_position] = 
+      (*i)->subrotamer_association_end(actual_internal_index);
       pos = p.GetPos();
       x_particle_positions[actual_position] = pos[0];
       y_particle_positions[actual_position] = pos[1];
@@ -625,4 +629,4 @@ void FRMRotamerGroup::Init(){
                             collision_distances);
 }
 
-}}//ns
+}} // ns
diff --git a/sidechain/src/rotamer_group.hh b/sidechain/src/rotamer_group.hh
index 6c203d792aea4f6d93e665c97d7b30fdc56ebee7..0ed5555e040b2a5f87c45dcdad5568b23ae90a08 100644
--- a/sidechain/src/rotamer_group.hh
+++ b/sidechain/src/rotamer_group.hh
@@ -6,10 +6,11 @@
 #include <boost/shared_ptr.hpp>
 
 #include <promod3/core/tetrahedral_polytope.hh>
+#include <promod3/core/eigen_types.hh>
 #include <promod3/sidechain/rotamer.hh>
 #include <promod3/sidechain/frame.hh>
 
-namespace promod3{ namespace sidechain{
+namespace promod3 { namespace sidechain {
 
 class RRMRotamerGroup;
 class FRMRotamerGroup;
@@ -21,7 +22,8 @@ class RRMRotamerGroup{
 
 public:
 
-  RRMRotamerGroup(const std::vector<RRMRotamerPtr>& rotamers, uint residue_index);
+  RRMRotamerGroup(const std::vector<RRMRotamerPtr>& rotamers, 
+                  uint residue_index);
 
   void Merge(const RRMRotamerGroupPtr other);
 
@@ -36,15 +38,16 @@ public:
 
   void AddFrameEnergy(FramePtr p);
 
-  Real* CalculatePairwiseEnergies(RRMRotamerGroupPtr other, Real threshold);
+  bool CalculatePairwiseEnergies(RRMRotamerGroupPtr other, Real threshold,
+                                 promod3::core::EMatXX& emat);
 
   Real GetMaxP() const;
 
   void ApplySelfEnergyThresh(Real self_energy_thresh = 30);
 
-  uint GetResidueIndex(){ return residue_index_; }
+  uint GetResidueIndex() { return residue_index_; }
 
-  const promod3::core::TetrahedralPolytopeTree& GetCollisionTree() const{
+  const promod3::core::TetrahedralPolytopeTree& GetCollisionTree() const {
     return collision_tree_;
   }
 
@@ -87,7 +90,8 @@ class FRMRotamerGroup{
 
 public:
 
-  FRMRotamerGroup(const std::vector<FRMRotamerPtr>& rotamers, uint residue_index);
+  FRMRotamerGroup(const std::vector<FRMRotamerPtr>& rotamers, 
+                  uint residue_index);
 
   virtual ~FRMRotamerGroup() { rotamers_.clear(); }
 
@@ -104,7 +108,8 @@ public:
 
   void AddFrameEnergy(FramePtr p);
 
-  Real* CalculatePairwiseEnergies(FRMRotamerGroupPtr other, Real threshold);
+  bool CalculatePairwiseEnergies(FRMRotamerGroupPtr other, Real threshold,
+                                 promod3::core::EMatXX& emat);
 
   Real GetMaxP() const;
 
@@ -112,7 +117,7 @@ public:
 
   uint GetResidueIndex() const { return residue_index_; }
 
-  const promod3::core::TetrahedralPolytopeTree& GetCollisionTree() const{
+  const promod3::core::TetrahedralPolytopeTree& GetCollisionTree() const {
     return collision_tree_;
   }
 
@@ -154,6 +159,6 @@ private:
 
 
 
-}}//ns
+}} // ns
 
 #endif
diff --git a/sidechain/src/rotamer_lib.cc b/sidechain/src/rotamer_lib.cc
index 4f06f77fc1f36747f26844f080a222fbc828ed9a..10ae3e6438f212aaac69a6e9b7b893e604d0ddde 100644
--- a/sidechain/src/rotamer_lib.cc
+++ b/sidechain/src/rotamer_lib.cc
@@ -237,12 +237,13 @@ std::pair<RotamerLibEntry*,uint> RotamerLib::QueryLib(RotamerID id) const{
   }
 
   std::map<RotamerID,std::pair<uint64_t,uint> >::const_iterator it = static_data_helper_.find(id);
-  if(it == static_data_helper_.end()){
-    throw promod3::Error("No rotamers for given id...");
-  } 
 
   result_buffer_.clear();
 
+  if(it == static_data_helper_.end()){
+    return std::make_pair(reinterpret_cast<RotamerLibEntry*>(NULL), 0);
+  } 
+
   uint64_t pos = it->second.first;
   for(uint i = 0; i < it->second.second; ++i){
     result_buffer_.push_back(static_data_[pos]);
diff --git a/sidechain/src/scwrl_rotamer_constructor.cc b/sidechain/src/scwrl_rotamer_constructor.cc
index 1ef28876c408c19e689c00c0ca252d9c50cfce77..ed8d8da2f04790a7c2d7b72f5eb189de82c1a420 100644
--- a/sidechain/src/scwrl_rotamer_constructor.cc
+++ b/sidechain/src/scwrl_rotamer_constructor.cc
@@ -53,7 +53,7 @@ void EvalLonePairRule(promod3::sidechain::Particle& p,
                       promod3::sidechain::SCWRLLPRule rule,
                       const geom::Vec3& a,
                       const geom::Vec3& b,
-                      const geom::Vec3& c){
+                      const geom::Vec3& c) {
   switch(rule){
     case promod3::sidechain::LONE_PAIR_CARBONYL: {
       _AddLonePairsCarbonyl(a, b, c, p);
@@ -170,7 +170,8 @@ _AtomSpecCPList _GetCarboxylAtoms(const _AtomInfo& atom_info) {
 
 namespace promod3 { namespace sidechain {
 
-SCWRLRotamerLookup::SCWRLRotamerLookup() {
+SCWRLRotamerLookup::SCWRLRotamerLookup(bool cb_in_sidechain) {
+
   core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
                                 "SCWRLRotamerLookup::SCWRLRotamerLookup", 2);
   
@@ -178,6 +179,7 @@ SCWRLRotamerLookup::SCWRLRotamerLookup() {
   sidechain_infos_[ARG].has_hydrogens = true;
   sidechain_infos_[ARG].internal_e_prefactor = 2.27;
   sidechain_infos_[ARG].frm_t = 1.23;
+
   AddInfo(ARG, CH2Particle, 0.0, "CG", promod3::loop::ARG_CG_INDEX, false);
   AddInfo(ARG, CH2Particle, 0.1, "CD", promod3::loop::ARG_CD_INDEX, false);
   AddInfo(ARG, NParticle, -0.4, "NE", promod3::loop::ARG_NE_INDEX, false);
@@ -189,11 +191,17 @@ SCWRLRotamerLookup::SCWRLRotamerLookup() {
   AddInfo(ARG, HParticle, 0.35, "HH12", promod3::loop::ARG_HH12_INDEX, true);
   AddInfo(ARG, HParticle, 0.35, "HH21", promod3::loop::ARG_HH21_INDEX, true);
   AddInfo(ARG, HParticle, 0.35, "HH22", promod3::loop::ARG_HH22_INDEX, true);
+
+  if(cb_in_sidechain) {
+    AddInfo(ARG, CH2Particle, 0.0, "CB", promod3::loop::BB_CB_INDEX, false);
+  }
+
   AddPDir(ARG, promod3::loop::ARG_HE_INDEX, promod3::loop::ARG_NE_INDEX, 6);
   AddPDir(ARG, promod3::loop::ARG_HH11_INDEX, promod3::loop::ARG_NH1_INDEX, 7);
   AddPDir(ARG, promod3::loop::ARG_HH12_INDEX, promod3::loop::ARG_NH1_INDEX, 8);
   AddPDir(ARG, promod3::loop::ARG_HH21_INDEX, promod3::loop::ARG_NH2_INDEX, 9);
   AddPDir(ARG, promod3::loop::ARG_HH22_INDEX, promod3::loop::ARG_NH2_INDEX, 10);
+
   AddFRMRule(ARG, promod3::loop::BB_CA_INDEX, promod3::loop::BB_CB_INDEX);
   AddFRMPrefactor(ARG, 0, -0.87);
   AddFRMPrefactor(ARG, 0, 0.87);
@@ -208,6 +216,7 @@ SCWRLRotamerLookup::SCWRLRotamerLookup() {
   AddFRMRotatingParticle(ARG, 0, 8);
   AddFRMRotatingParticle(ARG, 0, 9);
   AddFRMRotatingParticle(ARG, 0, 10);
+
   AddFRMRule(ARG, promod3::loop::BB_CB_INDEX, promod3::loop::ARG_CG_INDEX);
   AddFRMPrefactor(ARG, 1, -1.62);
   AddFRMPrefactor(ARG, 1, 1.62);
@@ -222,6 +231,7 @@ SCWRLRotamerLookup::SCWRLRotamerLookup() {
   AddFRMRotatingParticle(ARG, 1, 8);
   AddFRMRotatingParticle(ARG, 1, 9);
   AddFRMRotatingParticle(ARG, 1, 10);
+
   AddFRMRule(ARG, promod3::loop::ARG_CG_INDEX, promod3::loop::ARG_CD_INDEX);
   AddFRMPrefactor(ARG, 2, -1.67);
   AddFRMPrefactor(ARG, 2, 1.67);
@@ -236,6 +246,7 @@ SCWRLRotamerLookup::SCWRLRotamerLookup() {
   AddFRMRotatingParticle(ARG, 2, 8);
   AddFRMRotatingParticle(ARG, 2, 9);
   AddFRMRotatingParticle(ARG, 2, 10);
+
   AddFRMRule(ARG, promod3::loop::ARG_CD_INDEX, promod3::loop::ARG_NE_INDEX);
   AddFRMPrefactor(ARG, 3, -0.73);
   AddFRMPrefactor(ARG, 3, 0.73);
@@ -250,14 +261,26 @@ SCWRLRotamerLookup::SCWRLRotamerLookup() {
   AddFRMRotatingParticle(ARG, 3, 8);
   AddFRMRotatingParticle(ARG, 3, 9);
   AddFRMRotatingParticle(ARG, 3, 10);
+
+  if(cb_in_sidechain) {
+    AddFRMFixParticle(ARG, 0, 11);
+    AddFRMFixParticle(ARG, 1, 11);
+    AddFRMFixParticle(ARG, 2, 11);
+    AddFRMFixParticle(ARG, 3, 11);
+  }
+
   backbone_infos_[ARG].has_hydrogens = true;
   AddBBInfo(ARG, NParticle, -0.35, "N", promod3::loop::BB_N_INDEX, false);
   AddBBInfo(ARG, CH1Particle, 0.1, "CA", promod3::loop::BB_CA_INDEX, false);
   AddBBInfo(ARG, CParticle, 0.55, "C", promod3::loop::BB_C_INDEX, false);
   AddBBInfo(ARG, OParticle, -0.55, "O", promod3::loop::BB_O_INDEX, false);
-  AddBBInfo(ARG, CH2Particle, 0.0, "CB", promod3::loop::BB_CB_INDEX, false);
   AddBBInfo(ARG, HParticle, 0.25, "H", promod3::loop::ARG_H_INDEX,true);
-  AddBBPDir(ARG, promod3::loop::ARG_H_INDEX, promod3::loop::BB_N_INDEX, 5);
+
+  if(!cb_in_sidechain) {
+    AddBBInfo(ARG, CH2Particle, 0.0, "CB", promod3::loop::BB_CB_INDEX, false);
+  }
+
+  AddBBPDir(ARG, promod3::loop::ARG_H_INDEX, promod3::loop::BB_N_INDEX, 4);
   AddBBLP(ARG, promod3::loop::BB_CA_INDEX, promod3::loop::BB_C_INDEX, 
           promod3::loop::BB_O_INDEX, false, false, false, 3, LONE_PAIR_CARBONYL);
 
@@ -265,15 +288,22 @@ SCWRLRotamerLookup::SCWRLRotamerLookup() {
   sidechain_infos_[ASN].has_hydrogens = true;
   sidechain_infos_[ASN].internal_e_prefactor = 1.80;
   sidechain_infos_[ASN].frm_t = 1.41;
+
   AddInfo(ASN, CParticle, 0.55, "CG", promod3::loop::ASN_CG_INDEX, false);
   AddInfo(ASN, OParticle, -0.55, "OD1", promod3::loop::ASN_OD1_INDEX, false);
   AddInfo(ASN, NParticle, -0.6, "ND2", promod3::loop::ASN_ND2_INDEX, false);
   AddInfo(ASN, HParticle, 0.3, "HD21", promod3::loop::ASN_HD21_INDEX, true);
   AddInfo(ASN, HParticle, 0.3, "HD22", promod3::loop::ASN_HD22_INDEX, true);
+
+  if(cb_in_sidechain) {
+    AddInfo(ASN, CH2Particle, 0.0, "CB", promod3::loop::BB_CB_INDEX, false);
+  }
+
   AddPDir(ASN, promod3::loop::ASN_HD21_INDEX, promod3::loop::ASN_ND2_INDEX, 3);
   AddPDir(ASN, promod3::loop::ASN_HD22_INDEX, promod3::loop::ASN_ND2_INDEX, 4);
   AddLP(ASN, promod3::loop::ASN_ND2_INDEX, promod3::loop::ASN_CG_INDEX, 
         promod3::loop::ASN_OD1_INDEX, false, false, false, 1, LONE_PAIR_CARBONYL);
+
   AddFRMRule(ASN, promod3::loop::BB_CA_INDEX, promod3::loop::BB_CB_INDEX);
   AddFRMPrefactor(ASN, 0, -0.62);
   AddFRMPrefactor(ASN, 0, 0.62);
@@ -282,6 +312,7 @@ SCWRLRotamerLookup::SCWRLRotamerLookup() {
   AddFRMRotatingParticle(ASN, 0, 2);
   AddFRMRotatingParticle(ASN, 0, 3);
   AddFRMRotatingParticle(ASN, 0, 4);
+
   AddFRMRule(ASN, promod3::loop::BB_CB_INDEX, promod3::loop::ASN_CG_INDEX);
   AddFRMPrefactor(ASN, 1, -1.93);
   AddFRMPrefactor(ASN, 1, 1.93);
@@ -290,47 +321,76 @@ SCWRLRotamerLookup::SCWRLRotamerLookup() {
   AddFRMRotatingParticle(ASN, 1, 2);
   AddFRMRotatingParticle(ASN, 1, 3);
   AddFRMRotatingParticle(ASN, 1, 4);
+
+  if(cb_in_sidechain) {
+    AddFRMFixParticle(ASN, 0, 5);
+    AddFRMFixParticle(ASN, 1, 5);
+  }
+
   backbone_infos_[ASN].has_hydrogens = true;
   AddBBInfo(ASN, NParticle, -0.35, "N", promod3::loop::BB_N_INDEX, false);
   AddBBInfo(ASN, CH1Particle, 0.1, "CA", promod3::loop::BB_CA_INDEX, false);
   AddBBInfo(ASN, CParticle, 0.55, "C", promod3::loop::BB_C_INDEX, false);
   AddBBInfo(ASN, OParticle, -0.55, "O", promod3::loop::BB_O_INDEX, false);
-  AddBBInfo(ASN, CH2Particle, 0.0, "CB", promod3::loop::BB_CB_INDEX, false);
   AddBBInfo(ASN, HParticle, 0.25, "H", promod3::loop::ASN_H_INDEX,true);
-  AddBBPDir(ASN, promod3::loop::ASN_H_INDEX, promod3::loop::BB_N_INDEX, 5);
+
+  if(!cb_in_sidechain) {
+    AddBBInfo(ASN, CH2Particle, 0.0, "CB", promod3::loop::BB_CB_INDEX, false);
+  }
+
+  AddBBPDir(ASN, promod3::loop::ASN_H_INDEX, promod3::loop::BB_N_INDEX, 4);
   AddBBLP(ASN, promod3::loop::BB_CA_INDEX, promod3::loop::BB_C_INDEX, 
           promod3::loop::BB_O_INDEX, false, false, false, 3, LONE_PAIR_CARBONYL);
 
   // ASP
-  AddInfo(ASP, CParticle, 0.36, "CG", promod3::loop::ASP_CG_INDEX, false);
   sidechain_infos_[ASP].internal_e_prefactor = 2.44;
   sidechain_infos_[ASP].frm_t = 1.48;
+  sidechain_infos_[ASP].has_hydrogens = false;
+
+  AddInfo(ASP, CParticle, 0.36, "CG", promod3::loop::ASP_CG_INDEX, false);
   AddInfo(ASP, OParticle, -0.60, "OD1", promod3::loop::ASP_OD1_INDEX, false);
   AddInfo(ASP, OParticle, -0.60, "OD2", promod3::loop::ASP_OD2_INDEX, false);
+
+  if(cb_in_sidechain) {
+    AddInfo(ASP, CH2Particle, -0.16, "CB", promod3::loop::BB_CB_INDEX, false);
+  }
+
   AddLP(ASP, promod3::loop::ASP_OD2_INDEX, promod3::loop::ASP_CG_INDEX, 
         promod3::loop::ASP_OD1_INDEX, false, false, false, 1, LONE_PAIR_CARBONYL);
   AddLP(ASP, promod3::loop::ASP_OD1_INDEX, promod3::loop::ASP_CG_INDEX, 
         promod3::loop::ASP_OD2_INDEX, false, false, false, 2, LONE_PAIR_CARBONYL);
+
   AddFRMRule(ASP, promod3::loop::BB_CA_INDEX, promod3::loop::BB_CB_INDEX);
   AddFRMPrefactor(ASP, 0, -1.59);
   AddFRMPrefactor(ASP, 0, 1.59);
   AddFRMRotatingParticle(ASP, 0, 0);
   AddFRMRotatingParticle(ASP, 0, 1);
   AddFRMRotatingParticle(ASP, 0, 2);
+
   AddFRMRule(ASP, promod3::loop::BB_CB_INDEX, promod3::loop::ASP_CG_INDEX);
   AddFRMPrefactor(ASP, 1, -0.63);
   AddFRMPrefactor(ASP, 1, 0.63);
   AddFRMFixParticle(ASP, 1, 0);
   AddFRMRotatingParticle(ASP, 1, 1);
   AddFRMRotatingParticle(ASP, 1, 2);
+
+  if(cb_in_sidechain) {
+    AddFRMFixParticle(ASP, 0, 3);
+    AddFRMFixParticle(ASP, 1, 3);
+  }
+
   backbone_infos_[ASP].has_hydrogens = true;
   AddBBInfo(ASP, NParticle, -0.35, "N", promod3::loop::BB_N_INDEX, false);
   AddBBInfo(ASP, CH1Particle, 0.1, "CA", promod3::loop::BB_CA_INDEX, false);
   AddBBInfo(ASP, CParticle, 0.55, "C", promod3::loop::BB_C_INDEX, false);
   AddBBInfo(ASP, OParticle, -0.55, "O", promod3::loop::BB_O_INDEX, false);
-  AddBBInfo(ASP, CH2Particle, -0.16, "CB", promod3::loop::BB_CB_INDEX, false);
   AddBBInfo(ASP, HParticle, 0.25, "H", promod3::loop::ASP_H_INDEX,true);
-  AddBBPDir(ASP, promod3::loop::ASP_H_INDEX, promod3::loop::BB_N_INDEX, 5);
+
+  if(!cb_in_sidechain) {
+    AddBBInfo(ASP, CH2Particle, -0.16, "CB", promod3::loop::BB_CB_INDEX, false);
+  }
+
+  AddBBPDir(ASP, promod3::loop::ASP_H_INDEX, promod3::loop::BB_N_INDEX, 4);
   AddBBLP(ASP, promod3::loop::BB_CA_INDEX, promod3::loop::BB_C_INDEX, 
           promod3::loop::BB_O_INDEX, false, false, false, 3, LONE_PAIR_CARBONYL);
 
@@ -338,16 +398,23 @@ SCWRLRotamerLookup::SCWRLRotamerLookup() {
   sidechain_infos_[GLN].has_hydrogens = true;
   sidechain_infos_[GLN].internal_e_prefactor = 1.61;
   sidechain_infos_[GLN].frm_t = 1.32;
+
   AddInfo(GLN, CH2Particle, 0.0, "CG", promod3::loop::GLN_CG_INDEX, false);
   AddInfo(GLN, CParticle, 0.55, "CD", promod3::loop::GLN_CD_INDEX, false);
   AddInfo(GLN, OParticle, -0.55, "OE1", promod3::loop::GLN_OE1_INDEX, false);
   AddInfo(GLN, NParticle, -0.60, "NE2", promod3::loop::GLN_NE2_INDEX, false);
   AddInfo(GLN, HParticle, 0.3, "HE21", promod3::loop::GLN_HE21_INDEX, true);
   AddInfo(GLN, HParticle, 0.3, "HE22", promod3::loop::GLN_HE22_INDEX, true);
+
+  if(cb_in_sidechain) {
+    AddInfo(GLN, CH2Particle, 0.0, "CB", promod3::loop::BB_CB_INDEX, false);
+  }
+
   AddPDir(GLN, promod3::loop::GLN_HE21_INDEX, promod3::loop::GLN_NE2_INDEX, 4);
   AddPDir(GLN, promod3::loop::GLN_HE22_INDEX, promod3::loop::GLN_NE2_INDEX, 5);
   AddLP(GLN, promod3::loop::GLN_NE2_INDEX, promod3::loop::GLN_CD_INDEX, 
         promod3::loop::GLN_OE1_INDEX, false, false, false, 2, LONE_PAIR_CARBONYL);
+
   AddFRMRule(GLN, promod3::loop::BB_CA_INDEX, promod3::loop::BB_CB_INDEX);
   AddFRMPrefactor(GLN, 0, -1.55);
   AddFRMPrefactor(GLN, 0, 1.55);
@@ -357,6 +424,7 @@ SCWRLRotamerLookup::SCWRLRotamerLookup() {
   AddFRMRotatingParticle(GLN, 0, 3);
   AddFRMRotatingParticle(GLN, 0, 4);
   AddFRMRotatingParticle(GLN, 0, 5);
+
   AddFRMRule(GLN, promod3::loop::BB_CB_INDEX, promod3::loop::GLN_CG_INDEX);
   AddFRMPrefactor(GLN, 1, -0.53);
   AddFRMPrefactor(GLN, 1, 0.53);
@@ -366,6 +434,7 @@ SCWRLRotamerLookup::SCWRLRotamerLookup() {
   AddFRMRotatingParticle(GLN, 1, 3);
   AddFRMRotatingParticle(GLN, 1, 4);
   AddFRMRotatingParticle(GLN, 1, 5);
+
   AddFRMRule(GLN, promod3::loop::GLN_CG_INDEX, promod3::loop::GLN_CD_INDEX);
   AddFRMPrefactor(GLN, 2, -1.89);
   AddFRMPrefactor(GLN, 2, 1.89);
@@ -375,14 +444,25 @@ SCWRLRotamerLookup::SCWRLRotamerLookup() {
   AddFRMRotatingParticle(GLN, 2, 3);
   AddFRMRotatingParticle(GLN, 2, 4);
   AddFRMRotatingParticle(GLN, 2, 5);
+
+  if(cb_in_sidechain) {
+    AddFRMFixParticle(GLN, 0, 6);
+    AddFRMFixParticle(GLN, 1, 6);
+    AddFRMFixParticle(GLN, 2, 6);
+  }
+
   backbone_infos_[GLN].has_hydrogens = true;
   AddBBInfo(GLN, NParticle, -0.35, "N", promod3::loop::BB_N_INDEX, false);
   AddBBInfo(GLN, CH1Particle, 0.1, "CA", promod3::loop::BB_CA_INDEX, false);
   AddBBInfo(GLN, CParticle, 0.55, "C", promod3::loop::BB_C_INDEX, false);
   AddBBInfo(GLN, OParticle, -0.55, "O", promod3::loop::BB_O_INDEX, false);
-  AddBBInfo(GLN, CH2Particle, 0.0, "CB", promod3::loop::BB_CB_INDEX, false);
   AddBBInfo(GLN, HParticle, 0.25, "H", promod3::loop::GLN_H_INDEX,true);
-  AddBBPDir(GLN, promod3::loop::GLN_H_INDEX, promod3::loop::BB_N_INDEX, 5);
+
+  if(!cb_in_sidechain) {
+    AddBBInfo(GLN, CH2Particle, 0.0, "CB", promod3::loop::BB_CB_INDEX, false);
+  }
+
+  AddBBPDir(GLN, promod3::loop::GLN_H_INDEX, promod3::loop::BB_N_INDEX, 4);
   AddBBLP(GLN, promod3::loop::BB_CA_INDEX, promod3::loop::BB_C_INDEX, 
           promod3::loop::BB_O_INDEX, false, false, false, 3, LONE_PAIR_CARBONYL);
 
@@ -390,14 +470,21 @@ SCWRLRotamerLookup::SCWRLRotamerLookup() {
   sidechain_infos_[GLU].has_hydrogens = false;
   sidechain_infos_[GLU].internal_e_prefactor = 1.85;
   sidechain_infos_[GLU].frm_t = 0.94;
+
   AddInfo(GLU, CH2Particle, -0.16, "CG", promod3::loop::GLU_CG_INDEX, false);
   AddInfo(GLU, CParticle, 0.36, "CD", promod3::loop::GLU_CD_INDEX, false);
   AddInfo(GLU, OParticle, -0.60, "OE1", promod3::loop::GLU_OE1_INDEX, false);
   AddInfo(GLU, OParticle, -0.60, "OE2", promod3::loop::GLU_OE2_INDEX, false);
+
+  if(cb_in_sidechain) {
+    AddInfo(GLU, CH2Particle, 0.0, "CB", promod3::loop::BB_CB_INDEX, false);
+  }
+
   AddLP(GLU, promod3::loop::GLU_OE2_INDEX, promod3::loop::GLU_CD_INDEX, 
         promod3::loop::GLU_OE1_INDEX, false, false, false, 2, LONE_PAIR_CARBONYL);
   AddLP(GLU, promod3::loop::GLU_OE1_INDEX, promod3::loop::GLU_CD_INDEX, 
         promod3::loop::GLU_OE2_INDEX, false, false, false, 3, LONE_PAIR_CARBONYL);
+
   AddFRMRule(GLU, promod3::loop::BB_CA_INDEX, promod3::loop::BB_CB_INDEX);
   AddFRMPrefactor(GLU, 0, -0.82);
   AddFRMPrefactor(GLU, 0, 0.82);
@@ -405,6 +492,7 @@ SCWRLRotamerLookup::SCWRLRotamerLookup() {
   AddFRMRotatingParticle(GLU, 0, 1);
   AddFRMRotatingParticle(GLU, 0, 2);
   AddFRMRotatingParticle(GLU, 0, 3);
+
   AddFRMRule(GLU, promod3::loop::BB_CB_INDEX, promod3::loop::GLU_CG_INDEX);
   AddFRMPrefactor(GLU, 1, -1.57);
   AddFRMPrefactor(GLU, 1, 1.57);
@@ -412,6 +500,7 @@ SCWRLRotamerLookup::SCWRLRotamerLookup() {
   AddFRMRotatingParticle(GLU, 1, 1);
   AddFRMRotatingParticle(GLU, 1, 2);
   AddFRMRotatingParticle(GLU, 1, 3);
+
   AddFRMRule(GLU, promod3::loop::GLU_CG_INDEX, promod3::loop::GLU_CD_INDEX);
   AddFRMPrefactor(GLU, 2, -0.76);
   AddFRMPrefactor(GLU, 2, 0.76);
@@ -419,14 +508,25 @@ SCWRLRotamerLookup::SCWRLRotamerLookup() {
   AddFRMFixParticle(GLU, 2, 1);
   AddFRMRotatingParticle(GLU, 2, 2);
   AddFRMRotatingParticle(GLU, 2, 3);
+
+  if(cb_in_sidechain) {
+    AddFRMFixParticle(GLU, 0, 4);
+    AddFRMFixParticle(GLU, 1, 4);
+    AddFRMFixParticle(GLU, 2, 4);
+  }
+
   backbone_infos_[GLU].has_hydrogens = true;
   AddBBInfo(GLU, NParticle, -0.35, "N", promod3::loop::BB_N_INDEX, false);
   AddBBInfo(GLU, CH1Particle, 0.1, "CA", promod3::loop::BB_CA_INDEX, false);
   AddBBInfo(GLU, CParticle, 0.55, "C", promod3::loop::BB_C_INDEX, false);
   AddBBInfo(GLU, OParticle, -0.55, "O", promod3::loop::BB_O_INDEX, false);
-  AddBBInfo(GLU, CH2Particle, 0.0, "CB", promod3::loop::BB_CB_INDEX, false);
   AddBBInfo(GLU, HParticle, 0.25, "H", promod3::loop::GLU_H_INDEX,true);
-  AddBBPDir(GLU, promod3::loop::GLU_H_INDEX, promod3::loop::BB_N_INDEX, 5);
+
+  if(!cb_in_sidechain) {
+    AddBBInfo(GLU, CH2Particle, 0.0, "CB", promod3::loop::BB_CB_INDEX, false);
+  }
+
+  AddBBPDir(GLU, promod3::loop::GLU_H_INDEX, promod3::loop::BB_N_INDEX, 4);
   AddBBLP(GLU, promod3::loop::BB_CA_INDEX, promod3::loop::BB_C_INDEX, 
           promod3::loop::BB_O_INDEX, false, false, false, 3, LONE_PAIR_CARBONYL);
 
@@ -434,6 +534,7 @@ SCWRLRotamerLookup::SCWRLRotamerLookup() {
   sidechain_infos_[LYS].has_hydrogens = true;
   sidechain_infos_[LYS].internal_e_prefactor = 2.13;
   sidechain_infos_[LYS].frm_t = 1.27;
+
   AddInfo(LYS, CH2Particle, 0.0, "CG", promod3::loop::LYS_CG_INDEX,false);
   AddInfo(LYS, CH2Particle, 0.0, "CD", promod3::loop::LYS_CD_INDEX,false);
   AddInfo(LYS, CH2Particle, 0.25, "CE", promod3::loop::LYS_CE_INDEX,false);
@@ -441,9 +542,15 @@ SCWRLRotamerLookup::SCWRLRotamerLookup() {
   AddInfo(LYS, HParticle, 0.35, "HZ1", promod3::loop::LYS_HZ1_INDEX,true);
   AddInfo(LYS, HParticle, 0.35, "HZ2", promod3::loop::LYS_HZ2_INDEX,true);
   AddInfo(LYS, HParticle, 0.35, "HZ3", promod3::loop::LYS_HZ3_INDEX,true);
+
+  if(cb_in_sidechain) {
+    AddInfo(LYS, CH2Particle, 0.0, "CB", promod3::loop::BB_CB_INDEX, false);
+  }
+
   AddPDir(LYS, promod3::loop::LYS_HZ1_INDEX, promod3::loop::LYS_NZ_INDEX, 4);
   AddPDir(LYS, promod3::loop::LYS_HZ2_INDEX, promod3::loop::LYS_NZ_INDEX, 5);
   AddPDir(LYS, promod3::loop::LYS_HZ3_INDEX, promod3::loop::LYS_NZ_INDEX, 6);
+
   AddFRMRule(LYS, promod3::loop::BB_CA_INDEX, promod3::loop::BB_CB_INDEX);
   AddFRMPrefactor(LYS, 0, -1.62);
   AddFRMPrefactor(LYS, 0, 1.62);
@@ -454,6 +561,7 @@ SCWRLRotamerLookup::SCWRLRotamerLookup() {
   AddFRMRotatingParticle(LYS, 0, 4);
   AddFRMRotatingParticle(LYS, 0, 5);
   AddFRMRotatingParticle(LYS, 0, 6);
+
   AddFRMRule(LYS, promod3::loop::BB_CB_INDEX, promod3::loop::LYS_CG_INDEX);
   AddFRMPrefactor(LYS, 1, -0.99);
   AddFRMPrefactor(LYS, 1, 0.99);
@@ -464,6 +572,7 @@ SCWRLRotamerLookup::SCWRLRotamerLookup() {
   AddFRMRotatingParticle(LYS, 1, 4);
   AddFRMRotatingParticle(LYS, 1, 5);
   AddFRMRotatingParticle(LYS, 1, 6);
+
   AddFRMRule(LYS, promod3::loop::LYS_CG_INDEX, promod3::loop::LYS_CD_INDEX);
   AddFRMPrefactor(LYS, 2, -0.96);
   AddFRMPrefactor(LYS, 2, 0.96);
@@ -474,6 +583,7 @@ SCWRLRotamerLookup::SCWRLRotamerLookup() {
   AddFRMRotatingParticle(LYS, 2, 4);
   AddFRMRotatingParticle(LYS, 2, 5);
   AddFRMRotatingParticle(LYS, 2, 6);
+
   AddFRMRule(LYS, promod3::loop::LYS_CD_INDEX, promod3::loop::LYS_CE_INDEX);
   AddFRMPrefactor(LYS, 3, -1.49);
   AddFRMPrefactor(LYS, 3, 1.49);
@@ -484,14 +594,26 @@ SCWRLRotamerLookup::SCWRLRotamerLookup() {
   AddFRMRotatingParticle(LYS, 3, 4);
   AddFRMRotatingParticle(LYS, 3, 5);
   AddFRMRotatingParticle(LYS, 3, 6);
+
+  if(cb_in_sidechain) {
+    AddFRMFixParticle(LYS, 0, 7);
+    AddFRMFixParticle(LYS, 1, 7);
+    AddFRMFixParticle(LYS, 2, 7);
+    AddFRMFixParticle(LYS, 3, 7);
+  }
+
   sidechain_infos_[LYS].has_hydrogens = true;
   AddBBInfo(LYS, NParticle, -0.35, "N", promod3::loop::BB_N_INDEX, false);
   AddBBInfo(LYS, CH1Particle, 0.1, "CA", promod3::loop::BB_CA_INDEX, false);
   AddBBInfo(LYS, CParticle, 0.55, "C", promod3::loop::BB_C_INDEX, false);
   AddBBInfo(LYS, OParticle, -0.55, "O", promod3::loop::BB_O_INDEX, false);
-  AddBBInfo(LYS, CH2Particle, 0.0, "CB", promod3::loop::BB_CB_INDEX, false);
   AddBBInfo(LYS, HParticle, 0.25, "H", promod3::loop::LYS_H_INDEX,true);
-  AddBBPDir(LYS, promod3::loop::LYS_H_INDEX, promod3::loop::BB_N_INDEX, 5);
+
+  if(!cb_in_sidechain) {
+    AddBBInfo(LYS, CH2Particle, 0.0, "CB", promod3::loop::BB_CB_INDEX, false);
+  }
+
+  AddBBPDir(LYS, promod3::loop::LYS_H_INDEX, promod3::loop::BB_N_INDEX, 4);
   AddBBLP(LYS, promod3::loop::BB_CA_INDEX, promod3::loop::BB_C_INDEX, 
           promod3::loop::BB_O_INDEX, false, false, false, 3, LONE_PAIR_CARBONYL);
 
@@ -499,8 +621,14 @@ SCWRLRotamerLookup::SCWRLRotamerLookup() {
   sidechain_infos_[SER].has_hydrogens = true;
   sidechain_infos_[SER].internal_e_prefactor = 2.78;
   sidechain_infos_[SER].frm_t = 3.53;
+
   AddInfo(SER, OParticle, -0.65, "OG", promod3::loop::SER_OG_INDEX, false);
   AddInfo(SER, HParticle, 0.40, "HG", promod3::loop::SER_HG_INDEX, true);
+
+  if(cb_in_sidechain) {
+    AddInfo(SER, CH2Particle, 0.25, "CB", promod3::loop::BB_CB_INDEX, false);
+  }
+
   AddPDir(SER, promod3::loop::SER_HG_INDEX, promod3::loop::SER_OG_INDEX, 1);
   AddLP(SER, promod3::loop::BB_CB_INDEX, promod3::loop::SER_OG_INDEX, 
         promod3::loop::SER_HG_INDEX, false, false, true, 0, LONE_PAIR_COH);
@@ -508,24 +636,36 @@ SCWRLRotamerLookup::SCWRLRotamerLookup() {
                         promod3::loop::BB_CA_INDEX, promod3::loop::BB_CB_INDEX, 
                         promod3::loop::SER_OG_INDEX,
                         0.96, 1.85, 1);
+
   AddFRMRule(SER, promod3::loop::BB_CA_INDEX, promod3::loop::BB_CB_INDEX);
   AddFRMPrefactor(SER, 0, -0.65);
   AddFRMPrefactor(SER, 0, 0.65);
   AddFRMRotatingParticle(SER, 0, 0);
   AddFRMRotatingParticle(SER, 0, 1);
+
   AddFRMRule(SER, promod3::loop::BB_CB_INDEX, promod3::loop::SER_OG_INDEX);
   AddFRMPrefactor(SER, 1, -2.98);
   AddFRMPrefactor(SER, 1, 2.98);
   AddFRMFixParticle(SER, 1, 0);
   AddFRMRotatingParticle(SER, 1, 1);
+
+  if(cb_in_sidechain) {
+    AddFRMFixParticle(SER, 0, 2);
+    AddFRMFixParticle(SER, 1, 2);
+  }
+
   backbone_infos_[SER].has_hydrogens = true;
   AddBBInfo(SER, NParticle, -0.35, "N", promod3::loop::BB_N_INDEX, false);
   AddBBInfo(SER, CH1Particle, 0.1, "CA", promod3::loop::BB_CA_INDEX, false);
   AddBBInfo(SER, CParticle, 0.55, "C", promod3::loop::BB_C_INDEX, false);
   AddBBInfo(SER, OParticle, -0.55, "O", promod3::loop::BB_O_INDEX, false);
-  AddBBInfo(SER, CH2Particle, 0.25, "CB", promod3::loop::BB_CB_INDEX, false);
   AddBBInfo(SER, HParticle, 0.25, "H", promod3::loop::SER_H_INDEX,true);
-  AddBBPDir(SER, promod3::loop::SER_H_INDEX, promod3::loop::BB_N_INDEX, 5);
+
+  if(!cb_in_sidechain) {
+    AddBBInfo(SER, CH2Particle, 0.25, "CB", promod3::loop::BB_CB_INDEX, false);
+  }
+
+  AddBBPDir(SER, promod3::loop::SER_H_INDEX, promod3::loop::BB_N_INDEX, 4);
   AddBBLP(SER, promod3::loop::BB_CA_INDEX, promod3::loop::BB_C_INDEX, 
           promod3::loop::BB_O_INDEX, false, false, false, 3, LONE_PAIR_CARBONYL);
 
@@ -533,19 +673,34 @@ SCWRLRotamerLookup::SCWRLRotamerLookup() {
   sidechain_infos_[CYS].has_hydrogens = false;
   sidechain_infos_[CYS].internal_e_prefactor = 4.07;
   sidechain_infos_[CYS].frm_t = 1.69;
+
   AddInfo(CYS, SParticle, -0.19, "SG", promod3::loop::CYS_SG_INDEX, false);
+
+  if(cb_in_sidechain) {
+    AddInfo(CYS, CH2Particle, 0.19, "CB", promod3::loop::BB_CB_INDEX, false);  
+  }
+
   AddFRMRule(CYS, promod3::loop::BB_CA_INDEX, promod3::loop::BB_CB_INDEX);
   AddFRMPrefactor(CYS, 0, -1.69);
   AddFRMPrefactor(CYS, 0, 1.69);
   AddFRMRotatingParticle(CYS, 0, 0);
+
+  if(cb_in_sidechain) {
+    AddFRMFixParticle(CYS, 0, 1);
+  }
+
   backbone_infos_[CYS].has_hydrogens = true;
   AddBBInfo(CYS, NParticle, -0.35, "N", promod3::loop::BB_N_INDEX, false);
   AddBBInfo(CYS, CH1Particle, 0.1, "CA", promod3::loop::BB_CA_INDEX, false);
   AddBBInfo(CYS, CParticle, 0.55, "C", promod3::loop::BB_C_INDEX, false);
   AddBBInfo(CYS, OParticle, -0.55, "O", promod3::loop::BB_O_INDEX, false);
-  AddBBInfo(CYS, CH2Particle, 0.19, "CB", promod3::loop::BB_CB_INDEX, false);
   AddBBInfo(CYS, HParticle, 0.25, "H", promod3::loop::CYS_H_INDEX,true);
-  AddBBPDir(CYS, promod3::loop::CYS_H_INDEX, promod3::loop::BB_N_INDEX, 5);
+
+  if(!cb_in_sidechain) {
+    AddBBInfo(CYS, CH2Particle, 0.19, "CB", promod3::loop::BB_CB_INDEX, false);   
+  }
+
+  AddBBPDir(CYS, promod3::loop::CYS_H_INDEX, promod3::loop::BB_N_INDEX, 4);
   AddBBLP(CYS, promod3::loop::BB_CA_INDEX, promod3::loop::BB_C_INDEX, 
           promod3::loop::BB_O_INDEX, false, false, false, 3, LONE_PAIR_CARBONYL);
 
@@ -563,35 +718,54 @@ SCWRLRotamerLookup::SCWRLRotamerLookup() {
   sidechain_infos_[MET].has_hydrogens = false;
   sidechain_infos_[MET].internal_e_prefactor = 1.95;
   sidechain_infos_[MET].frm_t = 1.77;
+
   AddInfo(MET, CH2Particle, 0.06, "CG", promod3::loop::MET_CG_INDEX,false);
   AddInfo(MET, SParticle, -0.12, "SD", promod3::loop::MET_SD_INDEX,false);
   AddInfo(MET, CH3Particle, 0.06, "CE", promod3::loop::MET_CE_INDEX,false);
+
+  if(cb_in_sidechain) {
+    AddInfo(MET, CH2Particle, 0.0, "CB", promod3::loop::BB_CB_INDEX, false);
+  }
+
   AddFRMRule(MET, promod3::loop::BB_CA_INDEX, promod3::loop::BB_CB_INDEX);
   AddFRMPrefactor(MET, 0, -0.97);
   AddFRMPrefactor(MET, 0, 0.97);
   AddFRMRotatingParticle(MET, 0, 0);
   AddFRMRotatingParticle(MET, 0, 1);
   AddFRMRotatingParticle(MET, 0, 2);
+
   AddFRMRule(MET, promod3::loop::BB_CB_INDEX, promod3::loop::MET_CG_INDEX);
   AddFRMPrefactor(MET, 1, -1.54);
   AddFRMPrefactor(MET, 1, 1.54);
   AddFRMFixParticle(MET, 1, 0);
   AddFRMRotatingParticle(MET, 1, 1);
   AddFRMRotatingParticle(MET, 1, 2);
+
   AddFRMRule(MET, promod3::loop::MET_CG_INDEX, promod3::loop::MET_SD_INDEX);
   AddFRMPrefactor(MET, 2, -1.21);
   AddFRMPrefactor(MET, 2, 1.21);
   AddFRMFixParticle(MET, 2, 0);
   AddFRMFixParticle(MET, 2, 1);
   AddFRMRotatingParticle(MET, 2, 2);
+
+  if(cb_in_sidechain) {
+    AddFRMFixParticle(MET, 0, 3);
+    AddFRMFixParticle(MET, 1, 3);
+    AddFRMFixParticle(MET, 2, 3);
+  }
+
   backbone_infos_[MET].has_hydrogens = true;
   AddBBInfo(MET, NParticle, -0.35, "N", promod3::loop::BB_N_INDEX, false);
   AddBBInfo(MET, CH1Particle, 0.1, "CA", promod3::loop::BB_CA_INDEX, false);
   AddBBInfo(MET, CParticle, 0.55, "C", promod3::loop::BB_C_INDEX, false);
   AddBBInfo(MET, OParticle, -0.55, "O", promod3::loop::BB_O_INDEX, false);
-  AddBBInfo(MET, CH2Particle, 0.0, "CB", promod3::loop::BB_CB_INDEX, false);
   AddBBInfo(MET, HParticle, 0.25, "H", promod3::loop::MET_H_INDEX,true);
-  AddBBPDir(MET, promod3::loop::MET_H_INDEX, promod3::loop::BB_N_INDEX, 5);
+
+  if(!cb_in_sidechain) {
+    AddBBInfo(MET, CH2Particle, 0.0, "CB", promod3::loop::BB_CB_INDEX, false);
+  }
+
+  AddBBPDir(MET, promod3::loop::MET_H_INDEX, promod3::loop::BB_N_INDEX, 4);
   AddBBLP(MET, promod3::loop::BB_CA_INDEX, promod3::loop::BB_C_INDEX, 
           promod3::loop::BB_O_INDEX, false, false, false, 3, LONE_PAIR_CARBONYL);
 
@@ -599,6 +773,7 @@ SCWRLRotamerLookup::SCWRLRotamerLookup() {
   sidechain_infos_[TRP].has_hydrogens = true;
   sidechain_infos_[TRP].internal_e_prefactor = 3.24;
   sidechain_infos_[TRP].frm_t = 0.99;
+
   AddInfo(TRP, CParticle,-0.03, "CG", promod3::loop::TRP_CG_INDEX,false);
   AddInfo(TRP, CParticle, 0.06, "CD1", promod3::loop::TRP_CD1_INDEX,false);
   AddInfo(TRP, CParticle, 0.10, "CD2", promod3::loop::TRP_CD2_INDEX,false);
@@ -609,7 +784,13 @@ SCWRLRotamerLookup::SCWRLRotamerLookup() {
   AddInfo(TRP, CParticle, 0.00, "CH2", promod3::loop::TRP_CH2_INDEX,false);
   AddInfo(TRP, CParticle, 0.00, "CZ2", promod3::loop::TRP_CZ2_INDEX,false);
   AddInfo(TRP, HParticle, 0.30, "HE1", promod3::loop::TRP_HE1_INDEX,true);
+
+  if(cb_in_sidechain) {
+    AddInfo(TRP, CH2Particle, 0.0, "CB", promod3::loop::BB_CB_INDEX, false);
+  }
+
   AddPDir(TRP, promod3::loop::TRP_HE1_INDEX, promod3::loop::TRP_NE1_INDEX, 9);
+
   AddFRMRule(TRP, promod3::loop::BB_CA_INDEX, promod3::loop::BB_CB_INDEX);
   AddFRMPrefactor(TRP, 0, -1.28);
   AddFRMPrefactor(TRP, 0, 1.28);
@@ -623,6 +804,7 @@ SCWRLRotamerLookup::SCWRLRotamerLookup() {
   AddFRMRotatingParticle(TRP, 0, 7);
   AddFRMRotatingParticle(TRP, 0, 8);
   AddFRMRotatingParticle(TRP, 0, 9);
+
   AddFRMRule(TRP, promod3::loop::BB_CB_INDEX, promod3::loop::TRP_CG_INDEX);
   AddFRMPrefactor(TRP, 1, -1.48);
   AddFRMPrefactor(TRP, 1, 1.48);
@@ -636,14 +818,24 @@ SCWRLRotamerLookup::SCWRLRotamerLookup() {
   AddFRMRotatingParticle(TRP, 1, 7);
   AddFRMRotatingParticle(TRP, 1, 8);
   AddFRMRotatingParticle(TRP, 1, 9);
+
+  if(cb_in_sidechain) {
+    AddFRMFixParticle(TRP, 0, 10);
+    AddFRMFixParticle(TRP, 1, 10);
+  }
+
   backbone_infos_[TRP].has_hydrogens = true;
   AddBBInfo(TRP, NParticle, -0.35, "N", promod3::loop::BB_N_INDEX, false);
   AddBBInfo(TRP, CH1Particle, 0.1, "CA", promod3::loop::BB_CA_INDEX, false);
   AddBBInfo(TRP, CParticle, 0.55, "C", promod3::loop::BB_C_INDEX, false);
   AddBBInfo(TRP, OParticle, -0.55, "O", promod3::loop::BB_O_INDEX, false);
-  AddBBInfo(TRP, CH2Particle, 0.0, "CB", promod3::loop::BB_CB_INDEX, false);
   AddBBInfo(TRP, HParticle, 0.25, "H", promod3::loop::TRP_H_INDEX,true);
-  AddBBPDir(TRP, promod3::loop::TRP_H_INDEX, promod3::loop::BB_N_INDEX, 5);
+
+  if(!cb_in_sidechain) {
+    AddBBInfo(TRP, CH2Particle, 0.0, "CB", promod3::loop::BB_CB_INDEX, false);
+  }
+
+  AddBBPDir(TRP, promod3::loop::TRP_H_INDEX, promod3::loop::BB_N_INDEX, 4);
   AddBBLP(TRP, promod3::loop::BB_CA_INDEX, promod3::loop::BB_C_INDEX, 
           promod3::loop::BB_O_INDEX, false, false, false, 3, LONE_PAIR_CARBONYL);
 
@@ -651,6 +843,7 @@ SCWRLRotamerLookup::SCWRLRotamerLookup() {
   sidechain_infos_[TYR].has_hydrogens = true;
   sidechain_infos_[TYR].internal_e_prefactor = 2.00;
   sidechain_infos_[TYR].frm_t = 1.96;
+
   AddInfo(TYR, CParticle, 0.0, "CG", promod3::loop::TYR_CG_INDEX,false);
   AddInfo(TYR, CParticle, 0.0, "CD1", promod3::loop::TYR_CD1_INDEX,false);
   AddInfo(TYR, CParticle, 0.0, "CD2", promod3::loop::TYR_CD2_INDEX,false);
@@ -659,6 +852,11 @@ SCWRLRotamerLookup::SCWRLRotamerLookup() {
   AddInfo(TYR, CParticle, 0.25, "CZ", promod3::loop::TYR_CZ_INDEX,false);
   AddInfo(TYR, OParticle, -0.65, "OH", promod3::loop::TYR_OH_INDEX,false);
   AddInfo(TYR, HParticle, 0.40, "HH", promod3::loop::TYR_HH_INDEX,true);
+
+  if(cb_in_sidechain) {
+    AddInfo(TYR, CH2Particle, 0.0, "CB", promod3::loop::BB_CB_INDEX, false);
+  }
+
   AddPDir(TYR, promod3::loop::TYR_HH_INDEX, promod3::loop::TYR_OH_INDEX, 7);
   AddLP(TYR, promod3::loop::TYR_CZ_INDEX, promod3::loop::TYR_OH_INDEX, 
         promod3::loop::TYR_HH_INDEX, false, false, true, 6, LONE_PAIR_COH);
@@ -667,6 +865,7 @@ SCWRLRotamerLookup::SCWRLRotamerLookup() {
                         promod3::loop::TYR_CZ_INDEX, 
                         promod3::loop::TYR_OH_INDEX,
                         0.96, 1.885, 2);
+
   AddFRMRule(TYR, promod3::loop::BB_CA_INDEX, promod3::loop::BB_CB_INDEX);
   AddFRMPrefactor(TYR, 0, -1.48);
   AddFRMPrefactor(TYR, 0, 1.48);
@@ -678,6 +877,7 @@ SCWRLRotamerLookup::SCWRLRotamerLookup() {
   AddFRMRotatingParticle(TYR, 0, 5);
   AddFRMRotatingParticle(TYR, 0, 6);
   AddFRMRotatingParticle(TYR, 0, 7);
+
   AddFRMRule(TYR, promod3::loop::BB_CB_INDEX, promod3::loop::TYR_CG_INDEX);
   AddFRMPrefactor(TYR, 1, -0.73);
   AddFRMPrefactor(TYR, 1, 0.73);
@@ -689,6 +889,7 @@ SCWRLRotamerLookup::SCWRLRotamerLookup() {
   AddFRMRotatingParticle(TYR, 1, 5);
   AddFRMRotatingParticle(TYR, 1, 6);
   AddFRMRotatingParticle(TYR, 1, 7);
+
   AddFRMRule(TYR, promod3::loop::TYR_CZ_INDEX, promod3::loop::TYR_OH_INDEX);
   AddFRMPrefactor(TYR, 2, -0.96);
   AddFRMPrefactor(TYR, 2, 0.96);
@@ -700,14 +901,25 @@ SCWRLRotamerLookup::SCWRLRotamerLookup() {
   AddFRMFixParticle(TYR, 2, 5);
   AddFRMFixParticle(TYR, 2, 6);
   AddFRMRotatingParticle(TYR, 2, 7);
+
+  if(cb_in_sidechain) {
+    AddFRMFixParticle(TYR, 0, 8);
+    AddFRMFixParticle(TYR, 1, 8);
+    AddFRMFixParticle(TYR, 2, 8);
+  }
+
   backbone_infos_[TYR].has_hydrogens = true;
   AddBBInfo(TYR, NParticle, -0.35, "N", promod3::loop::BB_N_INDEX, false);
   AddBBInfo(TYR, CH1Particle, 0.1, "CA", promod3::loop::BB_CA_INDEX, false);
   AddBBInfo(TYR, CParticle, 0.55, "C", promod3::loop::BB_C_INDEX, false);
   AddBBInfo(TYR, OParticle, -0.55, "O", promod3::loop::BB_O_INDEX, false);
-  AddBBInfo(TYR, CH2Particle, 0.0, "CB", promod3::loop::BB_CB_INDEX, false);
   AddBBInfo(TYR, HParticle, 0.25, "H", promod3::loop::TYR_H_INDEX,true);
-  AddBBPDir(TYR, promod3::loop::TYR_H_INDEX, promod3::loop::BB_N_INDEX, 5);
+
+  if(!cb_in_sidechain) {
+    AddBBInfo(TYR, CH2Particle, 0.0, "CB", promod3::loop::BB_CB_INDEX, false);
+  }
+
+  AddBBPDir(TYR, promod3::loop::TYR_H_INDEX, promod3::loop::BB_N_INDEX, 4);
   AddBBLP(TYR, promod3::loop::BB_CA_INDEX, promod3::loop::BB_C_INDEX, 
           promod3::loop::BB_O_INDEX, false, false, false, 3, LONE_PAIR_CARBONYL);
 
@@ -715,36 +927,54 @@ SCWRLRotamerLookup::SCWRLRotamerLookup() {
   sidechain_infos_[THR].has_hydrogens = true;
   sidechain_infos_[THR].internal_e_prefactor = 2.96;
   sidechain_infos_[THR].frm_t = 1.11;
+
   AddInfo(THR, OParticle, -0.65, "OG1", promod3::loop::THR_OG1_INDEX, false);
   AddInfo(THR, CH3Particle, 0.0, "CG2", promod3::loop::THR_CG2_INDEX, false);
   AddInfo(THR, HParticle, 0.40, "HG1", promod3::loop::THR_HG1_INDEX, true);
-  AddPDir(THR, promod3::loop::THR_HG1_INDEX, promod3::loop::THR_OG1_INDEX, 0);
+
+  if(cb_in_sidechain) {
+    AddInfo(THR, CH2Particle, 0.25, "CB", promod3::loop::BB_CB_INDEX, false);
+  }
+
+  AddPDir(THR, promod3::loop::THR_HG1_INDEX, promod3::loop::THR_OG1_INDEX, 2);
   AddLP(THR, promod3::loop::BB_CB_INDEX, promod3::loop::THR_OG1_INDEX, 
         promod3::loop::THR_HG1_INDEX, false, false, true, 0, LONE_PAIR_COH);
   AddCustomHydrogenInfo(THR, promod3::loop::THR_HG1_INDEX, 
                         promod3::loop::BB_CA_INDEX, promod3::loop::BB_CB_INDEX, 
                         promod3::loop::THR_OG1_INDEX,
                         0.96, 1.85, 1);
+
   AddFRMRule(THR, promod3::loop::BB_CA_INDEX, promod3::loop::BB_CB_INDEX);
   AddFRMPrefactor(THR, 0, -0.88);
   AddFRMPrefactor(THR, 0, 0.88);
   AddFRMRotatingParticle(THR, 0, 0);
   AddFRMRotatingParticle(THR, 0, 1);
   AddFRMRotatingParticle(THR, 0, 2);
+
   AddFRMRule(THR, promod3::loop::BB_CB_INDEX, promod3::loop::THR_OG1_INDEX);
   AddFRMPrefactor(THR, 1, -0.88);
   AddFRMPrefactor(THR, 1, 0.88);
   AddFRMFixParticle(THR, 1, 0);
   AddFRMFixParticle(THR, 1, 1);
   AddFRMRotatingParticle(THR, 1, 2);
+
+  if(cb_in_sidechain) {
+    AddFRMFixParticle(THR, 0, 3);
+    AddFRMFixParticle(THR, 1, 3);
+  }
+
   backbone_infos_[THR].has_hydrogens = true;
   AddBBInfo(THR, NParticle, -0.35, "N", promod3::loop::BB_N_INDEX, false);
   AddBBInfo(THR, CH1Particle, 0.1, "CA", promod3::loop::BB_CA_INDEX, false);
   AddBBInfo(THR, CParticle, 0.55, "C", promod3::loop::BB_C_INDEX, false);
   AddBBInfo(THR, OParticle, -0.55, "O", promod3::loop::BB_O_INDEX, false);
-  AddBBInfo(THR, CH2Particle, 0.25, "CB", promod3::loop::BB_CB_INDEX, false);
   AddBBInfo(THR, HParticle, 0.25, "H", promod3::loop::THR_H_INDEX,true);
-  AddBBPDir(THR, promod3::loop::THR_H_INDEX, promod3::loop::BB_N_INDEX, 5);
+
+  if(!cb_in_sidechain) {
+    AddBBInfo(THR, CH2Particle, 0.25, "CB", promod3::loop::BB_CB_INDEX, false); 
+  }
+
+  AddBBPDir(THR, promod3::loop::THR_H_INDEX, promod3::loop::BB_N_INDEX, 4);
   AddBBLP(THR, promod3::loop::BB_CA_INDEX, promod3::loop::BB_C_INDEX, 
           promod3::loop::BB_O_INDEX, false, false, false, 3, LONE_PAIR_CARBONYL);
 
@@ -752,21 +982,36 @@ SCWRLRotamerLookup::SCWRLRotamerLookup() {
   sidechain_infos_[VAL].has_hydrogens = false;
   sidechain_infos_[VAL].internal_e_prefactor = 1.62;
   sidechain_infos_[VAL].frm_t = 2.20;
+
   AddInfo(VAL, CH3Particle, 0.0, "CG1", promod3::loop::VAL_CG1_INDEX, false);
   AddInfo(VAL, CH3Particle, 0.0, "CG2", promod3::loop::VAL_CG2_INDEX, false);
+
+  if(cb_in_sidechain) {
+    AddInfo(VAL, CH2Particle, 0.0, "CB", promod3::loop::BB_CB_INDEX, false);
+  }
+
   AddFRMRule(VAL, promod3::loop::BB_CA_INDEX, promod3::loop::BB_CB_INDEX);
   AddFRMPrefactor(VAL, 0, -2.09);
   AddFRMPrefactor(VAL, 0, 2.09);
   AddFRMRotatingParticle(VAL, 0, 0);
   AddFRMRotatingParticle(VAL, 0, 1);
+
+  if(cb_in_sidechain) {
+    AddFRMFixParticle(VAL, 0, 2);
+  }
+
   backbone_infos_[VAL].has_hydrogens = true;
   AddBBInfo(VAL, NParticle, -0.35, "N", promod3::loop::BB_N_INDEX, false);
   AddBBInfo(VAL, CH1Particle, 0.1, "CA", promod3::loop::BB_CA_INDEX, false);
   AddBBInfo(VAL, CParticle, 0.55, "C", promod3::loop::BB_C_INDEX, false);
   AddBBInfo(VAL, OParticle, -0.55, "O", promod3::loop::BB_O_INDEX, false);
-  AddBBInfo(VAL, CH2Particle, 0.0, "CB", promod3::loop::BB_CB_INDEX, false);
   AddBBInfo(VAL, HParticle, 0.25, "H", promod3::loop::VAL_H_INDEX,true);
-  AddBBPDir(VAL, promod3::loop::VAL_H_INDEX, promod3::loop::BB_N_INDEX, 5);
+
+  if(!cb_in_sidechain) {
+    AddBBInfo(VAL, CH2Particle, 0.0, "CB", promod3::loop::BB_CB_INDEX, false); 
+  }
+
+  AddBBPDir(VAL, promod3::loop::VAL_H_INDEX, promod3::loop::BB_N_INDEX, 4);
   AddBBLP(VAL, promod3::loop::BB_CA_INDEX, promod3::loop::BB_C_INDEX, 
           promod3::loop::BB_O_INDEX, false, false, false, 3, LONE_PAIR_CARBONYL);
 
@@ -774,29 +1019,46 @@ SCWRLRotamerLookup::SCWRLRotamerLookup() {
   sidechain_infos_[ILE].has_hydrogens = false;
   sidechain_infos_[ILE].internal_e_prefactor = 2.18;
   sidechain_infos_[ILE].frm_t = 2.03;
+
   AddInfo(ILE, CH2Particle, 0.0, "CG1", promod3::loop::ILE_CG1_INDEX, false);
   AddInfo(ILE, CH3Particle, 0.0, "CG2", promod3::loop::ILE_CG2_INDEX, false);  
   AddInfo(ILE, CH3Particle, 0.0, "CD1", promod3::loop::ILE_CD1_INDEX, false);  
+
+  if(cb_in_sidechain) {
+    AddInfo(ILE, CH2Particle, 0.0, "CB", promod3::loop::BB_CB_INDEX, false);
+  }
+
   AddFRMRule(ILE, promod3::loop::BB_CA_INDEX, promod3::loop::BB_CB_INDEX);
   AddFRMPrefactor(ILE, 0, -1.23);
   AddFRMPrefactor(ILE, 0, 1.23);
   AddFRMRotatingParticle(ILE, 0, 0);
   AddFRMRotatingParticle(ILE, 0, 1);
   AddFRMRotatingParticle(ILE, 0, 2);
+
   AddFRMRule(ILE, promod3::loop::BB_CB_INDEX, promod3::loop::ILE_CG1_INDEX);
   AddFRMPrefactor(ILE, 1, -0.98);
   AddFRMPrefactor(ILE, 1, 0.98);
   AddFRMFixParticle(ILE, 1, 0);
   AddFRMFixParticle(ILE, 1, 1);
   AddFRMRotatingParticle(ILE, 1, 2);
+
+  if(cb_in_sidechain) {
+    AddFRMFixParticle(ILE, 0, 3);
+    AddFRMFixParticle(ILE, 1, 3);
+  }
+
   backbone_infos_[ILE].has_hydrogens = true;
   AddBBInfo(ILE, NParticle, -0.35, "N", promod3::loop::BB_N_INDEX, false);
   AddBBInfo(ILE, CH1Particle, 0.1, "CA", promod3::loop::BB_CA_INDEX, false);
   AddBBInfo(ILE, CParticle, 0.55, "C", promod3::loop::BB_C_INDEX, false);
   AddBBInfo(ILE, OParticle, -0.55, "O", promod3::loop::BB_O_INDEX, false);
-  AddBBInfo(ILE, CH2Particle, 0.0, "CB", promod3::loop::BB_CB_INDEX, false);
   AddBBInfo(ILE, HParticle, 0.25, "H", promod3::loop::ILE_H_INDEX,true);
-  AddBBPDir(ILE, promod3::loop::ILE_H_INDEX, promod3::loop::BB_N_INDEX, 5);
+
+  if(!cb_in_sidechain) {
+    AddBBInfo(ILE, CH2Particle, 0.0, "CB", promod3::loop::BB_CB_INDEX, false);
+  }
+
+  AddBBPDir(ILE, promod3::loop::ILE_H_INDEX, promod3::loop::BB_N_INDEX, 4);
   AddBBLP(ILE, promod3::loop::BB_CA_INDEX, promod3::loop::BB_C_INDEX, 
           promod3::loop::BB_O_INDEX, false, false, false, 3, LONE_PAIR_CARBONYL);
 
@@ -804,49 +1066,76 @@ SCWRLRotamerLookup::SCWRLRotamerLookup() {
   sidechain_infos_[LEU].has_hydrogens = false;
   sidechain_infos_[LEU].internal_e_prefactor = 2.25;
   sidechain_infos_[LEU].frm_t = 2.55;
+  
   AddInfo(LEU, CH1Particle, 0.0, "CG", promod3::loop::LEU_CG_INDEX, false);
   AddInfo(LEU, CH3Particle, 0.0, "CD1", promod3::loop::LEU_CD1_INDEX, false);  
   AddInfo(LEU, CH3Particle, 0.0, "CD2", promod3::loop::LEU_CD2_INDEX, false);  
+
+  if(cb_in_sidechain) {
+    AddInfo(LEU, CH2Particle, 0.0, "CB", promod3::loop::BB_CB_INDEX, false);
+  }
+  
   AddFRMRule(LEU, promod3::loop::BB_CA_INDEX, promod3::loop::BB_CB_INDEX);
   AddFRMPrefactor(LEU, 0, -1.15);
   AddFRMPrefactor(LEU, 0, 1.15);
   AddFRMRotatingParticle(LEU, 0, 0);
   AddFRMRotatingParticle(LEU, 0, 1);
   AddFRMRotatingParticle(LEU, 0, 2);
+
   AddFRMRule(LEU, promod3::loop::BB_CB_INDEX, promod3::loop::LEU_CG_INDEX);
   AddFRMPrefactor(LEU, 1, -1.48);
   AddFRMPrefactor(LEU, 1, 1.48);
-  AddFRMFixParticle(LEU, 1, 0);
+  AddFRMFixParticle(LEU, 1, 0);  
   AddFRMRotatingParticle(LEU, 1, 1);
   AddFRMRotatingParticle(LEU, 1, 2);
+
+  if(cb_in_sidechain) {
+    AddFRMFixParticle(LEU, 0, 3);
+    AddFRMFixParticle(LEU, 1, 3);
+  }
+
   backbone_infos_[LEU].has_hydrogens = true;
   AddBBInfo(LEU, NParticle, -0.35, "N", promod3::loop::BB_N_INDEX, false);
   AddBBInfo(LEU, CH1Particle, 0.1, "CA", promod3::loop::BB_CA_INDEX, false);
   AddBBInfo(LEU, CParticle, 0.55, "C", promod3::loop::BB_C_INDEX, false);
   AddBBInfo(LEU, OParticle, -0.55, "O", promod3::loop::BB_O_INDEX, false);
-  AddBBInfo(LEU, CH2Particle, 0.0, "CB", promod3::loop::BB_CB_INDEX, false);
   AddBBInfo(LEU, HParticle, 0.25, "H", promod3::loop::LEU_H_INDEX,true);
-  AddBBPDir(LEU, promod3::loop::LEU_H_INDEX, promod3::loop::BB_N_INDEX, 5);
+
+  if(!cb_in_sidechain) {
+    AddBBInfo(LEU, CH2Particle, 0.0, "CB", promod3::loop::BB_CB_INDEX, false);
+  }
+
+  AddBBPDir(LEU, promod3::loop::LEU_H_INDEX, promod3::loop::BB_N_INDEX, 4);
   AddBBLP(LEU, promod3::loop::BB_CA_INDEX, promod3::loop::BB_C_INDEX, 
           promod3::loop::BB_O_INDEX, false, false, false, 3, LONE_PAIR_CARBONYL);
 
   // PROLINES DO NOT HAVE FRM DEFINITIONS!
   // large scale benchmarks showed, that varying around chi angles in case
-  // of prolines has a negative effect on performance => reduce to onoe single
+  // of prolines has a negative effect on performance => reduce to one single
   // subrotamer...
 
   // PRO
   sidechain_infos_[PRO].has_hydrogens = false;
   sidechain_infos_[PRO].internal_e_prefactor = 0.76;
   sidechain_infos_[PRO].frm_t = 2.62;
+  
   AddInfo(PRO, CH2Particle, 0.0, "CG", promod3::loop::PRO_CG_INDEX, false);
   AddInfo(PRO, CH2Particle, 0.0, "CD", promod3::loop::PRO_CD_INDEX, false); 
+
+  if(cb_in_sidechain) {
+    AddInfo(PRO, CH2Particle, 0.25, "CB", promod3::loop::BB_CB_INDEX, false);
+  }
+
   backbone_infos_[PRO].has_hydrogens = false;
   AddBBInfo(PRO, NParticle, -0.20, "N", promod3::loop::BB_N_INDEX, false);
   AddBBInfo(PRO, CH1Particle, 0.1, "CA", promod3::loop::BB_CA_INDEX, false);
   AddBBInfo(PRO, CParticle, 0.55, "C", promod3::loop::BB_C_INDEX, false);
   AddBBInfo(PRO, OParticle, -0.55, "O", promod3::loop::BB_O_INDEX, false);
-  AddBBInfo(PRO, CH2Particle, 0.25, "CB", promod3::loop::BB_CB_INDEX, false);
+
+  if(!cb_in_sidechain) {
+    AddBBInfo(PRO, CH2Particle, 0.25, "CB", promod3::loop::BB_CB_INDEX, false);
+  }
+
   AddBBLP(PRO, promod3::loop::BB_CA_INDEX, promod3::loop::BB_C_INDEX, 
           promod3::loop::BB_O_INDEX, false, false, false, 3, LONE_PAIR_CARBONYL);
 
@@ -864,15 +1153,23 @@ SCWRLRotamerLookup::SCWRLRotamerLookup() {
   sidechain_infos_[HSD].has_hydrogens = true;
   sidechain_infos_[HSD].internal_e_prefactor = 2.01;
   sidechain_infos_[HSD].frm_t = 1.35;
+
   AddInfo(HSD, CParticle, 0.10, "CG", promod3::loop::HIS_CG_INDEX,false);
   AddInfo(HSD, NParticle, -0.40, "ND1", promod3::loop::HIS_ND1_INDEX,false);
   AddInfo(HSD, CParticle, 0.10, "CD2", promod3::loop::HIS_CD2_INDEX,false);
   AddInfo(HSD, CParticle, 0.30, "CE1", promod3::loop::HIS_CE1_INDEX,false);
   AddInfo(HSD, NParticle, -0.40, "NE2", promod3::loop::HIS_NE2_INDEX,false);
   AddInfo(HSD, HParticle, 0.30, "HD1", promod3::loop::HIS_HD1_INDEX,true);
+
+  if(cb_in_sidechain) {
+    AddInfo(HSD, CH2Particle, 0.0, "CB", promod3::loop::BB_CB_INDEX, false);
+  }
+
   AddPDir(HSD, promod3::loop::HIS_HD1_INDEX, promod3::loop::HIS_ND1_INDEX, 5);
   AddLP(HSD, promod3::loop::HIS_CD2_INDEX, promod3::loop::HIS_NE2_INDEX, 
         promod3::loop::HIS_CE1_INDEX, false, false, false, 4, LONE_PAIR_CNC);
+
+
   AddFRMRule(HSD, promod3::loop::BB_CA_INDEX, promod3::loop::BB_CB_INDEX);
   AddFRMPrefactor(HSD, 0, -1.84);
   AddFRMPrefactor(HSD, 0, 1.84);
@@ -882,6 +1179,7 @@ SCWRLRotamerLookup::SCWRLRotamerLookup() {
   AddFRMRotatingParticle(HSD, 0, 3);
   AddFRMRotatingParticle(HSD, 0, 4);
   AddFRMRotatingParticle(HSD, 0, 5);
+
   AddFRMRule(HSD, promod3::loop::BB_CB_INDEX, promod3::loop::HIS_CG_INDEX);
   AddFRMPrefactor(HSD, 1, -0.85);
   AddFRMPrefactor(HSD, 1, 0.85);
@@ -891,14 +1189,24 @@ SCWRLRotamerLookup::SCWRLRotamerLookup() {
   AddFRMRotatingParticle(HSD, 1, 3);
   AddFRMRotatingParticle(HSD, 1, 4);
   AddFRMRotatingParticle(HSD, 1, 5);
+
+  if(cb_in_sidechain) {
+    AddFRMFixParticle(HSD, 0, 6);
+    AddFRMFixParticle(HSD, 1, 6);
+  }
+
   backbone_infos_[HSD].has_hydrogens = true;
   AddBBInfo(HSD, NParticle, -0.35, "N", promod3::loop::BB_N_INDEX, false);
   AddBBInfo(HSD, CH1Particle, 0.1, "CA", promod3::loop::BB_CA_INDEX, false);
   AddBBInfo(HSD, CParticle, 0.55, "C", promod3::loop::BB_C_INDEX, false);
   AddBBInfo(HSD, OParticle, -0.55, "O", promod3::loop::BB_O_INDEX, false);
-  AddBBInfo(HSD, CH2Particle, 0.0, "CB", promod3::loop::BB_CB_INDEX, false);
   AddBBInfo(HSD, HParticle, 0.25, "H", promod3::loop::HIS_H_INDEX,true);
-  AddBBPDir(HSD, promod3::loop::HIS_H_INDEX, promod3::loop::BB_N_INDEX, 5);
+
+  if(!cb_in_sidechain) {
+    AddInfo(HSD, CH2Particle, 0.0, "CB", promod3::loop::BB_CB_INDEX, false);
+  }
+
+  AddBBPDir(HSD, promod3::loop::HIS_H_INDEX, promod3::loop::BB_N_INDEX, 4);
   AddBBLP(HSD, promod3::loop::BB_CA_INDEX, promod3::loop::BB_C_INDEX, 
           promod3::loop::BB_O_INDEX, false, false, false, 3, LONE_PAIR_CARBONYL);
 
@@ -906,15 +1214,22 @@ SCWRLRotamerLookup::SCWRLRotamerLookup() {
   sidechain_infos_[HSE].has_hydrogens = true;
   sidechain_infos_[HSE].internal_e_prefactor = 2.01;
   sidechain_infos_[HSE].frm_t = 1.35;
+  
   AddInfo(HSE, CParticle, 0.10, "CG", promod3::loop::HIS_CG_INDEX,false);
   AddInfo(HSE, NParticle, -0.40, "ND1", promod3::loop::HIS_ND1_INDEX,false);
   AddInfo(HSE, CParticle, 0.10, "CD2", promod3::loop::HIS_CD2_INDEX,false);
   AddInfo(HSE, CParticle, 0.30, "CE1", promod3::loop::HIS_CE1_INDEX,false);
   AddInfo(HSE, NParticle, -0.40, "NE2", promod3::loop::HIS_NE2_INDEX,false);
   AddInfo(HSE, HParticle, 0.30, "HE2", promod3::loop::HIS_HE2_INDEX,true);
+  
+  if(cb_in_sidechain) {
+    AddInfo(HSE, CH2Particle, 0.0, "CB", promod3::loop::BB_CB_INDEX, false);
+  }
+
   AddPDir(HSE, promod3::loop::HIS_HE2_INDEX, promod3::loop::HIS_NE2_INDEX, 5);
   AddLP(HSE, promod3::loop::HIS_CG_INDEX, promod3::loop::HIS_ND1_INDEX, 
         promod3::loop::HIS_CE1_INDEX, false, false, false, 1, LONE_PAIR_CNC);
+
   AddFRMRule(HSE, promod3::loop::BB_CA_INDEX, promod3::loop::BB_CB_INDEX);
   AddFRMPrefactor(HSE, 0, -1.84);
   AddFRMPrefactor(HSE, 0, 1.84);
@@ -924,6 +1239,7 @@ SCWRLRotamerLookup::SCWRLRotamerLookup() {
   AddFRMRotatingParticle(HSE, 0, 3);
   AddFRMRotatingParticle(HSE, 0, 4);
   AddFRMRotatingParticle(HSE, 0, 5);
+
   AddFRMRule(HSE, promod3::loop::BB_CB_INDEX, promod3::loop::HIS_CG_INDEX);
   AddFRMPrefactor(HSE, 1, -0.85);
   AddFRMPrefactor(HSE, 1, 0.85);
@@ -933,14 +1249,24 @@ SCWRLRotamerLookup::SCWRLRotamerLookup() {
   AddFRMRotatingParticle(HSE, 1, 3);
   AddFRMRotatingParticle(HSE, 1, 4);
   AddFRMRotatingParticle(HSE, 1, 5);
+
+  if(cb_in_sidechain) {
+    AddFRMFixParticle(HSE, 0, 6);
+    AddFRMFixParticle(HSE, 1, 6);
+  }
+
   backbone_infos_[HSE].has_hydrogens = true;
   AddBBInfo(HSE, NParticle, -0.35, "N", promod3::loop::BB_N_INDEX, false);
   AddBBInfo(HSE, CH1Particle, 0.1, "CA", promod3::loop::BB_CA_INDEX, false);
   AddBBInfo(HSE, CParticle, 0.55, "C", promod3::loop::BB_C_INDEX, false);
   AddBBInfo(HSE, OParticle, -0.55, "O", promod3::loop::BB_O_INDEX, false);
-  AddBBInfo(HSE, CH2Particle, 0.0, "CB", promod3::loop::BB_CB_INDEX, false);
   AddBBInfo(HSE, HParticle, 0.25, "H", promod3::loop::HIS_H_INDEX,true);
-  AddBBPDir(HSE, promod3::loop::HIS_H_INDEX, promod3::loop::BB_N_INDEX, 5);
+
+  if(!cb_in_sidechain) {
+    AddBBInfo(HSE, CH2Particle, 0.0, "CB", promod3::loop::BB_CB_INDEX, false);
+  }
+
+  AddBBPDir(HSE, promod3::loop::HIS_H_INDEX, promod3::loop::BB_N_INDEX, 4);
   AddBBLP(HSE, promod3::loop::BB_CA_INDEX, promod3::loop::BB_C_INDEX, 
           promod3::loop::BB_O_INDEX, false, false, false, 3, LONE_PAIR_CARBONYL);
 
@@ -954,12 +1280,18 @@ SCWRLRotamerLookup::SCWRLRotamerLookup() {
   sidechain_infos_[PHE].has_hydrogens = false;
   sidechain_infos_[PHE].internal_e_prefactor = 1.71;
   sidechain_infos_[PHE].frm_t = 1.07;
+  
   AddInfo(PHE, CParticle, 0.0, "CG", promod3::loop::PHE_CG_INDEX, false);
   AddInfo(PHE, CParticle, 0.0, "CD1", promod3::loop::PHE_CD1_INDEX, false);  
   AddInfo(PHE, CParticle, 0.0, "CD2", promod3::loop::PHE_CD2_INDEX, false); 
   AddInfo(PHE, CParticle, 0.0, "CE1", promod3::loop::PHE_CE1_INDEX, false);  
   AddInfo(PHE, CParticle, 0.0, "CE2", promod3::loop::PHE_CE2_INDEX, false); 
   AddInfo(PHE, CParticle, 0.0, "CZ", promod3::loop::PHE_CZ_INDEX, false); 
+
+  if(cb_in_sidechain) {
+    AddInfo(PHE, CH2Particle, 0.0, "CB", promod3::loop::BB_CB_INDEX, false);
+  }
+
   AddFRMRule(PHE, promod3::loop::BB_CA_INDEX, promod3::loop::BB_CB_INDEX);
   AddFRMPrefactor(PHE, 0, -1.45);
   AddFRMPrefactor(PHE, 0, 1.45);
@@ -969,6 +1301,7 @@ SCWRLRotamerLookup::SCWRLRotamerLookup() {
   AddFRMRotatingParticle(PHE, 0, 3);
   AddFRMRotatingParticle(PHE, 0, 4);
   AddFRMRotatingParticle(PHE, 0, 5);
+
   AddFRMRule(PHE, promod3::loop::BB_CB_INDEX, promod3::loop::PHE_CG_INDEX);
   AddFRMPrefactor(PHE, 1, -1.35);
   AddFRMPrefactor(PHE, 1, 1.35);
@@ -978,32 +1311,56 @@ SCWRLRotamerLookup::SCWRLRotamerLookup() {
   AddFRMRotatingParticle(PHE, 1, 3);
   AddFRMRotatingParticle(PHE, 1, 4);
   AddFRMRotatingParticle(PHE, 1, 5);
+
+  if(cb_in_sidechain) {
+    AddFRMFixParticle(PHE, 0, 6);
+    AddFRMFixParticle(PHE, 1, 6);
+  }
+
   backbone_infos_[PHE].has_hydrogens = true;
   AddBBInfo(PHE, NParticle, -0.35, "N", promod3::loop::BB_N_INDEX, false);
   AddBBInfo(PHE, CH1Particle, 0.1, "CA", promod3::loop::BB_CA_INDEX, false);
   AddBBInfo(PHE, CParticle, 0.55, "C", promod3::loop::BB_C_INDEX, false);
   AddBBInfo(PHE, OParticle, -0.55, "O", promod3::loop::BB_O_INDEX, false);
-  AddBBInfo(PHE, CH2Particle, 0.0, "CB", promod3::loop::BB_CB_INDEX, false);
   AddBBInfo(PHE, HParticle, 0.25, "H", promod3::loop::PHE_H_INDEX,true);
-  AddBBPDir(PHE, promod3::loop::PHE_H_INDEX, promod3::loop::BB_N_INDEX, 5);
+
+  if(!cb_in_sidechain) {
+    AddBBInfo(PHE, CH2Particle, 0.0, "CB", promod3::loop::BB_CB_INDEX, false); 
+  }
+
+  AddBBPDir(PHE, promod3::loop::PHE_H_INDEX, promod3::loop::BB_N_INDEX, 4);
   AddBBLP(PHE, promod3::loop::BB_CA_INDEX, promod3::loop::BB_C_INDEX, 
           promod3::loop::BB_O_INDEX, false, false, false, 3, LONE_PAIR_CARBONYL);
 
   // ALA
   sidechain_infos_[ALA].has_hydrogens = false;
+  sidechain_infos_[ALA].internal_e_prefactor = 1.0;
+  sidechain_infos_[ALA].frm_t = 1.0;
+
+  if(cb_in_sidechain) {
+    AddInfo(ALA, CH3Particle, 0.0, "CB", promod3::loop::BB_CB_INDEX, false);
+  }
+
   backbone_infos_[ALA].has_hydrogens = true;
   AddBBInfo(ALA, NParticle, -0.35, "N", promod3::loop::BB_N_INDEX, false);
   AddBBInfo(ALA, CH1Particle, 0.1, "CA", promod3::loop::BB_CA_INDEX, false);
   AddBBInfo(ALA, CParticle, 0.55, "C", promod3::loop::BB_C_INDEX, false);
   AddBBInfo(ALA, OParticle, -0.55, "O", promod3::loop::BB_O_INDEX, false);
-  AddBBInfo(ALA, CH3Particle, 0.0, "CB", promod3::loop::BB_CB_INDEX, false);
   AddBBInfo(ALA, HParticle, 0.25, "H", promod3::loop::ALA_H_INDEX,true);
-  AddBBPDir(ALA, promod3::loop::ALA_H_INDEX, promod3::loop::BB_N_INDEX, 5);
+
+  if(!cb_in_sidechain) {
+    AddBBInfo(ALA, CH3Particle, 0.0, "CB", promod3::loop::BB_CB_INDEX, false); 
+  }
+
+  AddBBPDir(ALA, promod3::loop::ALA_H_INDEX, promod3::loop::BB_N_INDEX, 4);
   AddBBLP(ALA, promod3::loop::BB_CA_INDEX, promod3::loop::BB_C_INDEX, 
           promod3::loop::BB_O_INDEX, false, false, false, 3, LONE_PAIR_CARBONYL);
 
   // GLY
   sidechain_infos_[GLY].has_hydrogens = false;
+  sidechain_infos_[GLY].internal_e_prefactor = 1.0;
+  sidechain_infos_[GLY].frm_t = 1.0;
+  
   backbone_infos_[GLY].has_hydrogens = true;
   AddBBInfo(GLY, NParticle, -0.35, "N", promod3::loop::BB_N_INDEX, false);
   AddBBInfo(GLY, CH1Particle, 0.1, "CA", promod3::loop::BB_CA_INDEX, false);
@@ -1025,7 +1382,8 @@ SCWRLRotamerLookup::SCWRLRotamerLookup() {
   }
 }
 
-SCWRLRotamerConstructor::SCWRLRotamerConstructor(){
+SCWRLRotamerConstructor::SCWRLRotamerConstructor(bool cb_in_sidechain): 
+                                rotamer_lookup_(cb_in_sidechain) {
   String s(XXX,'X');
   for(uint i = 0; i < XXX; ++i){
     s[i] = RotIDToOLC(RotamerID(i));
@@ -1038,7 +1396,13 @@ SCWRLRotamerConstructor::SCWRLRotamerConstructor(){
 RRMRotamerGroupPtr SCWRLRotamerConstructor::ConstructRRMRotamerGroup(
         const ost::mol::ResidueHandle& res, RotamerID id,
         uint residue_index, RotamerLibPtr rot_lib, 
-        Real probability_cutoff){
+        Real probability_cutoff) {
+
+  if(id == XXX) {
+    throw promod3::Error("Cannot construct RRMRotamerGroup for unknown "
+                         "rotamer id!");
+  }
+
   std::pair<RotamerLibEntry*,uint> lib_entries = rot_lib->QueryLib(id);
   this->SetPosBuffer(res, id);
   return this->ConstructRRMRotamerGroup(id, residue_index, lib_entries, 
@@ -1048,19 +1412,15 @@ RRMRotamerGroupPtr SCWRLRotamerConstructor::ConstructRRMRotamerGroup(
 RRMRotamerGroupPtr SCWRLRotamerConstructor::ConstructRRMRotamerGroup(
         const promod3::loop::AllAtomPositions& all_atom, 
         uint aa_res_idx, RotamerID id, uint residue_index,
-        RotamerLibPtr rot_lib, Real probability_cutoff){
-  std::pair<RotamerLibEntry*,uint> lib_entries = rot_lib->QueryLib(id);
-  this->SetPosBuffer(all_atom, aa_res_idx, id);
-  return this->ConstructRRMRotamerGroup(id, residue_index, lib_entries, 
-                                        probability_cutoff);
-}
+        RotamerLibPtr rot_lib, Real probability_cutoff) {
+
+  if(id == XXX) {
+    throw promod3::Error("Cannot construct RRMRotamerGroup for unknown "
+                         "rotamer id!");
+  }
 
-RRMRotamerGroupPtr SCWRLRotamerConstructor::ConstructRRMRotamerGroup(
-        const geom::Vec3& n_pos, const geom::Vec3& ca_pos,
-        const geom::Vec3& cb_pos, RotamerID id, uint residue_index,
-        RotamerLibPtr rot_lib, Real probability_cutoff){
   std::pair<RotamerLibEntry*,uint> lib_entries = rot_lib->QueryLib(id);
-  this->SetPosBuffer(n_pos, ca_pos, cb_pos, id);
+  this->SetPosBuffer(all_atom, aa_res_idx, id);
   return this->ConstructRRMRotamerGroup(id, residue_index, lib_entries, 
                                         probability_cutoff);
 }
@@ -1068,7 +1428,13 @@ RRMRotamerGroupPtr SCWRLRotamerConstructor::ConstructRRMRotamerGroup(
 FRMRotamerGroupPtr SCWRLRotamerConstructor::ConstructFRMRotamerGroup(
         const ost::mol::ResidueHandle& res, RotamerID id,
         uint residue_index, RotamerLibPtr rot_lib, 
-        Real probability_cutoff){
+        Real probability_cutoff) {
+
+  if(id == XXX) {
+    throw promod3::Error("Cannot construct FRMRotamerGroup for unknown "
+                         "rotamer id!");
+  }
+
   std::pair<RotamerLibEntry*,uint> lib_entries = rot_lib->QueryLib(id);
   this->SetPosBuffer(res, id);
   return this->ConstructFRMRotamerGroup(id, residue_index, lib_entries, 
@@ -1078,19 +1444,15 @@ FRMRotamerGroupPtr SCWRLRotamerConstructor::ConstructFRMRotamerGroup(
 FRMRotamerGroupPtr SCWRLRotamerConstructor::ConstructFRMRotamerGroup(
         const promod3::loop::AllAtomPositions& all_atom, 
         uint aa_res_idx, RotamerID id, uint residue_index,
-        RotamerLibPtr rot_lib, Real probability_cutoff){
-  std::pair<RotamerLibEntry*,uint> lib_entries = rot_lib->QueryLib(id);
-  this->SetPosBuffer(all_atom, aa_res_idx, id);
-  return this->ConstructFRMRotamerGroup(id, residue_index, lib_entries, 
-                                        probability_cutoff);
-}
+        RotamerLibPtr rot_lib, Real probability_cutoff) {
+
+  if(id == XXX) {
+    throw promod3::Error("Cannot construct FRMRotamerGroup for unknown "
+                         "rotamer id!");
+  }
 
-FRMRotamerGroupPtr SCWRLRotamerConstructor::ConstructFRMRotamerGroup(
-        const geom::Vec3& n_pos, const geom::Vec3& ca_pos,
-        const geom::Vec3& cb_pos, RotamerID id, uint residue_index,
-        RotamerLibPtr rot_lib, Real probability_cutoff){
   std::pair<RotamerLibEntry*,uint> lib_entries = rot_lib->QueryLib(id);
-  this->SetPosBuffer(n_pos, ca_pos, cb_pos, id);
+  this->SetPosBuffer(all_atom, aa_res_idx, id);
   return this->ConstructFRMRotamerGroup(id, residue_index, lib_entries, 
                                         probability_cutoff);
 }
@@ -1098,7 +1460,13 @@ FRMRotamerGroupPtr SCWRLRotamerConstructor::ConstructFRMRotamerGroup(
 RRMRotamerGroupPtr SCWRLRotamerConstructor::ConstructRRMRotamerGroup(
         const ost::mol::ResidueHandle& res, RotamerID id,
         uint residue_index, BBDepRotamerLibPtr rot_lib, 
-        Real phi, Real psi, Real probability_cutoff){
+        Real phi, Real psi, Real probability_cutoff) {
+
+  if(id == XXX) {
+    throw promod3::Error("Cannot construct RRMRotamerGroup for unknown "
+                         "rotamer id!");
+  }
+
   std::pair<RotamerLibEntry*,uint> lib_entries = rot_lib->QueryLib(id, phi, psi);
   this->SetPosBuffer(res, id);
   return this->ConstructRRMRotamerGroup(id, residue_index, lib_entries, 
@@ -1109,20 +1477,15 @@ RRMRotamerGroupPtr SCWRLRotamerConstructor::ConstructRRMRotamerGroup(
         const promod3::loop::AllAtomPositions& all_atom, 
         uint aa_res_idx, RotamerID id, uint residue_index,
         BBDepRotamerLibPtr rot_lib, 
-        Real phi, Real psi, Real probability_cutoff){
-  std::pair<RotamerLibEntry*,uint> lib_entries = rot_lib->QueryLib(id, phi, psi);
-  this->SetPosBuffer(all_atom, aa_res_idx, id);
-  return this->ConstructRRMRotamerGroup(id, residue_index, lib_entries, 
-                                        probability_cutoff);
-}
+        Real phi, Real psi, Real probability_cutoff) {
+
+  if(id == XXX) {
+    throw promod3::Error("Cannot construct RRMRotamerGroup for unknown "
+                         "rotamer id!");
+  }
 
-RRMRotamerGroupPtr SCWRLRotamerConstructor::ConstructRRMRotamerGroup(
-        const geom::Vec3& n_pos, const geom::Vec3& ca_pos,
-        const geom::Vec3& cb_pos, RotamerID id, uint residue_index,
-        BBDepRotamerLibPtr rot_lib, 
-        Real phi, Real psi, Real probability_cutoff){
   std::pair<RotamerLibEntry*,uint> lib_entries = rot_lib->QueryLib(id, phi, psi);
-  this->SetPosBuffer(n_pos, ca_pos, cb_pos, id);
+  this->SetPosBuffer(all_atom, aa_res_idx, id);
   return this->ConstructRRMRotamerGroup(id, residue_index, lib_entries, 
                                         probability_cutoff);
 }
@@ -1130,7 +1493,13 @@ RRMRotamerGroupPtr SCWRLRotamerConstructor::ConstructRRMRotamerGroup(
 FRMRotamerGroupPtr SCWRLRotamerConstructor::ConstructFRMRotamerGroup(
         const ost::mol::ResidueHandle& res, RotamerID id,
         uint residue_index, BBDepRotamerLibPtr rot_lib, 
-        Real phi, Real psi, Real probability_cutoff){
+        Real phi, Real psi, Real probability_cutoff) {
+
+  if(id == XXX) {
+    throw promod3::Error("Cannot construct FRMRotamerGroup for unknown "
+                         "rotamer id!");
+  }
+
   std::pair<RotamerLibEntry*,uint> lib_entries = rot_lib->QueryLib(id, phi, psi);
   this->SetPosBuffer(res, id);
   return this->ConstructFRMRotamerGroup(id, residue_index, lib_entries, 
@@ -1141,20 +1510,15 @@ FRMRotamerGroupPtr SCWRLRotamerConstructor::ConstructFRMRotamerGroup(
         const promod3::loop::AllAtomPositions& all_atom, 
         uint aa_res_idx, RotamerID id, uint residue_index,
         BBDepRotamerLibPtr rot_lib, 
-        Real phi, Real psi, Real probability_cutoff){
-  std::pair<RotamerLibEntry*,uint> lib_entries = rot_lib->QueryLib(id, phi, psi);
-  this->SetPosBuffer(all_atom, aa_res_idx, id);
-  return this->ConstructFRMRotamerGroup(id, residue_index, lib_entries, 
-                                        probability_cutoff);
-}
+        Real phi, Real psi, Real probability_cutoff) {
+
+  if(id == XXX) {
+    throw promod3::Error("Cannot construct FRMRotamerGroup for unknown "
+                         "rotamer id!");
+  }
 
-FRMRotamerGroupPtr SCWRLRotamerConstructor::ConstructFRMRotamerGroup(
-        const geom::Vec3& n_pos, const geom::Vec3& ca_pos,
-        const geom::Vec3& cb_pos, RotamerID id, uint residue_index,
-        BBDepRotamerLibPtr rot_lib, 
-        Real phi, Real psi, Real probability_cutoff){
   std::pair<RotamerLibEntry*,uint> lib_entries = rot_lib->QueryLib(id, phi, psi);
-  this->SetPosBuffer(n_pos, ca_pos, cb_pos, id);
+  this->SetPosBuffer(all_atom, aa_res_idx, id);
   return this->ConstructFRMRotamerGroup(id, residue_index, lib_entries, 
                                         probability_cutoff);
 }
@@ -1163,11 +1527,13 @@ RRMRotamerGroupPtr SCWRLRotamerConstructor::ConstructRRMRotamerGroup(
         const ost::mol::ResidueHandle& res, RotamerID id,
         uint residue_index, 
         std::vector<RotamerLibEntry>& lib_entries, 
-        Real probability_cutoff){
-  if(lib_entries.empty()){
-    throw promod3::Error("How do you want me to construct rotamers with an " 
-                         "empty input?");
+        Real probability_cutoff) {
+
+  if(id == XXX) {
+    throw promod3::Error("Cannot construct RRMRotamerGroup for unknown "
+                         "rotamer id!");
   }
+
   std::pair<RotamerLibEntry*,uint> I_LIKE_CHEESE = 
   std::make_pair(&lib_entries[0], lib_entries.size());
   this->SetPosBuffer(res, id);
@@ -1179,30 +1545,16 @@ RRMRotamerGroupPtr SCWRLRotamerConstructor::ConstructRRMRotamerGroup(
         const promod3::loop::AllAtomPositions& all_atom, 
         uint aa_res_idx, RotamerID id, uint residue_index,
         std::vector<RotamerLibEntry>& lib_entries, 
-        Real probability_cutoff){
-   if(lib_entries.empty()){
-    throw promod3::Error("How do you want me to construct rotamers with an " 
-                         "empty input?");
-  }
-  std::pair<RotamerLibEntry*,uint> I_LIKE_CHEESE = 
-  std::make_pair(&lib_entries[0], lib_entries.size());
-  this->SetPosBuffer(all_atom, aa_res_idx, id);
-  return this->ConstructRRMRotamerGroup(id, residue_index, I_LIKE_CHEESE, 
-                                        probability_cutoff);
-}
+        Real probability_cutoff) {
 
-RRMRotamerGroupPtr SCWRLRotamerConstructor::ConstructRRMRotamerGroup(
-        const geom::Vec3& n_pos, const geom::Vec3& ca_pos,
-        const geom::Vec3& cb_pos, RotamerID id, uint residue_index,
-        std::vector<RotamerLibEntry>& lib_entries, 
-        Real probability_cutoff){
-  if(lib_entries.empty()){
-    throw promod3::Error("How do you want me to construct rotamers with an " 
-                         "empty input?");
+  if(id == XXX) {
+    throw promod3::Error("Cannot construct RRMRotamerGroup for unknown "
+                         "rotamer id!");
   }
+
   std::pair<RotamerLibEntry*,uint> I_LIKE_CHEESE = 
   std::make_pair(&lib_entries[0], lib_entries.size());
-  this->SetPosBuffer(n_pos, ca_pos, cb_pos, id);
+  this->SetPosBuffer(all_atom, aa_res_idx, id);
   return this->ConstructRRMRotamerGroup(id, residue_index, I_LIKE_CHEESE, 
                                         probability_cutoff);
 }
@@ -1210,11 +1562,13 @@ RRMRotamerGroupPtr SCWRLRotamerConstructor::ConstructRRMRotamerGroup(
 FRMRotamerGroupPtr SCWRLRotamerConstructor::ConstructFRMRotamerGroup(
         const ost::mol::ResidueHandle& res, RotamerID id,
         uint residue_index, std::vector<RotamerLibEntry>& lib_entries, 
-        Real probability_cutoff){
-  if(lib_entries.empty()){
-    throw promod3::Error("How do you want me to construct rotamers with an " 
-                         "empty input?");
+        Real probability_cutoff) {
+
+  if(id == XXX) {
+    throw promod3::Error("Cannot construct FRMRotamerGroup for unknown "
+                         "rotamer id!");
   }
+
   std::pair<RotamerLibEntry*,uint> I_LIKE_CHEESE = 
   std::make_pair(&lib_entries[0], lib_entries.size());
   this->SetPosBuffer(res, id);
@@ -1226,30 +1580,16 @@ FRMRotamerGroupPtr SCWRLRotamerConstructor::ConstructFRMRotamerGroup(
         const promod3::loop::AllAtomPositions& all_atom, 
         uint aa_res_idx, RotamerID id, uint residue_index,
         std::vector<RotamerLibEntry>& lib_entries, 
-        Real probability_cutoff){
-  if(lib_entries.empty()){
-    throw promod3::Error("How do you want me to construct rotamers with an " 
-                         "empty input?");
-  }
-  std::pair<RotamerLibEntry*,uint> I_LIKE_CHEESE = 
-  std::make_pair(&lib_entries[0], lib_entries.size());
-  this->SetPosBuffer(all_atom, aa_res_idx, id);
-  return this->ConstructFRMRotamerGroup(id, residue_index, I_LIKE_CHEESE, 
-                                        probability_cutoff);
-}
+        Real probability_cutoff) {
 
-FRMRotamerGroupPtr SCWRLRotamerConstructor::ConstructFRMRotamerGroup(
-        const geom::Vec3& n_pos, const geom::Vec3& ca_pos,
-        const geom::Vec3& cb_pos, RotamerID id, uint residue_index,
-        std::vector<RotamerLibEntry>& lib_entries, 
-        Real probability_cutoff){
-  if(lib_entries.empty()){
-    throw promod3::Error("How do you want me to construct rotamers with an " 
-                         "empty input?");
+  if(id == XXX) {
+    throw promod3::Error("Cannot construct FRMRotamerGroup for unknown "
+                         "rotamer id!");
   }
+
   std::pair<RotamerLibEntry*,uint> I_LIKE_CHEESE = 
   std::make_pair(&lib_entries[0], lib_entries.size());
-  this->SetPosBuffer(n_pos, ca_pos, cb_pos, id);
+  this->SetPosBuffer(all_atom, aa_res_idx, id);
   return this->ConstructFRMRotamerGroup(id, residue_index, I_LIKE_CHEESE, 
                                         probability_cutoff);
 }
@@ -1257,13 +1597,17 @@ FRMRotamerGroupPtr SCWRLRotamerConstructor::ConstructFRMRotamerGroup(
 
 FrameResiduePtr SCWRLRotamerConstructor::ConstructBackboneFrameResidue(
           const ost::mol::ResidueHandle& res, RotamerID id, uint residue_index,
-          Real phi, bool n_ter, bool c_ter){
+          Real phi, bool n_ter, bool c_ter) {
 
   core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
           "SCWRLRotamerConstructor::ConstructBackboneFrameResidue", 2);
 
-  const SCWRLRotamerInfo& info = 
-  SCWRLRotamerLookup::GetInstance().GetBackboneInfo(id);
+  if(id == XXX) {
+    throw promod3::Error("Cannot construct FrameResidue for unknown "
+                         "rotamer id!");
+  }
+
+  const SCWRLRotamerInfo& info = rotamer_lookup_.GetBackboneInfo(id);
 
   for(uint i = 0; i < info.particles.size(); ++i){
     if(!info.particles[i].is_hydrogen){
@@ -1296,13 +1640,17 @@ FrameResiduePtr SCWRLRotamerConstructor::ConstructBackboneFrameResidue(
 FrameResiduePtr SCWRLRotamerConstructor::ConstructBackboneFrameResidue(
           const promod3::loop::AllAtomPositions& all_atom, uint aa_res_idx, 
           RotamerID id, uint residue_index,
-          Real phi, bool n_ter, bool c_ter){
+          Real phi, bool n_ter, bool c_ter) {
 
   core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
           "SCWRLRotamerConstructor::ConstructBackboneFrameResidue", 2);
 
-  const SCWRLRotamerInfo& info = 
-  SCWRLRotamerLookup::GetInstance().GetBackboneInfo(id);
+  if(id == XXX) {
+    throw promod3::Error("Cannot construct FrameResidue for unknown "
+                         "rotamer id!");
+  }
+
+  const SCWRLRotamerInfo& info = rotamer_lookup_.GetBackboneInfo(id);
 
   for(uint i = 0; i < info.particles.size(); ++i){
     if(!info.particles[i].is_hydrogen){
@@ -1334,49 +1682,18 @@ FrameResiduePtr SCWRLRotamerConstructor::ConstructBackboneFrameResidue(
   return p; 
 }
 
-FrameResiduePtr SCWRLRotamerConstructor::ConstructBackboneFrameResidue(
-          const geom::Vec3& n_pos, const geom::Vec3& ca_pos, 
-          const geom::Vec3& c_pos, const geom::Vec3& o_pos,
-          const geom::Vec3& cb_pos, 
-          RotamerID id, uint residue_index,
-          Real phi, bool n_ter, bool c_ter){
-
-  core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
-          "SCWRLRotamerConstructor::ConstructBackboneFrameResidue", 2);
-
-  const SCWRLRotamerInfo& info = 
-  SCWRLRotamerLookup::GetInstance().GetBackboneInfo(id);
-
-  pos_buffer_->SetPos(id, promod3::loop::BB_N_INDEX, n_pos);
-  pos_buffer_->SetPos(id, promod3::loop::BB_CA_INDEX, ca_pos);
-  pos_buffer_->SetPos(id, promod3::loop::BB_C_INDEX, c_pos);
-  pos_buffer_->SetPos(id, promod3::loop::BB_O_INDEX, o_pos);
-  if(id != GLY) pos_buffer_->SetPos(id, promod3::loop::BB_CB_INDEX, cb_pos);
-
-  //set hydrogens
-  if(info.has_hydrogens){
-    promod3::loop::ConstructHydrogenN(*pos_buffer_, id, phi, *hydrogen_buffer_); 
-  }
-
-  int num_particles = info.particles.size();
-  if(n_ter) num_particles += 2;
-  if(c_ter) num_particles += 1;
-  std::vector<Particle> particles(num_particles);
-  this->ConstructBBFrameParticles(info, id, n_ter, c_ter, particles);
-
-  FrameResiduePtr p = boost::make_shared<FrameResidue>(particles, residue_index);
-
-  return p; 
-}
-
 FrameResiduePtr SCWRLRotamerConstructor::ConstructSidechainFrameResidue(
-          const ost::mol::ResidueHandle& res, RotamerID id, uint residue_index){
+        const ost::mol::ResidueHandle& res, RotamerID id, uint residue_index) {
 
   core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
           "SCWRLRotamerConstructor::ConstructSidechainFrameResidue", 2);
 
-  const SCWRLRotamerInfo& info = 
-  SCWRLRotamerLookup::GetInstance().GetSidechainInfo(id);
+  if(id == XXX) {
+    throw promod3::Error("Cannot construct FrameResidue for unknown "
+                         "rotamer id!");
+  }
+
+  const SCWRLRotamerInfo& info = rotamer_lookup_.GetSidechainInfo(id);
 
   for(uint i = 0; i < info.particles.size(); ++i){
     if(!info.particles[i].is_hydrogen){
@@ -1408,13 +1725,17 @@ FrameResiduePtr SCWRLRotamerConstructor::ConstructSidechainFrameResidue(
 
 FrameResiduePtr SCWRLRotamerConstructor::ConstructSidechainFrameResidue(
           const promod3::loop::AllAtomPositions& all_atom, uint aa_res_idx, 
-          RotamerID id, uint residue_index){
+          RotamerID id, uint residue_index) {
 
   core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
           "SCWRLRotamerConstructor::ConstructSidechainFrameResidue", 2);
 
-  const SCWRLRotamerInfo& info = 
-  SCWRLRotamerLookup::GetInstance().GetSidechainInfo(id);
+  if(id == XXX) {
+    throw promod3::Error("Cannot construct FrameResidue for unknown "
+                         "rotamer id!");
+  }
+
+  const SCWRLRotamerInfo& info = rotamer_lookup_.GetSidechainInfo(id);
 
   for(uint i = 0; i < info.particles.size(); ++i){
     if(!info.particles[i].is_hydrogen){
@@ -1447,7 +1768,7 @@ FrameResiduePtr SCWRLRotamerConstructor::ConstructSidechainFrameResidue(
 }
 
 FrameResiduePtr SCWRLRotamerConstructor::ConstructFrameResidue(
-          const ost::mol::ResidueHandle& res, uint residue_index){
+          const ost::mol::ResidueHandle& res, uint residue_index) {
 
   // get atoms and count non-hydrogens (= num. particles to add)
   ost::mol::AtomHandleList atom_list = res.GetAtomList();
@@ -1547,7 +1868,7 @@ FrameResiduePtr SCWRLRotamerConstructor::ConstructFrameResidueHeuristic(
   return boost::make_shared<FrameResidue>(particles, residue_index);
 }
 
-void SCWRLRotamerConstructor::AssignInternalEnergies(RRMRotamerGroupPtr group) const{
+void SCWRLRotamerConstructor::AssignInternalEnergies(RRMRotamerGroupPtr group) const {
 
   core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
           "SCWRLRotamerConstructor::AssignInternalEnergies", 2);
@@ -1562,7 +1883,7 @@ void SCWRLRotamerConstructor::AssignInternalEnergies(RRMRotamerGroupPtr group) c
   }
 }
 
-void SCWRLRotamerConstructor::AssignInternalEnergies(FRMRotamerGroupPtr group) const{
+void SCWRLRotamerConstructor::AssignInternalEnergies(FRMRotamerGroupPtr group) const {
 
   core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
           "SCWRLRotamerConstructor::AssignInternalEnergies", 2);
@@ -1582,7 +1903,7 @@ void SCWRLRotamerConstructor::AssignInternalEnergies(FRMRotamerGroupPtr group) c
 RRMRotamerGroupPtr SCWRLRotamerConstructor::ConstructRRMRotamerGroup(
           RotamerID id, uint residue_index, 
           std::pair<RotamerLibEntry*,uint> lib_entries, 
-          Real probability_cutoff){
+          Real probability_cutoff) {
 
   core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
           "SCWRLRotamerConstructor::ConstructRRMRotamerGroup", 2);
@@ -1597,6 +1918,20 @@ RRMRotamerGroupPtr SCWRLRotamerConstructor::ConstructRRMRotamerGroup(
     MVBBPosBuffer(HIS, HSE);
   }
 
+  // in case of alanine and glycine, the rotamer libraries won't have any 
+  // entries. For consistency we nevertheless construct rotamers.
+  // We simply add a fake RotamerLibEntry in this case that has
+  // no sidechain dihedrals set.
+  std::vector<RotamerLibEntry> fake_rotamers(1);
+  if(lib_entries.second == 0 && (id == ALA || id == GLY)) {
+    // we have to make sure, that the according probability really is one!
+    fake_rotamers[0].probability = 1.0;
+    lib_entries = std::make_pair(&fake_rotamers[0], 1);
+  }
+  else if(lib_entries.second == 0) {
+    throw promod3::Error("Did not find any rotamers in Rotamer Library!");
+  }
+
   for(uint i = 0; i < lib_entries.second; ++i){
 
     probability_ = lib_entries.first[i].probability;
@@ -1654,7 +1989,7 @@ RRMRotamerGroupPtr SCWRLRotamerConstructor::ConstructRRMRotamerGroup(
 FRMRotamerGroupPtr SCWRLRotamerConstructor::ConstructFRMRotamerGroup(
           RotamerID id, uint residue_index, 
           std::pair<RotamerLibEntry*,uint> lib_entries, 
-          Real probability_cutoff){
+          Real probability_cutoff) {
 
   core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
           "SCWRLRotamerConstructor::ConstructFRMRotamerGroup", 2);
@@ -1669,6 +2004,20 @@ FRMRotamerGroupPtr SCWRLRotamerConstructor::ConstructFRMRotamerGroup(
     MVBBPosBuffer(HIS, HSE);
   }
 
+  // in case of alanine and glycine, the rotamer libraries won't have any 
+  // entries. For consistency we nevertheless construct rotamers.
+  // We simply add a fake RotamerLibEntry in this case that has
+  // no sidechain dihedrals set.
+  std::vector<RotamerLibEntry> fake_rotamers(1);
+  if(lib_entries.second == 0 && (id == ALA || id == GLY)) {
+    // we have to make sure, that the according probability really is one!
+    fake_rotamers[0].probability = 1.0;
+    lib_entries = std::make_pair(&fake_rotamers[0], 1);
+  }
+  else if(lib_entries.second == 0) {
+    throw promod3::Error("Did not find any rotamers in Rotamer Library!");
+  }
+
   for(uint i = 0; i < lib_entries.second; ++i){
     probability_ = lib_entries.first[i].probability;
     summed_prob += probability_;
@@ -1728,15 +2077,13 @@ FRMRotamerGroupPtr SCWRLRotamerConstructor::ConstructFRMRotamerGroup(
 }
 
 RRMRotamerPtr SCWRLRotamerConstructor::ConstructRRMRotamer(RotamerID id, 
-                                                           uint residue_idx){
+                                                           uint residue_idx) {
 
   core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
           "SCWRLRotamerConstructor::ConstructRRMRotamer", 2);
 
-  const SCWRLRotamerInfo& info = 
-  SCWRLRotamerLookup::GetInstance().GetSidechainInfo(id);
-  int num_particles = 
-  SCWRLRotamerLookup::GetInstance().GetNumSidechainParticles(id);
+  const SCWRLRotamerInfo& info = rotamer_lookup_.GetSidechainInfo(id);
+  int num_particles = rotamer_lookup_.GetNumSidechainParticles(id);
   std::vector<Particle> particles(num_particles);
 
   //set the positions
@@ -1749,7 +2096,7 @@ RRMRotamerPtr SCWRLRotamerConstructor::ConstructRRMRotamer(RotamerID id,
     promod3::loop::ConstructHydrogens(*pos_buffer_, id, *hydrogen_buffer_, true, 
                                       promod3::loop::PROT_STATE_HISH);
 
-    // If there are any custom rules, we apply them now an overrule the
+    // If there are any custom rules, we apply them now and overrule the
     // default hydrogen construction
     if(!info.custom_hydrogens.empty()){
       for(uint i = 0; i < info.custom_hydrogens.size(); ++i){
@@ -1776,17 +2123,14 @@ RRMRotamerPtr SCWRLRotamerConstructor::ConstructRRMRotamer(RotamerID id,
 }
 
 FRMRotamerPtr SCWRLRotamerConstructor::ConstructFRMRotamer(RotamerID id,
-                                                           uint residue_idx){
+                                                           uint residue_idx) {
 
   core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
           "SCWRLRotamerConstructor::ConstructFRMRotamer", 2);
 
-  const SCWRLRotamerInfo& info = 
-  SCWRLRotamerLookup::GetInstance().GetSidechainInfo(id);
-  int num_rrm_particles = 
-  SCWRLRotamerLookup::GetInstance().GetNumSidechainParticles(id);
-  int num_particles = 
-  SCWRLRotamerLookup::GetInstance().GetNumFRMSidechainParticles(id);
+  const SCWRLRotamerInfo& info = rotamer_lookup_.GetSidechainInfo(id);
+  int num_rrm_particles = rotamer_lookup_.GetNumSidechainParticles(id);
+  int num_particles = rotamer_lookup_.GetNumFRMSidechainParticles(id);
   std::vector<Particle> particles(num_particles);
 
   //set the positions
@@ -1823,8 +2167,7 @@ FRMRotamerPtr SCWRLRotamerConstructor::ConstructFRMRotamer(RotamerID id,
   for(int i = 0; i < num_rrm_particles; ++i) actual_definition[i] = i;
   subrotamer_definitions.push_back(actual_definition);
 
-  const std::vector<SCWRLFRMRule>& frm_rules = 
-  SCWRLRotamerLookup::GetInstance().GetFRMRules(id);
+  const std::vector<SCWRLFRMRule>& frm_rules = rotamer_lookup_.GetFRMRules(id);
   geom::Vec3 rotation_axis, rotation_anchor;
   geom::Vec3 orig_pos, rot_pos;
   geom::Mat4 rot;
@@ -1836,8 +2179,10 @@ FRMRotamerPtr SCWRLRotamerConstructor::ConstructFRMRotamer(RotamerID id,
     int num_rotating_particles = frm_rule.rotating_particles.size();
 
     // Update the subrotamer definition... all particles that are fixed are taken
-    // from the first subrotamer, the indices therefore start from 0
-    for(int i = 0; i < num_fix_particles; ++i) actual_definition[i] = i;
+    // from the first subrotamer.
+    for(int i = 0; i < num_fix_particles; ++i) {
+      actual_definition[i] = frm_rule.fix_particles[i];
+    }
 
     // The data required for the rotation around the specified axis
     rotation_anchor = pos_buffer_->GetPos(id, frm_rule.anchor_idx_two);
@@ -1853,9 +2198,10 @@ FRMRotamerPtr SCWRLRotamerConstructor::ConstructFRMRotamer(RotamerID id,
                                               rotation_angle);
 
       for(int i = 0; i < num_rotating_particles; ++i){
+        int orig_particle_idx = frm_rule.rotating_particles[i];
         int new_particle_idx = base_idx + i;
-        int orig_particle_idx = num_fix_particles + i;
 
+        // replace the old with the new index...
         actual_definition[orig_particle_idx] = new_particle_idx;
 
         // get the new position
@@ -1877,10 +2223,10 @@ FRMRotamerPtr SCWRLRotamerConstructor::ConstructFRMRotamer(RotamerID id,
       // instead of building them from scratch, they get extracted from the
       // initial particles and transformed
       for(int i = 0; i < num_rotating_particles; ++i){
-        int orig_particle_idx = num_fix_particles + i;
+        int orig_particle_idx = frm_rule.rotating_particles[i];
+        int new_particle_idx = base_idx + i;
 
         if(particles[orig_particle_idx].IsHBondDonor()){
-          int new_particle_idx = base_idx + i;
           orig_pos = particles[orig_particle_idx].GetPos() +
                      particles[orig_particle_idx].GetPolarDirection();
           rot_pos[0] = rot(0,0) * orig_pos[0] + rot(0,1) * orig_pos[1] + 
@@ -1895,7 +2241,6 @@ FRMRotamerPtr SCWRLRotamerConstructor::ConstructFRMRotamer(RotamerID id,
         }
 
         if(particles[orig_particle_idx].IsHBondAcceptor()){
-          int new_particle_idx = base_idx + i;
           const std::vector<geom::Vec3>& lp = 
           particles[orig_particle_idx].GetLonePairs();
           for(uint j = 0; j < lp.size(); ++j){
@@ -1923,7 +2268,7 @@ FRMRotamerPtr SCWRLRotamerConstructor::ConstructFRMRotamer(RotamerID id,
                                                    info.frm_t, probability_,
                                                    info.internal_e_prefactor);
 
-  for(uint i = 0; i < subrotamer_definitions.size(); ++i){
+  for(uint i = 0; i < subrotamer_definitions.size(); ++i) {
     r->AddSubrotamerDefinition(subrotamer_definitions[i]);
   }
 
@@ -1931,7 +2276,7 @@ FRMRotamerPtr SCWRLRotamerConstructor::ConstructFRMRotamer(RotamerID id,
 }
 
 void SCWRLRotamerConstructor::SetPosBuffer(const ost::mol::ResidueHandle& res,
-                                           RotamerID id){
+                                           RotamerID id) {
 
   core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
           "SCWRLRotamerConstructor::SetPosBuffer_residue", 2);
@@ -1939,61 +2284,87 @@ void SCWRLRotamerConstructor::SetPosBuffer(const ost::mol::ResidueHandle& res,
   ost::mol::AtomHandle n = res.FindAtom("N");
   ost::mol::AtomHandle ca = res.FindAtom("CA");
   ost::mol::AtomHandle cb = res.FindAtom("CB");
+  ost::mol::AtomHandle c = res.FindAtom("C");
+  ost::mol::AtomHandle o = res.FindAtom("O");
 
-  if(!(n.IsValid() && ca.IsValid() && cb.IsValid())){
-    throw promod3::Error("N, CA and CB must be valid to construct rotamer!");
+  if(!(n.IsValid() && ca.IsValid() && c.IsValid() && o.IsValid())) {
+    throw promod3::Error("All backbone atoms must be valid to construct "
+                         "rotamer!");
   }
 
   pos_buffer_->SetPos(id, promod3::loop::BB_N_INDEX, n.GetPos());
   pos_buffer_->SetPos(id, promod3::loop::BB_CA_INDEX, ca.GetPos());
-  pos_buffer_->SetPos(id, promod3::loop::BB_CB_INDEX, cb.GetPos());
+  pos_buffer_->SetPos(id, promod3::loop::BB_C_INDEX, c.GetPos());
+  pos_buffer_->SetPos(id, promod3::loop::BB_O_INDEX, o.GetPos());
+
+  if(id != GLY) {
+    if(!cb.IsValid()) {
+      throw promod3::Error("All backbone atoms must be valid to construct "
+                           "rotamer!");
+    }
+    pos_buffer_->SetPos(id, promod3::loop::BB_CB_INDEX, cb.GetPos());
+  }
 }
 
 void SCWRLRotamerConstructor::SetPosBuffer(const promod3::loop::AllAtomPositions& all_atom_pos,
-                                           uint all_atom_idx, RotamerID id){
+                                           uint all_atom_idx, RotamerID id) {
 
   core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
           "SCWRLRotamerConstructor::SetPosBuffer_all_atom_pos", 2);
 
+
   if(!(all_atom_pos.IsSet(all_atom_idx, promod3::loop::BB_N_INDEX) &&
        all_atom_pos.IsSet(all_atom_idx, promod3::loop::BB_CA_INDEX) &&
-       all_atom_pos.IsSet(all_atom_idx, promod3::loop::BB_CB_INDEX))){
-    throw promod3::Error("N, CA and CB must be set to construct rotamer!");
+       all_atom_pos.IsSet(all_atom_idx, promod3::loop::BB_C_INDEX) &&
+       all_atom_pos.IsSet(all_atom_idx, promod3::loop::BB_O_INDEX))){
+    throw promod3::Error("All backbone atoms must be set to construct "
+                         "rotamer!");
   }
 
   pos_buffer_->SetPos(id, promod3::loop::BB_N_INDEX, 
-                      all_atom_pos.GetPos(all_atom_idx, promod3::loop::BB_N_INDEX));
+                      all_atom_pos.GetPos(all_atom_idx, 
+                                          promod3::loop::BB_N_INDEX));
   pos_buffer_->SetPos(id, promod3::loop::BB_CA_INDEX, 
-                      all_atom_pos.GetPos(all_atom_idx, promod3::loop::BB_CA_INDEX));
-  pos_buffer_->SetPos(id, promod3::loop::BB_CB_INDEX, 
-                      all_atom_pos.GetPos(all_atom_idx, promod3::loop::BB_CB_INDEX));  
-}
-
-void SCWRLRotamerConstructor::SetPosBuffer(const geom::Vec3& n_pos, 
-                                           const geom::Vec3& ca_pos, 
-                                           const geom::Vec3& cb_pos,
-                                           RotamerID id){
-
-  core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
-          "SCWRLRotamerConstructor::SetPosBuffer_vec3", 2);
+                      all_atom_pos.GetPos(all_atom_idx, 
+                                          promod3::loop::BB_CA_INDEX));
+  pos_buffer_->SetPos(id, promod3::loop::BB_C_INDEX, 
+                      all_atom_pos.GetPos(all_atom_idx, 
+                                          promod3::loop::BB_C_INDEX));
+  pos_buffer_->SetPos(id, promod3::loop::BB_O_INDEX, 
+                      all_atom_pos.GetPos(all_atom_idx, 
+                                          promod3::loop::BB_O_INDEX));  
+
+  if(id != GLY) {
+    if(!all_atom_pos.IsSet(all_atom_idx, promod3::loop::BB_CB_INDEX)) {
+      throw promod3::Error("All backbone atoms must be valid to construct "
+                           "rotamer!");
+    }
+    pos_buffer_->SetPos(id, promod3::loop::BB_CB_INDEX, 
+                        all_atom_pos.GetPos(all_atom_idx, 
+                                            promod3::loop::BB_CB_INDEX));
 
-  pos_buffer_->SetPos(id, promod3::loop::BB_N_INDEX, n_pos);
-  pos_buffer_->SetPos(id, promod3::loop::BB_CA_INDEX, ca_pos);
-  pos_buffer_->SetPos(id, promod3::loop::BB_CB_INDEX, cb_pos);  
+  }
 }
 
-void SCWRLRotamerConstructor::MVBBPosBuffer(RotamerID from, RotamerID to){
+void SCWRLRotamerConstructor::MVBBPosBuffer(RotamerID from, RotamerID to) {
   pos_buffer_->SetPos(to, promod3::loop::BB_N_INDEX, 
                       pos_buffer_->GetPos(from, promod3::loop::BB_N_INDEX));
   pos_buffer_->SetPos(to, promod3::loop::BB_CA_INDEX, 
                       pos_buffer_->GetPos(from, promod3::loop::BB_CA_INDEX));
+  pos_buffer_->SetPos(to, promod3::loop::BB_C_INDEX, 
+                      pos_buffer_->GetPos(from, promod3::loop::BB_C_INDEX));
+  pos_buffer_->SetPos(to, promod3::loop::BB_O_INDEX, 
+                      pos_buffer_->GetPos(from, promod3::loop::BB_O_INDEX));
+  // Even though we officially count CB as a sidechain atom, we still move it
+  // since its completely independent of any sidechain dihedral angle and
+  // cannot be constructed anyway
   pos_buffer_->SetPos(to, promod3::loop::BB_CB_INDEX, 
                       pos_buffer_->GetPos(from, promod3::loop::BB_CB_INDEX));
 }
 
 void SCWRLRotamerConstructor::ConstructBaseParticles(const SCWRLRotamerInfo& info,
                                                      RotamerID id,
-                                                     std::vector<Particle>& particles){
+                                                     std::vector<Particle>& particles) {
 
   core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
           "SCWRLRotamerConstructor::ConstructBaseParticles", 2);
@@ -2037,7 +2408,7 @@ void SCWRLRotamerConstructor::ConstructBaseParticles(const SCWRLRotamerInfo& inf
 void SCWRLRotamerConstructor::ConstructBBFrameParticles(
                                  const SCWRLRotamerInfo& info, RotamerID id,
                                  bool n_ter, bool c_ter,
-                                 std::vector<Particle>& particles){
+                                 std::vector<Particle>& particles) {
 
   core::ScopedTimerPtr prof = core::StaticRuntimeProfiler::StartScoped(
           "SCWRLRotamerConstructor::ConstructBBFrameParticles", 2);
@@ -2062,54 +2433,38 @@ void SCWRLRotamerConstructor::ConstructBBFrameParticles(
   }
 
   if(n_ter){
-    if(id == PRO || id == TPR || id == CPR){
-      // there are two hydrogens
-      geom::Vec3 ht1_pos, ht2_pos;
-      geom::Vec3 cb_pos, ca_pos, n_pos;
-      // Actually we would have to reconstruct the hydrogens using the prolines
-      // CD atom... since we only have bb info, we use the CB atom.
-      // rather crude, I know...
-      cb_pos = pos_buffer_->GetPos(id, promod3::loop::BB_CB_INDEX);
-      ca_pos = pos_buffer_->GetPos(id, promod3::loop::BB_CA_INDEX);
-      n_pos = pos_buffer_->GetPos(id, promod3::loop::BB_N_INDEX);
-      promod3::core::ConstructAtomPos(cb_pos, ca_pos, n_pos, 0.997, 2.042, 
-                                      2.0944, ht1_pos);
-      promod3::core::ConstructAtomPos(cb_pos,ca_pos,n_pos,0.997, 2.042, 
-                                     -2.0944, ht2_pos);
-      particles[p_idx] = Particle(HParticle, ht1_pos, 0.35, "HT1");
-      particles[p_idx].SetPolarDirection(ht1_pos - n_pos);
-      particles[p_idx + 1] = Particle(HParticle, ht2_pos, 0.35, "HT2");
-      particles[p_idx + 1].SetPolarDirection(ht2_pos - n_pos);
+    geom::Vec3 ht1_pos, ht2_pos, ht3_pos;
+    geom::Vec3 n_pos, ca_pos, c_pos;
+    n_pos = pos_buffer_->GetPos(id, promod3::loop::BB_N_INDEX);
+    ca_pos = pos_buffer_->GetPos(id, promod3::loop::BB_CA_INDEX);
+    c_pos = pos_buffer_->GetPos(id, promod3::loop::BB_C_INDEX);
+    promod3::core::ConstructAtomPos(c_pos, ca_pos, n_pos, 0.997, 2.042, 
+                                    1.0472, ht1_pos);
+    promod3::core::ConstructAtomPos(c_pos,ca_pos,n_pos,0.997, 2.042, 
+                                    -1.0472, ht2_pos);
+    particles[p_idx] = Particle(HParticle, ht1_pos, 0.35, "HT1");
+    particles[p_idx].SetPolarDirection(ht1_pos - n_pos);
+    particles[p_idx + 1] = Particle(HParticle, ht2_pos, 0.35, "HT2");
+    particles[p_idx + 1].SetPolarDirection(ht2_pos - n_pos);
+
+    if(id == PRO || id == TPR || id == CPR) {
+      // there are only two hydrogens... please note, that they are not
+      // optimally placed in case of proline. 
+      // we would have to consider CD for that. This costs a good bottle 
+      // of wine that I implement that correctly...
+      return;
     }
-    else{
-      // there are three hydrogens
-      geom::Vec3 ht1_pos, ht2_pos, ht3_pos;
-      geom::Vec3 cb_pos, ca_pos, n_pos; 
-      if(id == GLY) cb_pos = pos_buffer_->GetPos(id, promod3::loop::BB_C_INDEX);
-      else cb_pos = pos_buffer_->GetPos(id, promod3::loop::BB_CB_INDEX);
-      ca_pos = pos_buffer_->GetPos(id, promod3::loop::BB_CA_INDEX);
-      n_pos = pos_buffer_->GetPos(id, promod3::loop::BB_N_INDEX);
-      promod3::core::ConstructAtomPos(cb_pos, ca_pos, n_pos, 0.997, 2.042, 
-                                      M_PI, ht1_pos);
-      promod3::core::ConstructAtomPos(cb_pos, ca_pos, n_pos, 0.997, 2.042,
-                                      1.0472, ht2_pos);
-      promod3::core::ConstructAtomPos(cb_pos, ca_pos, n_pos, 0.997, 2.042, 
-                                      -1.0472, ht3_pos);
-
-      // we assume, that there is currently one hydrogen and replace it with ht1
-      for(uint i = 0; i < info.particles.size(); ++i){
-        if(info.particles[i].is_hydrogen){
-          particles[i] = Particle(HParticle, ht1_pos, 0.35, "HT1");
-          particles[i].SetPolarDirection(ht1_pos - n_pos);
-          break;
-        }
-      }
 
-      // set ht2 and ht3
-      particles[p_idx] = Particle(HParticle, ht2_pos, 0.35, "HT2");
-      particles[p_idx].SetPolarDirection(ht2_pos - n_pos);
-      particles[p_idx + 1] = Particle(HParticle, ht3_pos, 0.35, "HT3");
-      particles[p_idx + 1].SetPolarDirection(ht3_pos - n_pos);
+    promod3::core::ConstructAtomPos(c_pos, ca_pos, n_pos, 0.997, 2.042, 
+                                    M_PI, ht3_pos);
+    // we assume, that there is currently one hydrogen apart from ht1 and ht2 
+    // and replace it with ht3
+    for(uint i = 0; i < info.particles.size(); ++i){
+      if(info.particles[i].is_hydrogen){
+        particles[i] = Particle(HParticle, ht3_pos, 0.35, "HT3");
+        particles[i].SetPolarDirection(ht3_pos - n_pos);
+        break;
+      }
     }
   }
 }
diff --git a/sidechain/src/scwrl_rotamer_constructor.hh b/sidechain/src/scwrl_rotamer_constructor.hh
index cc0b38b392d9a5231a9d94a335bd469f15920014..8beea0819bacefa5d12de50ce1500740b23c20ed 100644
--- a/sidechain/src/scwrl_rotamer_constructor.hh
+++ b/sidechain/src/scwrl_rotamer_constructor.hh
@@ -18,6 +18,9 @@
 
 namespace promod3 { namespace sidechain {
 
+class SCWRLRotamerConstructor;
+typedef boost::shared_ptr<SCWRLRotamerConstructor> SCWRLRotamerConstructorPtr;
+
 /// \brief Types of lone pair construction
 enum SCWRLLPRule {
   LONE_PAIR_CARBONYL, LONE_PAIR_COH, LONE_PAIR_CNC
@@ -135,11 +138,9 @@ struct SCWRLRotamerInfo{
 /// \brief Defines lookups to build rotamer stuff.
 class SCWRLRotamerLookup {
 public:
-  // Singleton access to one constant instance (see AminoAcidLookup for details)
-  static const SCWRLRotamerLookup& GetInstance() {
-    static SCWRLRotamerLookup instance;
-    return instance;
-  }
+
+  SCWRLRotamerLookup(bool cb_in_sidechain);
+
   // Data access
   const SCWRLRotamerInfo& GetSidechainInfo(RotamerID id) const { 
     return sidechain_infos_[id]; 
@@ -227,8 +228,6 @@ private:
     frm_rules_[id][rule_idx].fix_particles.push_back(p_idx);
   }
 
-  SCWRLRotamerLookup();
-
   // To construct classical rotamers or as lookup for sidechain frame residues
   SCWRLRotamerInfo sidechain_infos_[XXX + 1];
 
@@ -248,7 +247,7 @@ class SCWRLRotamerConstructor{
 
 public:
 
-  SCWRLRotamerConstructor();
+  SCWRLRotamerConstructor(bool cb_in_sidechain = false);
 
   // Construct rotamer groups from non backbone dependent library
   RRMRotamerGroupPtr ConstructRRMRotamerGroup(
@@ -261,12 +260,6 @@ public:
           uint aa_res_idx, RotamerID id, uint residue_index,
           RotamerLibPtr rot_lib, 
           Real probability_cutoff = 0.98);
-
-  RRMRotamerGroupPtr ConstructRRMRotamerGroup(
-          const geom::Vec3& n_pos, const geom::Vec3& ca_pos,
-          const geom::Vec3& cb_pos, RotamerID id, uint residue_index,
-          RotamerLibPtr rot_lib, 
-          Real probability_cutoff = 0.98);
   
   FRMRotamerGroupPtr ConstructFRMRotamerGroup(
           const ost::mol::ResidueHandle& res, RotamerID id,
@@ -279,12 +272,6 @@ public:
           RotamerLibPtr rot_lib, 
           Real probability_cutoff = 0.98);
 
-  FRMRotamerGroupPtr ConstructFRMRotamerGroup(
-          const geom::Vec3& n_pos, const geom::Vec3& ca_pos,
-          const geom::Vec3& cb_pos, RotamerID id, uint residue_index,
-          RotamerLibPtr rot_lib, 
-          Real probability_cutoff = 0.98);
-
   // Construct rotamer groups from backbone dependent library
   RRMRotamerGroupPtr ConstructRRMRotamerGroup(
           const ost::mol::ResidueHandle& res, RotamerID id,
@@ -300,14 +287,6 @@ public:
           Real phi = -1.0472, 
           Real psi =  -0.7854,
           Real probability_cutoff = 0.98);
-
-  RRMRotamerGroupPtr ConstructRRMRotamerGroup(
-          const geom::Vec3& n_pos, const geom::Vec3& ca_pos,
-          const geom::Vec3& cb_pos, RotamerID id, uint residue_index,
-          BBDepRotamerLibPtr rot_lib, 
-          Real phi = -1.0472, 
-          Real psi =  -0.7854,
-          Real probability_cutoff = 0.98);
   
   FRMRotamerGroupPtr ConstructFRMRotamerGroup(
           const ost::mol::ResidueHandle& res, RotamerID id,
@@ -324,14 +303,6 @@ public:
           Real psi =  -0.7854,
           Real probability_cutoff = 0.98);
 
-  FRMRotamerGroupPtr ConstructFRMRotamerGroup(
-          const geom::Vec3& n_pos, const geom::Vec3& ca_pos,
-          const geom::Vec3& cb_pos, RotamerID id, uint residue_index,
-          BBDepRotamerLibPtr rot_lib, 
-          Real phi = -1.0472, 
-          Real psi =  -0.7854,
-          Real probability_cutoff = 0.98);
-
   // Construct rotamer groups directly from rotamerlib entries
   RRMRotamerGroupPtr ConstructRRMRotamerGroup(
           const ost::mol::ResidueHandle& res, RotamerID id,
@@ -344,12 +315,6 @@ public:
           uint aa_res_idx, RotamerID id, uint residue_index,
           std::vector<RotamerLibEntry>& lib_entries, 
           Real probability_cutoff = 0.98);
-
-  RRMRotamerGroupPtr ConstructRRMRotamerGroup(
-          const geom::Vec3& n_pos, const geom::Vec3& ca_pos,
-          const geom::Vec3& cb_pos, RotamerID id, uint residue_index,
-          std::vector<RotamerLibEntry>& lib_entries, 
-          Real probability_cutoff = 0.98);
   
   FRMRotamerGroupPtr ConstructFRMRotamerGroup(
           const ost::mol::ResidueHandle& res, RotamerID id,
@@ -363,26 +328,12 @@ public:
           std::vector<RotamerLibEntry>& lib_entries, 
           Real probability_cutoff = 0.98);
 
-  FRMRotamerGroupPtr ConstructFRMRotamerGroup(
-          const geom::Vec3& n_pos, const geom::Vec3& ca_pos,
-          const geom::Vec3& cb_pos, RotamerID id, uint residue_index,
-          std::vector<RotamerLibEntry>& lib_entries, 
-          Real probability_cutoff = 0.98);
-
   // Construct frame residues
   FrameResiduePtr ConstructBackboneFrameResidue(
           const ost::mol::ResidueHandle& res, RotamerID id, uint residue_index,
           Real phi, bool n_ter = false,
           bool c_ter = false);
 
-  FrameResiduePtr ConstructBackboneFrameResidue(
-          const geom::Vec3& n_pos, const geom::Vec3& ca_pos, 
-          const geom::Vec3& c_pos, const geom::Vec3& o_pos,
-          const geom::Vec3& cb_pos, 
-          RotamerID id, uint residue_index,
-          Real phi, bool n_ter = false,
-          bool c_ter = false);
-
   FrameResiduePtr ConstructBackboneFrameResidue(
           const promod3::loop::AllAtomPositions& all_atom, uint aa_res_idx, 
           RotamerID id, uint residue_index,
@@ -434,9 +385,6 @@ private:
   void SetPosBuffer(const promod3::loop::AllAtomPositions&,
                     uint aa_res_index, RotamerID id);
 
-  void SetPosBuffer(const geom::Vec3& n_pos, const geom::Vec3& ca_pos,
-                    const geom::Vec3& cb_pos, RotamerID id);
-
   void MVBBPosBuffer(RotamerID from, RotamerID to);
 
   void ConstructBaseParticles(const SCWRLRotamerInfo& info, RotamerID id,
@@ -449,6 +397,7 @@ private:
   Real chi_angles_[4];
   Real chi_dev_[4];
   Real probability_;
+  SCWRLRotamerLookup rotamer_lookup_;
   promod3::loop::AllAtomPositionsPtr pos_buffer_;
   promod3::loop::HydrogenStoragePtr hydrogen_buffer_;
 };
diff --git a/sidechain/src/subrotamer_optimizer.cc b/sidechain/src/subrotamer_optimizer.cc
index 64067573a88c06f741216c3faf6ef8f7254bd788..3594a5bcbe07e39b76c0e1098ac7eb440c031e15 100644
--- a/sidechain/src/subrotamer_optimizer.cc
+++ b/sidechain/src/subrotamer_optimizer.cc
@@ -38,7 +38,7 @@ void SubrotamerOptimizer(std::vector<FRMRotamerPtr>& rotamers,
   }
 
   // generate a graph from the RRMRotamerGroups to find the optimal subrotamers
-  RotamerGraphPtr graph = RotamerGraph::CreateFromRRMList(rrm_rotamer_groups);
+  RotamerGraphPtr graph = RotamerGraph::CreateFromList(rrm_rotamer_groups);
 
   std::pair<std::vector<int>, Real> full_solution = 
   graph->TreeSolve(max_complexity, initial_epsilon);
diff --git a/sidechain/tests/test_frame_construction.cc b/sidechain/tests/test_frame_construction.cc
index edae739c5d13546fd4d3f3f550de1726e6fafc46..5c6801168270bd96ee3ae08bde1c0486fa8ce8b0 100644
--- a/sidechain/tests/test_frame_construction.cc
+++ b/sidechain/tests/test_frame_construction.cc
@@ -59,13 +59,7 @@ void CheckBackboneFrameConstruction(ost::mol::ResidueHandleList& res_list,
     // frame residues
     fr1 = rc.ConstructBackboneFrameResidue(res_list[i], r_id, i,
                                            phi, n_ter, c_ter);
-    const geom::Vec3 n_pos  = all_atoms.GetPos(i, loop::BB_N_INDEX);
-    const geom::Vec3 ca_pos = all_atoms.GetPos(i, loop::BB_CA_INDEX);
-    const geom::Vec3 c_pos  = all_atoms.GetPos(i, loop::BB_C_INDEX);
-    const geom::Vec3 o_pos  = all_atoms.GetPos(i, loop::BB_O_INDEX);
-    if (r_id != GLY) cb_pos = all_atoms.GetPos(i, loop::BB_CB_INDEX);
-    fr2 = rc.ConstructBackboneFrameResidue(n_pos, ca_pos, c_pos, o_pos, cb_pos,
-                                           r_id, i, phi, n_ter, c_ter);
+    fr2 = rc.ConstructBackboneFrameResidue(all_atoms, i, r_id, i, phi, n_ter, c_ter);
     CompareFrameResidues(*fr1, *fr2);
   }
 }
diff --git a/sidechain/tests/test_rotamers.cc b/sidechain/tests/test_rotamers.cc
index 702bfd1d5c246bc7dca25132ea18b29b5ff8a90c..0b49ec0bd4a76442941fdc4555df4ec18aa99c8d 100644
--- a/sidechain/tests/test_rotamers.cc
+++ b/sidechain/tests/test_rotamers.cc
@@ -96,7 +96,6 @@ void CheckRotamerGroupConstruction(ost::mol::ResidueHandleList& res_list,
                                    RotamerLibPtr rot_lib) {
   // check all frames
   BOOST_CHECK_EQUAL(res_list.size(), all_atoms.GetNumResidues());
-  geom::Vec3 cb_pos;
   RRMRotamerGroupPtr rrm1, rrm2;
   FRMRotamerGroupPtr frm1, frm2;
   SCWRLRotamerConstructor rot_constructor;
@@ -108,81 +107,33 @@ void CheckRotamerGroupConstruction(ost::mol::ResidueHandleList& res_list,
     // angles
     const Real phi = (n_ter) ? -1.0472 : all_atoms.GetPhiTorsion(i);
     const Real psi = (c_ter) ? -0.7854 : all_atoms.GetPsiTorsion(i);
-    // pos
-    const geom::Vec3 n_pos  = all_atoms.GetPos(i, loop::BB_N_INDEX);
-    const geom::Vec3 ca_pos = all_atoms.GetPos(i, loop::BB_CA_INDEX);
-    if (r_id != GLY) cb_pos = all_atoms.GetPos(i, loop::BB_CB_INDEX);
     // do it
-    if (r_id == ALA || r_id == GLY) {
-      // should all throw exceptions
-      BOOST_CHECK_THROW(
-             rot_constructor.ConstructRRMRotamerGroup(res_list[i], r_id, i, 
-                                                      bbd_rot_lib,
-                                                      phi, psi),
-             promod3::Error);
-      BOOST_CHECK_THROW(
-             rot_constructor.ConstructRRMRotamerGroup(n_pos, ca_pos, cb_pos, 
-                                                      r_id, i, bbd_rot_lib, 
-                                                      phi, psi),
-             promod3::Error);
-      BOOST_CHECK_THROW(
-             rot_constructor.ConstructRRMRotamerGroup(res_list[i], r_id, i, 
-                                                      rot_lib),
-             promod3::Error);
-      BOOST_CHECK_THROW(
-             rot_constructor.ConstructRRMRotamerGroup(n_pos, ca_pos, cb_pos, 
-                                                      r_id, i, rot_lib),
-             promod3::Error);
-      BOOST_CHECK_THROW(
-             rot_constructor.ConstructFRMRotamerGroup(res_list[i], r_id, i, 
-                                                      bbd_rot_lib,
-                                                      phi, psi),
-             promod3::Error);
-      BOOST_CHECK_THROW(
-             rot_constructor.ConstructFRMRotamerGroup(n_pos, ca_pos, cb_pos, 
-                                                      r_id, i,
-                                                      bbd_rot_lib, 
-                                                      phi, psi),
-             promod3::Error);
-      BOOST_CHECK_THROW(
-             rot_constructor.ConstructFRMRotamerGroup(res_list[i], r_id, i, 
-                                                      rot_lib),
-             promod3::Error);
-      BOOST_CHECK_THROW(
-             rot_constructor.ConstructFRMRotamerGroup(n_pos, ca_pos, cb_pos, 
-                                                      r_id, i, rot_lib),
-             promod3::Error);
-    } else {
-      // RRM ROTAMER (bbdep)
-      rrm1 = rot_constructor.ConstructRRMRotamerGroup(res_list[i], r_id, i, 
-                                                      bbd_rot_lib,
-                                                      phi, psi);
-
-      rrm2 = rot_constructor.ConstructRRMRotamerGroup(n_pos, ca_pos, cb_pos, 
-                                                      r_id, i, bbd_rot_lib, 
-                                                      phi, psi);
-      CompareRotamerGroups(*rrm1, *rrm2);
-      // RRM ROTAMER (non-bbdep)
-      rrm1 = rot_constructor.ConstructRRMRotamerGroup(res_list[i], r_id, i, 
-                                                      rot_lib);
-      rrm2 = rot_constructor.ConstructRRMRotamerGroup(n_pos, ca_pos, cb_pos, 
-                                                      r_id, i, rot_lib);
-      CompareRotamerGroups(*rrm1, *rrm2);
-      // FRM ROTAMER (bbdep)
-      frm1 = rot_constructor.ConstructFRMRotamerGroup(res_list[i], r_id, i, 
-                                                      bbd_rot_lib,
-                                                      phi, psi);
-      frm2 = rot_constructor.ConstructFRMRotamerGroup(n_pos, ca_pos, cb_pos, 
-                                                      r_id, i, bbd_rot_lib, 
-                                                      phi, psi);
-      CompareRotamerGroups(*frm1, *frm2);
-      // RRM ROTAMER (non-bbdep)
-      frm1 = rot_constructor.ConstructFRMRotamerGroup(res_list[i], r_id, i, 
-                                                      rot_lib);
-      frm2 = rot_constructor.ConstructFRMRotamerGroup(n_pos, ca_pos, cb_pos, 
-                                                      r_id, i, rot_lib);
-      CompareRotamerGroups(*frm1, *frm2);
-    }
+    // RRM ROTAMER (bbdep)
+    rrm1 = rot_constructor.ConstructRRMRotamerGroup(res_list[i], r_id, i, 
+                                                    bbd_rot_lib,
+                                                    phi, psi);
+
+    rrm2 = rot_constructor.ConstructRRMRotamerGroup(all_atoms, i, r_id, i, 
+                                                    bbd_rot_lib, phi, psi);
+    CompareRotamerGroups(*rrm1, *rrm2);
+    // RRM ROTAMER (non-bbdep)
+    rrm1 = rot_constructor.ConstructRRMRotamerGroup(res_list[i], r_id, i, 
+                                                    rot_lib);
+    rrm2 = rot_constructor.ConstructRRMRotamerGroup(all_atoms, i, r_id, i, 
+                                                    rot_lib);
+    CompareRotamerGroups(*rrm1, *rrm2);
+    // FRM ROTAMER (bbdep)
+    frm1 = rot_constructor.ConstructFRMRotamerGroup(res_list[i], r_id, i, 
+                                                    bbd_rot_lib, phi, psi);
+    frm2 = rot_constructor.ConstructFRMRotamerGroup(all_atoms, i, r_id, i, 
+                                                    bbd_rot_lib, phi, psi);
+    CompareRotamerGroups(*frm1, *frm2);
+    // RRM ROTAMER (non-bbdep)
+    frm1 = rot_constructor.ConstructFRMRotamerGroup(res_list[i], r_id, i, 
+                                                    rot_lib);
+    frm2 = rot_constructor.ConstructFRMRotamerGroup(all_atoms, i, r_id, i, 
+                                                    rot_lib);
+    CompareRotamerGroups(*frm1, *frm2);
   }
 }