View source: R/cluster_enrichment.R
cluster_enrichment | R Documentation |
Cluster enrichment Run enrichment (Fisher's exact) on clusters (lists of identifier groups)
cluster_enrichment(geneset, clusters, background = NA, sigfilter = 0.05)
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 |
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.
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))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.