Phyloseq。如何测试丰度差异 [英] Phyloseq. How to test abundance difference
问题描述
图书馆phyoloseq数据= Globalpatterns
Library phyoloseq Data= Globalpatterns
GP = filter_taxa(GlobalPatterns, function(x) sum(x > 3) > (0.2*length(x)), TRUE)
定义人类与非人类分类变量,并将此新变量添加到样本数据:
Define a human versus non-human categorical variable, and add this new variable to sample data:
sample_data(GP)$human = factor( get_variable(GP, "SampleType") %in% c("Feces", "Mock", "Skin", "Tongue") )
将丰度标准化为中位数测序深度
Standardize abundances to the median sequencing depth
total = median(sample_sums(GP))
standf = function(x, t=total) round(t * (x / sum(x)))
gps = transform_sample_counts(GP, standf)
使用3.0的截止值对变异系数过滤分类群
Filter the taxa using a cutoff of 3.0 for the Coefficient of Variation
gpsf = filter_taxa(gps, function(x) sd(x)/mean(x) > 3.0, TRUE)
Subset the data to Bacteroidetes, used in some plots
gpsfb = subset_taxa(gpsf, Phylum=="Bacteroidetes")
绘制数据
Plotting the the data
title = "plot_bar; Bacteroidetes-only"
plot_bar(gpsfb, "SampleType", "Abundance", title=title)
问题:什么我需要编写代码来测试特定样本类型的拟杆菌的丰度差异,如当前的例子中使用的是ANOVA?
我尝试过:
目前gpsfb是phylseq对象,所以现在我迷路了
Question: What code do i need to write, to test difference in abundance of Bacteroidetes for specific sampletype like feces with ect ANOVA with current example?
What I have tried:
Currently gpsfb is phylseq object, so now i am lost
推荐答案
human = factor(get_variable(GP,SampleType)%in%c(粪便,模拟,皮肤,舌头))
human = factor( get_variable(GP, "SampleType") %in% c("Feces", "Mock", "Skin", "Tongue") )
标准化丰度到中位数测序深度
Standardize abundances to the median sequencing depth
total = median(sample_sums(GP))
standf = function(x, t=total) round(t * (x / sum(x)))
gps = transform_sample_counts(GP, standf)
过滤分类群使用3.0的截断值作为变异系数
Filter the taxa using a cutoff of 3.0 for the Coefficient of Variation
gpsf = filter_taxa(gps, function(x) sd(x)/mean(x) > 3.0, TRUE)
Subset the data to Bacteroidetes, used in some plots
gpsfb = subset_taxa(gpsf, Phylum=="Bacteroidetes")
绘制数据
Plotting the the data
title = "plot_bar; Bacteroidetes-only"
plot_bar(gpsfb, "SampleType", "Abundance", title=title)
问题:什么我需要编写代码来测试特定样本类型的拟杆菌的丰度差异,如当前的例子中使用的是ANOVA?
我尝试过:
目前gpsfb是phylseq对象,所以现在我迷路了
Question: What code do i need to write, to test difference in abundance of Bacteroidetes for specific sampletype like feces with ect ANOVA with current example?
What I have tried:
Currently gpsfb is phylseq object, so now i am lost
这篇关于Phyloseq。如何测试丰度差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!