首页 > 编程知识 正文

解决巴以冲突的完美方案,电车难题的完美解决办法

时间:2023-05-03 20:48:54 阅读:179715 作者:3472

关联图的完美解决方案安装-PheatMap软件包install.packages(PheatMap )软件包并加载数据的库(-PheatMap )和生成测试数据集的test 全部取出正3test[1: 10,seq (1,10,2 ) ]=test[1:10,seq ) 1,10,2 ) ]3#11-20行,246810列,全部取出正1 teq seq ) 2,10,2 ) )=test(15:20,seq ) 2,10,2 ) (5head ) test ) )添加] 5.8621581.00251104.6433831.3927777720 ] 2.1703320.9238553.270871-1.54415172.46412.79953282 [ 3,] 1.54441512.79953282 ] 3.2149880.85547053. ] 2.112973-0.3915936.574049.12242742.8164445.02743305 [ 5,5.3915936 ] 0.574049.122 ] 3.8759250.18356784 ] 4.492317-1.3624362.605374-0.7925712.541456.702127776 ] 2.412597-0.686675292.6934780.5390070 [ 2,] 3. ] 3.164220-0.80261049.139665 ] 1.781402-0.028995683.702517-0.4853577 [ 5, ] 3.4350760.714996452.017988-0.7940890 [ 6,]2.561281(31073192 ) 372816-0.4561410#添加行名和列名colnames(test )=sep=' ' )头(test ) )。 test1 test2test3test4test5test6gene 15.8621581.00251104.6433831.3927443.078703-0.7025575 gene 2.1703320.9238555553 5547053.535641-0.1205533.057674.53514690 gene 4.112973-0.3915936.574049.124274.8164445.02212973-0.3915151515151515151515151515151593 8-1.19018925 gene 6.492317-1.3624362.605374-0.7925712.541456.70211275 test7test 2.412597-0.6866675292.69292 0.3781316 gene 3.164220-0.80261049.139696.3642766696 95683.702517-0.4853577 gene 53.4350760.714996452.017988-0.7777

#取消列群集,并使用颜色pheatmap(test,cluster_cols=FALSE,color=colorramppalette(c ) ' green ',' white ',' red ' )

添加组信息以使pheatmap显示行或列组信息的Time, 添加CellType组信息annotation _ col=data.frame (cell type=factor (rep (c ) (x1 ),) X2 ) Time=1:5 ) rownames 1:10,sep=' ' ) GeneClass组信息annotation _ row=data.frame (gene class=factor (rep (c (P1 ),) P2 ),) P3 ) 3 ) ) ) ) rownames(annotation_row )=paste('gene ',1:20,sep=' ) #用于绘制的pheatmap(test,annnotation_col=)

使用annotation_colors参数选择每个组的颜色ann_colors-list(time=c(white ),) green )、celltype=c ) x1='#1b9e77 P2='#E7298A ',P3='#66A61E ' ) )绘制pheatmap(test,annotation_col=annotatation

使用cut_rows和cut_cols,可以基于矩阵聚类数据将热图映射到pheatmap(test,annotation_col=annotation_col, annotation _ row=annotation annotation _ colors=ann _ colors,cutree_rows=3,cutree_cols=2) #

查看pheatmap群集结果result-Pheatmap(test ) summary (result ) lengthclassmodetree _ row7hclustlisttree _ col7hclustlistkk

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。