def _sort_and_fill_taxa_summaries(taxa_summaries):
 master_taxa = []
 for ts in taxa_summaries:
  master_taxa += ts[1]
 master_taxa = sorted(set(master_taxa))
 result = []
 for ts in taxa_summaries:
  samples = ts[0]
  orig_taxa = ts[1]
  orig_data = ts[2]
  data = []
  for taxa in master_taxa:
   try:
    taxa_index = orig_taxa.index(taxa)
    data.append(orig_data[taxa_index])
   except ValueError:
    data.append(([0.0] * len(samples)))
  result.append((samples, master_taxa, array(data)))
 return result

def _sort_and_fill_taxa_summaries ( taxa_summaries ) : master_taxa = [ ] for ts in taxa_summaries : master_taxa += ts [ 1 ] master_taxa = sorted ( set ( master_taxa ) ) result = [ ] for ts in taxa_summaries : samples = ts [ 0 ] orig_taxa = ts [ 1 ] orig_data = ts [ 2 ] data = [ ] for taxa in master_taxa : try : taxa_index = orig_taxa . index ( taxa ) data . append ( orig_data [ taxa_index ] ) except ValueError : data . append ( ( [ 0.0 ] * len ( samples ) ) ) result . append ( ( samples , master_taxa , array ( data ) ) ) return result
sorts and fills the taxonomic information of taxa summaries .