本文整理汇总了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))
示例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))