nodes: 0, module; 1, function_definition; 2, function_name:sortmerna_detailed_barplot; 3, parameters; 4, block; 5, identifier:self; 6, expression_statement; 7, comment:# Specify the order of the different possible categories; 8, expression_statement; 9, expression_statement; 10, for_statement; 11, for_statement; 12, comment:# Config for the plot; 13, expression_statement; 14, expression_statement; 15, comment:""" Make the HighCharts HTML to plot the sortmerna rates """; 16, assignment; 17, assignment; 18, identifier:sample; 19, attribute; 20, block; 21, identifier:key; 22, identifier:metrics; 23, block; 24, assignment; 25, call; 26, identifier:keys; 27, call; 28, identifier:metrics; 29, call; 30, identifier:self; 31, identifier:sortmerna; 32, for_statement; 33, expression_statement; 34, identifier:pconfig; 35, dictionary; 36, attribute; 37, argument_list; 38, identifier:OrderedDict; 39, argument_list; 40, identifier:set; 41, argument_list; 42, identifier:key; 43, subscript; 44, block; 45, assignment; 46, pair; 47, pair; 48, pair; 49, identifier:self; 50, identifier:add_section; 51, keyword_argument; 52, attribute; 53, identifier:sample; 54, if_statement; 55, subscript; 56, dictionary; 57, string; 58, string; 59, string; 60, string; 61, string; 62, string; 63, identifier:plot; 64, call; 65, identifier:self; 66, identifier:sortmerna; 67, boolean_operator; 68, block; 69, identifier:keys; 70, identifier:key; 71, pair; 72, string_content:id; 73, string_content:sortmerna-detailed-plot; 74, string_content:title; 75, string_content:SortMeRNA: Hit Counts; 76, string_content:ylab; 77, string_content:Reads; 78, attribute; 79, argument_list; 80, not_operator; 81, not_operator; 82, expression_statement; 83, string; 84, call; 85, identifier:bargraph; 86, identifier:plot; 87, attribute; 88, identifier:keys; 89, identifier:pconfig; 90, comparison_operator:key in ["total", "rRNA", "non_rRNA"]; 91, comparison_operator:"_pct" in key; 92, call; 93, string_content:name; 94, attribute; 95, argument_list; 96, identifier:self; 97, identifier:sortmerna; 98, identifier:key; 99, list; 100, string:"_pct"; 101, identifier:key; 102, attribute; 103, argument_list; 104, identifier:key; 105, identifier:replace; 106, string:"_count"; 107, string:""; 108, string:"total"; 109, string:"rRNA"; 110, string:"non_rRNA"; 111, identifier:metrics; 112, identifier:add; 113, identifier:key
code: def sortmerna_detailed_barplot (self):
          """ Make the HighCharts HTML to plot the sortmerna rates """
  
          # Specify the order of the different possible categories
          keys = OrderedDict()
          metrics = set()
          for sample in self.sortmerna:
              for key in self.sortmerna[sample]:
                  if not key in ["total", "rRNA", "non_rRNA"] and not "_pct" in key:
                      metrics.add(key)
  
          for key in metrics:
              keys[key] = { 'name': key.replace("_count","") }
  
          # Config for the plot
          pconfig = {
              'id': 'sortmerna-detailed-plot',
              'title': 'SortMeRNA: Hit Counts',
              'ylab': 'Reads'
          }
  
          self.add_section( plot = bargraph.plot(self.sortmerna, keys, pconfig) )