本文整理汇总了Python中pymodule.PassingData.label_ls方法的典型用法代码示例。如果您正苦于以下问题:Python PassingData.label_ls方法的具体用法?Python PassingData.label_ls怎么用?Python PassingData.label_ls使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pymodule.PassingData
的用法示例。
在下文中一共展示了PassingData.label_ls方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: getCallMethodInfo
# 需要导入模块: from pymodule import PassingData [as 别名]
# 或者: from pymodule.PassingData import label_ls [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
示例2: get_min_distance_info
# 需要导入模块: from pymodule import PassingData [as 别名]
# 或者: from pymodule.PassingData import label_ls [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
示例3: get_no_of_top_snps_info
# 需要导入模块: from pymodule import PassingData [as 别名]
# 或者: from pymodule.PassingData import label_ls [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
示例4: getAnalysisMethodInfo
# 需要导入模块: from pymodule import PassingData [as 别名]
# 或者: from pymodule.PassingData import label_ls [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