Quick question about running some 4-way comparisons, have the following set up:
table(sampleSex, sampleTreatment) dds<-DESeqDataSet(se, design= ~batch + sex + treatment) dds$group <- factor(paste0(dds$sex, dds$treatment)) design(dds) <- ~0 + group dds <- dds[ rowSums(counts(dds)) > 1, ] dds <- DESeq(dds, betaPrior = FALSE) res1<-results(dds, format = c("GRanges"), contrast=c(1, -1/3, -1/3, -1/3) res2 <- subset(res1, padj<.001) res2_sorted = res2[order(res2$padj), ]
In doing it this way I get results that show the first member of the group contrast (1) as having the smallest number of counts in the matrix I am importing as the basis for DESeq2 - however I would like to have the opposite with the first member of the group having the most counts and the remaining members having the fewest. Not sure how to change the design to reflect that, thanks!
Thanks for the info. I am fine sorting by the (adjusted) pvalue, Im moreso interested in matching the way I do the 4-way analysis here to the following which is what I am doing for straightforward pairwise comparisons (where I don't do the onesided lfcThreshold):
Is there a remaining question? I think I answered why you see one or the other sign of LFC at the top of the table sorting by pvalue. If you are only interested in one sign of coefficient, use a one sided test. If you want to look at the genes where the LFC is positive or negative, subset the table.