Skip to content

Instantly share code, notes, and snippets.

@maromato
Created February 14, 2016 05:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maromato/14befed60da20ea85463 to your computer and use it in GitHub Desktop.
Save maromato/14befed60da20ea85463 to your computer and use it in GitHub Desktop.
#clustering
library(pheatmap)
x <- read.table("summary_est_mod.txt",header=T,sep="\t")
head(x)
y <- cor(x[,3:ncol(x)])
pheatmap(y)
#making a data file for analusis
z <- x[,3:ncol(x)]
z <- as.matrix(z)
rownames(z) <- x[,2]
#ranking based on fold change
ranking <- rank(z[,9])
#taking the data for top and bottom 25 genes
obj <- (ranking < 26)|(nrow(z)-26 < ranking)
#making a heatmap
library(gplots)
heatmap.2(as.matrix(z[obj,]), col=greenred(75), scale="row", key=T, keysize=1.5,density.info="none", trace="none",cexCol=0.9, cexRow=0.6)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment