#acl All:read DanieleMerico:write,delete,revert = Hierrachical Clustering of Array Columns (Samples) using Pearson Correlation = == Script-wise version == {{{ #!rscript numbers=off f.distCol.Pearson <- function (x.mx) # correlation among columns { dist.mx <- 1 - cor (x.mx, method = "pearson") dist.dmx <- as.dist (dist.mx) return (dist.dmx) } x.hclust <- hclust (d = f.distCol.Pearson (x.mx)) plot ( x.hclust, main = "", xlab = "1 - Pearson Correlation") }}} {{{ #!rscript numbers=off library (geneplotter) saveeps ("filename") savepng ("filename") }}} == Function-wise Version == {{{ #!rscript numbers=off f.Hclust_col_pc <- function ( expr.mx, title.ch) { f.distCol.Pearson <- function (expr.mx) # correlation among columns { dist.mx <- 1 - cor (expr.mx, method = "pearson") dist.dmx <- as.dist (dist.mx) return (dist.dmx) } x.hclust <- hclust (d = f.distCol.Pearson (expr.mx)) plot ( x.hclust, main = title.ch, xlab = "1 - Pearson Correlation") } }}} [[attachment:Hclust_arrayCols_PearsCorr_01.R]]