I have four groups in my RNAseq experiment and want to compare them all to each other (not them all to a control). How do I do this is deseq2?
1
0
Entering edit mode
@michael_sportiello-22878
Last seen 4.6 years ago

I have four groups, let's call them A, B, C, and D. I want to do all six comparisons:

  1. A to B
  2. A to C
  3. A to D
  4. B to C
  5. B to D
  6. C to D

but right now using my code I can only get the first three, with A always being compared to. How do I do this? My code is below.

# Assign conditions. I have three replicates in each group except for the fourth group I'm calling CD49a which has two replicates. (condition <- factor(c(rep("CD103", 3), rep("DP", 3), rep("DN",3), rep("CD49a",2))))

When I resultsNames the variable I'm storing my deseq() argument in, I only get things getting compared to A.

What should I do? Thanks in advance.

deseq2 • 430 views
ADD COMMENT
1
Entering edit mode
swbarnes2 ★ 1.4k
@swbarnes2-14086
Last seen 2 hours ago
San Diego

You can compare any subgroup to any subgroup using contrast in the results commend, instead of name.

ReusltsNames is behaving the way it is because you've let it set the reference level the default way. You can override this, and make the reference level whatever you want.

ADD COMMENT
0
Entering edit mode

Thank you so much. How do you do that?

Right now I'm doing this:

res.CD103vsCD49a <- lfcShrink(dds,coef = 'condition_CD49a_vs_CD103',type='apeglm')

but this function, when using apeglm, cannot take contrast arguments. Is there a way around this?

ADD REPLY

Login before adding your answer.

Traffic: 540 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6