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


Python PassingData.one_row方法代码示例

本文整理汇总了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
开发者ID:,项目名称:,代码行数:28,代码来源:


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