bjmt / universalmotif

Motif manipulation functions for R.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

validObject_universalmotif(motifs) fails when strand is "*"

doliv071 opened this issue · comments

Hi All,

I've just run across this error where the stand information must not be "", however, convert_motifs initially generated the "" when converting a matrix to a PFMatrix, see example below.

R> tmp <- matrix(1:20, nrow = 4, dimnames = list(c("A", "C", "T", "G")))
R> tmp
  [,1] [,2] [,3] [,4] [,5]
A    1    5    9   13   17
C    2    6   10   14   18
T    3    7   11   15   19
G    4    8   12   16   20

R> convert_motifs(tmp, "TFBSTools-PFMatrix")
An object of class PFMatrix
ID: 
Name: motif
Matrix Class: Unknown
strand: *
Tags: 
list()
Background: 
   A    C    G    T 
0.25 0.25 0.25 0.25 
Matrix: 
  N N N N N
A 1 2 2 2 2
C 2 2 2 2 2
G 4 3 3 3 3
T 3 3 3 3 3

R> convert_motifs(convert_motifs(tmp, "TFBSTools-PFMatrix"))
Error in validObject_universalmotif(motifs) : 
* strand must be one of +, -, +-

Thanks for the help

-Dave

Hi Dave,

Indeed, that looks like a bug to me. I'm surprised it's gone unnoticed this long! I've applied a patch which should fix the issue (v1.12.4 in the Bioc3.14 release branch, v1.13.9 in the dev branch). You can either wait a couple of days for Bioconductor to build the new version or install it from GitHub (only do the latter if you are set up to compile C++ code in R). Let me know once you get it if there are any further issues.

Thanks for the report!

Excellent, thanks for the quick resolution!