ArchR icon indicating copy to clipboard operation
ArchR copied to clipboard

Error in plotEnrichHeatmap:

Open erlun1 opened this issue 6 months ago • 1 comments

Problem: After running the code: enrichMotifs <- peakAnnoEnrichment( seMarker = markersPeaks, ArchRProj = proj, peakAnnotation = "Motif", cutOff = "FDR <= 0.01 & Log2FC >= 1.25"), I encountered an error when attempting to create a heatmap using: heatmapEM <- plotEnrichHeatmap(enrichMotifs, n = 10, transpose = FALSE). The error message received was "Error in dimnames<-.data.frame(tmp, value = value): invalid 'dimnames' given for data frame".

I used: R version 4.3.0, SummarizedExperiment version 1.30.2, ArchR version 1.0.2. Ultimately, I found that the issue lies in a specific line of code within plotEnrichHeatmap: "mat <- assays(seEnrich)[["mlog10Padj"]]". The problem with this line of code is that for a SummarizedExperiment object, it requires declaring "assays(enrichMotifs, withDimnames = FALSE)[['mlog10Padj']]" to correctly call the matrix. The default parameter for the assays function is "withDimnames = TRUE". This bug has existed since version 1.0.0 and was only recently discovered. I hope this information can be helpful to others facing the same issue.

erlun1 avatar Dec 26 '23 08:12 erlun1

Hi @erlun1! Thanks for using ArchR! Please make sure that your post belongs in the Issues section. Only bugs and error reports belong in the Issues section. Usage questions and feature requests should be posted in the Discussions section, not in Issues.
It is worth noting that there are very few actual bugs in ArchR. If you are getting an error, it is probably something specific to your dataset, usage, or computational environment, all of which are extremely challenging to troubleshoot. As such, we require reproducible examples (preferably using the tutorial dataset) from users who want assistance. If you cannot reproduce your error, we will not be able to help. Before going through the work of making a reproducible example, search the previous Issues, Discussions, function definitions, or the ArchR manual and you will likely find the answers you are looking for. If your post does not contain a reproducible example, it is unlikely to receive a response.
__In addition to a reproducible example, you must do the following things before we help you, unless your original post already contained this information: 1. If you've encountered an error, have you already searched previous Issues to make sure that this hasn't already been solved? 2. Did you post your log file? If not, add it now. 3. Remove any screenshots that contain text and instead copy and paste the text using markdown's codeblock syntax (three consecutive backticks). You can do this by editing your original post.

rcorces avatar Dec 26 '23 08:12 rcorces