Question: Raw Count Matrix from DiffBind
gravatar for barbara.mariotti
4.3 years ago by
barbara.mariotti0 wrote:


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



diffbind • 2.3k views
ADD COMMENTlink modified 4.3 years ago by Rory Stark3.0k • written 4.3 years ago by barbara.mariotti0
Answer: Raw Count Matrix from DiffBind
gravatar for Rory Stark
4.3 years ago by
Rory Stark3.0k
CRUK, Cambridge, UK
Rory Stark3.0k wrote:

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")



ADD COMMENTlink written 4.3 years ago by Rory Stark3.0k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 229 users visited in the last hour