本文整理汇总了Python中tt_log.logger.debug函数的典型用法代码示例。如果您正苦于以下问题:Python debug函数的具体用法?Python debug怎么用?Python debug使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了debug函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: findRegions
def findRegions(tranList):
# Find breakpoints where coverage by exons changes.
# Why are we doing this? See the note in the Transcript class
# definition below.
breaks = list()
for tranIx, tran in enumerate(tranList):
for exon in tran.exons:
breaks.append([exon.start, 0, tranIx, tran.name, exon.name])
breaks.append([exon.end, 1, tranIx, tran.name, exon.name])
breaks.sort(key=lambda x: x[0])
curPos = breaks[0][0]
curTranSet = set()
region = 0
for ix in xrange(len(breaks)):
posit, flag, tranIx, tranName, exonName = breaks[ix]
if posit > curPos + MIN_REGION_SIZE: # this is a new region
if len(curTranSet) > 0:
for ix in curTranSet:
tranList[ix].regions.add(region) # update set of regions hit by this transcript
region += 1
curPos = posit
if flag == 0: # exon start
curTranSet.add(tranIx)
else: # exon end
curTranSet.remove(tranIx)
logger.debug('found %d regions' % region)
return
示例2: __init__
def __init__(self, filename, CCSDir=None):
logger.debug("creating BasFile object")
self._filename = filename
self._CCSDir = CCSDir
self._infile = h5py.File(filename, "r")
self._top = self._infile
self._baxfile = list()
self._coords = None
self._consensusIndex = None
self._consPassIndex = None
if "MultiPart" not in self._top: # if this is an old-style bas file
bf = BaxFile(filename) # file will contain its own CCSdata
self._baxfile.append(bf) # only one file (this one) in the list
else: # else it's an index to a set of bax files
h5Dir = os.path.dirname(os.path.abspath(self._filename))
for baxfileName in self._top["MultiPart/Parts"]: # for each bax file
fqBaxfileName = os.path.join(h5Dir, baxfileName) # fq = fully qualified
bf = BaxFile(fqBaxfileName, CCSDir=CCSDir)
self._baxfile.append(bf) # add file to list
self.fillCombinedFields() # need to compute this first, we'll need it later
self.fillZMWIndexes()
self.fillMovieName()
self.fillRegionIndexes()
示例3: fillConsensusIndexes
def fillConsensusIndexes(self):
"""Compute _consPassIndex and _consensusIndex. Called only when those arrays are needed."""
self._consPassIndex = [None] * (self._maxZMW + 1)
self._consensusIndex = [None] * (self._maxZMW + 1)
for bf in self._baxfile:
bf.ZMWSanityClause() # sanity check the consensus datasets
ix = 0
passIndex = 0
consIndex = 0
numPasses = bf._consPasses["NumPasses"]
numEvent = bf._consZMW["NumEvent"]
for hole in bf.holeNumbers():
self._consPassIndex[hole] = passIndex
passIndex += numPasses[ix]
self._consensusIndex[hole] = consIndex
consIndex += numEvent[ix]
ix += 1
logger.debug("%s processed %d consensus passes" % (bf.shortName(), passIndex))
logger.debug("%s processed %d consensus basecalls" % (bf.shortName(), consIndex))
示例4: basecallIndex
def basecallIndex (self):
'''Create and cache a table by hole number of starting indexes into PulseData/BaseCalls.'''
if self._basecallIndex == None:
logger.debug("creating basecall index")
numEvent = self._ZMW["NumEvent"]
holeNumber = self._ZMW["HoleNumber"]
numZ = self.numZMWs()
index = 0
self._basecallIndex = [0] * numZ
# The loop below includes a check that the HoleNumbers run
# from 0 to N-1. I.e., HoleNumber[ix] == ix. Otherwise,
# there is no way to get from the hole number of a region
# back to the ZMW entry (other than searching for it).
for ix in xrange(numZ):
if holeNumber[ix] != ix:
raise RuntimeError("Hole number != index at %d" % ix)
self._basecallIndex[ix] = index
index += numEvent[ix]
logger.debug("processed %d basecalls" % index)
return self._basecallIndex
示例5: cellCoords
def cellCoords (self):
'''Find and cache the minimum and maximum X/Y coordinates on the SMRTcell'''
if self._coords is None:
logger.debug("finding SMRTcell coordinates")
numZ = self.numZMWs()
holeXY = self._ZMW["HoleXY"]
minX = maxX = holeXY[0,0]
minY = maxY = holeXY[0,1]
for ix in xrange(numZ):
x,y = holeXY[ix,:]
if x < minX:
minX = x
elif x > maxX:
maxX = x
if y < minY:
minY = y
elif y > maxY:
maxY = y
self._coords = (minX, maxX, minY, maxY)
logger.debug("SMRTcell is (%d,%d,%d,%d)" % (minX, maxX, minY, maxY))
return self._coords
示例6: cellCoords
def cellCoords(self):
"""Find and cache the minimum and maximum X/Y coordinates on the SMRTcell"""
if self._coords is None:
logger.debug("finding SMRTcell coordinates")
minX = 0
maxX = 0
minY = 0
maxY = 0
for bf in self._baxfile:
holeXY = bf._ZMW["HoleXY"]
minX = min(minX, min(holeXY[:, 0]))
maxX = max(maxX, max(holeXY[:, 0]))
minY = min(minY, min(holeXY[:, 1]))
maxY = max(maxY, max(holeXY[:, 1]))
self._coords = (minX, maxX, minY, maxY)
logger.debug("SMRTcell is (%d,%d,%d,%d)" % (minX, maxX, minY, maxY))
return self._coords
示例7: findCCSFile
def findCCSFile(self):
"""Given a directory to look in, find the ccs.h5 file that contains consensus reads for this bax file."""
self._hasConsensus = False # until proven otherwise
if "PulseData/ConsensusBaseCalls" in self._top: # if this is an older bax file, in contains its own CCS data
self._consBasecalls = self._top["PulseData/ConsensusBaseCalls"]
self._consZMW = self._top["PulseData/ConsensusBaseCalls/ZMW"]
self._consPasses = self._top["PulseData/ConsensusBaseCalls/Passes"]
self._hasConsensus = True
elif self._CCSDir is not None:
CCSFilename = os.path.basename(self._filename).replace("bax", "ccs")
fqCCSFilename = os.path.join(self._CCSDir, CCSFilename)
if os.path.exists(fqCCSFilename):
self._CCSFile = h5py.File(fqCCSFilename, "r")
self._consBasecalls = self._CCSFile["PulseData/ConsensusBaseCalls"]
self._consZMW = self._CCSFile["PulseData/ConsensusBaseCalls/ZMW"]
self._consPasses = self._CCSFile["PulseData/ConsensusBaseCalls/Passes"]
self._hasConsensus = True
logger.debug("BaxFile %s found CCS file %s" % (self._shortName, fqCCSFilename))
else:
logger.warning("%s: no CCS file found corresponding to %s" % (self._shortName, self._filename))
else:
logger.info("BaxFile %s does not contain CCS data (rel 2.1.0 and later). Use --ccs" % self._shortName)
示例8: _fillRegionTables
def _fillRegionTables (self):
'''Create and cache tables by hole number of starting and HQ indexes into PulseData/Regions.'''
if self._regionIndex == None:
logger.debug("creating region index")
self._regionIndex = [0] * self.numZMWs()
self._HQIndex = [0] * self.numZMWs()
regions = self._regions
index = 0
lastHole = -1 # init to non-matching value
for line in regions:
hole, regionType = line[0:2]
if hole != lastHole: # start of new hole?
self._regionIndex[hole] = index
lastHole = hole
if regionType == 2: # HQ region for this hole?
self._HQIndex[hole] = index
index += 1
logger.debug("processed %d regions" % index)
return self._regionIndex
示例9: __init__
def __init__ (self, name):
self.name = name
self.handle = open (name, 'w')
self.lastPos = dict()
logger.debug('opened %s' % name)
示例10: toPickle
def toPickle (self, filename):
pickHandle = open (filename, 'w')
pk = pickle.Pickler (pickHandle, pickle.HIGHEST_PROTOCOL)
pk.dump (self)
pickHandle.close()
logger.debug('wrote annotation data to pickle file %s' % filename)
return
示例11: __init__
def __init__ (self, fileName):
logger.debug("creating CmpFile object for %s" % (fileName))
self._fileName = fileName
self._infile = h5py.File (fileName, 'r')
#### self._top = h5py.Group (self._infile, '/')
self._top = self._infile # h5py 2.0.1 change!
return
示例12: fromPickle
def fromPickle (filename):
'''Create an AnnotationList object from a pickle file (alternative to __init__).'''
logger.debug('reading annotations in pickle format from %s' % filename)
handle = open (filename, 'r')
pk = pickle.Unpickler (handle)
annotList = pk.load()
handle.close()
return annotList
示例13: fromPickle
def fromPickle (filename):
'''Create a Reference object from a pickle file (alternative to __init__).'''
logger.debug('reading reference in pickle format from %s' % filename)
handle = open (filename, 'r')
pk = pickle.Unpickler (handle)
ref = pk.load()
handle.close()
return ref
示例14: fromPickle
def fromPickle (filename):
'''Create a ClusterDict object from a pickle file (alternative to __init__).'''
handle = open (filename, 'r')
pk = pickle.Unpickler (handle)
clusterDict = pk.load()
handle.close()
logger.debug('read %d clusters in pickle format from %s' % (len(clusterDict), filename))
return clusterDict
示例15: submitFinalJobs
def submitFinalJobs (opt, chunkList):
chunkFiles = ['%s \\\n' % chk.trimmedChunkName for chk in chunkList]
sh = list()
sh.append('#!/bin/bash\n\n')
sh.append('set -o errexit\n')
sh.append('set -o nounset\n\n')
sh.append('cat \\\n')
sh.extend(chunkFiles)
sh.append(' > %s\n' % opt.output)
if opt.report is not None:
reportFiles = ['%s \\\n' % chk.reportChunkName for chk in chunkList]
sh.append('\ncat \\\n')
sh.extend(reportFiles)
sh.append(' > %s\n' % opt.report)
finalScriptName = '%s/trim_final.sh' % opt.tmpdir
handle = open (finalScriptName, 'w')
handle.writelines (sh)
handle.close()
deps = ':'.join ([chk.jobno for chk in chunkList])
cmd = list()
cmd.append('qsub')
cmd.append('-N trim_final') # job name
cmd.append('-o trim_final.out') # output file
cmd.append('-j oe') # combine stdout and stderr
cmd.append('-l nodes=1:ppn=1,walltime=4:00:00') # resources required
cmd.append('-d . ') # working directory (strangely, ./ is not the default)
cmd.append('-r n') # do NOT attempt to restart on failure
cmd.append('-V') # export all environment variables to job
cmd.append('-W umask=0002') # make logs rw-rw-r--
cmd.append('-m n') # don't send any mail
cmd.append('-W depend=afterok:%s' % deps)
cmd.append(finalScriptName) # script to run
command = ' '.join(cmd)
logger.debug ('running %s' % command)
popen_file = os.popen(command)
response = popen_file.read().strip()
rc = popen_file.close()
if rc is not None:
logger.error('command failed, rc=%d' % rc)
raise RuntimeError
logger.debug ('jobno is %s' % response)
return response