This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Is it possible to convert Minimal MEME Motif Format to PFMatrix

Hi,Guys I am wondering whehter I can convert the result of MEME sutie like

MEME version 4.4

ALPHABET= ACGT

strands: + -

Background letter frequencies (from file `../../promoter_background/Ath.bg'):
A 0.33230 C 0.16770 G 0.16770 T 0.33230

MOTIF AT1G01060 MP00119

letter-probability matrix: alength= 4 w= 10 nsites= 599 E= 4.8e-803
  0.854758      0.001669      0.051753      0.091820   
  0.000000      0.000000      1.000000      0.000000   
  1.000000      0.000000      0.000000      0.000000   
  0.000000      0.000000      0.000000      1.000000   
  0.996661      0.003339      0.000000      0.000000   
  0.000000      0.013356      0.008347      0.978297   
  0.005008      0.000000      0.005008      0.989983   
  0.085142      0.010017      0.000000      0.904841   
  0.287145      0.076795      0.056761      0.579299   
  0.188648      0.240401      0.195326      0.375626   

URL http://planttfdb.cbi.pku.edu.cn/tf.php?sp=Ath&did=AT1G01060.1#bind_motif

to convert the PFMatrix like

Background: 
   A    C    G    T 
0.25 0.25 0.25 0.25 
Matrix: 
  [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
A   14    0   14    0    4    1    0    3
C    1    0    0    0    6    8    0    6
G    0   15    1    0    0    0    9    4
T    0    0    0   15    5    6    6    2

I search many site,but only I can find is that How to convert other fomart to MEME suite result. So I am wondering whether I can reverse change.

meme motif pfm

1 answer

It is a matter of writing a simple script. You have all the information in MEME output such as background frequencies, motif width (10) and the number of sites (599). It would look something like this:

Background: 
   A    C    G    T 
0.33 0.17 0.17 0.33 
Matrix: 
  [,1] [,2] [,3]
A  512    0  599
C    1    0    0
G   31  599    0
T   55    0    0

I have done only the first three out of 10 positions, but you can do the rest by simple calculation.

EDIT: In case it is not obvious, we multiply each number in the letter matrix (say, 0.854758) by the number of sites (599) and round it to the nearest integer (512).

Log in to answer this question.