def GetGOSlims(infile):
    """
    returns a map of go identifiers to slim categories

    Input is the output of Chris Mungal's map2slim.pl.
    """

    go2go = {}
    for line in infile:
        if line[:len("part_of")] == "part_of":
            continue

        mapped, parents = line.split("//")
        go, goslims = mapped.split("=>")
        goslims = goslims.split(" ")
        if len(goslims) == 0:
            continue

        go2go[go.strip()] = filter(
            lambda x: len(x), map(lambda x: x.strip(), goslims))

    return go2go