cluster_enrichment: cluster_enrichment

View source: R/cluster_enrichment.R

cluster_enrichmentR Documentation

cluster_enrichment

Description

Cluster enrichment Run enrichment (Fisher's exact) on clusters (lists of identifier groups)

Usage

cluster_enrichment(geneset, clusters, background = NA, sigfilter = 0.05)

Arguments

geneset

is a GeneSet object for pathway annotation

clusters

is a list of clusters (gene lists) to calculate enrichment on

background

is a list of genes to serve as the background for enrichment

sigfilter

minimum significance threshold default is .05

Details

This function will calculate enrichment (Fisher's exact test for membership overlap) on

a series of lists of genes, such as from a set of clusters. The results are returned as

a list of results matrices in the order of the input clusters.

Examples

dontrun{
        library(leapr)

        # read in the example transcriptomic data
        data("transdata")

        # read in the pathways
        data("ncipid")
        
        # for the example we will limit the number of transcripts considered - arbitrarily in this case
        transdata = transdata[1:3000,]

        # perform heirarchical clustering on the  data
        transdata.hc = hclust(dist(transdata), method="ward.D2")
        
        transdata.hc.clusters = cutree(transdata.hc, k=5)
        
        #calculates enrichment for each of the clusters individually and returns a list
        #   of enrichment results
        transdata.hc.enrichment = cluster_enrichment(geneset=ncipid, clusters=transdata.hc.clusters, background=rownames(transdata))
        
}


biodataganache/leapR documentation built on Jan. 20, 2024, 2:55 a.m.