How many particles are you using: I get about 1s for 1000 particles, which, given you have to compute a million distances, isn't too bad.
import IMP import IMP.core import time
i=0 m= IMP.Model() ub = IMP.core.HarmonicUpperBound(1.0, 0.1) ss= IMP.core.DistancePairScore(ub) ps = IMP.core.create_xyzr_particles(m, 1000, .1) r= IMP.core.ConnectivityRestraint(ss) r.set_particles(ps) m.add_restraint(r)
beg = time.time() m.evaluate(None) end = time.time() dt = end - beg print 'connectivity restraint calculation took %9.6f Seconds' % (dt)
Keren Lasker wrote: > just for the records, > Ben suggested compiling with release=true, which reduced the running > time to ~7 seconds. > I still think we should consider a faster implementation. Maybe use > geometric hashing to query close particles in space. > On Jan 26, 2009, at 9:43 PM, Keren Lasker wrote: > >> hi all, >> >> I am writing a test case for adding hierarchy support in DOMINO, and >> it seems that the connectivity restraint works incredibly >> sssllllooowww between two proteins each of ~100 residues. >> >> i=0 >> ub = IMP.core.HarmonicUpperBound(1.0, 0.1) >> ss= IMP.core.DistancePairScore(ub) >> r= IMP.core.ConnectivityRestraint(ss) >> ps = IMP.Particles() >> ps_refined=[] >> for j in xrange(2): >> >> ps_refined.append(IMP.core.hierarchy_get_leaves(self.h_particles[i+j])) >> ps.append(self.particles[i+j]) >> for e in ps_refined: >> r.add_particles(e) >> >> beg = time.time() >> r.evaluate(None) >> end = time.time() >> dt = end - beg >> print 'connectivity restraint calculation took %9.6f Seconds' % (dt) >> >> The evaluate function takes ~20 seconds. >> >> am I missing something here? is there a faster implementation using >> some external library ? >> >> thanks, >> Keren. >> >> >> _______________________________________________ >> IMP-dev mailing list >> IMP-dev@salilab.org >> https://salilab.org/mailman/listinfo/imp-dev > > _______________________________________________ > IMP-dev mailing list > IMP-dev@salilab.org > https://salilab.org/mailman/listinfo/imp-dev