我在R上使用heatpmap.2()来表示不同样本中的一些基因表达。 但是我尝试了很多东西,但我无法控制样品的宽度。 这是我的代码基本上:
heatmap.2( t(logM[1:6,1:500]),
Colv=NA,
col=my_palette,
colsep=3,
trace=c("none"),
density.info=c("none"),
adjCol = c(1,1), #more or less move text
cexRow = 0.1,
xlab="Mices")
我想缩小列的大小(对应我的样本,我有6个样本,意思是6列,我不能将任何图片发布为插图,对不起)。我在互联网上寻找了一段时间,但无法找到我想要的东西。
非常感谢你的帮助,我认为这可以用1或2行解决,但是当你找不到时......
最诚挚的问候,
答案 0 :(得分:1)
我建议使用pheatmap
库。它不仅提供合理的默认参数,而且还可以轻松定制。
edata <- structure(list(Controll = c(1.88652404567248, 7.56216163122565,
5.14725899353288, 6.08609722473225, -0.299183966356617, 4.25027223369266,
5.45902343668683, 5.85281618559412, 2.93112975036833, 6.12522039745773
), Controll.1 = c(2.29406389045036, 6.97597451795928, 4.5147662930767,
6.09625239882511, 0.921990457532795, 4.17832412568404, 5.95377074638688,
5.37442992479651, 0.54939804990357, 6.72853709005767), Pert. =
c(1.79358946043894,
7.90872166216125, 5.1124575575158, 6.29352463374008, 0.891739809245287,
4.84160106842908, 5.07613585232771, 3.61007431367141, 2.44943490047975,
5.27177316582586), Pert..1 = c(2.20978097040356, 7.57067518392199,
4.59252962972135, 5.91408661908659, -0.339030105179552, 4.25593889774791,
4.80784977136993, 3.46482298621816, 2.34957363521685, 4.47242819598903
)), .Names = c("Controll", "Controll.1", "Pert.", "Pert..1"),
row.names = c("ACRV1",
"DUSP1", "GAB1", "KIF1C", "LASS1", "MITD1", "NR2C2AP", "PLEKHG2",
"TEKT3", "ZDHHC20"), class = "data.frame")
library(pheatmap)
pheatmap(edata)
pheatmap(edata, cellwidth=25)