Caching restraint scores so that restraints are not evaluated repeatedly for the same configuration is an important part of domino. Without caching, sub assignments that are shared between subsets will be rescored. The IMP::domino::RestraintCache provides a centralized place for this. To use it, one creates one and then adds the restraints you want to use for filtering and scoring to it. You can then pass the cache to the IMP::domino::RestraintScoreFilterTable and it will filter based on those restraints. You can also extract scores from the table directly, using it to manage the loading of particle states.
31 for i
in range(0, int(2.0 / resolution))]
37 p.set_radius(resolution / 2.0)
39 p.set_radius(.4 * resolution)
40 order = [eps[0]] + ps + [eps[1]]
43 for i, p
in enumerate(order):
53 r.set_maximum_score(0.01)
57 resolution, IMP.algebra.get_unit_bounding_box_3d())
59 vs = [g.get_center(i)
for i
in g.get_all_indexes()]
60 print(
"States are", vs)
64 pst.set_particle_states(p, states)
69 r.set_log_level(IMP.SILENT)
70 rc.add_restraints([r])
74 s.set_check_level(IMP.NONE)
79 s.set_subset_filter_tables([ef, rssft])
87 sts = s.get_sample_assignments(alls)
91 print(
"saving configurations to", rmf.get_name())
98 domino_restraints = rc.get_restraints()
100 for r
in domino_restraints:
105 print(
"found assignments", sts)
107 for i, s
in enumerate(sts):
111 for r
in domino_restraints:
112 rc.load_last_score(r, alls, s)