Skip to content

Commit

Permalink
Don't use the implicit Model scoring function.
Browse files Browse the repository at this point in the history
  • Loading branch information
benmwebb committed Jul 2, 2015
1 parent c05840d commit 7c0df23
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions integrative_modeling/run_modeling.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def link_domains(self,prot, resrangelist, kappa):
pr=IMP.core.PairRestraint(dps,IMP.ParticlePair(p0,p1))
rs.add_restraint(pr)

self.m.add_restraint(rs)
self.all_restraints.add_restraint(rs)
self.rest_set[('link',prot)]=rs

#####################################################
Expand All @@ -80,7 +80,7 @@ def add_excluded_volume(self,prot,kappa):
lsa.add_particles(atoms)
evr=IMP.core.ExcludedVolumeRestraint(lsa,kappa)
rs.add_restraint(evr)
self.m.add_restraint(rs)
self.all_restraints.add_restraint(rs)
self.rest_set[('exvo',prot)]=rs

#####################################################
Expand Down Expand Up @@ -110,7 +110,7 @@ def add_symmetry_excluded_volume(self,prot_ref,prot_symm_list,kappa):
evr3=IMP.container.PairsRestraint(ssps,cbpc)
rs.add_restraint(evr3)

self.m.add_restraint(rs)
self.all_restraints.add_restraint(rs)
self.rest_set[('exvo_symm',prot_ref)]=rs

#####################################################
Expand All @@ -127,7 +127,7 @@ def add_external_barrier(self,rad,prot):
lsc.add_particles(IMP.atom.get_leaves(prot))
r3= IMP.container.SingletonsRestraint(ss3, lsc)
rs.add_restraint(r3)
self.m.add_restraint(rs)
self.all_restraints.add_restraint(rs)
self.rest_set[('barr',prot)]=rs

#####################################################
Expand Down Expand Up @@ -245,7 +245,7 @@ def cross_link_ms_simple_symmetrized_create(self,prot1,prot2,restraints_file):
self.pairs.append((p1, p2, crosslinker, rs_name, 100, 100, (r1,c1), (r2,c2), crosslinker, ln))


self.m.add_restraint(rs)
self.all_restraints.add_restraint(rs)
self.rest_set["xlms"]=rs

##############################################
Expand Down Expand Up @@ -274,7 +274,7 @@ def add_em_map(self,filename,domains,resname):
density_threshold = IMP.em.get_threshold_for_approximate_mass(map, 1.25*mass)
efr = IMP.em.EnvelopeFitRestraint(particles, map, 11.0, 5.0)
efr.set_weight(6.)
self.m.add_restraint(efr)
self.all_restraints.add_restraint(efr)
self.rest_set[(resname,self.prot[icopy])]=efr

#####################################################
Expand Down Expand Up @@ -308,14 +308,15 @@ def add_template_restraint(self,ps1,ps2,label):
pr=IMP.core.PairRestraint(dps,IMP.ParticlePair(p1,p2))
rset.add_restraint(pr)

self.m.add_restraint(rset)
self.all_restraints.add_restraint(rset)
self.rest_set[('Template_Restraint_'+label)]=rset


#####################################################

def setup_rigid_body_MonteCarlo(self,mc_kt,mc_dx=0.3,mc_dang=0.1,bm_dr=0.5,set_return_best=False):
mc=IMP.core.MonteCarlo(self.m)
mc.set_scoring_function(self.all_restraints)
mc.set_return_best(set_return_best)
mc.set_kt(mc_kt)
#create a list of rigid body movers for a serial mover
Expand Down Expand Up @@ -363,7 +364,7 @@ def write_stats(self):

output={}
output["Nframe"]=self.nframe
output["Total_Score"]=self.m.evaluate(False)
output["Total_Score"]=self.all_restraints.evaluate(False)

for i in range(len(self.pairs)):

Expand Down Expand Up @@ -416,7 +417,7 @@ def test_scores(self):
initialscores=eval(l)

output={}
output["Total_Score"]=self.m.evaluate(False)
output["Total_Score"]=self.all_restraints.evaluate(False)

aae(float(initialscores["Total_Score"]),output["Total_Score"],7,"Total_Score: test failed")

Expand Down Expand Up @@ -570,6 +571,7 @@ def setup_and_run(self,test=False):


self.m = IMP.Model()
self.all_restraints = IMP.RestraintSet(self.m, "All restraints")

#####################################################
#read pdb
Expand Down

0 comments on commit 7c0df23

Please sign in to comment.