本文整理汇总了Python中quick.util.GenomeInfo.GenomeInfo.isValidChr方法的典型用法代码示例。如果您正苦于以下问题:Python GenomeInfo.isValidChr方法的具体用法?Python GenomeInfo.isValidChr怎么用?Python GenomeInfo.isValidChr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类quick.util.GenomeInfo.GenomeInfo
的用法示例。
在下文中一共展示了GenomeInfo.isValidChr方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: isValidTrack
# 需要导入模块: from quick.util.GenomeInfo import GenomeInfo [as 别名]
# 或者: from quick.util.GenomeInfo.GenomeInfo import isValidChr [as 别名]
def isValidTrack(genome, trackName, fullAccess=False):
if not TrackInfo(genome, trackName).isValid(fullAccess):
return False
for fn in ProcTrackOptions._getDirContents(genome, trackName):
if GenomeInfo.isValidChr(genome, fn) or isBoundingRegionFileName(fn):
return True
return False
示例2: _checkValidStart
# 需要导入模块: from quick.util.GenomeInfo import GenomeInfo [as 别名]
# 或者: from quick.util.GenomeInfo.GenomeInfo import isValidChr [as 别名]
def _checkValidStart(self, chr, start):
if start < 0:
raise InvalidFormatError('Error: start position is negative: %s' % start)
if self.genome and \
GenomeInfo.isValidChr(self.genome, chr) and \
start > GenomeInfo.getChrLen(self.genome, chr):
raise InvalidFormatError('Error: start position is larger than chromosome size (%s) < %d' % \
(GenomeInfo.getChrLen(self.genome, chr), start))
return start
示例3: getSubtypes
# 需要导入模块: from quick.util.GenomeInfo import GenomeInfo [as 别名]
# 或者: from quick.util.GenomeInfo.GenomeInfo import isValidChr [as 别名]
def getSubtypes(genome, trackName, fullAccess=False):
dirPath = createDirPath(trackName, genome)
subtypes = [fn for fn in ProcTrackOptions._getDirContents(genome, trackName) \
if not (fn[0] in ['.','_'] or os.path.isfile(dirPath + os.sep + fn) \
or GenomeInfo.isValidChr(genome, fn))]
#fixme, just temporarily:, these dirs should start with _
subtypes= [x for x in subtypes if not x in ['external','ucsc'] ]
if not fullAccess and not ProcTrackOptions._isLiteratureTrack(genome, trackName):
subtypes = [x for x in subtypes if not TrackInfo(genome, trackName+[x]).private]
return sorted(subtypes, key=str.lower)
示例4: _checkValidEnd
# 需要导入模块: from quick.util.GenomeInfo import GenomeInfo [as 别名]
# 或者: from quick.util.GenomeInfo.GenomeInfo import isValidChr [as 别名]
def _checkValidEnd(self, chr, end, start=None):
if end < 0:
raise InvalidFormatError('Error: end position is negative: %s' % end)
if self.genome and \
GenomeInfo.isValidChr(self.genome, chr) and \
end-1 > GenomeInfo.getChrLen(self.genome, chr):
raise InvalidFormatError('Error: end position is larger than chromosome size (%s)' % \
GenomeInfo.getChrLen(self.genome, chr))
if start is not None and end <= start:
raise InvalidFormatError('Error: end position (end-exclusive) is smaller than or equal to start position: %d <= %d' % (end, start))
return end
示例5: _checkValidChr
# 需要导入模块: from quick.util.GenomeInfo import GenomeInfo [as 别名]
# 或者: from quick.util.GenomeInfo.GenomeInfo import isValidChr [as 别名]
def _checkValidChr(self, chr):
if self.genome and not GenomeInfo.isValidChr(self.genome, chr):
raise InvalidFormatWarning('Chromosome incorrectly specified: ' + chr)
return chr