GreenleafLab / ArchR

ArchR : Analysis of Regulatory Chromatin in R (www.ArchRProject.com)
MIT License
384 stars 137 forks source link

Error in plotEnrichHeatmap: #2083

Open erlun1 opened 10 months ago

erlun1 commented 10 months ago

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.

rcorces commented 10 months ago

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.