論文
A highly conserved core bacterial microbiota with nitrogen-fixation capacity inhabits the xylem sap in maize plants
https://www.nature.com/articles/s41467-022-31113-w
本地pdf s41467-022-31113-w.pdf
數(shù)據(jù)代碼鏈接
https://github.com/PlantNutrition/Liyu
今天的推文我們重復(fù)一下論文中的Figure2c
首先是輸入數(shù)據(jù)的格式
第一列是所有的基因名印叁,讀取數(shù)據(jù)后要將其轉(zhuǎn)換成行名
后面每一列是數(shù)據(jù)分組,如果這個基因存在于這一組纯路,就標識為1,如果不存在就標識為0
讀取示例數(shù)據(jù)
library(tidyverse)
library(readxl)
dat01<-read_excel("data/20220618/example_upsetR.xlsx") %>%
column_to_rownames("gene_name")
dat01
作圖代碼
library(UpSetR)
upset(dat01)
如果要突出強調(diào)某一組
queries = list(list(query = intersects,
params = list("group01","group03"),
active = T,
color="#d66a35",
query.name = "ABC"))
upset(dat01,
queries = queries)
接下來是論文中提供的數(shù)據(jù)和代碼
otu_RA <- read.delim('example_data/09-venndiagram/otu_RA.txt', header = TRUE, row.names = 1, sep = '\t')
head(otu_RA)
otu_RA[otu_RA > 0] <- 1
head(otu_RA)
他這里把otu表格里有數(shù)值的就變成1谤狡,只要有數(shù)值就說明這個樣本中有這個otu
list(list(query=intersects,
params=list("RS","BS"),
active=T,
color="red"),
list(query=intersects,
params=list("RS","BS","RE"),
active=T,
color="blue")) -> queries
upset(otu_RA,
nset = 7,
nintersects = 10,
order.by = c('degree','freq'),
decreasing = c(FALSE, TRUE),
mb.ratio = c(0.5, 0.5),
point.size = 1.8,
line.size = 1,
mainbar.y.label = "Intersection size",
sets.x.label = "Set Size",
main.bar.color = "#2a83a2",
sets.bar.color = "#3b7960",
queries = queries)
示例數(shù)據(jù)和代碼可以到論文中去下載净神,或者直接在公眾號后臺留言20220618獲取
明天下午兩點半到3點半直播分享R語言ggplot2科研數(shù)據(jù)可視化入門的一些基礎(chǔ)內(nèi)容,感興趣的可以參加 騰訊會議號984290307
琅豆,密碼220222榔幸。感興趣的參加允乐。參考文檔鏈接https://rpubs.com/xiaoming24/916001
歡迎大家關(guān)注我的公眾號
小明的數(shù)據(jù)分析筆記本
小明的數(shù)據(jù)分析筆記本 公眾號 主要分享:1、R語言和python做數(shù)據(jù)分析和數(shù)據(jù)可視化的簡單小例子牡辽;2喳篇、園藝植物相關(guān)轉(zhuǎn)錄組學敞临、基因組學态辛、群體遺傳學文獻閱讀筆記;3挺尿、生物信息學入門學習資料及自己的學習筆記奏黑!