Diffbind: How do I set up multiple contrasts, for example tissue type and timepoint?
1
0
Entering edit mode
estoyanova • 0
@estoyanova-15601
Last seen 5.9 years ago

Hi,

I would like to find differential binding between tissue ct1 condition 1 and tissue ct1 condition 2. How might I set this up in the contrast statement? Thank you!

My sample sheet looks something like this:

ID   Tissue Condition Replicate
1   ct1        1         1 counts   
2  ct1        1         2 counts    
3  ct1        2         1 counts    
4  ct1        2         2 counts   
5  ct1     3         1 counts    
6  ct1     3         2 counts    
7   ct2        1         1 counts    
8   ct2        1         2 counts    
9   ct2        2         1 counts    
10  ct2        2         2 counts    
11  ct2     3         1 counts    
12  ct2     3         2 counts   

diffbind • 2.5k views
ADD COMMENT
1
Entering edit mode
Rory Stark ★ 5.1k
@rory-stark-5741
Last seen 9 weeks ago
Cambridge, UK

There are a couple of ways to do this.

You can generate all the contrasts automatically with dba.contrast(), but since you only have two replicates for each condition/tissue pair, you have to specify minMembers=2:

> myDBA <- dba.contrast(myDBA, categories=c(DBA_TISSUE,DBA_CONDITION), minMembers=2)

This will give you quite a few contrasts, including ones you probably don't need.

The second way is to specify each desired contrast explicitly:

> myDBA <- dba.contrast(myDBA,
                        group1=myDBA$masks$ct1&myDBA$masks$1, 
                        group2=myDBA$masks$ct1&myDBA$masks$2,
                        name1="Ct1 Cond1", name2="Ct2 Cond2")

​I'm not 100% sure will work with your condition names, you could also specify the samples directly:

> myDBA <- dba.contrast(myDBA,group1=1:2, group2=3:4,
                        name1="Ct1 Cond1", name2="Ct2 Cond2")

 

 

ADD COMMENT
0
Entering edit mode

Hi Rory, I have a related comment for this thread.

So basically I am doing DBdata <-dba.contrast(DBdata, categories=DBACONDITION, block= c(DBATREATMENT,DBAFACTOR),minMembers = 2) or DBdata <-dba.contrast(DBdata, categories=c(DBACONDITION,DBATREATMENT,DBAFACTOR), minMembers = 2)

And according to your post, it says the contrast will create a quite a few contrast that I might not need. How are the results presented and how can I choose the right report, results from the exact contrast I need?

Thanks in advance!

Best, Jay

----- I went into other posts and found the dba.show getting the contrast numbers. Thanks.

ADD REPLY

Login before adding your answer.

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