mkatari-bioinformatics-august-2013-clustering
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
mkatari-bioinformatics-august-2013-clustering [2014/12/11 14:41] – mkatari | mkatari-bioinformatics-august-2013-clustering [2014/12/11 14:55] – [K-means] mkatari | ||
---|---|---|---|
Line 70: | Line 70: | ||
< | < | ||
- | sigGenesMean = rowMeans(sigGenes.normalized) | + | # this function takes an vector to be calculated. |
- | sigGenesSD | + | scaleData <- function(x) { |
+ | x = as.numeric(x) | ||
+ | | ||
+ | sdx = sd(x) | ||
+ | y = (x-meanx)/ | ||
+ | return(y) | ||
+ | } | ||
+ | |||
+ | #we need to transpose it because apply function returns the genes as different columns. | ||
+ | scaledSigGenes = t(apply(sigGenes.normalized, | ||
+ | colnames(scaledSigGenes)=colnames(sigGenes.normalized) | ||
</ | </ | ||
+ | |||
====== Heatmap ====== | ====== Heatmap ====== |
mkatari-bioinformatics-august-2013-clustering.txt · Last modified: 2015/06/17 13:26 by mkatari