<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_stats_table(self):
 """Adds stats to general table."""


        totals = {sample: sum(counts.values())
                  for sample, counts in self.data.items()}

        percentages = {sample: {k: (v / totals[sample]) * 100
                                for k, v in counts.items()}
                       for sample, counts in self.data.items()}

        headers = {
            'species_a': {
                'title': '% Species a',
                'description': 'Percentage of reads mapping to species a',
                'max': 100,
                'min': 0,
                'suffix': '%',
                'scale': 'YlGn'
            }
        }

        self.general_stats_addcols(percentages, headers)