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.
29 for i
in range(0, int(2.0 / resolution))]
35 p.set_radius(resolution / 2.0)
37 p.set_radius(.4 * resolution)
38 order = [eps[0]] + ps + [eps[1]]
41 for i, p
in enumerate(order):
52 r.set_maximum_score(0.01)
56 resolution, IMP.algebra.get_unit_bounding_box_3d())
58 vs = [g.get_center(i)
for i
in g.get_all_indexes()]
59 print "States are", vs
63 pst.set_particle_states(p, states)
69 r.set_log_level(IMP.base.SILENT)
70 rc.add_restraints([r])
73 s.set_check_level(IMP.base.NONE)
78 s.set_subset_filter_tables([ef, rssft])
86 sts = s.get_sample_assignments(alls)
89 rmf = RMF.create_rmf_file(IMP.create_temporary_file_name(
"cache",
".rmf"))
90 print "saving configurations to", rmf.get_name()
97 domino_restraints = rc.get_restraints()
99 for r
in domino_restraints:
100 IMP.show_restraint_hierarchy(r)
104 print "found assignments", sts
106 for i, s
in enumerate(sts):
110 for r
in domino_restraints:
111 rc.load_last_score(r, alls, s)