How to change peaks in global matrix in DiffBind?
2
0
Entering edit mode
@sarahblackstone7734-11208
Last seen 8.3 years ago

Hi,

I extracted my consensus peakset from the DBA object after counting. I filtered this list to remove outliers and other criteria. I would like to change the consensus peakset in my DBA object now, using my filtered list.

I extracted the consensus peaks like this:

countTable <- dba.peakset(sampleCounts, bRetrieve=T,DataType=DBA_DATA_FRAME)

 

How do I put it back into the DBA object?

diffbind • 976 views
ADD COMMENT
0
Entering edit mode
Rory Stark ★ 5.2k
@rory-stark-5741
Last seen 4 weeks ago
Cambridge, UK

Hi Sarah-

The most straightforward way is to pass in the filtered peaks to dba.count():

> countTable <- dba.peakset(sampleCounts, bRetrieve=T,DataType=DBA_DATA_FRAME)
> filteredPeaks <- do.some.filtering(countTable) #your filtering code
> filteredCounts <- dba.count(sampleCounts, peaks=filteredPeaks)

This will result in the new, filtered set of peaks being used as the the consensus peakset. It will also require that all the reads are re-counted for all the samples, so it is not a "free" operation. If you are using the default read score for your initial call to dba.count(), you would have retrieved normalized read scores (and presumably used them for your filtering). These scores would need to be re-normalized after filtering, which dba.count() will do.

Hope this helps-

Rory

ADD COMMENT
0
Entering edit mode

Thanks -

 

I gave it a try, but got an error when running dba.count()

> head(cPeaks)
  seqnames   start     end
1     chr1 3193392 3193892
2     chr1 4257230 4257730
3     chr1 4332360 4332860
4     chr1 4492080 4492580
5     chr1 4496255 4496755
6     chr1 4560053 4560553
> counts <- dba.count(samples, peaks=cPeaks)
Error in if (is.unsorted(unique(pv$vectors[, 1]))) { : 
  missing value where TRUE/FALSE needed

ADD REPLY
0
Entering edit mode
Rory Stark ★ 5.2k
@rory-stark-5741
Last seen 4 weeks ago
Cambridge, UK

Hi Sarah-

Sorry for the delay in responding. 

Could you let me know which version of the software you are running? Result of sessionInfo() or packageVersion("DiffBind"). This works for me in the most recently released version (2.0).

-Rory

ADD COMMENT

Login before adding your answer.

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