Exporting the xpearly data to build Venn diagram

# Warnings and message turned off for rendering
library(dplyr)
## Warnings turned off for rendering.
## Folders, Themes, colors
source("prelude.R")

# Setting up directories
data_dir <-paste0(data_dir_path,"xpearly")
output_dir <- paste0(output_dir_path,"Figure6_early")

# Defining the directory containing the data to import
setwd(data_dir)

# Data import
comm<-read.table("nmt3_abondance_early_tpn_notax.csv",sep=";",header=TRUE,row.names=1)

vennc<-t(comm)
vennc<-as.data.frame(vennc)
# Selection of the datasets
vennc_sl_early=select(vennc,c("SD-SL-NF41","SD-SL-NF48","SD-SL-NF50","SD-SL-NF52","SD-SL-PE"))
vennc_tga_early=select(vennc,c("SD-TGA-NF41","SD-TGA-NF48","SD-TGA-NF50","SD-TGA-NF52","SD-TGA-PE"))
vennc_sl_late=select(vennc,c("SD-SL-iNF52","SD-SL-iNF56","SD-SL-iNF60","SD-SL-iNF63","SD-SL-iNF66"))
vennc_tga_late=select(vennc,c("SD-TGA-iNF52","SD-TGA-iNF56","SD-TGA-iNF60","SD-TGA-iNF63","SD-TGA-iNF66"))

# Exporting datasets 
setwd(output_dir)
write.table(vennc_sl_early,"xpearly_sl_otu_abundance.tab")
write.table(vennc_sl_late,"xpearly_sl_late_otu_abundance.tab")
write.table(vennc_tga_early,"xpearly_tga_otu_abundance.tab")
write.table(vennc_tga_late,"xpearly_tga_late_otu_abundance.tab")