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


Python GenomeAnnotationAPI.get_taxon方法代码示例

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


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

示例1: get_taxon

# 需要导入模块: from doekbase.data_api.annotation.genome_annotation.api import GenomeAnnotationAPI [as 别名]
# 或者: from doekbase.data_api.annotation.genome_annotation.api.GenomeAnnotationAPI import get_taxon [as 别名]
    def get_taxon(self, ctx, ref):
        """
        Retrieve the Taxon associated with this GenomeAnnotation.
        @return Reference to TaxonAPI object
        :param ref: instance of type "ObjectReference"
        :returns: instance of type "ObjectReference"
        """
        # ctx is the context object
        # return variables are: returnVal
        #BEGIN get_taxon
        ga = GenomeAnnotationAPI_local(self.services, ctx['token'], ref)
        returnVal = ga.get_taxon(ref_only=True)
        #END get_taxon

        # At some point might do deeper type checking...
        if not isinstance(returnVal, basestring):
            raise ValueError('Method get_taxon return value ' +
                             'returnVal is not type basestring as required.')
        # return the results
        return [returnVal]
开发者ID:msneddon,项目名称:genome_annotation_api,代码行数:22,代码来源:GenomeAnnotationAPIImpl.py

示例2:

# 需要导入模块: from doekbase.data_api.annotation.genome_annotation.api import GenomeAnnotationAPI [as 别名]
# 或者: from doekbase.data_api.annotation.genome_annotation.api.GenomeAnnotationAPI import get_taxon [as 别名]
	'num_contigs' : 0,
	'contig_lengths' : [],
	'contig_ids' : [],
	'source' : "KBase",
	'source_id' : sys.argv[6],
#	'md5' : "",
	'taxonomy' : "Unknown",
	'gc_content' : 0.5,
	'complete' : 1,
	'features' : []
};

taxon = {};
success = 0;
try:
	taxon = ga.get_taxon();
	success = 1;
except Exception, e:
	success = 0
	
if success == 1:
	try:
		gto['scientific_name'] = taxon.get_scientific_name()
	except Exception, e:
		success = 0
	try:
		gto['domain'] = taxon.get_domain()
	except Exception, e:
		success = 0
	try:
		gto['genetic_code'] = taxon.get_genetic_code()
开发者ID:mdejongh,项目名称:MEModeling,代码行数:33,代码来源:get_genome.py


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