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


Python PassingData.id2index方法代码示例

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


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

示例1: getCallMethodInfo

# 需要导入模块: from pymodule import PassingData [as 别名]
# 或者: from pymodule.PassingData import id2index [as 别名]
    def getCallMethodInfo(cls, affiliated_table_name, extra_condition=None, extra_tables=None):
        """
		2009-1-30
			similar to getPhenotypeInfo, getListTypeInfo, getAnalysisMethodInfo
		"""
        table_str = "%s s, %s p" % (affiliated_table_name, model.Stock_250kDB.CallMethod.table.name)
        if extra_tables:
            table_str += ", %s" % extra_tables
        where_condition = "p.id=s.call_method_id"
        if extra_condition:
            where_condition += " and %s" % extra_condition
        rows = model.db.metadata.bind.execute(
            "select distinct p.id, p.short_name from %s \
			where %s order by p.id"
            % (table_str, where_condition)
        )
        id_ls = []
        id2index = {}
        label_ls = []
        prev_biology_category_id = -1
        no_of_separators = 0
        for row in rows:
            id2index[row.id] = len(id_ls)
            id_ls.append(row.id)
            label_ls.append("%s %s" % (row.id, row.short_name))
        list_info = PassingData()
        list_info.id2index = id2index
        list_info.id_ls = id_ls
        list_info.label_ls = label_ls
        return list_info
开发者ID:,项目名称:,代码行数:32,代码来源:

示例2: get_min_distance_info

# 需要导入模块: from pymodule import PassingData [as 别名]
# 或者: from pymodule.PassingData import id2index [as 别名]
	def get_min_distance_info(cls, db, from_where_clause):
		"""
		2008-10-23
		"""
		sys.stderr.write("Getting min_distance_info ...")
		rows = db.metadata.bind.execute("select distinct t.min_distance %s order by min_distance"%from_where_clause)
		id_ls = []
		id2index = {}
		label_ls = []
		no_of_separators = 0
		for row in rows:
			id2index[row.min_distance] = len(id_ls)
			id_ls.append(row.min_distance)
			label_ls.append('%s'%(row.min_distance))
		list_info = PassingData()
		list_info.id2index = id2index
		list_info.id_ls = id_ls
		list_info.label_ls = label_ls
		sys.stderr.write("Done.\n")
		return list_info
开发者ID:,项目名称:,代码行数:22,代码来源:

示例3: get_no_of_top_snps_info

# 需要导入模块: from pymodule import PassingData [as 别名]
# 或者: from pymodule.PassingData import id2index [as 别名]
	def get_no_of_top_snps_info(cls, db, from_where_clause):
		"""
		2008-11-04
			#there's a chance it occurs twice due to float difference in min_score
		2008-10-23
		"""
		sys.stderr.write("Getting no_of_top_snps_info ...")
		rows = db.metadata.bind.execute("select distinct t.no_of_top_snps, t.min_score %s order by no_of_top_snps"%from_where_clause)
		id_ls = []
		id2index = {}
		label_ls = []
		no_of_separators = 0
		for row in rows:
			if row.no_of_top_snps not in id2index:	#there's a chance it occurs twice due to float difference in min_score
				id2index[row.no_of_top_snps] = len(id_ls)
				id_ls.append(row.no_of_top_snps)
				label_ls.append('%s %s'%(row.no_of_top_snps, row.min_score))
		list_info = PassingData()
		list_info.id2index = id2index
		list_info.id_ls = id_ls
		list_info.label_ls = label_ls
		sys.stderr.write("Done.\n")
		return list_info
开发者ID:,项目名称:,代码行数:25,代码来源:

示例4: getAnalysisMethodInfo

# 需要导入模块: from pymodule import PassingData [as 别名]
# 或者: from pymodule.PassingData import id2index [as 别名]
    def getAnalysisMethodInfo(cls, affiliated_table_name, extra_condition=None, extra_tables=None):
        """
		2009-5-20
			label no longer includes db id
		2009-4-26
			add description_ls in return
		2008-10-19
		"""
        table_str = "%s s, %s p" % (affiliated_table_name, model.Stock_250kDB.AnalysisMethod.table.name)
        if extra_tables:
            table_str += ", %s" % extra_tables
        where_condition = "p.id=s.analysis_method_id"
        if extra_condition:
            where_condition += " and %s" % extra_condition
        rows = model.db.metadata.bind.execute(
            "select distinct p.id, p.short_name, p.method_description from %s \
			where %s order by p.id"
            % (table_str, where_condition)
        )
        id_ls = []
        id2index = {}
        label_ls = []
        description_ls = []
        prev_biology_category_id = -1
        no_of_separators = 0
        for row in rows:
            id2index[row.id] = len(id_ls)
            id_ls.append(row.id)
            label_ls.append("%s" % (row.short_name))
            description_ls.append(row.method_description)
        list_info = PassingData()
        list_info.id2index = id2index
        list_info.id_ls = id_ls
        list_info.label_ls = label_ls
        list_info.description_ls = description_ls
        return list_info
开发者ID:,项目名称:,代码行数:38,代码来源:


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