Question: Extracting sex specific differences between groups using DESeq2 interactions?
0
5 months ago by
hrishi27n20
hrishi27n20 wrote:

Hello,

I am very new to using interactions using DESeq2 and handling multi-factor design. I have two groups 'Treated' and 'Untreated' which include both males and females in both groups. First, I am interested in looking into comparing treated vs untreated without considering sex specific effects. And in the next comparison look at differences between treated and untreated for males and females independently.
Ideally, for sex-specific results I would just subset the data by sex and then run the analysis separately for each sex but I guess there is a better way to do this. I have age of the patients, so I want to control for age.

The following is my code:

        dds <- DESeqDataSetFromMatrix(countData = myFile, colData = Pheno, design= ~ Condition + Age + Sex + Condition:Sex)
resultsNames(dds)
[1] "Intercept"                 "Condition_treated_vs_untreated"
[3] "Age"                         "Sex_M_vs_F"          "Condition.Sex_M"


What is the best way to write a contrast to get 'Treated vs Untreated' comparison and then same comparison but individually for both sexes?

Thanks!

deseq2 • 169 views
modified 5 months ago by Michael Love25k • written 5 months ago by hrishi27n20
Answer: Extracting sex specific differences between groups using DESeq2 interactions?
0
5 months ago by
Michael Love25k
United States
Michael Love25k wrote:

Have you seen the examples in the man page for

?results

Micheal thanks for the reply. I read the results section and now things are a little more clear. So I ended up combining groups into a single factor.

 Gr <- factor(paste0(Pheno$Condition,Pheno$Sex))
dds <- DESeqDataSetFromMatrix(countData = myFile, colData = Pheno, design= ~Gr+Age)
dds <- DESeq(dds,parallel=TRUE)
resultsNames(dds)
[1] "Intercept"
[2] "Gr_UntreatedM_vs_UntreatedF"
[3] "Gr_TreatedF_vs_UntreatedF"
[4] "Gr_TreatedM_vs_UntreatedF"
[5] "Age"

So to get effect of treatment in males and females, I did the following.  Is this correct?
Male <- results(dds, contrast=c('Gr','TreatedM','UntreatedM'))
Female <- results(dds, contrast=c('Gr','TreatedF','UntreatedF'))


How do I get the comparison between Untreated and Treated not taking sex into consideration? Also, is this a correct way to account for age?

1

To not take the sex into consideration I’d use a model that removes the sex variable. But I don’t know if this is a bad assumption for your system. That’s outside the scope of the kind of support I am able to provide. That’s how most control for age, but again what design you chose to model your data is up to you.