def process_otu_table_sample_ids(sample_id_fields):
 if (len(sample_id_fields) == 0):
  raise ValueError(('Error parsing sample ID line in OTU table. Fields are %s' % ' '.join(sample_id_fields)))
 last_column_header = sample_id_fields[(-1)].strip().replace(' ', '').lower()
 if (last_column_header in ['consensuslineage', 'otumetadata', 'taxonomy']):
  has_metadata = True
  sample_ids = sample_id_fields[:(-1)]
 else:
  has_metadata = False
  sample_ids = sample_id_fields
 return (sample_ids, has_metadata)

def process_otu_table_sample_ids ( sample_id_fields ) : if ( len ( sample_id_fields ) == 0 ) : raise ValueError ( ( 'Error parsing sample ID line in OTU table. Fields are %s' % ' ' . join ( sample_id_fields ) ) ) last_column_header = sample_id_fields [ ( - 1 ) ] . strip ( ) . replace ( ' ' , '' ) . lower ( ) if ( last_column_header in [ 'consensuslineage' , 'otumetadata' , 'taxonomy' ] ) : has_metadata = True sample_ids = sample_id_fields [ : ( - 1 ) ] else : has_metadata = False sample_ids = sample_id_fields return ( sample_ids , has_metadata )
process the sample ids line of an otu table .