Calculate the absolute error for the analysis cases. Must be called after get_experimental_ddg_values.

def compute_absolute_error(self, predicted_data, record, dataframe_record):
        '''Calculate the absolute error for the analysis cases. Must be called after get_experimental_ddg_values.'''

        new_idxs = []
        for analysis_set in self.get_analysis_sets(record):
            ddg_details = record['DDG'][analysis_set]
            exp_ddg_fieldname = BenchmarkRun.get_analysis_set_fieldname('Experimental', analysis_set)
            absolute_error_fieldname = BenchmarkRun.get_analysis_set_fieldname('AbsoluteError', analysis_set)
            new_idxs.append(absolute_error_fieldname)
            dataframe_record[absolute_error_fieldname] = None

            if ddg_details and predicted_data[self.ddg_analysis_type] != None:
                absolute_error = abs(dataframe_record[exp_ddg_fieldname] - predicted_data[self.ddg_analysis_type])
                dataframe_record[absolute_error_fieldname] = absolute_error

        # Update the CSV headers
        try:
            idx = self.csv_headers.index('AbsoluteError')
            self.csv_headers = self.csv_headers[:idx] + new_idxs + self.csv_headers[idx + 1:]
        except ValueError, e: pass