diff --git a/modelling/pymod/_closegaps.py b/modelling/pymod/_closegaps.py index 9b960da0c62455ccd6bedf7e8f15c2fc25b190a7..95b94dfcc0b22859aa3f1c8540a248fa2a2603b4 100644 --- a/modelling/pymod/_closegaps.py +++ b/modelling/pymod/_closegaps.py @@ -149,11 +149,15 @@ def _GetBestLC(mhandle, loop_candidates, start_resnum, chain_idx, # extract relevant loop candidates and scores aa_loop_candidates = loop_candidates.Extract(min_indices) for key in all_scores: - all_scores[key] = all_scores[key][min_indices] - # score them w/o relaxation + all_scores[key] = [all_scores[key][i] for i in min_indices] + # keep backup of loop of interest loop_length = len(loop_candidates[0]) loop_backup = aa_sc_env.GetEnvironment(start_resnum, loop_length, chain_idx) + # setup empty lists for AA results + for key in _GetAaScoringKeys(): + all_scores[key] = list() + # score them w/o relaxation for lc_bb_list in aa_loop_candidates: # setup sc env. and reconstruct aa_sc_env.SetEnvironment(lc_bb_list, start_resnum, chain_idx) @@ -161,9 +165,9 @@ def _GetBestLC(mhandle, loop_candidates, start_resnum, chain_idx, # fix env. for scoring (always contains full loop too!) aa_score_env.SetEnvironment(sc_result.env_pos) for key in _GetAaScoringKeys(): - scores = aa_scorer[key].CalculateScore(start_resnum, - loop_length, chain_idx) - all_scores[key] = scores + score = aa_scorer[key].CalculateScore(start_resnum, + loop_length, chain_idx) + all_scores[key].append(score) # reset aa_sc_env aa_sc_env.SetEnvironment(loop_backup) # NOTE: we leave the aa_score_env in a modified state @@ -284,6 +288,9 @@ def _CloseLoopFrame(mhandle, gap_orig, actual_candidates, actual_extended_gaps, # update score env. mhandle.backbone_scorer_env.SetEnvironment(bb_list, start_resnum, actual_chain_idx) + if all_atom: + mhandle.all_atom_sidechain_env.SetEnvironment(bb_list, start_resnum, + actual_chain_idx) ost.LogInfo("Resolved %s by filling %s (%d candidates)" % \ (str(gap_orig), str(actual_extended_gaps[idx_a]),