library(knitr)
library(readxl)
#detach(package:plyr)
library(dplyr)
library(ggplot2)
library(reshape2)
library(kableExtra)
library(tidyr)
library(phyloseq)
library(vegan)
library(metagMisc)
set.seed(100)
get files
ss<-read.csv(
"/Users/kylielanglois/OneDrive - SCCWRP/SD I-O data/biofilm ddPCR/septic sludge/septic sludge processed nodups 060223.csv")
dat<-read.csv("/Users/kylielanglois/OneDrive - SCCWRP/SD I-O data/all SD IO combo 2024/SDIO_fastq_combo_table_norep_nobl_nozero.csv")
dat1<-dat
map<-read.csv("/Users/kylielanglois/OneDrive - SCCWRP/SD I-O data/all SD IO combo 2024/SD_IO_metadata_fastq_combo_012624_norep_nobl_nozero.csv")
map1<-map
rownames(map1)<-map1$SEQUENCING_NAME
map1$SAMPLE_TYPE<-gsub("POT_SEPTIC", "GRABS", map1$SAMPLE_TYPE)
path.for.export<-"/Users/kylielanglois/SCCWRP/KL data - General/project folders/SD_IO/"
#anosim: sewer v storm
v.df<-phyloseq_to_df(physeq1, addtax = F, addtot = F)
#ASV table with only sewers and storm samples
#transform for vegan (samples as rows)
rownames(v.df)<-v.df$OTU
v.df<-v.df[,-1]
v.df.t<-as.data.frame(t(v.df))
a<-anosim(x=v.df.t,
grouping = samples_keep$SAMPLE_TYPE,
permutations = 999, distance = "bray")
a
##
## Call:
## anosim(x = v.df.t, grouping = samples_keep$SAMPLE_TYPE, permutations = 999, distance = "bray")
## Dissimilarity: bray
##
## ANOSIM statistic R: 0.4827
## Significance: 0.001
##
## Permutation: free
## Number of permutations: 999
a1<-anosim(x=v.df.t,
grouping = samples_keep$season,
permutations = 999, distance = "bray")
a1
##
## Call:
## anosim(x = v.df.t, grouping = samples_keep$season, permutations = 999, distance = "bray")
## Dissimilarity: bray
##
## ANOSIM statistic R: 0.4858
## Significance: 0.001
##
## Permutation: free
## Number of permutations: 999
#permanova: season
p<-adonis2(v.df.t~samples_keep$season, method = "bray")
p
## Permutation test for adonis under reduced model
## Terms added sequentially (first to last)
## Permutation: free
## Number of permutations: 999
##
## adonis2(formula = v.df.t ~ samples_keep$season, method = "bray")
## Df SumOfSqs R2 F Pr(>F)
## samples_keep$season 1 2.697 0.04182 7.2884 0.001 ***
## Residual 167 61.790 0.95818
## Total 168 64.487 1.00000
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
| Target | mean | st.dev |
|---|---|---|
| ENT | 6.61e+08 | 1.18e+09 |
| HF183 | 1.12e+07 | 1.38e+07 |
| Lachno3 | 1.89e+07 | 1.65e+07 |
| NP gyrA | 2.25e+05 | 3.95e+05 |
| sketa | 4.92e+07 | 4.78e+07 |
plot