Parse a string in simple Wig format and return a GenomicInterval.

  :param line: the string to be parsed
  :param scoreType: treat the score field as having this type.
  :return: GenomicInterval object representing this wig line; the name of the
           interval will be set to 'X', and it's strand to the default.

def parseWigString(line, scoreType=int):
  """
  Parse a string in simple Wig format and return a GenomicInterval.

  :param line: the string to be parsed
  :param scoreType: treat the score field as having this type.
  :return: GenomicInterval object representing this wig line; the name of the
           interval will be set to 'X', and it's strand to the default.
  """
  parts = line.split("\t")
  if (len(parts) < 4):
    raise GenomicIntervalError("failed to parse " + line +
                               " as wig format, too few fields")
  return GenomicInterval(parts[0].strip(), int(parts[1]), int(parts[2]), None,
                         scoreType(parts[3]))