This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Diffbind: how to get raw read counts and normalized read counts

Hi,


I want to get raw reads and normalized read count from Diffbind. This is my code:

dbObj=dba(sampleSheet = samplesheet)
dbObj=dba.count(dbObj, bUseSummarizeOverlaps=T,bRemoveDuplicates = T)
datac=dba.normalize(datac,normalize=DBA_NORM_LIB)

Then I want to get normalized read count dataframe from this. I try to read this quesion and official manuals.So I write following code:

rawread=dba.peakset(datac,bRetrieve = T,DataType = DBA_DATA_FRAME,writeFile = 'rawread.csv',peak.format ='csv' )

I get a dataframe: enter image description here

So is it right? Or how can I get raw read counts and normalized read counts?

diffbind rawcount

1 answer

Yes, these are the normalized reads.

If you want to get the raw read counts, you can change the reported score and then re-retrieve the binding matrix:

normread <- dba.peakset(datac, bRetrieve = TRUE, DataType = DBA_DATA_FRAME, writeFile = 'normread.txt')
datac    <- dba.count(datac, peaks=NULL, score=DBA_SCORE_READS)
rawread  <- dba.peakset(datac, bRetrieve = TRUE, DataType = DBA_DATA_FRAME, writeFile = 'rawread.txt' )

Thank you. I really appreciate it.

Log in to answer this question.