This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to extract binding affinity matrix in Diffbind

Hi everyone, I'm performing ChIP-Seq analysis using Diffbind3.0, after doing:

>     dbObj <- dba(sampleSheet="peaksfile_merged.txt")
>     dbObj <- dba.count(dbObj, bUseSummarizeOverlaps=FALSE, summits=FALSE)
>     dbObj <- dba.normalize(dbObj, normalize=DBA_NORM_LIB)

then use plot(dbObj) for clustering among samples,and generate a heatmap of clustering among samples.

However, we want to make some adjustments to the generated heatmap. What are the parameters in the plot() function, or can we extract the original data used to draw the heatmap?

help will be highly appriciated!

diffbind clustering among chipseq samples

1 answer

plot() calls dba.plotHeatmap(); parameter documentation is available on the help page.

You can also extract the normalized count data using dba.peakset() with bRetrieve=TRUE

Hi Rory,

From the latest update, I can retrieve the data from dba.peakset() ,after doing:

data <- dba.peakset(dbObj, bRetrieve=TRUE)

Then use the following code to calculate the correlation of each sample and draw the heatmap:

> result <- cor(data) ## use pearson method 
> heatmap.2(result )

However, the heatmap obtained is not consistent with that drawn by using the default function dba.plotHeatmap(dbObj), and the clustering results are also different.Does it need to set other parameters.

Thank you very much!

This is likely due to the default setting in dba.plotHeatmap() of bLog=TRUE, which uses the log2() normalized count values for the correlations.

Log in to answer this question.