Question: Diffbind: How do I set up multiple contrasts, for example tissue type and timepoint?
gravatar for estoyanova
6 months ago by
estoyanova0 wrote:


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   

ADD COMMENTlink modified 6 months ago by Rory Stark2.6k • written 6 months ago by estoyanova0
gravatar for Rory Stark
6 months ago by
Rory Stark2.6k
CRUK, Cambridge, UK
Rory Stark2.6k wrote:

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,
                        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 COMMENTlink written 6 months ago by Rory Stark2.6k
Please log in to add an answer.


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