stuart-lab / signac

R toolkit for the analysis of single-cell chromatin data
https://stuartlab.org/signac/
Other
330 stars 88 forks source link

Error in Motif Analysis #1788

Closed yangxinzhi closed 1 month ago

yangxinzhi commented 1 month ago

I encountered an issue while using Signac for motif analysis. I keep getting the following error message (screenshot attached). Could you please help me figure out why this error is occurring? ![Uploading image.png…]() ![Uploading 6b816780c7bda7f6dfcf1b67972d62e.png…]() open.peaks <- AccessiblePeaks(combined, idents = c("CD4 Memory", "CD8 Naive"))

匹配峰集中的总体 GC 含量

meta.feature <- GetAssayData(combined, assay = "ATAC", layer = "meta.features") peaks.matched <- MatchRegionStats(

  • meta.feature = meta.feature,
  • query.feature = matched.query,
  • n = 50000
  • ) Error in [.data.frame(meta.feature, , features.match, drop = FALSE) : 选择了未定义的列

    使用 FindMotifs 函数进行 motif 富集分析

    enriched.motifs <- FindMotifs(

  • object = combined,
  • features = top.da.peak
  • ) Selecting background regions to match input sequence characteristics Error in [.data.frame(meta.feature, , features.match, drop = FALSE) : 选择了未定义的列 head(rownames(meta.feature)) [1] "chr1-565153-565499" "chr1-713551-714783" "chr1-752418-753020" "chr1-762249-763345" [5] "chr1-779771-780224" "chr1-801014-801379" head(open.peaks) [1] "chr1-565153-565499" "chr1-713551-714783" "chr1-752418-753020" "chr1-762249-763345" [5] "chr1-779771-780224" "chr1-804888-805748" head(top.da.peak) [1] "chr16-79632125-79636693" "chr1-159046122-159047701" "chr6-31542787-31545486"
    [4] "chr1-236162006-236163426" "chr6-167362839-167366196" "chr14-65222314-65223141" head(meta.feature) count percentile chr1-565153-565499 94 0.03409748 chr1-713551-714783 7199 0.93075999 chr1-752418-753020 955 0.68005959 chr1-762249-763345 4567 0.89083693 chr1-779771-780224 332 0.36622271 chr1-801014-801379 216 0.21864855 colnames(meta.feature) [1] "count" "percentile" packageVersion("Signac") [1] '1.14.0'
timoast commented 1 month ago

The problem is that you don't have the GC content for each peak computed. You will need to run RegionStats() on the object before running the motif enrichment test.

I will update this to give a more informative error message