def populate_cbo_box(self): print("populating combo box") self.method_cbo_box.clear() # we first build an R object with the current data. this is to pass off # to the R side to check the feasibility of the methods over the current data. # i.e., we do not display methods that cannot be performed over the # current data. tmp_obj_name = "tmp_obj" covs_to_include = [] #if self.mode==SUBGROUP_MODE: # covs_to_include = [self.wizard().get_subgroup_variable(),] covs_to_include = [] if OMA_CONVENTION[self.data_type] == "binary": python_to_R.dataset_to_simple_binary_robj( self.model, included_studies=self.get_included_studies_in_proper_order(), data_location=self.data_location, var_name=tmp_obj_name, covs_to_include=covs_to_include, one_arm=False, ) elif OMA_CONVENTION[self.data_type] == "continuous": python_to_R.dataset_to_simple_cont_robj( model=self.model, included_studies=self.get_included_studies_in_proper_order(), data_location=self.data_location, data_type=self.data_type, var_name=tmp_obj_name, covs_to_include=covs_to_include, one_arm=False, ) self.available_method_d = python_to_R.get_available_methods( for_data_type=OMA_CONVENTION[self.data_type], data_obj_name=tmp_obj_name, metric=self.metric, funnel_mode=self.funnel_mode, ) print "\n\navailable %s methods: %s" % (self.data_type, ", ".join(self.available_method_d.keys())) method_names = self.available_method_d.keys() method_names.sort(reverse=True) for method in method_names: self.method_cbo_box.addItem(method) self.current_method = self.available_method_d[str(self.method_cbo_box.currentText())] self.setup_params() self.parameter_grp_box.setTitle(self.current_method)
def test_binaryMetaAnalysis(self): #result = None studies = self.model.get_studies_in_current_order() data_location = {'control_noresponse': None, 'effect_size': 16, 'experimental_response': None, 'experimental_noresponse': None, 'variance': 17, 'control_response': None} python_to_R.dataset_to_simple_binary_robj(model=self.model, included_studies=studies, data_location=data_location, covs_to_include=[]) method = "binary.random" params = {'conf.level': 95.0, 'digits': 3, 'fp_col2_str': u'[default]', 'fp_show_col4': True, 'to': 'only0', 'fp_col4_str': u'Ev/Ctrl', 'fp_xticks': '[default]', 'fp_col3_str': u'Ev/Trt', 'fp_show_col3': True, 'fp_show_col2': True, 'fp_show_col1': True, 'fp_plot_lb': '[default]', 'fp_outpath': u'./r_tmp/forest.png', 'rm.method': 'DL', 'adjust': 0.5, 'fp_plot_ub': '[default]', 'fp_col1_str': u'Studies', 'measure': 'OR', 'fp_xlabel': u'[default]', 'fp_show_summary_line': True} result = python_to_R.run_binary_ma(function_name=method, params=params) self.assertIsNotNone(result, "Result is unexpectedly none!")