R2-12热图

pcr狗 2017-12-26 08:56:55 阅读: 1086

library(ggplot2)

library(plyr)

require(reshape2)

require(scales)

heat_mir<-read.table("2.csv",header = T,sep = ",")

head(heat_mir)

heat_mir$Name <- with(heat_mir, reorder(ID, CL))

head(heat_mir)

heat.m<-melt(heat_mir)#id(即var.ids)和 观测值(即measure.vars)这两个参数可以只指定其中一个剩余的列被当成另外一个参数的值;如果两个都省略,数值型的列被看成观测值

heat.m<-ddply(heat.m,.(variable),transform,label=rescale(value,to=c(-5,5)))

p <- ggplot(heat.m, aes(variable, Name)) + 

  geom_tile(aes(fill = label),colour = "white") + 

  scale_fill_gradient(low = "orange",high = "red") +

  labs(x="",y="miRNA ID",title="R2-12")

p

heat.png


#use pheatmap 感觉还是这个容易点啊

library(pheatmap)

heat_text<-read.table("2.csv",header = T,sep = ",")

head(heat_text)

row.names(heat_text)<-heat_text$ID

head(heat_text)

heat_text<-heat_text[,2:5]

head(heat_text)

heat_m<-data.matrix(heat_text)

pheatmap(heat_m,scale = "column",

         cluster_rows = TRUE,cluster_cols = FALSE,

         display_numbers=T)

pheat1.png


 
邀请讨论

附件

{{f.title}} 大小 {{f.file_size}} 下载 {{f.count_download}} 金币 {{f.count_gold}}
{{item.nick_name}} 受邀请回答 {{item.create_time}}
{{item.refer_comment.nick_name}} {{item.refer_comment.create_time}}

附件

{{f.title}} 大小 {{f.file_size}} 下载 {{f.count_download}} 金币 {{f.count_gold}}
切换到完整回复 发送回复
赞({{item.count_zan}}) 踩({{item.count_cai}}) 删除 回复 关闭
科研狗©2015-2024 科研好助手,京ICP备20005780号-1 建议意见

服务热线

178 0020 3020

微信服务号