# Analysis using FEAST https://github.com/cozygene/FEAST
library(ggplot2)
## Folders, Themes, colors
source("prelude.R")
# Setting up directories
data_dir <-paste0(data_dir_path,"xptransmission")
output_dir <- paste0(output_dir_path,"Figure6_transmission")
# Importation of FEAST multisample results with same source
setwd(data_dir)
feast_result<-read.table(file="FEAST_RESULTS_MULTI.csv",header=TRUE,sep=";")
# Importation of FEAST multisample results with all sources
feast_result_M1<-read.table(file="FEAST_RESULTS_M1.csv",header=TRUE,sep=";")
# Plot the proportions of each source by cross
ggplot(feast_result)+geom_bar(aes(y=Feast,x=Cross,fill=Source),stat="identity",colour="black")+theme_npgray()+ylab("Source proportion")+scale_fill_manual(limits=c("FFeces","FSkin","MFeces","MSkin","unknown"),labels=c("Female feces","Female skin","Male feces","Male skin","Unknown"),values=c("gray95","gray80","gray60","gray35","black"))
setwd(output_dir)
ggsave("Feast_transmission_results_multi.pdf",width=8,height=6)
# Plot multisample FEAST results with all sources altogether
ggplot(feast_result_M1,aes(y=Feast,x=Category))+geom_jitter(aes(colour=Category),size=4,alpha=0.7,width=0.25)+scale_y_sqrt()+theme_npgray()+scale_fill_discrete()
# Plot multisample FEAST results with all sources altogether facet by cross
ggplot(feast_result_M1,aes(y=Feast,x=Category))+geom_jitter(aes(colour=Category),alpha=0.7,width=0.25)+facet_wrap(~Sink)+scale_y_sqrt()+theme_npgray()+scale_fill_discrete()