Skip to content

Instantly share code, notes, and snippets.

@jnhutchinson
Created April 9, 2012 15:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jnhutchinson/2344340 to your computer and use it in GitHub Desktop.
Save jnhutchinson/2344340 to your computer and use it in GitHub Desktop.
Heatmaps
source("http://bioconductor.org/biocLite.R") #adds bioconductor site as a package source
BiocLite(“pheatmap”) #downloads and install pheatmap package from bioconductor
library(pheatmap) #loads pheatmap package
install.packages(“RColorBrewer”) #donwnloads and installs a package with useful color themes
Library(RColorBrewer) #load RcolorBrewer package
#LOAD DATA
data=read.delim(“KO-WT-OV-3way.sig.batch.exprs.xls”) #read in expression values for significantly correlated probesets
data=data[,1:6] #subsets data remove the gene symbols, names or EntrezIDs
# GENERATE HEATMAP
pheatmap(data, #expression values for the heatmap
main=“title of plot”, # whatever you want this plot to be names
color=rev(brewer.pal(10, "RdBu")), # uses colorbrewer package to generate 10 values along a red->blue scale (try http://casoilresource.lawr.ucdavis.edu/drupal/node/192 to see the names of more color themes, or just google image search for “RColorBrewer”))
cluster_cols=F, # don’t cluster columns
fontsize_row=10 # font size of the row labels
filename="./results/KO-WT-OV-3way.sig.batch.heatmap.pdf") # name of file output
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment