from typing import OrderedDict


def parse_gene_set(gene_set_fp):
    """Parses gene set file and returns a (group)-(gene set) dictionary.
    Attribute:
        gene_set_fp (str): File path to a gene set file.
    """
    group_gene_set_dict = OrderedDict()

    with open(gene_set_fp) as inFile:
        for line in inFile.readlines():
            tokens = line.strip().split('\t')
            group = tokens[0]
            gene_set = set(tokens[1:])

            group_gene_set_dict[group] = gene_set

    return group_gene_set_dict