--- title: "Phage" author: "Scott A. Handley" date: "4 December 2015" output: html_document --- ```{r} # Set your working directory setwd("~/Dropbox/presentations/2015_Africa_virology") ``` ```{r} # Install and load required libraries install.packages("vegan") library("vegan") install.packages("rich") library("rich") ``` ```{r} # Myoviridae myo <- read.table("myo.txt") # Podoviridae podo <- read.table("podo.txt") # Siphoviridae sipho <- read.table("sipho.txt") # All caudovirales caudo <- read.table("caudo.txt") ``` ```{r} # Normalize the data myo.total <- decostand(myo, method="total") podo.total <- decostand(podo, method="total") sipho.total <- decostand(sipho, method="total") caudo.total <- decostand(caudo, method="total") ``` ```{r} # Calculate rarefaction curves rarc.myo <- rarc(myo.total, nrandom=99) rarc.podo <- rarc(podo.total, nrandom=99) rarc.sipho <- rarc(sipho.total, nrandom=99) rarc.caudo <- rarc(caudo.total, nrandom=99) ``` ```{r} # Plot and customize rarefaction curves plot(rarc.myo) # plot(rarc.caudo$richness, type="s", lwd=4, col="firebrick3", ylab="Richness", main="Caudovirales comparison") # lines(rarc.sipho$richness, type="s", lwd=4, col="steelblue") # lines(rarc.myo$richness, type="s", lwd=4, col="forestgreen") # lines(rarc.podo$richness, type="s", lwd=4, col="orange") ```