DiffBind block not working for me
1
0
Entering edit mode
@liruiradiant-8906
Last seen 8 days ago
United States

Hello Rory,

I have the following experimental design, Rep1 and Rep2 are collected in different batches, with batch effect obvious from PCA plots:

Sample    Condition    Replicate
1              A         1
2              A         2
3              B         1
4              B         2

I used the following code to account for batch effect:

db.counts <- dba.contrast(db.counts, 
                            categories=DBA_CONDITION, 
                            block = DBA_REPLICATE, # block design
                            minMember = 2)
db.counts <- dba.analyze(db.counts)
db.results <- dba.report(db.counts, th = 1, 
                         method=db.counts$config$AnalysisMethod,
                         bCalled = TRUE)

However, when I use the altered code below, all the output csv files are the same as above.

db.counts <- dba.contrast(db.counts, 
                            categories=DBA_CONDITION, 
                           # block = DBA_REPLICATE, # block design
                            minMember = 2)
db.counts <- dba.analyze(db.counts)
db.results <- dba.report(db.counts, th = 1, 
                         method=db.counts$config$AnalysisMethod,
                         bCalled = TRUE)
write.csv(db.results, paste(metaFile, "res.csv", sep = '.'))

Did I do sth. wrong? Thanks!

Ray

diffbind • 216 views
ADD COMMENT
3
Entering edit mode
Rory Stark ★ 4.1k
@rory-stark-5741
Last seen 24 days ago
CRUK, Cambridge, UK

When you add a blocking contrast, DiffBind runs two different analyses: one with and one without the blocking factor. By default, when you call dba.report(), you get the non-blocked analysis. You have to request the blocked results using the method parameter.

To retrieve the results for the blocked analysis:

db.results <- dba.report(db.counts, th = 1, 
                         method=DBA_DESEQ2_BLOCK,
                         bCalled = TRUE)
ADD COMMENT
0
Entering edit mode

Book online Packers & Movers Services at Home for best rates

ADD REPLY
0
Entering edit mode

Thanks Rory! I replaced method=db.counts$config$AnalysisMethod, to DBADESEQ2BLOCK and everything works well now!

ADD REPLY
0
Entering edit mode

Thanks Rory! I replaced method=db.counts$config$AnalysisMethod, to DBADESEQ2BLOCK and everything works well now!

ADD REPLY

Login before adding your answer.

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