The OTUs are treated the same as in the Variance Partitioning analysis, except that MD sites are removed before taxa are filtered by abundance.
otu= readRDS("~/Dropbox/sequence-processing-projects/21_sites/2020-01-01_set4/set4_vsearch-OTUs.RDS") %>%
subset_taxa( (Class!="Chloroplast" | is.na(Class) ) & !(is.na(Phylum)) & (Family!="mitochondria" | is.na(Family) ) ) %>%
subset_samples(SamplingPeriod=="May_2018") %>%
subset_samples(OilingLevel %in% c("HV","RF")) %>%
filter_taxa(function(x) sum(x > 1) > 1, TRUE) %>%
rarefy_even_depth(.)
tax_table(otu) = tax_table(otu)[,1:7]
# Transpose and transform
m18.sp = t(otu_table(otu))
# Hellinger:
m18.sp = decostand(m18.sp, "hellinger")
md = data.frame(sample_data(otu))
I’m considering only the RF and HV sites. The R function is multipatt. The reference paper is: DeCaceres, M., Legendre, P., Moretti, M. 2010. Improving indicator species analysis by combining groups of sites. Oikos 119(10): 1674-1684.
may18ind = multipatt(m18.sp, md$OilingLevel, func = "IndVal.g", duleg=F, control = how(nperm=9999))
may18HV = data.frame(may18ind$sign) %>%
filter(s.HV==1) %>%
filter(p.value <= 0.05)
may18RF = data.frame(may18ind$sign) %>%
filter(s.RF==1) %>%
filter(p.value <= 0.05)
resHV = otu %>%
transform_sample_counts(function(x) x / sum(x)) %>%
subset_taxa(taxa_names(otu) %in% rownames(may18HV))
# calculate mean relative abundance (of HV and RF samples based on filtering above)
# resHV_RA = taxa_sums(resHV)/nsamples(resHV)
# HV_tab = cbind(may18HV, Mean_RelAbund = round(resHV_RA, 3))
HV_tab = cbind(may18HV, data.frame(tax_table(resHV))) %>% select(-c(s.HV,s.RF,index)) %>% arrange(p.value)
knitr::kable(HV_tab, row.names = F)
stat | p.value | Kingdom | Phylum | Class | Order | Family | Genus | Species |
---|---|---|---|---|---|---|---|---|
1.0000000 | 0.0007 | Bacteria | Deinococcus-Thermus | Deinococci | Thermales | Thermaceae | NA | NA |
1.0000000 | 0.0007 | Bacteria | Proteobacteria | Alphaproteobacteria | NA | NA | NA | NA |
1.0000000 | 0.0007 | Bacteria | Proteobacteria | Alphaproteobacteria | NA | NA | NA | NA |
1.0000000 | 0.0007 | Bacteria | Proteobacteria | Gammaproteobacteria | NA | NA | NA | NA |
1.0000000 | 0.0007 | Bacteria | Proteobacteria | Gammaproteobacteria | Acidithiobacillales | Acidithiobacillaceae | KCM-B-112 | uncultured bacterium |
1.0000000 | 0.0007 | Bacteria | Proteobacteria | Gammaproteobacteria | Immundisolibacterales | Immundisolibacteraceae | uncultured | NA |
1.0000000 | 0.0007 | Bacteria | Proteobacteria | Gammaproteobacteria | Oceanospirillales | Pseudohongiellaceae | Pseudohongiella | NA |
1.0000000 | 0.0007 | Bacteria | Proteobacteria | Gammaproteobacteria | Cellvibrionales | Porticoccaceae | C1-B045 | NA |
0.9366467 | 0.0017 | Bacteria | Proteobacteria | Gammaproteobacteria | Steroidobacterales | Woeseiaceae | Woeseia | NA |
0.9258201 | 0.0038 | Bacteria | Actinobacteria | Actinobacteria | Corynebacteriales | Mycobacteriaceae | Mycobacterium | Ambiguous_taxa |
0.9258201 | 0.0038 | Bacteria | Proteobacteria | NA | NA | NA | NA | NA |
0.9258201 | 0.0038 | Bacteria | Proteobacteria | Deltaproteobacteria | Desulfovibrionales | Desulfovibrionaceae | Desulfovibrio | Ambiguous_taxa |
0.9258201 | 0.0041 | Bacteria | Proteobacteria | Gammaproteobacteria | Ectothiorhodospirales | Thioalkalispiraceae | Thiohalophilus | NA |
0.9258201 | 0.0042 | Bacteria | Deferribacteres | Deferribacteres | Deferribacterales | Deferribacteraceae | uncultured | uncultured Deferribacteres bacterium |
0.9258201 | 0.0042 | Bacteria | Proteobacteria | Gammaproteobacteria | Ectothiorhodospirales | Ectothiorhodospiraceae | Thiogranum | NA |
0.8687282 | 0.0078 | Bacteria | Bacteroidetes | Bacteroidia | Chitinophagales | Saprospiraceae | uncultured | NA |
0.8725543 | 0.0117 | Bacteria | Proteobacteria | Deltaproteobacteria | Desulfobacterales | Desulfobacteraceae | SEEP-SRB1 | uncultured bacterium |
0.8491389 | 0.0182 | Bacteria | Acidobacteria | Subgroup 21 | uncultured bacterium | uncultured bacterium | uncultured bacterium | uncultured bacterium |
0.8451543 | 0.0184 | Bacteria | Proteobacteria | Gammaproteobacteria | Cellvibrionales | Porticoccaceae | C1-B045 | uncultured gamma proteobacterium |
0.8066309 | 0.0198 | Bacteria | Bacteroidetes | Bacteroidia | Sphingobacteriales | NA | NA | NA |
0.8451543 | 0.0198 | Bacteria | Proteobacteria | Gammaproteobacteria | Oceanospirillales | Alcanivoracaceae | Alcanivorax | NA |
0.8451543 | 0.0202 | Bacteria | Epsilonbacteraeota | Campylobacteria | Campylobacterales | Thiovulaceae | Sulfurimonas | NA |
0.8451543 | 0.0202 | Bacteria | Bacteroidetes | Bacteroidia | Bacteroidales | Prolixibacteraceae | NA | NA |
0.8199735 | 0.0202 | Bacteria | Planctomycetes | Pla4 lineage | NA | NA | NA | NA |
0.8451543 | 0.0202 | Bacteria | Proteobacteria | Deltaproteobacteria | Desulfarculales | Desulfarculaceae | NA | NA |
0.8451543 | 0.0202 | Bacteria | Proteobacteria | Gammaproteobacteria | Betaproteobacteriales | Gallionellaceae | Candidatus Nitrotoga | NA |
0.8142142 | 0.0202 | Bacteria | Proteobacteria | Gammaproteobacteria | Chromatiales | NA | NA | NA |
0.8451543 | 0.0202 | Bacteria | Proteobacteria | Gammaproteobacteria | Immundisolibacterales | Immundisolibacteraceae | NA | NA |
0.8451543 | 0.0211 | Bacteria | Bacteroidetes | Bacteroidia | Cytophagales | Cyclobacteriaceae | uncultured | NA |
0.8451543 | 0.0228 | Bacteria | Chloroflexi | Anaerolineae | Anaerolineales | Anaerolineaceae | uncultured | uncultured bacterium |
0.7821963 | 0.0348 | Bacteria | Spirochaetes | Spirochaetia | Spirochaetales | Spirochaetaceae | Spirochaeta 2 | NA |
0.8210749 | 0.0364 | Bacteria | Proteobacteria | Gammaproteobacteria | NA | NA | NA | NA |
0.7859200 | 0.0377 | Bacteria | Proteobacteria | Alphaproteobacteria | NA | NA | NA | NA |
0.7872623 | 0.0431 | Bacteria | Planctomycetes | Phycisphaerae | NA | NA | NA | NA |
0.7604379 | 0.0437 | Bacteria | Proteobacteria | Gammaproteobacteria | Alteromonadales | NA | NA | NA |
resRF = otu %>%
transform_sample_counts(function(x) x / sum(x)) %>%
subset_taxa(taxa_names(otu) %in% rownames(may18RF))
RF_tab = cbind(may18RF, data.frame(tax_table(resRF))) %>% select(-c(s.HV,s.RF,index)) %>% arrange(p.value)
knitr::kable(RF_tab[1:20,], row.names = F)
stat | p.value | Kingdom | Phylum | Class | Order | Family | Genus | Species |
---|---|---|---|---|---|---|---|---|
1.0000000 | 0.0007 | Bacteria | Proteobacteria | Alphaproteobacteria | Acetobacterales | Acetobacteraceae | NA | NA |
0.9544651 | 0.0007 | Bacteria | Proteobacteria | Alphaproteobacteria | Reyranellales | Reyranellaceae | Reyranella | NA |
1.0000000 | 0.0007 | Bacteria | Chloroflexi | Anaerolineae | RBG-13-54-9 | uncultured bacterium | uncultured bacterium | uncultured bacterium |
1.0000000 | 0.0007 | Bacteria | Verrucomicrobia | Verrucomicrobiae | Pedosphaerales | Pedosphaeraceae | uncultured bacterium | uncultured bacterium |
1.0000000 | 0.0007 | Bacteria | Proteobacteria | Deltaproteobacteria | Desulfuromonadales | Sva1033 | NA | NA |
1.0000000 | 0.0007 | Bacteria | Proteobacteria | Gammaproteobacteria | KI89A clade | NA | NA | NA |
1.0000000 | 0.0007 | Bacteria | Proteobacteria | Gammaproteobacteria | Alteromonadales | Colwelliaceae | Thalassotalea | NA |
0.9577520 | 0.0009 | Bacteria | Cyanobacteria | Oxyphotobacteria | Chloroplast | NA | NA | NA |
0.9118706 | 0.0016 | Bacteria | Nitrospirae | Nitrospira | Nitrospirales | Nitrospiraceae | Nitrospira | uncultured bacterium |
0.8682361 | 0.0018 | Bacteria | Chloroflexi | Anaerolineae | SBR1031 | A4b | NA | NA |
0.9446638 | 0.0018 | Bacteria | Proteobacteria | Deltaproteobacteria | Myxococcales | Sandaracinaceae | uncultured | NA |
0.9481443 | 0.0020 | Bacteria | Acidobacteria | NA | NA | NA | NA | NA |
0.9384220 | 0.0021 | Bacteria | Chloroflexi | KD4-96 | uncultured bacterium | uncultured bacterium | uncultured bacterium | uncultured bacterium |
0.9346049 | 0.0021 | Bacteria | Proteobacteria | Gammaproteobacteria | Acidiferrobacterales | Acidiferrobacteraceae | Sulfurifustis | NA |
0.9235892 | 0.0022 | Bacteria | Proteobacteria | Deltaproteobacteria | Desulfobacterales | Desulfobulbaceae | NA | NA |
0.8837933 | 0.0031 | Bacteria | Bacteroidetes | Bacteroidia | Chitinophagales | Saprospiraceae | uncultured | NA |
0.9202534 | 0.0031 | Bacteria | Kiritimatiellaeota | Kiritimatiellae | Kiritimatiellales | Kiritimatiellaceae | R76-B128 | NA |
0.9266534 | 0.0032 | Bacteria | Proteobacteria | Gammaproteobacteria | Betaproteobacteriales | NA | NA | NA |
0.9068840 | 0.0033 | Bacteria | Proteobacteria | Gammaproteobacteria | NA | NA | NA | NA |
0.9258201 | 0.0034 | Bacteria | Bacteroidetes | Bacteroidia | Chitinophagales | Saprospiraceae | uncultured | NA |