I'm trying to use DESeq2 to determine if an OTU is enriched by treatments from 16S rRNA sequence data. I imported OTU counts for each library (otu), and metadata information for each library (meta). One of my metadata columns is a factor with 5 levels (factors). I want to do all pairwise comparisons for all 5 factor levels.
I've tried to do it this way:
dds = DESeqDataSetFromMatrix(countData = otu, colData = meta, design = ~factors, betaPrior = FALSE)
The rownames in my metadata are the same as the colnames in the otu table, but I get an error:
Error in FUN(X[[i]], ...) : assay colnames() must be NULL or equal colData rownames()
I also tried using phyloseq this way:
dds = phyloseq_to_deseq2(phyloseq(otu,meta), design = ~factors)
dds = DESeq(dds, design = ~ factors)
This method only compared the first and last factor levels, but I want all the comparisons.
I need help with the syntax for the contrast argument.
Thanks!