def parse_rarefaction(lines):
 col_headers = []
 comments = []
 rarefaction_data = []
 rarefaction_fns = []
 for line in lines:
  if (line[0] == '#'):
   comments.append(line)
  elif (line[0] == ' DCTB '):
   col_headers = map(strip, line.split(' DCTB '))
  else:
   (rarefaction_fn, data) = parse_rarefaction_record(line)
   rarefaction_fns.append(rarefaction_fn)
   rarefaction_data.append(data)
 return (col_headers, comments, rarefaction_fns, rarefaction_data)

def parse_rarefaction ( lines ) : col_headers = [ ] comments = [ ] rarefaction_data = [ ] rarefaction_fns = [ ] for line in lines : if ( line [ 0 ] == '#' ) : comments . append ( line ) elif ( line [ 0 ] == ' DCTB ' ) : col_headers = map ( strip , line . split ( ' DCTB ' ) ) else : ( rarefaction_fn , data ) = parse_rarefaction_record ( line ) rarefaction_fns . append ( rarefaction_fn ) rarefaction_data . append ( data ) return ( col_headers , comments , rarefaction_fns , rarefaction_data )
function for parsing rarefaction files specifically for use in make_rarefaction_plots .