本文整理汇总了Python中pymodule.PassingData.one_row方法的典型用法代码示例。如果您正苦于以下问题:Python PassingData.one_row方法的具体用法?Python PassingData.one_row怎么用?Python PassingData.one_row使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pymodule.PassingData
的用法示例。
在下文中一共展示了PassingData.one_row方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: merge_call_on_one_row
# 需要导入模块: from pymodule import PassingData [as 别名]
# 或者: from pymodule.PassingData import one_row [as 别名]
def merge_call_on_one_row(cls, ecotypeid_duplicate_index_ls, data_matrix, no_of_cols, NA_set=Set([0, -2])):
"""
2008-07-11
calculate the inconsistency ratio among duplicates
2008-05-12
-2 is also ruled out, add NA_set
"""
one_row = numpy.zeros(no_of_cols)
passingdata = PassingData()
passingdata.no_of_non_NA_pairs = 0
passingdata.no_of_non_NA_inconsistent_pairs = 0
for i in range(no_of_cols):
call_counter_ls = [0]*11
non_NA_call_number_set = Set()
for index in ecotypeid_duplicate_index_ls:
call_number = data_matrix[index][i]
if call_number not in NA_set: #dont' need NA and non-touched bit
call_counter_ls[call_number] += 1
non_NA_call_number_set.add(call_number)
if len(non_NA_call_number_set)>0:
passingdata.no_of_non_NA_pairs += 1
if len(non_NA_call_number_set)>1:
passingdata.no_of_non_NA_inconsistent_pairs += 1
one_row[i] = dbSNP2data.get_majority_call_number(call_counter_ls)
passingdata.one_row = one_row
return passingdata