diff --git a/CMakeLists.txt b/CMakeLists.txt index 4032c98398459f76e46ca43a81562b531adaa856..1bf4ce892a9344af2b897a1e3992d750417d94a9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,7 +15,7 @@ include(PROMOD3) set(PROMOD3_VERSION_MAJOR 1) set(PROMOD3_VERSION_MINOR 0) -set(PROMOD3_VERSION_PATCH 1) +set(PROMOD3_VERSION_PATCH 2) set(PROMOD3_VERSION_STRING ${PROMOD3_VERSION_MAJOR}.${PROMOD3_VERSION_MINOR}) set(PROMOD3_VERSION_STRING ${PROMOD3_VERSION_STRING}.${PROMOD3_VERSION_PATCH}) diff --git a/modelling/pymod/_closegaps.py b/modelling/pymod/_closegaps.py index 903c30f851592e8151cdf2c48327ed53231e8021..99a536ff13289ad1d42bdec2143531aff5bdf913 100644 --- a/modelling/pymod/_closegaps.py +++ b/modelling/pymod/_closegaps.py @@ -14,7 +14,10 @@ import sys ############################################################################### # helper functions def _GetGapExtender(mhandle, actual_gap, use_scoring_extender, - use_full_extender=True, max_length=-1): + use_full_extender, max_length=-1): + # DO NOT USE full ext. with max_len = -1 as this can use LOTS of memory + if use_full_extender and max_length < 0: + raise RuntimeError("Cannot use neg. max_length with full extender!") # return appropriate gap extender actual_chain_idx = actual_gap.GetChainIndex() if use_scoring_extender: @@ -32,9 +35,7 @@ def _GetGapExtender(mhandle, actual_gap, use_scoring_extender, mhandle.seqres[actual_chain_idx], max_length) else: - return ScoringGapExtender(actual_gap, 0.8, - extender_penalties, - mhandle.seqres[actual_chain_idx]) + raise RuntimeError("Cannot use ScoringGapExtender w/o max_length.") else: if use_full_extender: return FullGapExtender(actual_gap, @@ -753,9 +754,12 @@ def FillLoopsByMonteCarlo(mhandle, scorer, torsion_sampler, max_loops_to_search= found_loops = 0 # currently extended gap and gap-extender actual_gap = gap_orig.Copy() + # each extension can make it at most 1 longer... + max_loop_len = gap_orig.length + max_extension actual_extender = _GetGapExtender(mhandle, actual_gap, use_scoring_extender, - use_full_extender) + use_full_extender, + max_loop_len) actual_chain_idx = actual_gap.GetChainIndex() # iteratively extend actual_gap ext_step = 0