文/伍鸿荣 要做热图,首先我们是要准备好数据,比如说TCGA的rna-seq,或者你自个测有的数据。然后可能利用deseq 包进行差异分析。比如说作者提出的用阿扎胞苷对AML3细胞影响的基因表达谱数据。 数据筛选:在热图上绘制所有5704个FDR调整p值<>
以下是我将在以下R脚本代码: #read in the count matrix mx<-read.table('aza_aml3_countmatrix.xls', row.names="1" ,="" header="">-read.table('aza_aml3_countmatrix.xls',> #read in the DESeq DGE spreadsheet dge<-read.table('deb_deseq.xls', row.names="1" ,="" header="">-read.table('deb_deseq.xls',> #merge the counts onto the DGE spreadsheet mg<> #sort the merged table by p-value smg<-mg[order(mg$pval),>-mg[order(mg$pval),> #select only the columns containing the gene names and count data x<-subset(smg, select="c('Row.names'," 'untr1',="" 'untr2',="" 'untr3',="" 'aza1',="" 'aza2',="">-subset(smg,> #make the table a data frame with gene names then remove duplicate gene name column y<-(as.data.frame(x, row.names="">-(as.data.frame(x,> x<-subset(y,>-subset(y,> #scale rows xt<> xts<> xtst<> #only grab top 100 by p-value h<-head(xtst, n="">-head(xtst,> #set layout options - adjust if labels get cut off pdf('heatmap.pdf',width=7, height=8) #draw heatmap allowing larger margins and adjusting row label font size heatmap(h, margins = c(4,10), cexRow=.4) #output plot to file dev.off() 正如您所看到的,热图显示了这100个最显着差异基因的严重表达变化。还要注意,前100名中的大多数基因是下调的。 |
|