Skip to content

Instantly share code, notes, and snippets.

@jnhutchinson
Created April 23, 2013 21:20
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jnhutchinson/5447492 to your computer and use it in GitHub Desktop.
Save jnhutchinson/5447492 to your computer and use it in GitHub Desktop.
pheatmap for pathprint
# annotations
heatmap.annots <- pData(mic.norm.eset)[,c("ID", "study", "stage", "gender")]
heatmap.annots <- as.data.frame(apply(heatmap.annots, 2, unlist))
row.names(heatmap.annots) <- heatmap.annots$ID
heatmap.annots$ID <- NULL
# annotation colors
study_colors <- c("#FF0000","#00FF00", "#0000FF", cbPalette )
names(study_colors) <- unique(unlist(pd$study))
stage_colors <- c("white", "darkgrey", "black")
names(stage_colors) <- unique(unlist(pd$stage))
gender_colors <- c("cyan", "pink")
names(gender_colors) <- unique(unlist(pd$gender))
ann_colors = list(study = study_colors, stage = stage_colors, gender=gender_colors)
for (sd in seq(0.2,0.8, 0.1)){
pheatmap(mic.fingerprint[apply(mic.fingerprint, 1, sd) > sd, ], col = c("blue", "white", "red"), legend_breaks=c(-1,0,1), annotation=heatmap.annots, main=paste("All Samples, sd=", sd, sep=""), show_colnames=F, fontsize_row=10, cluster_cols=TRUE,annotation_colors=ann_colors, show_rownames=F)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment