Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/clusterEvaluation.R

Evaluate a given grouping of genes or terms with respect to their GO similarity.

1 | ```
evaluateClustering(clust, Sim)
``` |

`clust` |
vector of cluster labels (integer or character) for each gene |

`Sim` |
similarity matrix |

If necessary, more details than the description above

evaluateClustering returns a list with two items:

`clusterstats ` |
matrix (ncluster x 2) of median within cluster similarities and median absolute deviations |

`clustersil` |
cluster silhouette values |

Holger Froehlich

Rousseeuw, P., Silhouettes: a graphical aid to the interpretation and validation of cluster analysis, J. Comp. and Applied Mathematics, 1987, 20, 53-6

`getGeneSimPrototypes`

, `getGeneSim`

, `getTermSim`

, `GOenrichment`

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | ```
setOntology("BP")
gomap <- get("gomap",env=GOSimEnv)
allgenes = sample(names(gomap), 1000) # suppose these are all genes
genesOfInterest = sample(allgenes, 20) # suppose these are all genes of interest
sim = getGeneSim(genesOfInterest,verbose=FALSE) # and these are their similarities
hc = hclust(as.dist(1-sim), method="ward") # use them to perform a clustering
plot(hc) # plot the cluster tree
cl = cutree(hc, k=3) # take 3 clusters
if(require(cluster)){
ev = evaluateClustering(cl, sim) # evaluate the clustering
print(ev$clusterstats) # print out some statistics
plot(ev$clustersil,main="") # plot the cluster silhouettes
}
# investigate cluster 1 further
if(require(topGO))
GOenrichment(genesOfInterest[cl == 1], allgenes, cutoff=0.05) # print out what cluster 1 is about
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.