motifStack importMatrix problem reading meme file to pcm
2
1
Entering edit mode
lmolla ▴ 10
@lmolla-7662
Last seen 6.0 years ago
United States

I am trying to import my list of motifs (that were output of MEME)

motifs<-importMatrix(file),
                     format="meme", 
                     to="pcm")

When I look at the result there is one more extra column than what I expect with an A value of 'NA'; the motif is only 8 bases long in this case.

Not sure why this is happening and how i can fix it 

Slot "mat":
  [,1] [,2]     [,3] [,4] [,5] [,6] [,7] [,8] [,9]
A    0    1 0.000000    0    0    0    0    1   NA
C    1    0 0.290323    0    1    0    1    0    0
G    0    0 0.387097    1    0    1    0    0    1
T    0    0 0.322581    0    0    0    0    0    0

 

------------

my MEME file which is the input:

-----------------

 

MEME version 4.12.0

ALPHABET= ACGT

strands: + -

Background letter frequencies (from unknown source):
A 0.198 C 0.302 G 0.296 T 0.204

MOTIF CABGCGCA

letter-probability matrix: alength= 4 w= 8 nsites= 62 E= 8.6e-003
0.000000 1.000000 0.000000 0.000000
1.000000 0.000000 0.000000 0.000000
0.000000 0.290323 0.387097 0.322581
0.000000 0.000000 1.000000 0.000000
0.000000 1.000000 0.000000 0.000000
0.000000 0.000000 1.000000 0.000000
0.000000 1.000000 0.000000 0.000000
1.000000 0.000000 0.000000 0.000000

motifstack meme • 1.3k views
ADD COMMENT
0
Entering edit mode
lmolla ▴ 10
@lmolla-7662
Last seen 6.0 years ago
United States

Well I solved this by doing the following:

 

for (i in 1:length(motifs)){
  motifs[[i]]@mat =motifs[[i]]@mat[,1:ncol(motifs[[i]]@mat)-1]
}
ADD COMMENT
0
Entering edit mode
Ou, Jianhong ★ 1.3k
@ou-jianhong-4539
Last seen 4 days ago
United States

Hi Imolla,

Thank you for reporting this. This bug should be fixed in next building. 

Jianhong.

 

ADD COMMENT

Login before adding your answer.

Traffic: 810 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6