示例#1
0
文件: server.py 项目: JoshDaly/TrackM
    def importNewPairs(self,
                      pairs,     # csv containing information about new pairs to process
                      paths     # absolute paths to new genome fasta files referenced in pairs
                      ):
        print "Importing new pairs from: %s" % pairs
        print "Import full contig file paths from: %s" % paths

        # get an interface to the file
        II = ImportInterface(self.dbFileName)

        # import paths first
        with open(paths, "r") as paths_fh:
            II.importGenomes(paths_fh)

        # import genomes next
        with open(pairs, "r") as pairs_fh:
            II.importPairs(pairs_fh)
示例#2
0
文件: server.py 项目: JoshDaly/TrackM
 def _updateHits(self, contigHeaders, resultQueue, hitCache):
     II = ImportInterface(self.dbFileName,verbosity=-1)
     tmp = []
     while(True):
         current = resultQueue.get(block=True, timeout=None)
         #print "current capacity of resultQueue %d" % int(resultQueue.qsize())
         if current == None: 
             #print ">> DBG Current is None"
             II.importHits(contigHeaders, tmp)
             break
         else:
             tmp.append(current)
         
         #print ">> DBG Length of tmp is %d" % len(tmp)
          
         if len(tmp) >= hitCache: # set size limit of queue
             print ">> DBG " + datetime.datetime.fromtimestamp(time.time()).strftime('%Y-%m-%d %H:%M:%S') + " Length of tmp is %d :: current capacity of resultQueue %d" % (len(tmp), int(resultQueue.qsize()))
             II.importHits(contigHeaders, tmp)
             tmp = []