Question: Extracting sex specific differences between groups using DESeq2 interactions?
0
gravatar for hrishi27n
4 weeks 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 • 113 views
ADD COMMENTlink modified 4 weeks ago by Michael Love23k • written 4 weeks ago by hrishi27n20
Answer: Extracting sex specific differences between groups using DESeq2 interactions?
0
gravatar for Michael Love
4 weeks ago by
Michael Love23k
United States
Michael Love23k wrote:

Have you seen the examples in the man page for

?results

ADD COMMENTlink written 4 weeks ago by Michael Love23k

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?

ADD REPLYlink written 4 weeks ago by hrishi27n20
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.

ADD REPLYlink written 4 weeks ago by Michael Love23k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 131 users visited in the last hour