GreenleafLab / ArchR

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

Error in plotEnrichHeatmap for Motif Enrichment Analysis #473

Closed jbjela closed 3 years ago

jbjela commented 3 years ago

PLEASE FILL OUT THE RELEVANT INFORMATION AND DELETE THE UNUSED PORTIONS OF THIS ISSUE TEMPLATE.

Attach your log file ArchR-plotEnrichHeatmap-7fc6549babd-Date-2020-12-17_Time-11-59-13.log

Describe the bug I attempted to perform motif enrichment on the marker peaks identified using getMarkerFeatures(). I then used the SummarizedExperiment output to directly plot these motif enrichments across all cell groups using the plotEnrichHeatmap() function. However, I received the following error after using plotEnrichHeatmap():

heatmapEncode <- plotEnrichHeatmap(enrichMotifs, n = 7, transpose = TRUE)

ArchR logging to : ArchRLogs/ArchR-plotEnrichHeatmap-7fc6549babd-Date-2020-12-17_Time-11-59-13.log

If there is an issue, please report to github with logFile!

Error in names(x) <- value :

names attribute [13] must be the same length as the vector [0]

My enrichMotifs variable looks as expected, so Im not sure what the issue is:

enrichMotifs

class: SummarizedExperiment

dim: 870 13

metadata(0):

assays(10): mlog10Padj mlog10p ... CompareFrequency feature

rownames(870): TFAP2B_1 TFAP2D_2 ... TBX18_869 TBX22_870

rowData names(0):

colnames(13): C1 C2 ... C12 C13

colData names(0):

To Reproduce I was able to perform this action with the tutorial dataset

Expected behavior A expected that a heatmap plot of enriched TF motifs throughout the clusters in my dataset would be produced.

Thank you.

jgranja24 commented 3 years ago

Hi @jbjela,

I think the problem here is that your cutoffs may be too stringent for the differential peaks prior to motif enrichment. After filtering of motifs passing the cutoff of 10^-20 there are no rows and thus an error.

In your log file we see first

2020-12-17 11:59:13 : mat-mlog10Padj, Class = data.frame
mat-mlog10Padj: nRows = 870, nCols = 13
                C1 C2 C3         C4        C5 C6 C7 C8       C9 C10       C11       C12       C13
TFAP2B_1 0.0000000  0  0 0.00000000 0.0000000  0  0  0 0.000000   0 1.5290575 0.0000000 0.9133575
TFAP2D_2 3.9948575  0  0 0.04645749 0.0000000  0  0  0 0.000000   0 2.4383575 0.0000000 7.1142575
TFAP2C_3 0.8332575  0  0 0.00000000 0.0000000  0  0  0 0.000000   0 5.4290575 0.1964575 1.4562575
TFAP2E_4 0.0000000  0  0 0.00000000 0.0000000  0  0  0 0.000000   0 1.7364575 0.0000000 0.0000000
TFAP2A_5 2.2418575  0  0 0.00000000 0.0000000  0  0  0 0.000000   0 0.9949575 0.0000000 1.4621575
ARID3A_6 0.0000000  0  0 0.00000000 0.1346575  0  0  0 1.022657   0 0.0000000 0.0000000 0.0000000

and then,

2020-12-17 11:59:13 : mat-mlog10Padj-Filter, Class = data.frame
mat-mlog10Padj-Filter: nRows = 0, nCols = 13
 [1] C1  C2  C3  C4  C5  C6  C7  C8  C9  C10 C11 C12 C13
<0 rows> (or 0-length row.names)
jgranja24 commented 3 years ago

I will add an error message to better handle this error.

jgranja24 commented 3 years ago

Closing this issue feel free to open new ones!