def read_gmt(path) -> dict:
    """
    Load gmt file representing gene sets into dict {geneset: gene symbols}.
    """
            
    d = {}
    with open(path, "r") as f:
        for line in f.readlines():
                    
            if line == '\n':
                continue
                    
            row = line.split("\t")
            geneset_name = row[0]
                    
            # row[1] is a link
            gene_symbols = row[2:]
            d[geneset_name] = [s for s in gene_symbols if s not in {'', '\n'}]

    return d