DiffBind paired samples
2
0
Entering edit mode
igor ▴ 40
@igor
Last seen 9 months ago
United States

When you run dba.contrast and dba.analyze in DiffBind, it divides the samples into all the possible groups and compares the various groups. If you have paired samples (for example, before and after treatment), is there a way to indicate that so that the analysis takes that into account (rather than simply doing all "before" versus all "after")?

diffbind • 1.0k views
1
Entering edit mode
Gord Brown ▴ 640
@gord-brown-5664
Last seen 8 months ago
United Kingdom

Hi,

The block parameter of dba.contrast allows the sort of paired comparison you want.  See section 5 of the vignette for details.

0
Entering edit mode

I looked at the block parameter. That seems appropriate, but it's fairly flexible. I wasn't sure if there is some other option that specifically assumes paired analysis.

1
Entering edit mode

To the best of my knowledge, block is the only parameter for this purpose.  The EdgeR user manual gives a bit more detail about how to use it.

1
Entering edit mode
Rory Stark ★ 4.1k
@rory-stark-5741
Last seen 1 day ago
CRUK, Cambridge, UK

The block parameter is set up to handle paired samples.  So for example if the CONDITION is before or after, and each pair of samples share the same REPLICATE or TISSUE id, you can try:

myDBA <- dba.contrast(myDBA, group1=myDBA$masks$before, group2=myDBA$masks$after, name1="before",name2="after", block=DBA_REPLICATE)

myDBA <- dba.analyze(myDBA)

myReport <- dba.report(myDBA, method=DBA_EDGER_BLOCK)


0
Entering edit mode

Quick followup. This is your example:

dba.contrast(myDBA, group1=myDBA$masks$before, group2=myDBA$masks$after, name1="before",name2="after", block=DBA_REPLICATE)

Since we only have 2 conditions here, I would do this:

dba.contrast(myDBA, categories=DBA_CONDITION, block=DBA_REPLICATE)

Since you used the less concise approach, are the two actually different? Or was it to make the answer more clear?

0
Entering edit mode

You are correct, I made it very explicit in case you had other conditions, these are the same.

Actually I tend to add each contrast explicitly so I can see the contrasts in my analysis script instead of relying on DiffBind's automatic feature.

-Rory