Entering edit mode
Hi,
I have generated a heatmap based on binding sites using DiffBind package. I was wondering if it is possible to output the rows (dendogram) in the order as they appear on the heatmap.
Many Thanks,
Hi,
I have generated a heatmap based on binding sites using DiffBind package. I was wondering if it is possible to output the rows (dendogram) in the order as they appear on the heatmap.
Many Thanks,
The binding sites are returned invisibly in a GRanges
object, in the order they appear in the plot. So all you have to do is to assign the return value of the dba.plotHeatmap()
[or plot()
] to a variable. For example:
> data(tamoxifen_counts) > bsites <- dba.plotHeatmap(tamoxifen, correlations=FALSE) > bsites
Cheers-
Rory
Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Hi,
I have tried this option but I get a value of null. I use the following commands
>peaks=dba(sampleSheet="samplesheet.csv")
>rawcounts=dba.count(peaks)
>x= dba.plotHeatmap(rawcounts,correlations=FALSE)
> x
NULL
Any suggestions?
Thanks,
What version of
Bioconductor
/DiffBind
are you using? The feature to return the binding sites in order was introduced inDiffBind
v1.16, which was part ofBioconductor
3.2. The current version isBioconductor
3.3/DiffBind
2.0.x.I upgraded Diffbind ( DiffBind_2.0.6) but I am not getting some error while loading the samplesheet. > peakSet=dba(sampleSheet="samplesheet.csv")
Error in if (sum(changed) > 0) { : missing value where TRUE/FALSE needed
Hmmn, that error is in a function that checks the strings in the sample sheet. If you could send me a copy of your samplesheet, I can have a look.
rory.stark@cruk.cam.ac.uk
P.S. If you had an existing DBA object from a previous version, and save it with
dba.save()
, you should be able to read it into the new version usingdba.load()
, which converts between versions.Looks like some new error-checking code introduced a bug when dealing with NAs in the samplesheet. I'll check in a fix, but in the meantime if you delete the columns that have NAs it should work.
-R
Error in pv$peaks[[i]] : subscript out of bounds
I'm not exactly what you are trying to do here, but I see a couple of problems with this script.
1. The second line adds a peakset (contained in the file
promoter.peaks.bed
) to an existing DBA object (peakSet
) which when returned is assigned to a new variable (new
). In the third line, you are counting using the original DBA object (peakSet
), but using a mask from the "new
" DBA object. As the new DBA object has an additional sample peakset in it, the masks can not be used with the original peakset (mask will be the wrong length), hence the error you are seeing.2. It doesn't make sense to use a mask as the value for the
peaks
parameter todba.count()
-- this has to be an actual peakset. A mask is used to limit which samples are used ("masking out" some of the samples). A peakset specifies which binding site intervals to include.What I think you want to do is to have the peaks in
promoter.peaks.bed
serve as the peakset to use when counting the reads in the samples in the originalpeakSet
DBA object. There are number of ways to do this, but the most straightforward way is:However there may be a bug in this (I am checking in a fix that should appear as
DiffBind 2.0.7
). A workaround is to read the peaks in first, giving:-Rory