You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem: FindMotifs gives a (slightly cryptic) error message when run with only one feature
library("Signac")
library("JASPAR2020")
library("TFBSTools")
library("BSgenome.Hsapiens.UCSC.hg19")
pfm<- getMatrixSet(x=JASPAR2020,
opts=list(species=9606, all_versions=FALSE))
# add motif informationatac_small<- AddMotifs(object=atac_small,
genome=BSgenome.Hsapiens.UCSC.hg19,
pfm=pfm)
motifs<- FindMotifs(object=atac_small, features="chr1-9064752-9065614")
# Selecting background regions to match input sequence characteristics# Matching GC.percent distribution# Testing motif enrichment in 1 regions# Error in base::colSums(x, na.rm = na.rm, dims = dims, ...) : # 'x' must be an array of at least two dimensions
Expected result: that is would be possible (even if it's probably not biologically meaningful!) to run FindMotifs on any number of features, or that it would fail with an error message that makes it clear what the issue is without reading the code
Proposed solution: If you add drop=FALSE to the matrix subsetting statement in this line and the one below, the objects returned will be matrices even if they only have one row, so colSums will work.
Thanks for the bug report. I've now fixed this on the develop branch, although it's really not recommended to do motif enrichment for only one region. I've also added a warning message to show a warning when running this function with <10 regions as input.
Hello,
A side question: why isn't it recommended to run FindMotifs with one region? For example, I found an interesting open chromatin region that has a high link score with a DEG, and that peak is differentially accessible between my clusters. I am really interested in knowing possible motifs/TF binding sites for this region, and possible infer regulation for that DEG. If I can't use FindMotifs on this one region, is there an alternative way?
Problem:
FindMotifs
gives a (slightly cryptic) error message when run with only one featureExpected result: that is would be possible (even if it's probably not biologically meaningful!) to run FindMotifs on any number of features, or that it would fail with an error message that makes it clear what the issue is without reading the code
Proposed solution: If you add
drop=FALSE
to the matrix subsetting statement in this line and the one below, the objects returned will be matrices even if they only have one row, socolSums
will work.sessionInfo:
The text was updated successfully, but these errors were encountered: