diff --git a/doc/tests/scripts/modelling_close_small_deletions.py b/doc/tests/scripts/modelling_close_small_deletions.py index 54809c2fdb1591cce6257fcca98ceb1e47baaf5c..80e8c3e590b9bd3d4d80449ee34bb7eac4c68263 100644 --- a/doc/tests/scripts/modelling_close_small_deletions.py +++ b/doc/tests/scripts/modelling_close_small_deletions.py @@ -9,6 +9,5 @@ aln.AttachView(1, tpl.CreateFullView()) mhandle = modelling.BuildRawModel(aln) # close small deletion print 'Number of gaps before: %d' % len(mhandle.gaps) -modelling.SetupDefaultBackboneScorer(mhandle) modelling.CloseSmallDeletions(mhandle) print 'Number of gaps after: %d' % len(mhandle.gaps) diff --git a/doc/tests/scripts/modelling_fill_loops_by_database.py b/doc/tests/scripts/modelling_fill_loops_by_database.py index 16f0944bbf7b86130d3e66412d089da6348cada5..6aaec8a41a098be6c6249db20cad543ef3328e2e 100644 --- a/doc/tests/scripts/modelling_fill_loops_by_database.py +++ b/doc/tests/scripts/modelling_fill_loops_by_database.py @@ -11,7 +11,6 @@ aln.AttachView(1, tpl.CreateFullView()) mhandle = modelling.BuildRawModel(aln) # merge gaps print 'Number of gaps before: %d' % len(mhandle.gaps) -modelling.SetupDefaultBackboneScorer(mhandle) modelling.FillLoopsByDatabase(mhandle, loop.LoadFragDB(), loop.LoadStructureDB(), loop.LoadTorsionSamplerCoil()) diff --git a/doc/tests/scripts/modelling_fill_loops_by_monte_carlo.py b/doc/tests/scripts/modelling_fill_loops_by_monte_carlo.py index e8e02a052f0c533026c85afe3de68e109c24fc84..880c9938721c4c405dde458136883ed3075662a4 100644 --- a/doc/tests/scripts/modelling_fill_loops_by_monte_carlo.py +++ b/doc/tests/scripts/modelling_fill_loops_by_monte_carlo.py @@ -11,7 +11,6 @@ aln.AttachView(1, tpl.CreateFullView()) mhandle = modelling.BuildRawModel(aln) # merge gaps print 'Number of gaps before: %d' % len(mhandle.gaps) -modelling.SetupDefaultBackboneScorer(mhandle) modelling.FillLoopsByMonteCarlo(mhandle, loop.LoadTorsionSamplerCoil()) print 'Number of gaps after: %d' % len(mhandle.gaps) diff --git a/doc/tests/scripts/modelling_model_termini.py b/doc/tests/scripts/modelling_model_termini.py index 464857d455f6cdba5a92b8e1ab6b1482322b74cd..1371741d58099a10acbd790f7b24c182a6a1476d 100644 --- a/doc/tests/scripts/modelling_model_termini.py +++ b/doc/tests/scripts/modelling_model_termini.py @@ -11,7 +11,6 @@ aln.AttachView(1, tpl.CreateFullView()) mhandle = modelling.BuildRawModel(aln) # merge gaps print 'Number of gaps before: %d' % len(mhandle.gaps) -modelling.SetupDefaultBackboneScorer(mhandle) modelling.ModelTermini(mhandle, loop.LoadTorsionSamplerCoil()) print 'Number of gaps after: %d' % len(mhandle.gaps) diff --git a/modelling/doc/pipeline.rst b/modelling/doc/pipeline.rst index 7ae07b4858f1f77c96592261aee018e11de06b58..3c2930ab87d67c47e9bba28cc998a4a38b542ea3 100644 --- a/modelling/doc/pipeline.rst +++ b/modelling/doc/pipeline.rst @@ -199,18 +199,10 @@ Modelling Steps :attr:`~ModellingHandle.backbone_scorer_env` of `mhandle`. :type mhandle: :class:`~promod3.modelling.ModellingHandle` -.. function:: IsBackboneScorerSet(mhandle) +.. function:: IsBackboneScoringSetUp(mhandle) - :return: True, if :attr:`~ModellingHandle.backbone_scorer` of `mhandle` is - set. - :rtype: :class:`bool` - :param mhandle: Modelling handle to check. - :type mhandle: :class:`ModellingHandle` - -.. function:: IsBackboneScorerEnvSet(mhandle) - - :return: True, if :attr:`~ModellingHandle.backbone_scorer_env` of `mhandle` is - set. + :return: True, if :attr:`~ModellingHandle.backbone_scorer` and + :attr:`~ModellingHandle.backbone_scorer_env` of `mhandle` are set. :rtype: :class:`bool` :param mhandle: Modelling handle to check. :type mhandle: :class:`ModellingHandle` diff --git a/modelling/pymod/_closegaps.py b/modelling/pymod/_closegaps.py index dde6c8d7adb5f9dd35e948a93373662a50d022a0..191010924689f6ddb46ac38a945044a8b36a4fbc 100644 --- a/modelling/pymod/_closegaps.py +++ b/modelling/pymod/_closegaps.py @@ -315,8 +315,6 @@ def _CloseLoopBare(mhandle, gap_orig, actual_candidates, actual_extended_gaps, actual_chain_idx = actual_extended_gaps[0].GetChainIndex() # score loops as they are - scorer = mhandle.backbone_scorer - weights = _GetWeights() min_score = float("inf") optimal_gap = None optimal_candidate = None @@ -354,7 +352,6 @@ def _CloseLoopBare(mhandle, gap_orig, actual_candidates, actual_extended_gaps, mhandle.backbone_scorer_env.SetEnvironment(optimal_candidate, start_resnum, actual_chain_idx) - # TODO: remove debug scoring out scor_str = "BB" if actual_db_scores: scor_str += "_DB" @@ -494,18 +491,21 @@ def CloseSmallDeletions(mhandle, max_extension=9, clash_thresh=1.0, prof = core.StaticRuntimeProfiler.StartScoped(prof_name) if len(mhandle.gaps) > 0: - ost.LogInfo("Trying to close small deletions (no. of gap(s): %d)." % \ - len(mhandle.gaps)) + ost.LogInfo("Trying to close small deletions (no. of gap(s): %d)." \ + % len(mhandle.gaps)) else: return + # check/setup scoring + if not IsBackboneScoringSetUp(mhandle): + SetupDefaultBackboneScorer(mhandle) clash_scorer = mhandle.backbone_scorer.Get("clash") - current_gap_index = 0 # iterating mhandle.gaps. The number of gaps may change during the process, # hence we run by 'while', comparing to the updated list of gaps. If a gap # gets closed, it is deleted from mhandle.gaps, otherwise, current_gap_index # as a counter is increased. + current_gap_index = 0 while current_gap_index < len(mhandle.gaps): # in the end this determines if a gap was closed or not success = False @@ -761,6 +761,10 @@ def FillLoopsByDatabase(mhandle, fragment_db, structure_db, else: return + # check/setup scoring + if not IsBackboneScoringSetUp(mhandle): + SetupDefaultBackboneScorer(mhandle) + # some score variants cannot deal with multiple insertions in one "gap" disallow_ins_merge = (score_variant in [0,3]) add_db_features = (len(mhandle.profiles) > 0) @@ -1012,10 +1016,15 @@ def FillLoopsByMonteCarlo(mhandle, torsion_sampler, max_loops_to_search=6, prof = core.StaticRuntimeProfiler.StartScoped(prof_name) if len(mhandle.gaps) > 0: - ost.LogInfo("Trying to fill %d gap(s) by Monte Carlo." % len(mhandle.gaps)) + ost.LogInfo("Trying to fill %d gap(s) by Monte Carlo." \ + % len(mhandle.gaps)) else: return + # check/setup scoring + if not IsBackboneScoringSetUp(mhandle): + SetupDefaultBackboneScorer(mhandle) + # disable AllAtom scoring here if score_variant == 3: score_variant = 0 @@ -1205,8 +1214,6 @@ def CloseGaps(mhandle, merge_distance=4, fragment_db=None, structure_db=None, ''' # load stuff if needed - if not IsBackboneScorerSet(mhandle) or not IsBackboneScorerEnvSet(mhandle): - SetupDefaultBackboneScorer(mhandle) if fragment_db is None: fragment_db = loop.LoadFragDB() if structure_db is None: @@ -1294,6 +1301,12 @@ def ModelTermini(mhandle, torsion_sampler, fragger_handles=None, terminal_gaps = [g.Copy() for g in mhandle.gaps if g.IsTerminal() and g.length > 1] if len(terminal_gaps) > 0: ost.LogInfo("Trying to model %d terminal gap(s)." % len(terminal_gaps)) + else: + return + + # check/setup scoring + if not IsBackboneScoringSetUp(mhandle): + SetupDefaultBackboneScorer(mhandle) # model them for actual_gap in terminal_gaps: @@ -1424,6 +1437,10 @@ def CloseLargeDeletions(mhandle, structure_db, linker_length=8, else: return + # check/setup scoring + if not IsBackboneScoringSetUp(mhandle): + SetupDefaultBackboneScorer(mhandle) + # point to the current gap gap_idx = 0 diff --git a/modelling/pymod/_mtm.py b/modelling/pymod/_mtm.py index 3c4614dac2cb5b49337f13a70f1cee6e8d96a5fc..90cd6fdcce367c43ba2d04f33d7e7ee4bbef44cb 100644 --- a/modelling/pymod/_mtm.py +++ b/modelling/pymod/_mtm.py @@ -971,8 +971,7 @@ def ModelExtensions(seed_rawmodel, alternative_rawmodels, ost.LogInfo(log_string) # make sure the seed has a scorer - if not (IsBackboneScorerSet(seed_rawmodel) and\ - IsBackboneScorerEnvSet(seed_rawmodel)): + if not IsBackboneScoringSetUp(seed_rawmodel): SetupDefaultBackboneScorer(seed_rawmodel) # assign default weights if not given diff --git a/modelling/pymod/_pipeline.py b/modelling/pymod/_pipeline.py index 006ab4abd682c2d607598418570266c932f56db5..acc14cf57955f881310a76d999b4da13968bdbf2 100644 --- a/modelling/pymod/_pipeline.py +++ b/modelling/pymod/_pipeline.py @@ -210,8 +210,6 @@ def BuildSidechains(mhandle, merge_distance=4, fragment_db=None, mygap = StructuralGap(res.prev, res.next, res.one_letter_code) mhandle.gaps.append(mygap) # load stuff if needed - if not IsBackboneScorerSet(mhandle) or not IsBackboneScorerEnvSet(mhandle): - SetupDefaultBackboneScorer(mhandle) if fragment_db is None: fragment_db = loop.LoadFragDB() if structure_db is None: @@ -417,12 +415,10 @@ def BuildFromRawModel(mhandle, alternative_mhandles=None, modelling pipeline. For reproducibility, we recommend that you keep copies of custom pipelines. - If you wish to adapt the scoring used during loop closing, you can set - :attr:`~ModellingHandle.backbone_scorer` and - :attr:`~ModellingHandle.backbone_scorer_env` of `mhandle`, but you must - ensure that both are set and are consistent. Alternatively, you can call - :func:`SetupDefaultBackboneScorer` and adapt the default scorer and score - environment for your purposes. + If you wish to adapt the scoring used during loop closing, you can set the + scorers manually, but you must ensure consistency yourself! Alternatively, + you can call :func:`SetupDefaultBackboneScorer` and adapt the default scorer + and score environment for your purposes. If the function fails to close all gaps, it will produce a warning and return an incomplete model. @@ -464,11 +460,6 @@ def BuildFromRawModel(mhandle, alternative_mhandles=None, torsion_sampler = loop.LoadTorsionSamplerCoil() merge_distance = 4 - if IsBackboneScorerSet(mhandle) and IsBackboneScorerEnvSet(mhandle): - ost.LogInfo("Using scorer which is already set in modelling handle.") - else: - SetupDefaultBackboneScorer(mhandle) - # try to extend terminal coverage using alternative rawmodels if alternative_mhandles != None: # iterate extensions until nothing happens anymore diff --git a/modelling/pymod/export_model.cc b/modelling/pymod/export_model.cc index 5acd1fa11600415055d3a0dee06c35fdae62abe9..8781f1b2c28ae557b3fc13d3c2a875e1f94edbf9 100644 --- a/modelling/pymod/export_model.cc +++ b/modelling/pymod/export_model.cc @@ -65,14 +65,6 @@ void WrapSetPsipredPredictions(ModellingHandle& mhandle, SetPsipredPredictions(mhandle, v_predictions); } -// not really needed in C++ as we can do the check below directly -bool WrapIsBackboneScorerSet(ModellingHandle& mhandle) { - return bool(mhandle.backbone_scorer); -} -bool WrapIsBackboneScorerEnvSet(ModellingHandle& mhandle) { - return bool(mhandle.backbone_scorer_env); -} - boost::python::list WrapPsipredPredictionAccess(ModellingHandle& mhandle){ boost::python::list return_list; promod3::core::AppendVectorToList(mhandle.psipred_predictions, return_list); @@ -110,9 +102,12 @@ void export_model() def("MergeGaps", MergeGaps, (arg("mhandle"),arg("index"))); def("RemoveTerminalGaps", RemoveTerminalGaps, (arg("mhandle"))); def("ReorderGaps", &ReorderGaps, (arg("mhandle"))); - def("SetupDefaultBackboneScorer", &SetupDefaultBackboneScorer, (arg("mhandle"))); - def("SetSequenceProfiles", &WrapSetSequenceProfiles, (arg("mhandle"),arg("profiles"))); - def("SetPsipredPredictions", &WrapSetPsipredPredictions, (arg("mhandle"),arg("psipred_predictions"))); + def("SetupDefaultBackboneScorer", &SetupDefaultBackboneScorer, + (arg("mhandle"))); + def("SetSequenceProfiles", &WrapSetSequenceProfiles, + (arg("mhandle"), arg("profiles"))); + def("SetPsipredPredictions", &WrapSetPsipredPredictions, + (arg("mhandle"), arg("psipred_predictions"))); def("MergeMHandle", &MergeMHandle, (arg("source_mhandle"), arg("target_mhandle"), arg("source_chain_idx"), @@ -121,8 +116,7 @@ void export_model() arg("end_resnum"), arg("transform"), arg("reset_scoring_env") = true)); - def("IsBackboneScorerSet", &WrapIsBackboneScorerSet, (arg("mhandle"))); - def("IsBackboneScorerEnvSet", &WrapIsBackboneScorerEnvSet, (arg("mhandle"))); + def("IsBackboneScoringSetUp", &IsBackboneScoringSetUp, (arg("mhandle"))); def("BuildRawModel", BuildRawModelHandle, (arg("aln"), arg("include_ligands")=false, diff --git a/modelling/src/model.cc b/modelling/src/model.cc index b2a292a9c0c8a9c3afd49261a5e9d9eb1048735d..5cd31c4cd0bf1e220132cb2dec89bf82070c3b8d 100644 --- a/modelling/src/model.cc +++ b/modelling/src/model.cc @@ -594,7 +594,7 @@ void MergeMHandle(const ModellingHandle& source_mhandle, //finally reorder the gaps to ensure consistency ReorderGaps(target_mhandle); - if(reset_scoring_env && target_mhandle.backbone_scorer_env){ + if (reset_scoring_env && target_mhandle.backbone_scorer_env) { target_mhandle.backbone_scorer_env->SetInitialEnvironment(target_mhandle.model); } } diff --git a/modelling/src/model.hh b/modelling/src/model.hh index afebc691db3eee1b9487a7b5198f5a0900e6668e..330dc17209050df5e1cb3f2b62e3e5dde986e2ea 100644 --- a/modelling/src/model.hh +++ b/modelling/src/model.hh @@ -55,11 +55,15 @@ void MergeGaps(ModellingHandle& mhandle, uint index); // see Python doc int RemoveTerminalGaps(ModellingHandle& mhandle); -//see Python doc +// see Python doc void ReorderGaps(ModellingHandle& mhandle); -//see Python doc +// see Python doc void SetupDefaultBackboneScorer(ModellingHandle& mhandle); +// see Python doc +inline bool IsBackboneScoringSetUp(ModellingHandle& mhandle) { + return bool(mhandle.backbone_scorer) && bool(mhandle.backbone_scorer_env); +} // see Python doc void SetSequenceProfiles(ModellingHandle& mhandle, diff --git a/modelling/tests/test_close_gaps.py b/modelling/tests/test_close_gaps.py index f7bc1298acf7861e0f8d90f266dc998a7de3f761..60bec07df9d8ba436cc07b12a1c7a0726ce26ca2 100644 --- a/modelling/tests/test_close_gaps.py +++ b/modelling/tests/test_close_gaps.py @@ -162,7 +162,6 @@ class CloseGapsTests(unittest.TestCase): mhandle = modelling.BuildRawModel(aln) self.assertEqual(len(mhandle.gaps), 1) # close it - modelling.SetupDefaultBackboneScorer(mhandle) nlogs = len(self.log.messages['INFO']) modelling.CloseSmallDeletions(mhandle) self.assertEqual(len(mhandle.gaps), 0) @@ -190,7 +189,6 @@ class CloseGapsTests(unittest.TestCase): mhandle = modelling.BuildRawModel(alns) self.assertEqual(len(mhandle.gaps), 2) # do it - modelling.SetupDefaultBackboneScorer(mhandle) modelling.CloseSmallDeletions(mhandle) # check self.assertEqual(len(mhandle.gaps), 0) @@ -287,7 +285,6 @@ class CloseGapsTests(unittest.TestCase): def testFillGapsByDatabase(self): '''Get rid of 2 gaps by db.''' mhandle = self.getGapTest() - modelling.SetupDefaultBackboneScorer(mhandle) modelling.FillLoopsByDatabase(mhandle, self.frag_db, self.structure_db, self.torsion_sampler) @@ -299,7 +296,6 @@ class CloseGapsTests(unittest.TestCase): def testFillGapsByDatabaseDeletion(self): '''Get rid of deletion by db.''' mhandle = self.getGapTestDeletion() - modelling.SetupDefaultBackboneScorer(mhandle) modelling.FillLoopsByDatabase(mhandle, self.frag_db, self.structure_db, self.torsion_sampler) @@ -311,7 +307,6 @@ class CloseGapsTests(unittest.TestCase): def testFillGapsByDatabaseInsertion(self): '''Get rid of insertion by db.''' mhandle = self.getGapTestInsertion() - modelling.SetupDefaultBackboneScorer(mhandle) modelling.FillLoopsByDatabase(mhandle, self.frag_db, self.structure_db, self.torsion_sampler) @@ -323,7 +318,6 @@ class CloseGapsTests(unittest.TestCase): def testFillGapsByDatabaseInsertionTerminal(self): '''Get rid of insertion by db close to terminal (needs FullExtender).''' mhandle = self.getGapTestInsertionTerminal() - modelling.SetupDefaultBackboneScorer(mhandle) modelling.FillLoopsByDatabase(mhandle, self.frag_db, self.structure_db, self.torsion_sampler, @@ -336,7 +330,6 @@ class CloseGapsTests(unittest.TestCase): def testFillGapsByDatabaseTerminal(self): '''Terminal loops are not altered.''' mhandle = self.getGapTestTerminal() - modelling.SetupDefaultBackboneScorer(mhandle) modelling.FillLoopsByDatabase(mhandle, self.frag_db, self.structure_db, self.torsion_sampler) @@ -345,7 +338,6 @@ class CloseGapsTests(unittest.TestCase): def testFillGapsByDatabaseNoSE(self): '''Get rid of 2 gaps by db (without scoring extender).''' mhandle = self.getGapTest() - modelling.SetupDefaultBackboneScorer(mhandle) modelling.FillLoopsByDatabase(mhandle, self.frag_db, self.structure_db, self.torsion_sampler, @@ -358,7 +350,6 @@ class CloseGapsTests(unittest.TestCase): def testFillGapsByDatabaseDeletionNoSE(self): '''Get rid of deletion by db (without scoring extender).''' mhandle = self.getGapTestDeletion() - modelling.SetupDefaultBackboneScorer(mhandle) modelling.FillLoopsByDatabase(mhandle, self.frag_db, self.structure_db, self.torsion_sampler, @@ -371,7 +362,6 @@ class CloseGapsTests(unittest.TestCase): def testFillGapsByDatabaseInsertionNoSE(self): '''Get rid of insertion by db (without scoring extender).''' mhandle = self.getGapTestInsertion() - modelling.SetupDefaultBackboneScorer(mhandle) modelling.FillLoopsByDatabase(mhandle, self.frag_db, self.structure_db, self.torsion_sampler, @@ -384,7 +374,6 @@ class CloseGapsTests(unittest.TestCase): def testFillGapsByDatabaseTerminalNoSE(self): '''Terminal loops are not altered (without scoring extender).''' mhandle = self.getGapTestTerminal() - modelling.SetupDefaultBackboneScorer(mhandle) modelling.FillLoopsByDatabase(mhandle, self.frag_db, self.structure_db, self.torsion_sampler, @@ -394,7 +383,6 @@ class CloseGapsTests(unittest.TestCase): def testFillGapsByDatabaseHomoOligomer(self): '''Get rid of 2 gaps by db for homo oligomers.''' mhandle = self.getRawModelOligo("data/2aoh-1_cut") - modelling.SetupDefaultBackboneScorer(mhandle) modelling.FillLoopsByDatabase(mhandle, self.frag_db, self.structure_db, self.torsion_sampler) @@ -404,7 +392,6 @@ class CloseGapsTests(unittest.TestCase): def testFillGapsByDatabaseHeteroOligomer(self): '''Get rid of 2 gaps by db for hetero oligomers.''' mhandle = self.getRawModelOligo("data/5d52-1_cut") - modelling.SetupDefaultBackboneScorer(mhandle) modelling.FillLoopsByDatabase(mhandle, self.frag_db, self.structure_db, self.torsion_sampler) @@ -416,7 +403,6 @@ class CloseGapsTests(unittest.TestCase): def testFillGapsByMonteCarlo(self): '''Get rid of 2 gaps by MC.''' mhandle = self.getGapTest() - modelling.SetupDefaultBackboneScorer(mhandle) modelling.FillLoopsByMonteCarlo(mhandle, self.torsion_sampler, mc_steps=100) self.assertEqual(len(mhandle.gaps), 0) @@ -427,7 +413,6 @@ class CloseGapsTests(unittest.TestCase): def testFillGapsByMonteCarloDeletion(self): '''Get rid of deletion by MC.''' mhandle = self.getGapTestDeletion() - modelling.SetupDefaultBackboneScorer(mhandle) modelling.FillLoopsByMonteCarlo(mhandle, self.torsion_sampler, mc_steps=100) self.assertEqual(len(mhandle.gaps), 0) @@ -438,7 +423,6 @@ class CloseGapsTests(unittest.TestCase): def testFillGapsByMonteCarloInsertion(self): '''Get rid of insertion by MC.''' mhandle = self.getGapTestInsertion() - modelling.SetupDefaultBackboneScorer(mhandle) modelling.FillLoopsByMonteCarlo(mhandle, self.torsion_sampler, mc_steps=100) self.assertEqual(len(mhandle.gaps), 0) @@ -449,7 +433,6 @@ class CloseGapsTests(unittest.TestCase): def testFillGapsByMonteCarloTerminal(self): '''Terminal loops are not altered.''' mhandle = self.getGapTestTerminal() - modelling.SetupDefaultBackboneScorer(mhandle) modelling.FillLoopsByMonteCarlo(mhandle, self.torsion_sampler, mc_steps=100) self.assertEqual(len(mhandle.gaps), 2) @@ -457,7 +440,6 @@ class CloseGapsTests(unittest.TestCase): def testFillGapsByMonteCarloHomoOligomer(self): '''Get rid of 2 gaps by db for homo oligomers.''' mhandle = self.getRawModelOligo("data/2aoh-1_cut") - modelling.SetupDefaultBackboneScorer(mhandle) modelling.FillLoopsByMonteCarlo(mhandle, self.torsion_sampler, mc_steps=100) self.assertEqual(len(mhandle.gaps), 0) @@ -466,7 +448,6 @@ class CloseGapsTests(unittest.TestCase): def testFillGapsByMonteCarloHeteroOligomer(self): '''Get rid of 2 gaps by db for hetero oligomers.''' mhandle = self.getRawModelOligo("data/5d52-1_cut") - modelling.SetupDefaultBackboneScorer(mhandle) modelling.FillLoopsByMonteCarlo(mhandle, self.torsion_sampler, mc_steps=100) self.assertEqual(len(mhandle.gaps), 0) @@ -482,7 +463,6 @@ class CloseGapsTests(unittest.TestCase): mhandle = modelling.BuildRawModel(aln) self.assertEqual(len(mhandle.gaps), 3) # model termini - modelling.SetupDefaultBackboneScorer(mhandle) modelling.ModelTermini(mhandle, self.torsion_sampler, mc_steps=100) self.assertEqual(len(mhandle.gaps), 1) @@ -512,7 +492,6 @@ class CloseGapsTests(unittest.TestCase): mhandle = modelling.BuildRawModel(alns) self.assertEqual(len(mhandle.gaps), 4) # model termini - modelling.SetupDefaultBackboneScorer(mhandle) modelling.ModelTermini(mhandle, self.torsion_sampler, mc_steps=100) self.assertEqual(len(mhandle.gaps), 0) @@ -529,7 +508,6 @@ class CloseGapsTests(unittest.TestCase): seq.CreateSequence('tpl', 'NGGTLLIPNGTYHFLGIQMKSNVHIRVE')) aln.AttachView(1, tpl.CreateFullView()) mhandle = modelling.BuildRawModel(aln) - modelling.SetupDefaultBackboneScorer(mhandle) self.assertEqual(len(mhandle.gaps), 1) modelling.CloseLargeDeletions(mhandle, self.structure_db, num_fragments=100) @@ -545,7 +523,6 @@ class CloseGapsTests(unittest.TestCase): seq.CreateSequence('tpl', 'NGGTLLIPNGTYHFLGIQMKSNVHIRVE')) aln.AttachView(1, tpl.CreateFullView()) mhandle = modelling.BuildRawModel(aln) - modelling.SetupDefaultBackboneScorer(mhandle) modelling.MergeGapsByDistance(mhandle, 1) self.assertEqual(len(mhandle.gaps), 1) modelling.CloseLargeDeletions(mhandle, self.structure_db, @@ -562,7 +539,6 @@ class CloseGapsTests(unittest.TestCase): seq.CreateSequence('tpl', 'NGGTLLIPNGTYHFLGIQMKSNVHIRVE')) aln.AttachView(1, tpl.CreateFullView()) mhandle = modelling.BuildRawModel(aln) - modelling.SetupDefaultBackboneScorer(mhandle) self.assertEqual(len(mhandle.gaps), 1) modelling.CloseLargeDeletions(mhandle, self.structure_db, num_fragments=100) @@ -579,7 +555,6 @@ class CloseGapsTests(unittest.TestCase): aln.AttachView(1, tpl.CreateFullView()) mhandle = modelling.BuildRawModel(aln) modelling.RemoveTerminalGaps(mhandle) - modelling.SetupDefaultBackboneScorer(mhandle) self.assertEqual(len(mhandle.gaps), 1) modelling.CloseLargeDeletions(mhandle, self.structure_db, num_fragments=100) @@ -602,7 +577,6 @@ class CloseGapsTests(unittest.TestCase): alns.append(aln_A) alns.append(aln_B) mhandle = modelling.BuildRawModel(alns) - modelling.SetupDefaultBackboneScorer(mhandle) self.assertEqual(len(mhandle.gaps), 2) modelling.CloseLargeDeletions(mhandle, self.structure_db, num_fragments=100) diff --git a/modelling/tests/test_pipeline.py b/modelling/tests/test_pipeline.py index acaa032be02e4ae2ac086480aa5b89fcf505e37c..50c3d97b8eae10309a067a235e6eadd33d371b69 100644 --- a/modelling/tests/test_pipeline.py +++ b/modelling/tests/test_pipeline.py @@ -44,7 +44,6 @@ from promod3 import loop, modelling, core # io.SavePDB(final_model, 'data/1crn_build.pdb') # # step-by-step - loop # mhandle = modelling.BuildRawModel(aln) -# modelling.SetupDefaultBackboneScorer(mhandle) # frag_db = loop.LoadFragDB() # structure_db = loop.LoadStructureDB() # torsion_sampler = loop.LoadTorsionSamplerCoil() @@ -218,7 +217,6 @@ class PipelineTests(unittest.TestCase): def testLoopReconstruction(self): '''Check loop reconstruction.''' mhandle = self.getRawModel() - modelling.SetupDefaultBackboneScorer(mhandle) modelling.FillLoopsByDatabase(mhandle, self.frag_db, self.structure_db, self.torsion_sampler)