当前位置: 首页>>代码示例>>Python>>正文


Python GenomeInfo.getChrRegsFn方法代码示例

本文整理汇总了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()
开发者ID:Anderrb,项目名称:Dynamic-benchmark,代码行数:39,代码来源:MakeGenomePartionAccordingToSegments.py

示例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)
开发者ID:Anderrb,项目名称:Dynamic-benchmark,代码行数:8,代码来源:MakeGenomePartionAccordingToSegments.py


注:本文中的quick.util.GenomeInfo.GenomeInfo.getChrRegsFn方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。