def read_gmt(fileobj):
    """Read a .gmt file into a gene set name -> [genes] dictionary.

    Args:
       fileobj (string or file like object):

    Returns:
       (dict): branch-id -> markers dictionary
    """

    # Currently assumes gmt file.
    gene_sets = {}

    for line in fileobj:
        row = line.strip().split("\t")
        gene_sets[row[0]] = row[2:]

    return gene_sets