code: def add_stats_table(self):
          
  
          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)
docs: Adds stats to general table.