212.樣本量和測序深度的Alpha多樣性稀釋曲線

樣本量和測序深度的Alpha多樣性稀釋曲線

本節作者:劉永鑫,文濤

版本1.0.1,更新日期:2020年6月22日

本項目永久地址:https://github.com/YongxinLiu/MicrobiomeStatPlot ,本節目錄 212RareCurve,包含R markdown(*.Rmd)、Word(*.docx)文檔、測試數據和結果圖表,歡迎廣大同行幫忙審覈校對、並提修改意見。提交反饋的三種方式:1. 公衆號文章下方留言;2. 下載Word文檔使用審閱模式修改和批註後,發送至微信(meta-genomics)或郵件([email protected]);3. 在Github中的Rmd文檔直接修改並提交Issue。審稿人請在創作者登記表 https://www.kdocs.cn/l/c7CGfv9Xc 中記錄個人信息、時間和貢獻,以免專著發表時遺漏。

基本概念

稀釋曲線(Rarefaction Curve,也稱稀疏曲線):一般在微生物組研究中用於評估測序量或樣本量的飽和情況。

本方法主要用於檢測測序量是否充足時。這裏用到的方法是逐步擴大隨機抽樣的測序深度,如果樣本測序深度增大但曲線不再有明顯升高(準確來講,曲線斜率平滑,變化較小)時,則認爲測序量已充足,再增加測序量,樣本的alpha多樣性指標也不會有明顯的變化,即樣本alpha多樣性指標達到穩定。

本方法也常用於評估樣本量是否足夠,是從樣本中隨機抽取一定數量的個體,統計出這些個體所代表物種數目,並以個體數與物種數來構建曲線。它可以用來比較測序不同數量樣本的物種豐富度,也可以用來說明樣本量大小是否合理。評估樣本量是否足夠,通常分析採用對原始樣本進行隨機抽樣的方法,以抽到的樣本與它們所有特徵(如OTU)的數目構建稀釋曲線。在樣本稀釋曲線圖中,當曲線趨向平坦時,說明取樣量充足且合理,更多的取樣只會產生少量新的特徵,反之則表明繼續取樣還可能產生較多新的特徵,有必要進一步增加取樣量。因此,通過繪製稀釋性曲線,可以得出樣品的取樣量是否充足的結論。 

但是就目前擴增子測序深度而言,其實稀釋曲線的判斷樣本測序量是否足夠的問題已經不是非常重的科學問題,目前在樣本量是否充足和宏基因組測序基因集是否飽和方面越來越廣泛的應用。alpha多樣性的計算目前只能通過抽平來計算。但是一次抽平有概率 (小概率)在一定程度上評估錯誤的alpha多樣性結果。所以現在有一些研究者通過多次抽平計算alpha多樣性,並通過求取均值的方式來叫矯正alpha多樣性。稀釋曲線是對單個alpha多樣性結果的補充,可以從不同梯度全面地分析和展示結果。因此,基於不 深度或樣本量水平上展示了alpha多樣性,更加有利於對微生物羣體多樣性的綜合評估。

文獻解讀

稀釋曲線多用於測序量和樣本量是否飽和的評估,在高通量測序初期(5前的文章)中應用較多,目前文章結果種類越來越多樣,而且更多注重結果的新發現而不是評估,在擴增子文章中使用頻率逐漸下降,但在宏基因組的文章中使用頻率較來越多。

例1. 各組中各樣本的多樣性隨測序深度變化

本文是在Microbiome雜誌上發表的楊樹各部分微生物組的16S測序描述文章(Beckers et al., 2017),圖1採用稀釋曲線描述各樣本的測序深度與多樣性的變化。這篇文章分析思想比較和內容都非常簡單,文章發表3年引用過百次,詳見 - 《Microbiome: 簡單套路發高分文章—楊樹微生物組》

注:關於Microbiome的圖片格式和質量說明。Microbiome雜誌的文章圖片都是位圖,不僅圖片有時會字看不清,而且無法被搜索引擎檢索。此圖在文章主頁中插入的圖片質量非常差,是僅有37.5 KB的webp格式,點擊查看原圖(Full size )圖片仍爲webp,且僅爲48.1 KB,圖中文字比較模糊。再使用Adobe Reader打開PDF,複製到Word中,再另存爲jpg/png,圖片更清楚,分別爲200/500 KB。

圖1. 每種取樣部位(Compartment)中每株楊樹測序數據繪製繪製Good的覆蓋率估算值稀釋曲線。A 根際土、B 根、C 莖、D 葉。展示測序的飽合情況,同時展示不同生態位的差異(Y軸座標不同,即Alpha多樣性差別很大),還有每顆樹間也有較大的差別(圖中的每條線代表來自一棵樹的樣品)

Average Good’s coverage estimates (%) and rarefaction curves of individual poplar trees per plant compartment (a rhizosphere soil, b root, c stem, d leaf). Good’s coverage estimates represent averages of 15 independent, clonally replicated poplar trees (rhizosphere soil and root samples) and 11 replicates (stem and leaf samples) (± standard deviation) and were calculated in mothur based on 10,000 iterations. Lowercase letters represent statistical differences at the 95% confidence interval (P < 0.05). Rarefaction curves were assembled showing the number of OTUs, defined at the 97% sequence similarity cut-off in mothur, relative to the number of total sequences.

結果:爲了構建alpha稀釋曲線(圖1),我們從數據集中刪除了單體(只有一個序列的OTU),因爲這些單體可能是由於測序錯誤造成的。爲每個單獨的樣品構建了稀釋曲線,顯示了觀察到的OTU的數量,相對於已鑑定的細菌rRNA序列的總數(圖1),該數量定義爲以Mohur表示的97%序列相似性閾值下的序列數量。正如預期的那樣,內生細菌羣落(圖1b–d)的多樣性遠低於根際羣落(圖1a)。此外,與根際樣品相比,內生樣品的稀釋曲線形狀變化程度更高。評估每個樣品的OTU豐富度的稀釋曲線通常接近飽和度。大多數根內生樣品的飽和度約爲250–300 OTUs,而對於莖和葉樣品只有50–150 OTUs左右。

To construct alpha rarefaction curves (Fig. 1), we removed singletons (OTUs with only one sequence) from the dataset since these singletons could be due to sequencing artefacts. Rarefaction curves were constructed for each individual sample showing the number of observed OTUs, defined at a 97% sequence similarity cut-off in mothur, relative to the number of total identified bacterial rRNA sequences (Fig. 1). As expected, endophytic bacterial communities (Fig. 1b–d) were much less diverse than rhizospheric communities (Fig. 1a). Furthermore, the endophytic samples exhibited a higher degree of variation in the shape of their rarefaction curves as compared to the rhizospheric samples. Rarefaction curves evaluating the OTU richness per sample generally approached saturation. The majority of the root endophytic samples saturated around 250–300 OTUs and around 50–150 OTUs for the stem and leaf samples.

討論:當比較根際土和根內樣品時,我們觀察到OTU稀釋曲線的形狀明顯不同(圖1)。根際土樣品顯示均勻的稀釋曲線(圖1a),而內生樣品的稀釋曲線形狀的變化要大得多,尤其是莖和葉樣品(圖1b-d)。如稀釋曲線所示,內生OTU豐富度的高變異性可能是由楊樹的根和植物地上部的散發和非均勻定植引起。Gottel等人將這種變異的一部分歸因於無法對細菌內生菌羣落進行足夠深而均勻的測序,這是由於宿主16S rRNA基因(本研究檢測到67,000個葉綠體和65,000個線粒體序列)的高度共擴增引起。但是,我們的數據顯示出大致相同的模式,沒有對非目標DNA進行共擴增,並且Good的覆蓋率估算值很高(圖1)。因此,我們的數據表明內生菌落的大量變化是稀釋曲線高度變化的主要原因。根際定植主要是由以下因素驅動的:(a)植物(根際沉積)沉積大量碳(例如,根系分泌物,根冠粘液等),以及(b)相對簡單或不完善的化學作用-將細菌(和其他微生物)吸引到根系分泌物中。

We observed remarkably dissimilar shapes of the OTU rarefaction curves when comparing rhizosphere soil  and endosphere samples (Fig. 1). Rhizosphere soil samples displayed uniform rarefaction curves (Fig. 1a) whereas the variation in the shape of the rarefaction curves from the endophytic samples was much higher, especially for the stem and leaf samples (Fig. 1b–d). High variability of endophytic OTU richness, as depicted by the rarefaction curves, could possibly be caused by sporadic and non-uniform colonization of the roots and aerial plant compartments of Populus [36]. Gottel et al. attributed part of the variation to their inability to sequence the bacterial endophytic community deeply and uniformly enough because of the high co-amplification of organellar 16S rRNA (67,000 chloroplast and 65,000 mitochondrial sequences) [36]. However, our data exhibit roughly the same pattern without the co-amplification of non-target DNA (Table 1) and with high Good’s coverage estimates (Fig. 1). Therefore, our data suggest considerable variation in endophytic colonization as a major reason for the high variability in the rarefaction curves. Indeed, rhizosphere/rhizoplane colonization is primarily driven by (a) the deposition of large amounts of carbon (e.g., root exudates, mucilage by the root caps, etc.) by plants (rhizodeposition) and (b) the relatively simple or inelaborate chemo-attraction of the bacteria (and other microorganisms) to the root exudates.

例2. 樣品和百分比抽樣稀釋曲線

本文是我負責分析發表於Naute Biotechnology(簡稱NBT)的封面文章(Zhang et al., 2019),介紹了水稻羣體層面微生物組的研究並揭示宿主調控根系微生物參與氮利用的現象。詳見《NBT封面:水稻NRT1.1B基因調控根系微生物組參與氮利用》

附圖1. 代表性的秈稻和粳稻品種在根細菌羣成員中的覆蓋度
(a)樣本稀釋曲線:隨着樣品數量的增加,根微生物羣的細菌種類稀釋曲線達到飽和階段,這表明我們羣體中的根微生物捕獲了每個水稻亞種的大部分根細菌成員。分別顯示了兩個位置的秈稻和粳稻品種。(b)隨着測序深度的增加,從秈稻和粳稻品種根系菌羣中檢測到的細菌OTU的稀釋曲線達到飽和階段。每個誤差線代表標準誤差。該圖中重複樣本的數量如下:在地塊I中,秈稻(n = 201),粳稻(n = 80),土壤(n = 12);在地塊II中,秈稻(n = 201),粳稻(n = 81),土壤(n = 12)。

Supplementary Figure 1. Coverage of members in the root bacterial microbiota by the representative indica and japonica varieties.
(a) Rarefaction curves of detected bacterial species of the root microbiota reach the saturation stage with increasing numbers ofsamples, indicating that the root microbiota in our population capture most root bacteria members from each rice subspecies. Indicaand japonica varieties in two locations are shown separately. (b) Rarefaction curves of detected bacterial OTUs of the root microbiotafrom indica and japonica varieties reach saturation stage with increasing sequencing depth. Each vertical bar represents standard error.The numbers of replicated samples in this figure are as follows: in field I, indica (n = 201), japonica (n = 80), soil (n = 12); in field II,indica (n = 201), japonica (n = 81), soil (n = 12).

例3. 樣品和基因(簇)數量的稀釋曲線或等差箱線圖

本文是華大基因覃俊傑、李瑞強、王俊等負責分析發表於Naute的文章(Qin et al., 2010),構建了人類腸道基因集1.0版本,雖然發表近10年,但是里程碑式的成果,目前被引用近8千次。詳見:《Nature:基於宏基因組測序構建人類腸道微生物組參考基因集》

圖2. 預測人體腸道微生物組中的開放閱讀框(稀釋曲線展示樣本量與基因或基因家族數量的關係)。a,測序樣本量與非冗餘基因數量的稀釋曲線。基因積累曲線對應於Sobs值(觀察到的基因數),該值是使用EstimateS 8.2.0對隨機選擇的100個樣本(由於內存限制)計算得出。b,採用三種不同相似度計算來自89種常見腸道微生物物種的基因覆蓋數量和比例的關係。c,基於已知直系同源基團(OG;底部),已知加未知直系同源基團(包括例如假定的、預測的、保守的假定功能;中間)和從宏基因組中恢復直系同源的基因,通過調查的樣本數量捕獲的功能同源簇和新基因家族(> 20個蛋白質)(上)。箱線表示第一和第三四分位數(分別爲第25個和第75個百分位數)之間的四分位間距(IQR),內部的線表示中位數。軸須線分別表示距第一個和第三個四分位數的1.5倍IQR內的最小和最高值。圓圈表示軸須以外的異常值。

Figure 2: Predicted ORFs in the human gut microbiome. a, Number of unique genes as a function of the extent of sequencing. The gene accumulation curve corresponds to the Sobs (Mao Tau) values (number of observed genes), calculated using EstimateS21 (version 8.2.0) on randomly chosen 100 samples (due to memory limitation). b, Coverage of genes from 89 frequent gut microbial species (Supplementary Table 12). c, Number of functions captured by number of samples investigated, based on known (well characterized) orthologous groups (OGs; bottom), known plus unknown orthologous groups (including, for example, putative, predicted, conserved hypothetical functions; middle) and orthologous groups plus novel gene families (>20 proteins) recovered from the metagenome (top). Boxes denote the interquartile range (IQR) between the first and third quartiles (25th and 75th percentiles, respectively) and the line inside denotes the median. Whiskers denote the lowest and highest values within 1.5 times IQR from the first and third quartiles, respectively. Circles denote outliers beyond the whiskers.

結果

我們檢查了在所有個體中發現的流行基因的數量,要求至少兩個讀長的基因才被計算在內,繪製該基因數量與測序樣本量累計分佈曲線(圖2a)。是由100個人確定的(EvaluateS程序可以容納的最高人數)基於指示的覆蓋範圍豐富度估計值,表明我們的目錄涵蓋了85.3%的流行基因。儘管這可能被低估了,但它仍然表明該基因集包含了該隊列的絕大多數流行基因。

We examined the number of prevalent genes identified across all individuals as a function of the extent of sequencing, demanding at least two supporting reads for a gene call (Fig. 2a). The incidence-based coverage richness estimator (ICE), determined at 100 individuals (the highest number the EstimateS program could accommodate), indicates that our catalogue captures 85.3% of the prevalent genes. Although this is probably an underestimate, it nevertheless indicates that the catalogue contains an overwhelming majority of the prevalent genes of the cohort.

我們將330萬個腸道ORF映射到人類腸道中89個常見微生物參考基因組的319,812個基因(目標基因)。在90%的相似度閾值下,80%的靶基因至少有80%的長度被ORF覆蓋(圖2b)。這表明該基因組包括大多數已知的人類腸道細菌基因。

We mapped the 3.3 million gut ORFs to the 319,812 genes (target genes) of the 89 frequent reference microbial genomes in the human gut. At a 90% identity threshold, 80% of the target genes had at least 80% of their length covered by a single gut ORF (Fig. 2b). This indicates that the gene set includes most of the known human gut bacterial genes.

爲了研究流行基因集的功能組成,我們計算了n個個體(n = 2–124;見圖2c)的任何組合中存在的直系同源基因簇和/或基因家族的總數。這種稀釋性分析表明,“已知”功能(在eggNOG或KEGG中註釋)迅速飽和(觀察到5569個簇):對50個個體的任何子集進行採樣時,大多數被檢測到。然而,四分之三的普遍腸道功能由未表徵的直系同源基因簇和/或全新的基因家族組成(圖2c)。當包括這些基因簇時,稀釋曲線僅在最後階段纔開始趨於平穩,並達到更高的水平(檢測到19,338個簇),這證實了大量個體的大量採樣對於獲得如此大量新穎或未知功能的基因是必須的。

To investigate the functional content of the prevalent gene set we computed the total number of orthologous groups and/or gene families present in any combination of n individuals (with n = 2–124; see Fig. 2c). This rarefaction analysis shows that the ‘known’ functions (annotated in eggNOG or KEGG) quickly saturate (a value of 5,569 groups was observed): when sampling any subset of 50 individuals, most have been detected. However, three-quarters of the prevalent gut functionalities consists of uncharacterized orthologous groups and/or completely novel gene families (Fig. 2c). When including these groups, the rarefaction curve only starts to plateau at the very end, at a much higher level (19,338 groups were detected), confirming that the extensive sampling of a large number of individuals was necessary to capture this considerable amount of novel/unknown functionality.

繪圖實戰

測試數據和代碼準備教程,詳見- 211.Alpha多樣性箱線圖(樣章,11圖2視頻)
安裝R包出現問題,可以下載預編譯的R包,地址項目 https://github.com/YongxinLiu/MicrobiomeStatPlot - Data 目錄 - BigDataDownlaodList.md 文檔。

安裝和加載依賴R包

檢查依賴關係是否安裝,有則跳過,無則自動安裝。

# github安裝包需要devtools,檢測是否存在,不存在則安裝
if (!requireNamespace("devtools", quietly = TRUE))
    install.packages("devtools")
library(devtools)
# 檢測amplicon包是否安裝,沒有從源碼安裝
if (!requireNamespace("amplicon", quietly = TRUE))
    install_github("microbiota/amplicon")
# library加載包,suppress不顯示消息和警告信息
suppressWarnings(suppressMessages(library(amplicon)))

# Biconductor包安裝,需要BiocManager
if (!requireNamespace("BiocManager", quietly = TRUE))
    install.packages("BiocManager")
library("BiocManager")
# 檢測amplicon包是否安裝,沒有從源碼安裝
p_list = c("phyloseq", "microbiome")
for(p in p_list){
  if (!requireNamespace(p, quietly = TRUE))
    BiocManager::install(p)}
USEARCH結果繪製稀釋曲線+標準誤

USEARCH中的usearch -alpha_div_rare可以快速計算抽平後特徵表的稀釋曲線數據(詳見:USEARCH流程),我們配合amplicon包中的alpha_rare_curve函數,可以基於稀釋曲線數據一行命令繪製稀釋曲線(Rarefaction curve)+標準誤(standard error)的圖。

通過?alpha_rare_curve查看函數內容。本函數使用計算好的alpha稀釋曲線表格僅僅用於對圖形的繪製,按照分組展示不同處理的稀釋曲線。

使用內置數據快速繪製,輸入文件爲對樣本從1-100%重採樣的豐富度(richness / Observed OTU),樣本元數據和分組列名

(p = alpha_rare_curve(alpha_rare, metadata, groupID = "Group"))
# 保存圖片,指定圖片爲pdf格式方便後期修改,圖片寬89毫米,高56毫米
ggsave(paste0("p1.rare_curve.pdf"), p, width=89*1.5, height=56, units="mm")
ggsave(paste0("p1.rare_curve.png"), p, width=89*1.5, height=56, units="mm")

圖1. 按分組繪製的稀釋曲線+標準誤。我們可以看到三組的豐富度存在明顯區別。輸出圖片可以拉長寬度,或減少高度,以使圖片尺寸更寬,可用於突出曲線平滑,測序量充足的效果。

我們更常用的使用方法,是從外部讀取數據,查看輸入數據格式,逐步繪圖,最後保存圖片。

# 設置數據目錄位置,可以爲本地或網絡;這裏設爲網絡地址,方便大家直接運行
dir="http://210.75.224.110/github/MicrobiomeStatPlot/Data/Science2019/"
# 讀取元數據,參數指定包括標題行(TRUE),列名爲1列,製表符分隔,無註釋行,不轉換爲因子類型
metadata <- read.table(paste0(dir, "metadata.txt"), header=T, row.names=1, sep="\t", comment.char="", stringsAsFactors = F)
# 預覽元數據前3行,前6列,注意分組列名
metadata[1:3, 1:6]
# 讀取usearch生成的稀釋表
alpha_rare = read.table(paste0(dir, "alpha/alpha_rare.txt"), row.names= 1, header=T, sep="\t",  comment.char="", stringsAsFactors = F)
# 預覽稀釋表前3行和9列
alpha_rare[1:3,1:9]

# 繪製稀釋曲線+標準誤,本次選擇地點"Site"分組
(p = alpha_rare_curve(alpha_rare, metadata, groupID = "Site"))
ggsave(paste0("p2.rare_curve.pdf"), p, width=89*1.5, height=56, units="mm")
ggsave(paste0("p2.rare_curve.png"), p, width=89*1.5, height=56, units="mm")

圖2. 按地點(Site)分組繪製的稀釋曲線+標準誤。我們可以看到朝陽、昌平和海淀三組的豐富度沒有明顯區別。

想要修改圖片的細節,或進一步修改代碼,可以直接運行函數名稱(如alpha_rare_curve),顯示完整代碼,進一步編輯修改。

基於特徵表繪製稀釋曲線

我們更多的時候是隻有特徵表,如計算型(reads count)的OTU表。可以使用alpha_rare_all函數計算並繪製不同處理的稀釋曲線,?alpha_rare_all查看函數功能。

  • 計算alpha多樣性部分,包含了phyloseq和microbiome包的全部alpha多樣性指數,總共超過20種alpha多樣性指數可供選擇。

  • 提供start參數可以指定合適的抽平數量

  • 提供step參數用於控制抽平序列的間隔,默認100,意思是按照100條序列間隔多次抽平,直到達到最大序列數量。這裏的最大序列數量爲所有樣本中序列數量最多的那一個,其他序列數目較少的樣本抽平到自己的最大條數後便自動停止。爲了縮短抽平時間,可以將這個參數設置大一些。

# 依賴phyloseq和microbiome包
result = alpha_rare_all(otu = otutab, map = metadata, group = "Group", method = "chao1", start = 500, step = 500)
# 結果返回列表,1爲樣本稀釋曲線,2爲數據表,3爲按組均值的稀釋曲線,4爲組置信區間

# 樣本稀釋曲線
(p = result[[1]])
ggsave(paste0("p3.rare_curve.pdf"), p, width=89*1.5, height=56, units="mm")
ggsave(paste0("p3.rare_curve.png"), p, width=89*1.5, height=56, units="mm")

圖3. 按樣本繪製的稀釋曲線,並按組着色。類似於例1 Microbiome的結果,但尤其樣本多時互相重疊,很難觀察規律,使用較少。

也可以導出原始數據,作爲文章的附表,或使用其它工具進一步繪圖。

# 預覽數據前3行
head(result[[2]], n=3)
write.table(result[[2]], file="t1.rare_curve.txt", sep="\t", quote=F, row.names=F)
# 按組均值繪圖
(p = result[[3]])
ggsave(paste0("p4.rare_curve_group.pdf"), p, width=89*1.5, height=56, units="mm")
ggsave(paste0("p4.rare_curve_group.png"), p, width=89*1.5, height=56, units="mm")

圖4. 按樣本分組繪製的稀釋曲線,並按組着色。類似於圖1,不同的是usearch是基於抽平的結果,各組線長度相同,而本函數可基於末抽平的特徵表,繪製與實際測序量相同的結果。

# 按照分組繪製標準差稀釋曲線
(p = result[[4]])
ggsave(paste0("p5.rare_curve_group_CI.pdf"), p, width=89*1.5, height=56, units="mm")
ggsave(paste0("p5.rare_curve_group_CI.png"), p, width=89*1.5, height=56, units="mm")

圖5. 按樣本分組+置信區間繪製的稀釋曲線,並按組着色。

Phyloseq輸入的稀釋曲線

這裏設置從1000條序列開始抽平,並按照1000條間隔進行逐步抽樣,速度快很多,但是圖形鋸齒化化程度會更多一下。

library(phyloseq)
# 構造phyloseq對象
ps = phyloseq(otu_table(otutab, taxa_are_rows=TRUE), sample_data(metadata))
# 輸入爲Phyloseq的繪圖
result = alpha_rare_all(ps = ps, group = "Group", method = "chao1", start = 1000, step = 1000)
(p = result[[4]])
ggsave(paste0("p6.rare_curve_group_CI.pdf"), p, width=89*1.5, height=56, units="mm")
ggsave(paste0("p6.rare_curve_group_CI.png"), p, width=89*1.5, height=56, units="mm")

圖6. 按樣本分組+置信區間繪製的稀釋曲線,並按組着色,步長爲1000。

樣本箱線圖稀釋曲線

我們也經常要評估樣本量是否達到物種、非冗餘基因、基因家庭的飽和。這裏編寫了alpha_sample_rare函數可以基於reads counts值的特徵表,直接繪製箱線圖稀釋曲線。詳細幫助見?alpha_sample_rare

主要參數:

  • otutab:特徵表,推薦使用計數值的特徵表(OTU/ASV/基因/KO),也可以是抽平或標準化的。

  • length:樣本重採樣的梯度數量,對應圖中的箱體數量,默認爲18;本版圖推薦6-10,全版圖推薦15-10;最大值<樣本量,不然會有重複的箱體;

  • rep: 每個樣本梯度下的抽樣次數,即對應每個箱體中的樣本量,默認爲30。提高會增加計算量。

# 默認值繪製樣本箱線圖稀釋曲線
library(amplicon)
(p = alpha_sample_rare(otutab, length=18, rep=30, count_cutoff=1))
ggsave(paste0("p7.sample_rare.pdf"), p, width=89*1.5, height=56, units="mm")
ggsave(paste0("p7.sample_rare.png"), p, width=89*1.5, height=56, units="mm")

圖7. 樣本稀釋梯度箱線圖,從1-18個樣本對應的豐富度值。可以看到在5個以上樣本時多樣性趨於穩定。

# 修改樣本量箱體數量,length從默認18修改爲9,用於不同趨勢或圖片佈局
(p = alpha_sample_rare(otutab, length=9))
# 箱體少時,可減少圖片的寬度比例,如從1.5-2降低爲1
ggsave(paste0("p8.sample_rare.pdf"), p, width=89*1, height=56, units="mm")
ggsave(paste0("p8.sample_rare.png"), p, width=89*1, height=56, units="mm")

圖8. 樣本稀釋梯度箱線圖,從1-18個樣本對應的豐富度值。只計算並展示9個梯度。

# 默認值繪製樣本箱線圖稀釋曲線
(p = alpha_sample_rare(otutab, count_cutoff=9))
ggsave(paste0("p9.sample_rare.pdf"), p, width=89*1.5, height=56, units="mm")
ggsave(paste0("p9.sample_rare.png"), p, width=89*1.5, height=56, units="mm")

圖9. 樣本稀釋梯度箱線圖,從1-18個樣本對應的豐富度值。閾值(count_cutoff)從1修改爲9,即9個讀長才算可檢測的特徵,多樣性增長的趨勢變明顯。因此閾值對多樣性有極大的影響,可以適合不同場景表達不同的意義。如你有特別多的樣品,如果count_cutoff=1顯示很少樣本就達到飽和,則應該提高閾值,來突出本項目有足夠多的樣本才收集到如此高的多樣性,即表達大樣本量是非常有必要且有意義的。

此外,QIIME 2中都有相應繪製稀釋曲線的方法,詳見之前的教程:

如果你使用本教程的代碼,請引用:

  • Yong-Xin Liu, Yuan Qin, Tong Chen, et. al. A practical guide to amplicon and metagenomic analysis of microbiome data. Protein Cell 41, 1-16, doi:10.1007/s13238-020-00724-8 (2020)

  • Jingying Zhang, Yong-Xin Liu, et. al. NRT1.1B is associated with root microbiota composition and nitrogen use in field-grown rice. Nature Biotechnology 37, 676-684, doi:10.1038/s41587-019-0104-4 (2019).

聲明:由於個人時間和知識有限,文中定有很多不足之處,歡迎大家留言批評指正。

作者貢獻:劉永鑫負責本文的主體框架和大部分寫作,編寫了alpha_rare_curve、alpha_sample_rare函數;文濤參與本文部分創作,編寫了alpha_rare_all函數。

致謝:感謝西北農林科技大學的席嬌對本文的校對,並提出寶貴修改意見。

參考文獻

Bram Beckers, Michiel Op De Beeck, Nele Weyens, Wout Boerjan & Jaco Vangronsveld. (2017). Structural variability and niche differentiation in the rhizosphere and endosphere bacterial microbiome of field-grown poplar trees. Microbiome 5, 25, doi: https://doi.org/10.1186/s40168-017-0241-2

Jingying Zhang, Yong-Xin Liu, Na Zhang, Bin Hu, Tao Jin, Haoran Xu, Yuan Qin, Pengxu Yan, Xiaoning Zhang, Xiaoxuan Guo, Jing Hui, Shouyun Cao, Xin Wang, Chao Wang, Hui Wang, Baoyuan Qu, Guangyi Fan, Lixing Yuan, Ruben Garrido-Oter, Chengcai Chu & Yang Bai. (2019). NRT1.1B is associated with root microbiota composition and nitrogen use in field-grown rice. Nature Biotechnology 37, 676-684, doi: https://doi.org/10.1038/s41587-019-0104-4

Junjie Qin, Ruiqiang Li, Jeroen Raes, Manimozhiyan Arumugam, Kristoffer Solvsten Burgdorf, Chaysavanh Manichanh, Trine Nielsen, Nicolas Pons, Florence Levenez, Takuji Yamada, Daniel R. Mende, Junhua Li, Junming Xu, Shaochuan Li, Dongfang Li, Jianjun Cao, Bo Wang, Huiqing Liang, Huisong Zheng, Yinlong Xie, Julien Tap, Patricia Lepage, Marcelo Bertalan, Jean-Michel Batto, Torben Hansen, Denis Le Paslier, Allan Linneberg, H. Bjørn Nielsen, Eric Pelletier, Pierre Renault, Thomas Sicheritz-Ponten, Keith Turner, Hongmei Zhu, Chang Yu, Shengting Li, Min Jian, Yan Zhou, Yingrui Li, Xiuqing Zhang, Songgang Li, Nan Qin, Huanming Yang, Jian Wang, Søren Brunak, Joel Doré, Francisco Guarner, Karsten Kristiansen, Oluf Pedersen, Julian Parkhill, Jean Weissenbach, H. I. T. Consortium Meta, Maria Antolin, François Artiguenave, Hervé Blottiere, Natalia Borruel, Thomas Bruls, Francesc Casellas, Christian Chervaux, Antonella Cultrone, Christine Delorme, Gérard Denariaz, Rozenn Dervyn, Miguel Forte, Carsten Friss, Maarten van de Guchte, Eric Guedon, Florence Haimet, Alexandre Jamet, Catherine Juste, Ghalia Kaci, Michiel Kleerebezem, Jan Knol, Michel Kristensen, Severine Layec, Karine Le Roux, Marion Leclerc, Emmanuelle Maguin, Raquel Melo Minardi, Raish Oozeer, Maria Rescigno, Nicolas Sanchez, Sebastian Tims, Toni Torrejon, Encarna Varela, Willem de Vos, Yohanan Winogradsky, Erwin Zoetendal, Peer Bork, S. Dusko Ehrlich & Jun Wang. (2010). A human gut microbial gene catalogue established by metagenomic sequencing. Nature 464, 59-65, doi: https://doi.org/10.1038/nature08821

責編:劉永鑫,中科院遺傳發育所

版本1.0.0,提供USEARCH稀釋結果、OTU表輸入、QIIME2和樣本稀釋曲線多種方案
版本1.0.1,整合席嬌的審稿意見,並全文修改

猜你喜歡

10000+:菌羣分析 寶寶與貓狗 梅毒狂想曲 提DNA發Nature Cell專刊 腸道指揮大腦

系列教程:微生物組入門 Biostar 微生物組  宏基因組

專業技能:學術圖表 高分文章 生信寶典 不可或缺的人

一文讀懂:宏基因組 寄生蟲益處 進化樹

必備技能:提問 搜索  Endnote

文獻閱讀 熱心腸 SemanticScholar Geenmedical

擴增子分析:圖表解讀 分析流程 統計繪圖

16S功能預測   PICRUSt  FAPROTAX  Bugbase Tax4Fun

在線工具:16S預測培養基 生信繪圖

科研經驗:雲筆記  雲協作 公衆號

編程模板: Shell  R Perl

生物科普:  腸道細菌 人體上的生命 生命大躍進  細胞暗戰 人體奧祕  

寫在後面

爲鼓勵讀者交流、快速解決科研困難,我們建立了“宏基因組”專業討論羣,目前己有國內外5000+ 一線科研人員加入。參與討論,獲得專業解答,歡迎分享此文至朋友圈,並掃碼加主編好友帶你入羣,務必備註“姓名-單位-研究方向-職稱/年級”。PI請明示身份,另有海內外微生物相關PI羣供大佬合作交流。技術問題尋求幫助,首先閱讀《如何優雅的提問》學習解決問題思路,仍未解決羣內討論,問題不私聊,幫助同行。

學習16S擴增子、宏基因組科研思路和分析實戰,關注“宏基因組”

點擊閱讀原文,跳轉最新文章目錄閱讀

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章