def parse_irefindex(path, n_data=5):
  """Parse first @n_data@ data lines irefindex data file at @path@
  @return field_map, data where @field_map@ is a map of field name to index number
    and @data@ is an array of arrays with inner array the result of splitting a 
    data line on tab characters
  """
  field_map = {}
  data = []
  with open(path) as fh:
    header_line = fh.readline()
    i = 0
    for field in header_line[1:].split("\t"):
      field_map[field] = i
      i += 1

    i = 0
    for line in fh:
      data.append(line.split("\t"))
      i += 1
      if (i > n_data):
        break
  return field_map, data