DESeq2 design with multiple conditions
2
2
Entering edit mode
5.3 years ago
maria2019 ▴ 250

Hi,

I have 16 samples and multiple conditions (treatment and sex): (4 Untreated_male, 4 Untreated_female, 4 Treated_male, 4 Treated_female)

I want to do 3 types of DEG analysis using DESeq2.

  1. Treated_female VS Untreated Female
  2. Treated_male VS Untreated male
  3. Treated VS Untreated controlled by sex

I am very new to DESeq2. I read in some posts that for the #1 and #2 analysis, it is better to combine all the 16 samples in dds and then set a design just specifically for Treated_female VS Untreated Female.

I know that:

design= ~ treatment ( will result in untreated VS treated (both sexes))

design= ~ sex+treatment+sex:treatment ( will result in Treated VS Untreated controlled by sex)

but how about the #1 and #2 analysis? how can I specify the design for just one sex?

DESeq2 • 9.0k views
ADD COMMENT
1
Entering edit mode

Saying what your design is isn't enough, you also need to say what your result command is.

ADD REPLY
0
Entering edit mode

Hi, I just mentioned the results in the above comment.

ADD REPLY
9
Entering edit mode
5.3 years ago
Ram 44k

I think that the first 2 analyses, the 8 samples of the other sex are not relevant and so need not be combined. Also, I think you mean you have 16 samples, not 12.

You can create 3 DESeq datasets, one with all male samples and design = ~ treatment, one with all female samples and same design, and the third with all 16 samples and a combined formula. I don't understand why the design formula has the sex:treatment term though - how does that change a design of just sex + treatment?

ADD COMMENT
0
Entering edit mode

Hi, you are right thanks. I changed it to 16 samples.

So there is a post that is almost similar to my design (here). It mentions that it is good to have all the samples at the same time to estimate the variance across many more degrees of freedom.

I have created one other group so in total I have 3 cols: sex, condition, group (condition_group).

Then I have this design:

dds <- DESeqDataSetFromHTSeqCount( sampleTable = sampleTable, directory = directory, design= ~group)
dds <- DESeq(dds)

contrast_male <- c("group", "treated_male", "untreated_male")
res_male <- results(dds, contrast = contrast_male, alpha = 0.05)
contrast_female <- c("group", "treated_female", "untreated_female")
res_female <- results(dds, contrast = contrast_female, alpha = 0.05)    
class(res_male)

resultsNames(dds)
>> [1] "Intercept"
>> [2] "group_treated_male_vs_untreated_female"
>> [3] "group_untreated_female_vs_treated_female"
>> [4] "group_untreated_male_vs_treated_female"

res_male    
>> log2 fold change (MAP): group treated_male vs untreated_male
>> Wald test p-value: group treated_male vs untreated_male
>> DataFrame with 21971 rows and 6 columns

my question is, why I do not have the right comparisons in the resultsName ( it does not even have treated_male vs untreated_male)? eventhough the res_male show that the comparison is treated_male vs untreated_male

ADD REPLY
3
Entering edit mode

Your dds was created with design = ~ group, so its resultsNames does not have everything you need. You're able to use results(dds, contrast = ...) to get what you need, so I don't see a problem here.

ADD REPLY
0
Entering edit mode

Thank you. So, does it mean that the res_male is has the right comparison? and the DEGs resulted from it is really based on treated_male vs untreated_male?

ADD REPLY
1
Entering edit mode

I looked it up, and this thread on BioConductor Support seems to agree. resultsNames only shows a subset of all possible contrasts, and one can always specify their contrast of interest to get to a target dataset.

ADD REPLY
0
Entering edit mode

Thank you very much. This was helpful

ADD REPLY
0
Entering edit mode

I've moved my comment to an answer - please accept it if it solved your question.

Upvote|Bookmark|Accept

ADD REPLY

Login before adding your answer.

Traffic: 2100 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