-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathComplexHeatmap
27 lines (21 loc) · 983 Bytes
/
ComplexHeatmap
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
source("https://bioconductor.org/biocLite.R")
biocLite("ComplexHeatmap")
biocLite("colorspace")
library(ComplexHeatmap)
# read the drug response data
data1<-read.table("AUCs_with_names_of_Drugs.txt", header=T, sep="\t", na.strings = "NA", fill=T)
row.names(data1)<-data1$SAMPLE
r.data1<-data1[,2:the dimensions]
r.data1_matrix<-data.matrix(r.data1)
# set the order of raw and column if needed
data2<-read.table("crc_final_colorder.txt", header=T, sep="\t", na.strings = "NA", fill=T)
v.data2<-as.vector(t(data2))
data3<-read.table("crc_final_roworder.txt", header=T, sep="\t", na.strings = "NA", fill=T)
v.data3<-as.vector(t(data3))
# draw heatmap defaulting clustering
Heatmap(r.data1_matrix, name = "AUC")
# draw heatmap k-means clustering
Heatmap(r.data1_matrix, name = "AUC", row_km = 2, row_km_repeats = 100, column_km = 3, column_km_repeats = 100)
# make the plot
dev.copy(tiff,"CRCHETERODRUGALL_HEAT_Kmeans.tiff",width=22.7, height=11, units="in",res=200)
dev.off()