Entering edit mode
jacob.westaway
•
0
@jacobwestaway-23627
Last seen 5.4 years ago
Is there a way of using the DESeq2 results to obtain the n of the groups in a particular contrast?
For example, the number of "Yes" and "No" observations in Chorioamnionitis for each significant taxa?
res = results(multi.deseq.clean, contrast = c("Chorioamnionitis", "Yes", "No"), lfcThreshold = 1)
res = res[order(res$padj, na.last = NA), ]
alpha = 0.01
sigtab = res[(res$padj < alpha), ]
sigtab = cbind(as(sigtab, "data.frame"), as(tax_table(ps.NICU)[rownames(sigtab), ], "matrix"))
posigtab = sigtab[ order(sigtab$log2FoldChange, decreasing = TRUE), ]
posigtab = posigtab[, c("baseMean", "log2FoldChange", "lfcSE", "padj", "Phylum", "Class", "Order", "Family", "Genus")]

Hi Michael, thanks for your quick response. Much appreciated.
I do have a follow up question if that’s okay.
I'm using DESeq2 for differential abundance testing on a microbiome dataset, and when performing the Wald test I get a lot more significant taxa than expected, despite having a p value of 0.01 and lfcthreshold = 1. Moreover, when exploring the raw data it looks like taxa that are found to be significant having very low n values. I should also mention that the model is quite complex with 7 predictor variables. Do you have any suggestions for "tightening" up the number of significant taxa?
Apologies if you answered this kind of question before and I've missed it. Thanks.
I don’t actually recommend DESeq2 for microbiome as I’m not convinced it’s the right model for the counts.
With RNA-seq we sometimes use a prefilter, such as requiring more than x samples with a count of 10 or more, to deal with outlier values.