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


Python GenomeInfo.hasOrigFiles方法代码示例

本文整理汇总了Python中quick.util.GenomeInfo.GenomeInfo.hasOrigFiles方法的典型用法代码示例。如果您正苦于以下问题:Python GenomeInfo.hasOrigFiles方法的具体用法?Python GenomeInfo.hasOrigFiles怎么用?Python GenomeInfo.hasOrigFiles使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在quick.util.GenomeInfo.GenomeInfo的用法示例。


在下文中一共展示了GenomeInfo.hasOrigFiles方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: execute

# 需要导入模块: from quick.util.GenomeInfo import GenomeInfo [as 别名]
# 或者: from quick.util.GenomeInfo.GenomeInfo import hasOrigFiles [as 别名]
 def execute(cls, choices, galaxyFn=None , username=''):
     '''Is called when execute-button is pushed by web-user.
     Should print output as HTML to standard out, which will be directed to a results page in Galaxy history.
     If needed, StaticFile can be used to get a path where additional files can be put (e.g. generated image files).
     choices is a list of selections made by web-user in each options box.
     '''
     #print 'Executing... with choices %s'%str(choices)
     abbrv = choices[0]
     name = choices[1]
     
     #Should test that the genome is not in hyperbrowser.
     gi = GenomeInfo(abbrv)
     
     if gi.hasOrigFiles():
         sys.stderr.write( "Genome "+abbrv+ " is already in the Genomic HyperBrowser. Remove the old first.")
     else:
         gi.fullName = name
         if choices[2] == 'URL':
             urls = choices[3].split()
             gi.sourceUrls = urls
             for url in urls:
                 try:
                     GenomeImporter.downloadGenomeSequence(abbrv, url)
                 except InvalidFormatError:
                     return
         else:
             basePath =  os.sep.join([NONSTANDARD_DATA_PATH, abbrv] + GenomeInfo.getSequenceTrackName(abbrv))
             fnSource = ExternalTrackManager.extractFnFromGalaxyTN(choices[4].split(':'))
             fnDest = basePath+'/'+abbrv+'Sequence.fasta'
             ensurePathExists(fnDest)
             copyfile(fnSource, fnDest)
             
         chrs=GenomeImporter.extractChromosomesFromGenome(abbrv)
         gi.sourceChrNames = chrs
         gi.installedBy = username
         gi.genomeBuildSource = choices[5]
         gi.genomeBuildName = choices[6]
         gi.species = choices[7]
         gi.speciesTaxonomyUrl = choices[8]
         gi.assemblyDetails = choices[9]
         gi.privateAccessList = [v.strip() for v in choices[10].replace(os.linesep, ' ').replace(',', ' ').split(' ') if v.find('@')>0]
         gi.isPrivate = (choices[11] != 'All')
         gi.isExperimental = (choices[12] != 'All')
         gi.ucscClade = choices[13]
         gi.ucscGenome = choices[14]
         gi.ucscAssembly = choices[15]
         
         galaxyFile=open(galaxyFn, "w")
         galaxyFile.write( 'Genome abbreviation: ' + abbrv + os.linesep)
         galaxyFile.write( 'Genome full name: ' + name + os.linesep)
         galaxyFile.write( 'Track name: ' + ':'.join(GenomeInfo.getSequenceTrackName(abbrv)) + os.linesep)
         galaxyFile.write( 'Temp chromosome names: ' + ' || '.join(chrs) + os.linesep)
         #GenomeImporter.saveTempInfo(abbrv, name, chrs)
         #print 'Chromosomes: '+chrs
         gi.store()
开发者ID:Anderrb,项目名称:Dynamic-benchmark,代码行数:57,代码来源:UploadGenomeTool.py


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