def __init__(self, ma_unit, cur_txs, cur_group_str, conf_level=None, parent=None):
     super(DiagnosticDataForm, self).__init__(parent)
     self.setupUi(self)
     
     if conf_level is None:
         raise ValueError("Confidence level must be specified")
     self.global_conf_level = conf_level
     self.mult = meta_py_r.get_mult_from_r(self.global_conf_level)
     
     self.setup_signals_and_slots()
     
     # Assign stuff
     self.ma_unit = ma_unit
     self.cur_groups = cur_txs
     self.group_str = cur_group_str
     self.cur_effect = "Sens" # arbitrary
     self.entry_widgets = [self.two_by_two_table, self.prevalence_txt_box,
                           self.low_txt_box, self.high_txt_box,
                           self.effect_txt_box,]
     self.text_boxes = [self.low_txt_box, self.high_txt_box,
                        self.effect_txt_box, self.prevalence_txt_box]
     
     self.ci_label.setText("{0:.1f}% Confidence Interval".format(self.global_conf_level))
     self.initialize_form()
     self.setup_inconsistency_checking()
     self.undoStack = QUndoStack(self)
     
     #self.setup_clear_button_palettes()
     self._update_raw_data()    # ma_unit -> table
     self._populate_effect_cmbo_box()     # make cmbo box entries for effects
     self.set_current_effect()   # fill in current effect data in line edits
     self._update_data_table()          # fill in the rest of the data table
     self.enable_back_calculation_btn()
     
     self.current_prevalence = self._get_prevalence_str()
    def __init__(self, ma_unit, cur_txs, cur_group_str, cur_effect, conf_level=None, parent=None):
        super(BinaryDataForm2, self).__init__(parent)
        self.setupUi(self)
        
        if conf_level is None:
            raise ValueError("Confidence level must be specified")
        self.global_conf_level = conf_level
        self.mult=meta_py_r.get_mult_from_r(self.global_conf_level)
        
        self._setup_signals_and_slots()
        
        # Assign stuff
        self.ma_unit = ma_unit
        self.cur_groups = cur_txs
        self.group_str = cur_group_str
        self.cur_effect = cur_effect
        self.entry_widgets = [self.raw_data_table, self.low_txt_box,
                              self.high_txt_box, self.effect_txt_box]
        self.text_boxes = [self.low_txt_box, self.high_txt_box, self.effect_txt_box]
        
        self.ci_label.setText("{0:.1f}% Confidence Interval".format(self.global_conf_level))
        self.initialize_form()             # initialize all cell to empty items
        self.setup_inconsistency_checking()
        self.undoStack = QUndoStack(self)

        #self.setup_clear_button_palettes()    # Color for clear_button_pallette
        self._update_raw_data()               # ma_unit --> table
        self._populate_effect_data()          # make combo boxes for effects
        self.set_current_effect()   # fill in current effect data in line edits
        self._update_data_table()   # fill in 2x2
        self.enable_back_calculation_btn()
 def __init__(self, ma_unit, cur_txs, cur_group_str, cur_effect, conf_level=None, parent=None):
     super(ContinuousDataForm, self).__init__(parent)
     self.setupUi(self)
     self.setup_signals_and_slots()
     
     if conf_level is None:
         QMessageBox.critical(self, "insufficient arguments", "Confidence interval must be specified")
         raise ValueError("Confidence interval must be specified")
     self.conf_level = conf_level
     self.mult = meta_py_r.get_mult_from_r(self.conf_level)
     
     self.ma_unit = ma_unit
     self.cur_groups = cur_txs
     self.cur_effect = cur_effect
     self.group_str = cur_group_str
     self.metric_parameter = None
     self.entry_widgets = [self.simple_table, self.g1_pre_post_table,
                           self.g2_pre_post_table, self.effect_txt_box,
                           self.low_txt_box, self.high_txt_box,
                           self.correlation_pre_post]
     self.text_boxes = [self.low_txt_box, self.high_txt_box,
                        self.effect_txt_box, self.correlation_pre_post]
     self.ci_label.setText("{0:.1f}% Confidence Interval".format(self.conf_level))
     self.current_item_data = {}
     
     # Set the table headers to reflect the group names
     groups_names = QStringList(self.cur_groups)
     self.simple_table.setVerticalHeaderLabels(groups_names)
     
     self.tables = [self.simple_table, self.g1_pre_post_table, self.g2_pre_post_table]
     for table in self.tables:
         self._set_col_widths(table)
         
     self.grp_1_lbl.setText(QString(self.cur_groups[0]))
     self.grp_2_lbl.setText(QString(self.cur_groups[1]))
     
     self.setup_clear_button_palettes() # Color for clear_button_pallette
     self.initialize_form() # initialize cells to empty items 
     self.undoStack = QUndoStack(self)
     
     self.update_raw_data()
     self._populate_effect_data()
     self.set_current_effect()
     self.impute_data()
     self.enable_back_calculation_btn()
     
     print("current effect: %s" % str(self.cur_effect))
     # Hide pre-post for SMD until it is implemented
     if self.cur_effect not in ["MD","SMD"]:
         self.grp_box_pre_post.setVisible(False)
         self.adjustSize()
         
     self.current_correlation = self._get_correlation_str()
    def __init__(self,
                 ma_unit,
                 cur_txs,
                 cur_group_str,
                 cur_effect,
                 conf_level=None,
                 parent=None):
        super(BinaryDataForm2, self).__init__(parent)
        self.setupUi(self)

        if conf_level is None:
            raise ValueError("Confidence level must be specified")
        self.global_conf_level = conf_level
        self.mult = meta_py_r.get_mult_from_r(self.global_conf_level)

        self._setup_signals_and_slots()

        # Assign stuff
        self.ma_unit = ma_unit
        self.cur_groups = cur_txs
        self.group_str = cur_group_str
        self.cur_effect = cur_effect
        self.entry_widgets = [
            self.raw_data_table, self.low_txt_box, self.high_txt_box,
            self.effect_txt_box
        ]
        self.text_boxes = [
            self.low_txt_box, self.high_txt_box, self.effect_txt_box
        ]

        self.ci_label.setText("{0:.1f}% Confidence Interval".format(
            self.global_conf_level))
        self.initialize_form()  # initialize all cell to empty items
        self.setup_inconsistency_checking()
        self.undoStack = QUndoStack(self)

        #self.setup_clear_button_palettes()    # Color for clear_button_pallette
        self._update_raw_data()  # ma_unit --> table
        self._populate_effect_data()  # make combo boxes for effects
        self.set_current_effect()  # fill in current effect data in line edits
        self._update_data_table()  # fill in 2x2
        self.enable_back_calculation_btn()
    def __init__(self,
                 ma_unit,
                 cur_txs,
                 cur_group_str,
                 cur_effect,
                 conf_level=None,
                 parent=None):
        super(ContinuousDataForm, self).__init__(parent)
        self.setupUi(self)
        self.setup_signals_and_slots()

        if conf_level is None:
            QMessageBox.critical(self, "insufficient arguments",
                                 "Confidence interval must be specified")
            raise ValueError("Confidence interval must be specified")
        self.conf_level = conf_level
        self.mult = meta_py_r.get_mult_from_r(self.conf_level)

        self.ma_unit = ma_unit
        self.cur_groups = cur_txs
        self.cur_effect = cur_effect
        self.group_str = cur_group_str
        self.metric_parameter = None
        self.entry_widgets = [
            self.simple_table, self.g1_pre_post_table, self.g2_pre_post_table,
            self.effect_txt_box, self.low_txt_box, self.high_txt_box,
            self.correlation_pre_post
        ]
        self.text_boxes = [
            self.low_txt_box, self.high_txt_box, self.effect_txt_box,
            self.correlation_pre_post
        ]
        self.ci_label.setText("{0:.1f}% Confidence Interval".format(
            self.conf_level))
        self.current_item_data = {}

        # Set the table headers to reflect the group names
        groups_names = QStringList(self.cur_groups)
        self.simple_table.setVerticalHeaderLabels(groups_names)

        self.tables = [
            self.simple_table, self.g1_pre_post_table, self.g2_pre_post_table
        ]
        for table in self.tables:
            self._set_col_widths(table)

        self.grp_1_lbl.setText(QString(self.cur_groups[0]))
        self.grp_2_lbl.setText(QString(self.cur_groups[1]))

        self.setup_clear_button_palettes()  # Color for clear_button_pallette
        self.initialize_form()  # initialize cells to empty items
        self.undoStack = QUndoStack(self)

        self.update_raw_data()
        self._populate_effect_data()
        self.set_current_effect()
        self.impute_data()
        self.enable_back_calculation_btn()

        print("current effect: %s" % str(self.cur_effect))
        # Hide pre-post for SMD until it is implemented
        if self.cur_effect not in ["MD", "SMD"]:
            self.grp_box_pre_post.setVisible(False)
            self.adjustSize()

        self.current_correlation = self._get_correlation_str()