DiffBind dba.plotHeatmap Error in hclustfun(distfun(x))
2
0
Entering edit mode
Gary ▴ 20
@gary-7967
Last seen 5.2 years ago

Hi

When I run dba.plotHeatmap command below, there is an error message:

> dba.plotHeatmap(h3k27ac, attributes = DBA_ID, ColAttributes = c(DBA_CONDITION, DBA_TISSUE), colSideCols = c("deepskyblue", "deeppink"), correlations = FALSE, colScheme = "Blues", scale = "row", maxSites = 1000, margin = 13)

Error in hclustfun(distfun(x)) :

NA/NaN/Inf in foreign function call (arg 11)

The below are all commands I performed for reference.

Best & many thanks,

Gary

> setwd("/Volumes/NCHU/20170811_Tang_MandarinDuck/20170815_analysis/diffbind")
> require("DiffBind")
Loading required package: DiffBind
Loading required package: GenomicRanges
Loading required package: stats4
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: ‘BiocGenerics’

The following objects are masked from ‘package:parallel’:

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ, clusterExport, clusterMap,
    parApply, parCapply, parLapply, parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked from ‘package:stats’:

    IQR, mad, xtabs

The following objects are masked from ‘package:base’:

    anyDuplicated, append, as.data.frame, cbind, colnames, do.call, duplicated, eval, evalq,
    Filter, Find, get, grep, grepl, intersect, is.unsorted, lapply, lengths, Map, mapply,
    match, mget, order, paste, pmax, pmax.int, pmin, pmin.int, Position, rank, rbind,
    Reduce, rownames, sapply, setdiff, sort, table, tapply, union, unique, unsplit, which,
    which.max, which.min

Loading required package: S4Vectors

Attaching package: ‘S4Vectors’

The following objects are masked from ‘package:base’:

    colMeans, colSums, expand.grid, rowMeans, rowSums

Loading required package: IRanges
Loading required package: GenomeInfoDb
Loading required package: SummarizedExperiment
Loading required package: Biobase
Welcome to Bioconductor

    Vignettes contain introductory material; view with 'browseVignettes()'. To cite
    Bioconductor, see 'citation("Biobase")', and for packages 'citation("pkgname")'.


> h3k27ac <- dba(sampleSheet = "h3k27ac.csv")
MSailH3K27ac_C153 Sail H3K27ac Male C153 1 narrow
MSailH3K27ac_C156 Sail H3K27ac Male C156 2 narrow
MFlightH3K27ac_C159 Flight H3K27ac Male C159 1 narrow
MFlightH3K27ac_C165 Flight H3K27ac Male C165 2 narrow
FSailH3K27ac_C168 Sail H3K27ac Female C168 1 narrow
FSailH3K27ac_C171 Sail H3K27ac Female C171 2 narrow
FFlightH3K27ac_C177 Flight H3K27ac Female C177 1 narrow
FFlightH3K27ac_C180 Flight H3K27ac Female C180 2 narrow
> h3k27ac
8 Samples, 13047 sites in matrix (19937 total):
                   ID Tissue  Factor Condition Treatment Replicate Caller Intervals
1   MSailH3K27ac_C153   Sail H3K27ac      Male      C153         1 narrow     10373
2   MSailH3K27ac_C156   Sail H3K27ac      Male      C156         2 narrow      9158
3 MFlightH3K27ac_C159 Flight H3K27ac      Male      C159         1 narrow      9622
4 MFlightH3K27ac_C165 Flight H3K27ac      Male      C165         2 narrow      9059
5   FSailH3K27ac_C168   Sail H3K27ac    Female      C168         1 narrow     10853
6   FSailH3K27ac_C171   Sail H3K27ac    Female      C171         2 narrow     15717
7 FFlightH3K27ac_C177 Flight H3K27ac    Female      C177         1 narrow     12572
8 FFlightH3K27ac_C180 Flight H3K27ac    Female      C180         2 narrow     11963
> plot(h3k27ac)
> dba.plotHeatmap(h3k27ac, attributes = DBA_ID, ColAttributes = c(DBA_CONDITION, DBA_TISSUE), colSideCols = c("mediumpurple1", "palegreen2"), correlations = FALSE, colScheme = "Blues", scale="row", maxSites = 1000)
> dba.plotPCA(h3k27ac, attributes = DBA_CONDITION, dotSize = 3, cor = TRUE, vColors = c("deepskyblue", "deeppink"))
> dba.plotPCA(h3k27ac, attributes = DBA_TISSUE, dotSize = 3, cor = TRUE, vColors = c("goldenrod1", "mediumblue"))
> savefile <- dba.save(h3k27ac, file = "h3k27ac_peaks")
> h3k27ac <- dba.load(file = "h3k27ac_peaks")
> h3k27ac <- dba.count(h3k27ac, minOverlap = 2, score = DBA_SCORE_TMM_MINUS_EFFECTIVE_CPM, fragmentSize = 0, bRemoveDuplicates = TRUE, bScaleControl = TRUE, mapQCth = 10, bCorPlot = TRUE, bUseSummarizeOverlaps = TRUE, bParallel = TRUE)
> dba.plotHeatmap(h3k27ac, attributes = DBA_ID, ColAttributes = c(DBA_CONDITION, DBA_TISSUE), colSideCols = c("deepskyblue", "deeppink"), margin = 13)
> dba.plotHeatmap(h3k27ac, attributes = DBA_ID, ColAttributes = c(DBA_CONDITION, DBA_TISSUE), colSideCols = c("deepskyblue", "deeppink"), correlations = FALSE, colScheme = "Blues", scale = "row", maxSites = 1000, margin = 13)
Error in hclustfun(distfun(x)) : 
  NA/NaN/Inf in foreign function call (arg 11)

diffbind • 1.2k views
ADD COMMENT
1
Entering edit mode
Rory Stark ★ 5.2k
@rory-stark-5741
Last seen 13 days ago
Cambridge, UK

Hi Gary-

If you could email me the DiffBind object (h3k27ac) I can see if I can reproduce this and resolve the issue.

Regards-

Rory

ADD COMMENT
0
Entering edit mode
Rory Stark ★ 5.2k
@rory-stark-5741
Last seen 13 days ago
Cambridge, UK

This turned out to be a bug in DiffBind when there are rows in the binding matrix will all zero values. I am checking in a fix for the next release. 

There is a work-around you can use in the meantime, which is to set the sortFun parameter to sd:

> dba.plotHeatmap(h3k27ac, attributes = DBA_ID, 
                  ColAttributes = c(DBA_CONDITION, DBA_TISSUE), 
                  colSideCols = c("deepskyblue", "deeppink"), 
                  correlations = FALSE, colScheme = "Blues", 
                  scale = "row", maxSites = 1000, margin = 13, 
                  sortFun=sd)

I will be making this the default in the next release.

Cheers-

Rory

ADD COMMENT

Login before adding your answer.

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