Size: 1085
Comment:
|
← Revision 5 as of 2010-03-30 21:57:00 ⇥
Size: 1210
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 7: | Line 7: |
#!rscript numbers=off | |
Line 25: | Line 26: |
#!rscript numbers=off | |
Line 36: | Line 38: |
#!rscript numbers=off | |
Line 53: | Line 56: |
main = "", | main = title.ch, |
Line 58: | Line 61: |
[[attachment:Hclust_arrayCols_PearsCorr_01.R]] |
Hierrachical Clustering of Array Columns (Samples) using Pearson Correlation
Script-wise version
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")
library (geneplotter)
saveeps ("filename")
savepng ("filename")
Function-wise Version
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")
}