SEQanswers

Go Back   SEQanswers > Bioinformatics > Bioinformatics



Similar Threads
Thread Thread Starter Forum Replies Last Post
Question related to analysis using DESeq2 kjaja Bioinformatics 7 08-29-2016 02:18 PM
Metagenomic analysis with DESeq2 Patrick Munk Bioinformatics 2 06-26-2015 05:16 AM
DESeq2 experimental design/analysis crh Bioinformatics 1 05-05-2015 11:30 PM
DESeq2 Transcriptome Analysis Quat Bioinformatics 3 01-16-2015 01:05 AM
using DESeq2 for RNA-Seq analysis ogla Bioinformatics 6 03-20-2014 05:05 AM

Reply
 
Thread Tools
Old 09-24-2015, 05:47 AM   #1
genomica
Junior Member
 
Location: United Kingdom

Join Date: Feb 2013
Posts: 9
Default Deseq2 multifactor analysis

Hello,

I have a RNAseq experiment where I have 2 conditions and 3 replicates each and replicates are taken from different individuals. So my design is as follows:

Sample Condition Individual
S1 treated A
S2 untreated A
S3 treated B
S4 untreated B
S5 treated C
S6 untreated C

Here is my code to analyse the data using deseq2:
Code:
library('DESeq2')
directory<-"counts"
sampleFilesN1_N2 <- grep("*N[1-2]",list.files(directory),value=TRUE)
sampleConditionN1_N2<-c("treated","untreated","treated","untreated","treated","untreated")
sampleIndividual<-c("A","A","B","B","C","C")
sampleTable1<-data.frame(sampleName=sampleFilesN1_N2, fileName=sampleFilesN1_N2, condition=sampleConditionN1_N2, individual=sampleIndividual)
ddsHTSeq <- DESeqDataSetFromHTSeqCount(sampleTable = sampleTable1, directory = directory,design= ~ condition + individual)
ddsHTSeq$condition <- relevel(ddsHTSeq$condition, "untreated")
dds<-DESeq(ddsHTSeq)
res<-results(dds)
res<-res[order(res$padj),]
write.csv(as.data.frame(res),file="DeSEQ2_treated_vs_untreated.csv")
However, when I run these and look at results, following message:
Code:
"log2 fold change (MAP): individual C vs A
Wald test p-value: individual C vs A"
So, its only giving me results after comparing C vs A. Am I missing anything here?

Thanks for any help.
genomica is offline   Reply With Quote
Old 09-24-2015, 05:55 AM   #2
dpryan
Devon Ryan
 
Location: Freiburg, Germany

Join Date: Jul 2011
Posts: 3,480
Default

results() will just give you one of the possible comparisons (the last one in the model matrix, by default). See help(results) for how to get the results you want.
dpryan is offline   Reply With Quote
Old 09-24-2015, 06:38 AM   #3
genomica
Junior Member
 
Location: United Kingdom

Join Date: Feb 2013
Posts: 9
Default

Quote:
Originally Posted by dpryan View Post
results() will just give you one of the possible comparisons (the last one in the model matrix, by default). See help(results) for how to get the results you want.
Thanks for the hint, that's really helpful. So, I understand if I want to get comparison of conditions considering the pairing of samples into account, I should give

Code:
res <- results(dds, contrast=c("condition","treated","untreated"))
Is this correct?

Thanks again.

Last edited by genomica; 09-24-2015 at 07:41 AM.
genomica is offline   Reply With Quote
Old 09-24-2015, 10:46 AM   #4
dpryan
Devon Ryan
 
Location: Freiburg, Germany

Join Date: Jul 2011
Posts: 3,480
Default

Yup and I see you figured out the error in your earlier attempt
dpryan is offline   Reply With Quote
Old 09-24-2015, 11:31 PM   #5
genomica
Junior Member
 
Location: United Kingdom

Join Date: Feb 2013
Posts: 9
Default

Thanks very much Devon. Yes, I did figure out the first error

I am a bit paranoid as I am doing this analysis for the first time and hence wondered if you could confirm if my experimental design is ok.

Code:
ddsHTSeq <- DESeqDataSetFromHTSeqCount(sampleTable = sampleTable1, directory = directory,design= ~ condition + individual)
or do I need:
Code:
ddsHTSeq <- DESeqDataSetFromHTSeqCount(sampleTable = sampleTable1, directory = directory,design= ~ condition + individual +condition:individual)
Many thanks again.
genomica is offline   Reply With Quote
Old 09-25-2015, 09:39 AM   #6
dpryan
Devon Ryan
 
Location: Freiburg, Germany

Join Date: Jul 2011
Posts: 3,480
Default

Go for the first one, the second one ends up directly comparing individual samples and therefore isn't reliable.
dpryan is offline   Reply With Quote
Old 09-26-2015, 01:03 AM   #7
genomica
Junior Member
 
Location: United Kingdom

Join Date: Feb 2013
Posts: 9
Default

Thanks a lot for your help Devon.
genomica is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off




All times are GMT -8. The time now is 10:58 PM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Single Sign On provided by vBSSO