コード例 #1
0
ファイル: server.py プロジェクト: JoshDaly/TrackM
    def makeHits(self,
                 queueURL,       # the queue we'll be sending work to
                 commsPort,      # port we'll be asked for progress etc on
                 portRange,      # the total number of concurrent pairs we can handle
                 sgeBaseDir,     # where to write SGE scripts to
                 workingDir,     # where tmp files will be stored
                 batches=[],     # the order to do pairs in
                 hitCache=1000   # number of hits to cache before writing to database
                 ):
        """process any specified outstanding pairs"""
        print ">> DBG " + datetime.datetime.fromtimestamp(time.time()).strftime('%Y-%m-%d %H:%M:%S')
        print "Processing outstanding pairs"

        # set tmp dirs
        self.sgeBaseDir = sgeBaseDir
        self.workingDir = workingDir

        # get hold of the server queue
        self.queueManager = SGE(queueURL)

        VI = ViewInterface(self.dbFileName)
        contig_headers = {}
        if batches != []:
            for batch in batches:
                pairs = VI.getOutstandingPairs(batch=batch)
                if len(pairs) > 0:
                    contig_headers = VI.getContigHeaders()
                    self.processOutstandingPairs(pairs, portRange, contig_headers, hitCache, batch=batch)
        else:
            pairs = VI.getOutstandingPairs()
            if len(pairs) > 0:
                contig_headers = VI.getContigHeaders()
                self.processOutstandingPairs(pairs, portRange, contig_headers, hitCache)
コード例 #2
0
ファイル: seqs.py プロジェクト: JoshDaly/TrackM
    def __init__(self, dbFileName, ani=95, batches=[]):
        # get an interface to the DB
        VI = ViewInterface(dbFileName)

        # build the condition we want to select on and get the hit data
        C = Condition("ani_comp", "<=", ani)
        if len(batches) > 0:
            bc = Condition("batch", "=", batches[0])
            for batch_num in range(1, len(batches)):
                bc = Condition(bc, "or", Condition("batch", "=", batches[batch_num]))
            C = Condition(C, "and", bc)

        seqs = VI.getHitData(C)