def parse_taxonomy(infile):
 res = {}
 for line in infile:
  if ((not line) or line.startswith('#')):
   continue
  line = line.rstrip('\n')
  fields = line.split(' DCTB ')
  otu = fields[0].split(' ')[0]
  res[otu] = taxa_split(fields[1])
 return res

def parse_taxonomy ( infile ) : res = { } for line in infile : if ( ( not line ) or line . startswith ( '#' ) ) : continue line = line . rstrip ( '\n' ) fields = line . split ( ' DCTB ' ) otu = fields [ 0 ] . split ( ' ' ) [ 0 ] res [ otu ] = taxa_split ( fields [ 1 ] ) return res
parse a taxonomy file .