Raw Count Matrix from DiffBind
1
0
Entering edit mode
@barbaramariotti-8083
Last seen 5.4 years ago
Italy

Hi,

I know that those are very stupid question but is there a way to obtain an "exportable" data frame (something like a txt file) containing the raw count for each peak in each sample obtained with dba.count without performing all the differential analysis? Is there the possibility to obtained data frame containing the consensus peak set generated in my analysis?

Thank you so much

Barbara

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

Hi Barbara-

Yes, you can do this using the dba.peakset() function with the parameter bRetrieve=TRUE.

For example, if you have a DBA object called myDBA:

> myDBA <- dba.count(myDBA)
> counts <- dba.peakset(myDBA, bRetrieve=TRUE)

This will return a GRanges object with the count scores. The default count score is TMM normalised using the edgeR package. If you want raw read counts, you can change the score first:

> myDBA <- dba.count(myDBA, peaks=NULL, score=DBA_SCORE_READS)
> counts <- dba.peakset(myDBA, bRetrieve=TRUE)

If you would prefer a data frame to a GRanges object:

> counts <- dba.peakset(myDBA, bRetrieve=TRUE, DataType=DBA_DATA_FRAME)

And if you want to write out the counts to a text file:

> counts <- dba.peakset(myDBA, bRetrieve=TRUE, writeFile="readscores.txt")

Cheers-

Rory