Entering edit mode
Hi,
I do have three treatment condition (T1, T2 and T3), could you please suggest how I can improve below code to extract pairwise comparisons in edgeR after importing data from phyloseq object to edgeR.
dge = phyloseq_to_edgeR(kosticB, group="Treatment")
# Perform binary test
et = exactTest(dge)
# Extract values from test results
tt = topTags(et, n=nrow(dge$table), adjust.method="BH", sort.by="PValue")
res = tt@.Data[[1]]
alpha = 0.001
sigtab = res[(res$FDR < alpha), ]
I will be thankful for your time and help.
Thanks a lot Smyth. I just want to add one more thing that these treatment were collected from 9 different locations so to ignore the location effect do I need to change group formula to location + Treatment?
location is also a part of metadata column as like treatment.
and then can I use the the same pair argument?
exactTest(dge, pair = c(1,2)) compares T2 to T1.
exactTest(dge, pair = c(1,3)) compares T3 to T1.
exactTest(dge, pair = c(2,3)) compares T3 to T2.
Thanks Yogesh
If you want to adjust for location then use the glm pipeline of edgeR rather than the classic exact tests. See the edgeR User's Guide or: https://bioconductor.org/packages/release/workflows/vignettes/RnaSeqGeneEdgeRQL/inst/doc/edgeRQL.html