计算微生物otu表格组间差异
2019-03-10 本文已影响0人
赵会成
ANOSIM相似性分析是一种非参数检验,用来检验组间(两组或多组)差异是否显著大于组内差异,从而判断分组是否有意义。首先利用Bray-Curtis算法计算两两样品间的距离,然后将所有距离从小到大进行排序,并计算R和P值。
library(vegan)
type = read.table("sample-metadata2.txt", header=T, row.names=1, sep="\t", comment.char="")
beta_bray_curtis = read.table("bacteria3.txt", header=T, row.names=1, sep="\t", comment.char="")
anosim(beta_bray_curtis,type$Type,permutations = 999,distance = 'bray')
#Call:
# anosim(x = beta_bray_curtis, grouping = type$Type, permutations = 999, distance = "bray")
#Dissimilarity: bray
#ANOSIM statistic R: 0.7143
#Significance: 0.001
#Permutation: free
#Number of permutations: 999