def METHOD_NAME(adata, top_n=10):
    """Give out the genes that contribute the largest fraction to the total UMI counts.
    Calculates the genes which contribute the largest fraction of UMI counts to the total
     UMI counts (i.e. the most abundant transcripts).
    parameters
    ----------
    adata: :class:`~anndata.AnnData`
        The annotated data matrix.
    top_n: `int` | default = 10
        Integer defining the number of entries to return. If None then the entire table is returned.
    returns
    -------
    DataFrame
        pandas DataFrame containing the top_n genes
    Example
    -------
    >>> import besca as bc
    >>> adata = bc.datasets.simulated_pbmc3k_raw()
    >>> genes = bc.pp.top_counts_genes(adata)
    """
    if isinstance(adata, anndata.AnnData):
        if "frac_reads" in adata.var.columns:
            # generate a table sorted by frac_pos (descending order)
            sorted = adata.var.sort_values(by="frac_reads", ascending=False)
            if top_n == None:
                return sorted
            else:
                return sorted.head(top_n)
        else:
            logging.info("calculating frac_reads")
            # calculate fraciton positive for a gene
            bdata = adata.copy()
            frac_reads(bdata)
            # generate a table sorted by frac_pos (descending order)
            sorted = bdata.var.sort_values(by="frac_reads", ascending=False)
            if top_n == None:
                return sorted
            else:
                return sorted.head(top_n)
    else:
        sys.exit("please pass an AnnData object as data")