#!/usr/bin/env python

# Jacob Joseph
# 21 Sept 2009

# Profile graph building

import cProfile
from JJnetstat import stathelper
from DurandDB import blastq

nc_id = 750
stype = 'nc_score'
min_score = 0.8
cacheq = False



#stathelper.nxstat_duranddb( nc_id=nc_id, stype=stype, min_score = min_score,
#                            cacheq = cacheq)



# 123 seconds
#bq = blastq.blastq ()
#iterator = bq.fetch_hits_iter(nc_id=nc_id, stype=stype, thresh=min_score)
#cProfile.runctx( "for a in iterator: pass", globals(), locals())


shlp = stathelper.nxstat_duranddb( nc_id=nc_id, stype=stype, min_score = min_score, cacheq = cacheq,
                            build_graph = False)

cProfile.runctx( "shlp.build_graph_sql(None, nc_id, stype, min_score, None)",
                 globals(), locals())

