def make_otu_table(otu_map_f, otu_to_taxonomy=None, delim='_', table_id=None, otu_ids_to_exclude=None, sample_metadata=None):
 (data, sample_ids, otu_ids) = parse_otu_map(otu_map_f, delim=delim, otu_ids_to_exclude=otu_ids_to_exclude)
 if (otu_to_taxonomy is not None):
  otu_metadata = []
  for o in otu_ids:
   otu_metadata.append({'taxonomy': otu_to_taxonomy.get(o, ['None'])})
 else:
  otu_metadata = None
 if (sample_metadata is not None):
  try:
   sample_metadata = [sample_metadata[sample_id] for sample_id in sample_ids]
  except KeyError:
   raise KeyError('Sample IDs found in OTU map without sample metadata')
 try:
  return Table(data, otu_ids, sample_ids, observation_metadata=otu_metadata, sample_metadata=sample_metadata, table_id=table_id, generated_by=get_generated_by_for_biom_tables(), create_date=datetime.now().isoformat())
 except ValueError as e:
  raise ValueError(("Couldn't create OTU table. Is your OTU map empty? Original error message: %s" % str(e)))

def make_otu_table ( otu_map_f , otu_to_taxonomy = None , delim = '_' , table_id = None , otu_ids_to_exclude = None , sample_metadata = None ) : ( data , sample_ids , otu_ids ) = parse_otu_map ( otu_map_f , delim = delim , otu_ids_to_exclude = otu_ids_to_exclude ) if ( otu_to_taxonomy is not None ) : otu_metadata = [ ] for o in otu_ids : otu_metadata . append ( { 'taxonomy' : otu_to_taxonomy . get ( o , [ 'None' ] ) } ) else : otu_metadata = None if ( sample_metadata is not None ) : try : sample_metadata = [ sample_metadata [ sample_id ] for sample_id in sample_ids ] except KeyError : raise KeyError ( 'Sample IDs found in OTU map without sample metadata' ) try : return Table ( data , otu_ids , sample_ids , observation_metadata = otu_metadata , sample_metadata = sample_metadata , table_id = table_id , generated_by = get_generated_by_for_biom_tables ( ) , create_date = datetime . now ( ) . isoformat ( ) ) except ValueError as e : raise ValueError ( ( "Couldn't create OTU table. Is your OTU map empty? Original error message: %s" % str ( e ) ) )
generate a biom table from an otu map parameters otu_map_f : file-like object the otu map .