Indicator analysis

,

INDICATOR SPECIES ANALYSIS

#Uses a sequence table from your phyloseq object

What ASVs are exclusive to each group (ex. control vs disease state)?

#Guides
#Indicator Species Analysis in R
#Indicator species analysis • indicspecies

library(indicspecies)
library(ggplot2)
library(reshape2)
library(funrar)

#Load the seqtab. Seqtab must be in the same folder as the .R file. Alternatively, use the code with file.choose() to select manually through the file explorer
seqtab ← read.csv(“pe_seqtab.csv”, sep=“,”, row.names=1)
#OR
seqtab ← read.csv(file.choose(), sep=“,”, row.names=1)

#Create a vector where the groups are what you want to compare
#ORDER MUST BE THE SAME AS IN THE SEQTAB FILE
groups = c(rep(“Pre-eclampsia”, 10), rep(“Normotensive”, 10))

#Get indicator values
indval = multipatt(seqtab, groups,
control = how(nperm=999))

#Do indicator analysis
inv_sp = multipatt(seqtab, groups, func = “IndVal.g”, control = how(nperm=9999))

#Show us only the significant values. If you have ASVs, they will be shown after you run this code
summary(inv_sp, indvalcomp=TRUE, alpha=0.05, minstat= 0.3 )

#Save the results in an easy to read manner
results<-indval$sign

#Write the results to a CSV file
write.csv(results, “PE_IndicatorSpecies_Results.csv”)

@graceekalle