當前位置: 首頁>>代碼示例>>Python>>正文


Python PassingData.no_of_top_snps方法代碼示例

本文整理匯總了Python中pymodule.PassingData.no_of_top_snps方法的典型用法代碼示例。如果您正苦於以下問題:Python PassingData.no_of_top_snps方法的具體用法?Python PassingData.no_of_top_snps怎麽用?Python PassingData.no_of_top_snps使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在pymodule.PassingData的用法示例。


在下文中一共展示了PassingData.no_of_top_snps方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: computing_node_handler

# 需要導入模塊: from pymodule import PassingData [as 別名]
# 或者: from pymodule.PassingData import no_of_top_snps [as 別名]
	def computing_node_handler(self, communicator, data, comp_param_obj):
		"""
		2009-1-22
			deal with option self.store_null_data
		2008-11-12
			turn runHGTest() back into life
			turn off runEnrichmentTestToGetNullData()
		2008-10-31
			runEnrichmentTestToGetNullData() is gonna get data at all different no_of_top_snps's or min_score's
		2008-10-26
			handle (min_score, rank_gap, stop_rank)
			handle scenario that rank_gap is negative and so the parameters tried are descending.
		2008-08-20
		"""
		node_rank = communicator.rank
		sys.stderr.write("Node no.%s working...\n"%node_rank)
		data = cPickle.loads(data)
		result_ls = []
		null_data_ls = []
		pd = PassingData(snps_context_wrapper=comp_param_obj.snps_context_wrapper,\
							no_of_total_genes=comp_param_obj.no_of_total_genes, \
							results_directory=comp_param_obj.results_directory, \
							min_MAF=comp_param_obj.min_MAF, \
							get_closest=self.get_closest, 
							min_distance=self.min_distance, \
							no_of_top_snps=self.no_of_top_snps, #2008-10-25 no_of_top_snps is useless. overwritten later
							min_sample_size=self.min_sample_size,
							test_type_id=self.test_type_id, \
							results_type=self.results_type, 
							no_of_permutations=self.no_of_permutations,\
							no_of_min_breaks=self.no_of_min_breaks,
							type_id=comp_param_obj.type_id,\
							null_distribution_type_id=self.null_distribution_type_id,\
							allow_two_sample_overlapping=self.allow_two_sample_overlapping,
							total_gene_id_ls=comp_param_obj.total_gene_id_ls,\
							min_score=self.min_score,
							commit=self.commit)	#2008-10-25 min_score is useless. overwritten later
		#2008-10-25
		#if rank_gap is negative, stop_marker means the minimum cutoff
		#if rank_gap is positive, stop_marker means the maximum cutoff
		#both signs have to be swapped in the case of negative rank_gap
		"""	
		if self.rank_gap<0:
			stop_marker = -self.stop_rank
		else:
			stop_marker = self.stop_rank
		
		for results_id, list_type_id in data:
			if self.debug:
				sys.stderr.write("working on results_id=%s, list_type_id=%s, type_id=%s .\n"%(results_id, list_type_id, pd.type_id))
			i = 0
			#reset it to zero!!
			if self.rank_gap<0:	#has to be less than -self.stop_rank in order to pass first round. because stop_marker=-stop_rank when rank_gap<0.
				current_marker = stop_marker - 1
			else:
				current_marker = stop_marker -1
			
			while current_marker<stop_marker:	#add one more layer to look at certain top genes
				if self.min_score is not None:
					current_marker = self.min_score +i*self.rank_gap
					pd.min_score = current_marker
				else:
					current_marker = self.no_of_top_snps + i*self.rank_gap
					pd.no_of_top_snps = current_marker
				
				if self.rank_gap<0:
					current_marker = -current_marker
				else:
					current_marker = current_marker
				
				pd.results_id = results_id
				pd.list_type_id = list_type_id
				if self.debug:
					sys.stderr.write("working on results_id=%s, list_type_id=%s, current_marker=%s.\n"%\
									(pd.results_id, pd.list_type_id, current_marker))
				i += 1
				result = self.runHGTest(pd)
				if result is not None:
					result_ls.append(result)
		"""
		
		pd.commit = 0	#commit once afterwards. commit runtime would render 'Lock wait timeout exceeded; try restarting transaction'
		for results_id, list_type_id, cutoff in data:
			if self.debug:
				sys.stderr.write("working on results_id=%s, list_type_id=%s, type_id=%s, cutoff %s.\n"%(results_id, list_type_id, pd.type_id, cutoff))
			pd.results_id = results_id
			pd.list_type_id = list_type_id
			if self.min_score:
				pd.min_score_ls = [cutoff]
				pd.min_score = cutoff
			else:
				pd.no_of_top_snps_ls = [cutoff]
				pd.no_of_top_snps = cutoff
			if self.store_null_data:
				return_data = self.runEnrichmentTestToGetNullData(comp_param_obj.session, pd)
			else:
				return_data = self.runHGTest(pd)
			if return_data:
				result_ls += return_data.result_ls
				null_data_ls += return_data.null_data_ls
#.........這裏部分代碼省略.........
開發者ID:,項目名稱:,代碼行數:103,代碼來源:


注:本文中的pymodule.PassingData.no_of_top_snps方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。