def get_stratified_genome_coverage(term_coverage_df):
    """
    Turn the dataframe with term count (i.e. how many terms of this database can this
    gene be found in) information into a wide-form dataframe with the number of genes
    that are covered by 0, 1, 2, or 3+ terms in a given database.
    
    term_coverage_df: dataframe with at least columns: [shorthand, term_count, database]
    """
    
    def classify_gene_coverage(n):
        group = str(int(n)) if n < 3 else '3+'
        return group

    gene_coverage_group = term_coverage_df.term_count.apply(classify_gene_coverage)
    term_coverage_df = term_coverage_df.assign(gene_coverage_group = gene_coverage_group)


    genome_coverage_df = term_coverage_df.groupby(['database', 'gene_coverage_group']).apply(len)
    genome_coverage_df = genome_coverage_df.unstack()

    # Sort columns
    sorted_columns = genome_coverage_df.columns.to_list()
    reverse_columns = genome_coverage_df.columns.sort_values(ascending = False).to_list()

    genome_coverage_df = genome_coverage_df.loc[:, reverse_columns]
    
    return genome_coverage_df