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.
20 for i
in range(0,int(2.0/resolution))]
25 p.set_radius(resolution/2.0)
27 p.set_radius(.4*resolution)
28 order=[eps[0]]+ps+[eps[1]]
31 for i,p
in enumerate(order):
41 r.set_maximum_score(0.01)
46 vs= [g.get_center(i)
for i
in g.get_all_indexes()]
47 print "States are", vs
51 pst.set_particle_states(p, states)
57 r.set_log_level(IMP.base.SILENT)
58 rc.add_restraints([r])
61 s.set_check_level(IMP.base.NONE)
66 s.set_subset_filter_tables([ef, rssft])
74 sts= s.get_sample_assignments(alls)
77 rmf= RMF.create_rmf_file(IMP.create_temporary_file_name(
"cache",
".rmf"))
78 print "saving configurations to", rmf.get_name()
85 domino_restraints= rc.get_restraints()
87 for r
in domino_restraints:
88 IMP.show_restraint_hierarchy(r)
92 print "found assignments", sts
94 for i, s
in enumerate(sts):
98 for r
in domino_restraints:
99 rc.load_last_score(r, alls, s)