I hope someone can help. I am trying to carry out some differential abundance analysis on some microbiome data that has come from a metabarcoding experiment using 16S illumina sequencing. I have processed my data using the R packages phyoseq and DESeq2 however I would like to average some of my data (multiple data points into a single data point) after I have made my phyloseq object but before working out the differential abundance.
I have a column for the abundance, the taxa and the sample (and there are 9 of each sample which I want to average)
I have used 'merge_samples' however it merges all the samples together and not in respect to each taxa. I want to merge each sample for each taxa i.e. merge all samples for Acetobacteraceae and then for all Cyclobacteriaceae.
Without this, when I carry out my differential abundance analysis it gives me 9 separate values when I only want one.
So far I have created my phyloseq object:
OTU<-otu_table(otu_table, taxa_are_rows = TRUE)
TAX<-tax_table(taxonomy)
META<-sample_data(metadata)
physeqBact<-phyloseq(OTU, TAX, META, phy_tree)
#mergedData <- merge_samples(physeqBact, "Type")