Shiny app: effects of different linkage methods on the hierarchical clustering

Ming Tang
Sat Jul 25 11:02:24 2015

Introduction of the app

  • ncidat is the microarray gene expression data for different cancer types
  • hclust command is used to do the hierachical clustering
  • linkage methods: “ward.D”, “ward.D2”, “single”, “complete”, “average” are used to test the clustering effect

The data structure

# install the package if you do not have it.
# install.packages("ISLR")
library(ISLR)
ncidat = t(NCI60$data)
colnames(ncidat) = NCI60$labs
# how many genes and samples in the data matrix?
dim(ncidat)
[1] 6830   64
# what are the samples
unique(colnames(ncidat))
 [1] "CNS"         "RENAL"       "BREAST"      "NSCLC"       "UNKNOWN"    
 [6] "OVARIAN"     "MELANOMA"    "PROSTATE"    "LEUKEMIA"    "K562B-repro"
[11] "K562A-repro" "COLON"       "MCF7A-repro" "MCF7D-repro"

Complete linkage

Different likages give you different clusters. For example: complete linkage.

plot of chunk unnamed-chunk-2

Play with the shiny app

Access the app on shinyapps

choose different linkage methods and cluster numbers to see the effect.