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


Python GenomeAnnotationAPI.get_gff方法代码示例

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


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

示例1: generate_gff

# 需要导入模块: from doekbase.data_api.annotation.genome_annotation.api import GenomeAnnotationAPI [as 别名]
# 或者: from doekbase.data_api.annotation.genome_annotation.api.GenomeAnnotationAPI import get_gff [as 别名]
def generate_gff(logger,internal_services,token,ref,output_dir,obj_name,output_file):
        try:
                ga = GenomeAnnotationAPI(internal_services,
                             token=token,
                             ref= "{}/{}".format(ref,obj_name))
        except:
                raise Exception("Unable to Call GenomeAnnotationAPI : {0}".format(e))
        logger.info("Requesting GenomeAnnotation GFF for {}/{}".format(ref,obj_name))
    	gff_start = datetime.datetime.utcnow()
	#output_file = os.path.join(output_dir,'{}.gff'.format(obj_name))
    	with open(output_file, 'w') as gff_file:
        	ga.get_gff().to_file(gff_file)
    	gff_file.close()
	gff_end = datetime.datetime.utcnow()
    	logger.info("Generating GFF for {} took {}".format(obj_name, gff_end - gff_start))
开发者ID:kbase,项目名称:KBaseRNASeq,代码行数:17,代码来源:script_util.py

示例2: generate_gff

# 需要导入模块: from doekbase.data_api.annotation.genome_annotation.api import GenomeAnnotationAPI [as 别名]
# 或者: from doekbase.data_api.annotation.genome_annotation.api.GenomeAnnotationAPI import get_gff [as 别名]
def generate_gff(logger,internal_services,token,ref,output_dir,obj_name,output_file):
        try:
                ga = GenomeAnnotationAPI(internal_services,
                             token=token,
                             ref= ref)
        except:
                raise Exception("Unable to Call GenomeAnnotationAPI : {0}".format(("".join(traceback.format_exc()))))
        logger.info("Requesting GenomeAnnotation GFF for {}".format(obj_name))
    	gff_start = datetime.datetime.utcnow()
        gff_file= io.open(output_file, 'wb')
	#output_file = os.path.join(output_dir,'{}.gff'.format(obj_name))
	try:
        	ga.get_gff().to_file(gff_file)
	except Exception as e:
                #raise Exception("Unable to Create GFF  file from Genome Annotation : {0}: {1}".format(obj_name,e))
                raise Exception("Unable to Create GFF  file from Genome Annotation : {0}: {1}".format(obj_name,"".join(traceback.format_exc())))
        finally:
    		gff_file.close()
	gff_end = datetime.datetime.utcnow()
    	logger.info("Generating GFF for {} took {}".format(obj_name, gff_end - gff_start))
开发者ID:briehl,项目名称:KBaseRNASeq,代码行数:22,代码来源:script_util.py


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