本文整理匯總了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