本文整理汇总了Python中quick.util.GenomeInfo.GenomeInfo.getChrRegsFn方法的典型用法代码示例。如果您正苦于以下问题:Python GenomeInfo.getChrRegsFn方法的具体用法?Python GenomeInfo.getChrRegsFn怎么用?Python GenomeInfo.getChrRegsFn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类quick.util.GenomeInfo.GenomeInfo
的用法示例。
在下文中一共展示了GenomeInfo.getChrRegsFn方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: execute
# 需要导入模块: from quick.util.GenomeInfo import GenomeInfo [as 别名]
# 或者: from quick.util.GenomeInfo.GenomeInfo import getChrRegsFn [as 别名]
def execute(cls, choices, galaxyFn=None, username=''):
outputFile = open(galaxyFn, 'w')
genome = choices[0]
histItem = choices[2]
trackItem = choices[3]
chromRegsPath = GenomeInfo.getChrRegsFn(genome)
chrSizeDict = dict([ ( chrom, GenomeInfo.getChrLen(genome, chrom)) for chrom in GenomeInfo.getChrList(genome)])
geSource = headLinesStr = None
if choices[1] == 'History':
trackType = choices[2].split(':')[1]
username = ''.join([chr(random.randint(97,122)) for i in range(6)])
tempFn = createCollectedPath(genome, [], username+'_'.join([str(v) for v in time.localtime()[:6]])+'.'+trackType)
fnSource = ExternalTrackManager.extractFnFromGalaxyTN(choices[2].split(':'))
open(tempFn,'w').write(open(fnSource,'r').read())
if trackType in ['marked.bed', 'category.bed', 'bed']:
geSource = GenomeElementSorter(BedGenomeElementSource(tempFn, genome=genome)).__iter__()
elif trackType == 'gtrack':
geSource = GenomeElementSorter(GtrackGenomeElementSource(tempFn, genome=genome)).__iter__()
headLinesStr = geSource.getHeaderLines().replace('##','\n##')
cls.WriteExpandedElementsToFile(geSource, chrSizeDict, outputFile, headLinesStr, writeHeaderFlag=True)
os.remove(tempFn)
else:
writeHeaderFlag = True
for chrom in GenomeInfo.getChrList(genome):
gRegion = GenomeRegion(genome, chrom, 0, chrSizeDict[chrom])
plTrack = PlainTrack(trackItem.split(':'))
geSource = GenomeElementTvWrapper(plTrack.getTrackView(gRegion)).__iter__()
cls.WriteExpandedElementsToFile(geSource, chrSizeDict, outputFile, headLinesStr, writeHeaderFlag)
writeHeaderFlag = False
outputFile.close()
示例2: getOptionsBox5
# 需要导入模块: from quick.util.GenomeInfo import GenomeInfo [as 别名]
# 或者: from quick.util.GenomeInfo.GenomeInfo import getChrRegsFn [as 别名]
def getOptionsBox5(prevChoices):
if prevChoices[1] == 'History':
return (prevChoices[2], 2, True)
elif prevChoices[1] == 'Track':
return (prevChoices[3], 2, True)
return (GenomeInfo.getChrRegsFn(prevChoices[0]), 2, True)