論文是
Environmental factors shaping the gut microbiome in a Dutch population
數(shù)據(jù)和代碼的github主頁(yè)鏈接
https://github.com/GRONINGEN-MICROBIOME-CENTRE/DMP
這個(gè)也是數(shù)據(jù)代碼的下載鏈接,可以看目錄結(jié)構(gòu)
https://zenodo.org/record/5910709#.YmAcp4VBzic
今天的推文重復(fù)一下論文中的 Extended Data Fig. 10

論文中做數(shù)據(jù)計(jì)算和做這個(gè)圖定義了一個(gè)很長(zhǎng)很長(zhǎng)的函數(shù),這里只介紹作圖代碼,數(shù)據(jù)計(jì)算的過(guò)程我還看不懂
這里主要有兩個(gè)數(shù)據(jù),一個(gè)是熱圖顏色的數(shù)據(jù),另外一個(gè)是加減號(hào)的文本數(shù)據(jù),部分示例數(shù)據(jù)集如下


讀取數(shù)據(jù)
dat01<-read.csv("ExtendedFig10_01.csv",
header=TRUE,
row.names = 1)
dat02<-read.csv("ExtendedFig10_02.csv",
header=TRUE,
row.names = 1)
他這里還設(shè)置了一些額外參數(shù),我保存到abc.Rdata這個(gè)數(shù)據(jù)集里了,加載這個(gè)數(shù)據(jù)集
load("abc.Rdata")
作圖代碼
pheatmap(dat01,
annotation_row = NULL,
annotation_names_row = T,
labels_row = rownames(dat01),
legend = T,
show_rownames = T,
cluster_rows = clusterFeatures,
cluster_cols = clusterPhenos,
angle_col = 90,
fontsize_number = textSize,
border_color = "#EEEEEE",
na_col = "white",
fontsize = legendTextSize,
treeheight_row = 0,
treeheight_col = 0,
legend_labels = "sig*log(p-value)",
color = myColor,
fontsize_col = colTextSize,
fontsize_row = rowTextSize,
display_numbers = dat02,
breaks = myBreaks,
cellwidth = cellWidth,
cellheight = cellHeight,
filename = NA)

這里參數(shù)有點(diǎn)多,就不在推文里介紹了,爭(zhēng)取錄制視頻介紹吧
示例數(shù)據(jù)和代碼可以在公眾號(hào)后臺(tái)回復(fù) 20220531 獲取
歡迎大家關(guān)注我的公眾號(hào)
小明的數(shù)據(jù)分析筆記本
小明的數(shù)據(jù)分析筆記本 公眾號(hào) 主要分享:1、R語(yǔ)言和python做數(shù)據(jù)分析和數(shù)據(jù)可視化的簡(jiǎn)單小例子;2、園藝植物相關(guān)轉(zhuǎn)錄組學(xué)、基因組學(xué)、群體遺傳學(xué)文獻(xiàn)閱讀筆記;3、生物信息學(xué)入門學(xué)習(xí)資料及自己的學(xué)習(xí)筆記!
