def read_isoforms(isoforms_file):
    """Read isoform file.

    The required format is:
    gene_id <tab> comma-sep list of transcripts OR
    gene_id <tab> transcript_id (BioMart format)
    """
    isoforms = {}
    f = open(isoforms_file, "r")
    for line in f:
        line_info = line[:-1].split()
        gene = line_info[0]
        transs = [x for x in line_info[1].split(",") if x != ""]
        # we need correspondence TRANSCRIPT -to- GENE
        for trans in transs:
            isoforms[trans] = gene
    f.close()
    return isoforms