bjmt / universalmotif

Motif manipulation functions for R.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

read_meme() yields out that "alphabet type cannot be detected" although "ALPHABET= ACGT" is provided

ruixuan-zhang opened this issue · comments

Hi there,

I'm new to this package.

When I tried to import motif from MEME, I got error information that

Error in get_custom_meme_alph(raw_lines) :
Alphabet type cannot be detected, custom alphabets are not currently supported

However my meme motif is in correct format where

ALPHABET= ACGT

My code is

motif_1 <- read_meme(system.file("/Users/Desktop/motif/pssm/up150_motif_1_pssm.txt",
                                           package = "universalmotif"))

When I tried with this code below

motif_1 <- read_meme("/Users/Desktop/motif/pssm/up150_motif_1_pssm.txt")

It returned that

Warning message:
In readLines(con <- file(file)) :
incomplete final line found on '/Users/zhangruixuan/Desktop/medusavirus_paper/motif/pssm/up150_motif_1_pssm.txt'

I'm not sure whether this warning message meaning, the last part of motif format is letter-probability matrix and I'm sure it is complete. Why did this warning come out?

Could you give me some advices? Thank you in advance.

Hi,

As far as I know this line:

motif_1 <- read_meme(system.file("/Users/Desktop/motif/pssm/up150_motif_1_pssm.txt",
                                           package = "universalmotif"))

Shouldn't work regardless of the motif. If you run

system.file("/Users/Desktop/motif/pssm/up150_motif_1_pssm.txt", package = "universalmotif")

on its own, it should return "" (and thus read_meme("") is not reading anything).

Your second attempt does look correct. The reason for the warning is because the file does not end with a newline character (you can try and prevent this warning by opening the file in a text editor, going to the end of the last line and hitting enter). This shouldn't stop the function from correctly reading the file however.

I'm going to close this issue. Feel free to reopen if you're still having problems with the motif file not being read correctly.