Learn R Programming

GOsummaries (version 2.6.0)

gosummaries.kmeans: Prepare gosummaries object based on k-means results

Description

The gosummaries object is created based on the genes in the clusters, it is possible to add corresponding gene expression data as well.

Usage

"gosummaries"(x, exp = NULL, annotation = NULL, components = 1:length(x$size), organism = "hsapiens", ...)

Arguments

x
an object of class kmeans
exp
an expression matrix, with row names corresponding to the names of the genes in clusters (Optional)
annotation
a data.frame describing the samples, its row names should match with column names of exp (Optional)
components
numeric vector of clusters to annotate
organism
the organism that the gene lists correspond to. The format should be as follows: "hsapiens", "mmusculus", "scerevisiae", etc.
...
GO annotation filtering parameters as defined in gosummaries.default

Value

A gosummaries object.

Details

The k-means clustering of expression matrix naturally defines a set of gene lists that can be annotated functionally and displayed as a GOsummaries figure. This functon takes in a kmeans object and and converts it to a gosummaries object that can be plotted. If expression matrix is attached then the panel shows the expression values for each gene as boxplots, if not then number of genes is displayed

It is advisable to filter some genes out before doing the clustering since the very large gene lists (more than 2000 genes) might fail the annotation step and are usually not too specific either.

Examples

Run this code
## Not run: 
# data(tissue_example)
# 
# # Filter genes and perform k-means
# sd = apply(tissue_example$exp, 1, sd)
# exp2 = tissue_example$exp[sd > 0.75,]
# exp2 = exp2 - apply(exp2, 1, mean)
# kmr = kmeans(exp2, centers = 6, iter.max = 100)
# 
# # Create gosummaries object  
# gs_kmeans = gosummaries(kmr, exp = exp2, annotation = tissue_example$annot)
# plot(gs_kmeans, panel_height = 0, components = 1:3, fontsize = 8)
# plot(gs_kmeans, classes = "Tissue", components = 1:3, fontsize = 8)
# ## End(Not run)

Run the code above in your browser using DataLab