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


Python GenomeAnnotationAPI.get_feature_ids方法代码示例

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


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

示例1: get_feature_ids

# 需要导入模块: from doekbase.data_api.annotation.genome_annotation.api import GenomeAnnotationAPI [as 别名]
# 或者: from doekbase.data_api.annotation.genome_annotation.api.GenomeAnnotationAPI import get_feature_ids [as 别名]
    def get_feature_ids(self, ctx, ref, filters, group_type):
        """
        Retrieve Feature IDs, optionally filtered by type, region, function, alias.
        @param filters Dictionary of filters that can be applied to contents.
          If this is empty or missing, all Feature IDs will be returned.
        @param group_type How to group results, which is a single string matching one
          of the values for the ``filters`` parameter.
        @return Grouped mapping of features.
        :param ref: instance of type "ObjectReference"
        :param filters: instance of type "Feature_id_filters" (* * Filters
           passed to :meth:`get_feature_ids`) -> structure: parameter
           "type_list" of list of String, parameter "region_list" of list of
           type "Region" -> structure: parameter "contig_id" of String,
           parameter "strand" of String, parameter "start" of Long, parameter
           "length" of Long, parameter "function_list" of list of String,
           parameter "alias_list" of list of String
        :param group_type: instance of String
        :returns: instance of type "Feature_id_mapping" -> structure:
           parameter "by_type" of mapping from String to list of String,
           parameter "by_region" of mapping from String to mapping from
           String to mapping from String to list of String, parameter
           "by_function" of mapping from String to list of String, parameter
           "by_alias" of mapping from String to list of String
        """
        # ctx is the context object
        # return variables are: returnVal
        #BEGIN get_feature_ids
        ga = GenomeAnnotationAPI_local(self.services, ctx['token'], ref)

        if group_type is None:
            returnVal = ga.get_feature_ids(filters)
        else:
            returnVal = ga.get_feature_ids(filters, group_type)
        #END get_feature_ids

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


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