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


Python PassingData.parameters方法代碼示例

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


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

示例1: generate_parameters

# 需要導入模塊: from pymodule import PassingData [as 別名]
# 或者: from pymodule.PassingData import parameters [as 別名]
    def generate_parameters(self, parameter_names, parameter_depth=2):
        """
		2008-05-19
			min_call_probability = self.min_call_probability
		2008-05-11
			put NA rate into passing parameters as well. too much memory consumption on each computing node
		"""
        sys.stderr.write("Generating parameter settings ...")
        param_d = PassingData()
        for parameter_name in parameter_names:
            parameter_value = getattr(self, parameter_name)
            parameter_value = parameter_value.split(",")
            parameter_value = map(float, parameter_value)
            setattr(self, parameter_name, parameter_value)

        """
		#2008-05-19 commented out. use self.min_call_probability
		#figure out call probability from input_fname
		import re
		call_prob_pattern = re.compile(r'_(\d+)\.csv')
		call_prob_p_result = call_prob_pattern.search(self.input_fname)
		if call_prob_p_result:
			min_call_probability = float(call_prob_p_result.groups()[0])
		else:
			min_call_probability = -1
		"""
        min_call_probability = self.min_call_probability

        # only 1st 4, last 2 passed to computing node
        parameters = []
        for max_call_mismatch_rate in getattr(self, parameter_names[0]):
            for max_call_NA_rate in getattr(self, parameter_names[1]):
                for max_snp_mismatch_rate in getattr(self, parameter_names[2]):
                    for max_snp_NA_rate in getattr(self, parameter_names[3]):
                        for npute_window_size in getattr(self, parameter_names[4]):
                            parameters.append(
                                [
                                    min_call_probability,
                                    max_call_mismatch_rate,
                                    max_call_NA_rate,
                                    max_snp_mismatch_rate,
                                    max_snp_NA_rate,
                                    npute_window_size,
                                ]
                            )

        param_d.parameters = parameters
        param_d.max_snp_NA_rate_ls = self.max_snp_NA_rate_ls
        param_d.npute_window_size_ls = self.npute_window_size_ls
        sys.stderr.write(" %s parameter settings to process. Done.\n" % len(parameters))
        return param_d
開發者ID:,項目名稱:,代碼行數:53,代碼來源:


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