Comparing factor levels in deseq2
1
0
Entering edit mode
gv ▴ 40
@gv-6516
Last seen 2.2 years ago
United States

Hi,

I have sample information (sampleinfo) in this format:

SampleID    condition   type
MP_1    A_1 Paired-End
MP_2    A_1 Paired-End
MP_3    A_1 Paired-End
MN_1    A_2 Paired-End
MN_2    A_2 Paired-End
MN_3    A_2 Paired-End
WP_1    B_1 Paired-End
WP_2    B_1 Paired-End
WP_3    B_1 Paired-End
WN_1    B_2 Paired-End
WN_2    B_2 Paired-End
WN_3    B_2 Paired-End

I want to compare A1 with A2, B1 with B2 ans also want to compare (A1+A2) with (B1+B2).

This is how I used DESeqDataSetFromMatrix

ddsMat <- DESeqDataSetFromMatrix(countData = seqdata[,rownames(sampleinfo)], colData =  sampleinfo, design = ~ condition)
ddsMat <- DESeq(ddsMat)

res.05_FC0<-results(ddsMat,contrast = c("condition","A_1","A_2"),alpha=0.05,lfcThreshold = 0)
res.05_FC0<-results(ddsMat,contrast = c("condition","B_1","B_2"),alpha=0.05,lfcThreshold = 0)

How can I compare (A_1+A_2) with (B_1+B_2) using the contrast argument in results function?

deseq2 • 2.0k views
ADD COMMENT
0
Entering edit mode
@mikelove
Last seen 1 day ago
United States

Take a look at the examples in the ?results man page. There are examples of how to do this.

ADD COMMENT
0
Entering edit mode

Hi Michael, I read the examples, I am getting this as my output to resultsNames(ddsMat)

"Intercept"                    "condition_A_1_vs_A_2" "condition_B_2_vs_A_2"  "condition_B_1_vs_A_2"

Do I need to use contrast in a list fashion, something like this to capture(A1+A2) vs (B1+B2)

`contrast=list("condition_A_1_vs_A_2","condition_B1_vs_A2")`

and keep the listValues as default. Would that be correct? Of course it is a little confusing and I can actually make another sampleinfo table, but I want to learn how it will be done here. Thanks

ADD REPLY
0
Entering edit mode

Can you look over this related thread for more background:

https://support.bioconductor.org/p/117940/#126943

ADD REPLY

Login before adding your answer.

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