def format_add_taxa_summary_mapping(summary, tax_order, mapping, header, delimiter=';'):
 tax_order = [delimiter.join(tax) for tax in tax_order]
 header.extend(tax_order)
 (yield ('#%s\n' % ' DCTB '.join(header)))
 for row in mapping:
  sample_id = row[0]
  if (sample_id not in summary):
   continue
  row.extend(map(str, summary[sample_id]))
  (yield ('%s\n' % ' DCTB '.join(row)))

def format_add_taxa_summary_mapping ( summary , tax_order , mapping , header , delimiter = ';' ) : tax_order = [ delimiter . join ( tax ) for tax in tax_order ] header . extend ( tax_order ) ( yield ( '#%s\n' % ' DCTB ' . join ( header ) ) ) for row in mapping : sample_id = row [ 0 ] if ( sample_id not in summary ) : continue row . extend ( map ( str , summary [ sample_id ] ) ) ( yield ( '%s\n' % ' DCTB ' . join ( row ) ) )
formats a summarized taxonomy with mapping information .