def estimate(self, experiment):
     for i, control_i in enumerate(self.controls_list):
         for j, control_j in enumerate(self.controls_list):
             if control_i.from_channel == control_j.from_channel and i != j:
                 raise util.CytoflowOpError("Channel {0} is included more than once"
                                            .format(control_i.from_channel))
                 
     # check for experiment metadata used to estimate operations in the
     # history, and bail if we find any
     for op in experiment.history:
         if hasattr(op, 'by'):
             for by in op.by:
                 if 'experiment' in experiment.metadata[by]:
                     raise util.CytoflowOpError('experiment',
                                                "Prior to applying this operation, "
                                                "you must not apply any operation with 'by' "
                                                "set to an experimental condition.")
                                            
     self.controls = {}
     for control in self.controls_list:
         self.controls[(control.from_channel, control.to_channel)] = control.file
         
     if not self.subset:
         warnings.warn("Are you sure you don't want to specify a subset "
                       "used to estimate the model?",
                       util.CytoflowOpWarning)
                 
     try:
         ColorTranslationOp.estimate(self, experiment, subset = self.subset)
     except:
         raise
     finally:
         self.changed = (Changed.ESTIMATE_RESULT, self)
    def estimate(self, experiment):
        for i, control_i in enumerate(self.controls_list):
            for j, control_j in enumerate(self.controls_list):
                if control_i.from_channel == control_j.from_channel and i != j:
                    raise util.CytoflowOpError(
                        "Channel {0} is included more than once".format(
                            control_i.from_channel))

        self.controls = {}
        for control in self.controls_list:
            self.controls[(control.from_channel,
                           control.to_channel)] = control.file

        if not self.subset:
            warnings.warn(
                "Are you sure you don't want to specify a subset "
                "used to estimate the model?", util.CytoflowOpWarning)

        ColorTranslationOp.estimate(self, experiment, subset=self.subset)

        self.changed = "estimate_result"