def get_transcript2phylosofs(data, exon2char):
    """
    Return a dictionary from transcript id to its phylosofs representation.
    """
    transcript2phylosofs = {}
    for _, gene in data.groupby('GeneID'):
        for transcript_id, transcript in gene.groupby('TranscriptID'):
            phylosofs = []
            for subexon in transcript.sort_values('SubexonRank')['S_exons']:
                for ortholog in subexon.split('/'):
                    phylosofs.append(exon2char[ortholog])
            transcript2phylosofs[transcript_id] = ''.join(phylosofs)
    return transcript2phylosofs
