Regular Expression From Glam2
1
2
Entering edit mode
10.6 years ago
brentp 23k

i'm using glam2 to automate motif finding over sets of sequences (so it's running thousands of times). for each run, glam2 outputs a pretty html file and a .meme file. the html file lists a regular expression for each motif while the .meme file only lists the PWM. i want to grab is all regular expressions for each run. are there any tools to parse glam2 output? or some other tool in the meme tool suite to just get the regexp?

otherwise, it seems the simplest solution is to reconstruct the regexp from the PWM.

motif parsing • 2.5k views
ADD COMMENT
4
Entering edit mode
10.6 years ago
Gurado ▴ 280

There is a new version of meme (4.5) about to be released and next to all programs now also provide xml output, which would easily get you what you are after. Unfortunately, as far as I know, glam2 is the exception and has not been updated in that regard yet.

I'm not aware of any tool in the meme suite that would give you the regexp from the output meme file so I see two ways:

1) as you describe, parse the pwm and generate your own regexp. 2) modify the file that generates the html output of glam that is scripts/glam2html.py. You could kick out all the stuff you are not interested in or put some unique labels around the regexp so you can easily extract it using sed or the like. Don't forget to run make and make install to get it properly converted and placed into where your installation is. If you hesitate to modify the original source you can modify scripts/glam2html (without the .py) and run a make install. Note, glam2html is usually generated from glam2html.py when you run make, so whenever scripts/glam2html.py is modified your local changes in scripts/glam2html will be overwritten. On the plus site, you should be able to recover the original version by simply deleting scripts/glam2html and running make install again.

ADD COMMENT
0
Entering edit mode

thanks much! the pointer to glam2html.py was very helpful. i just modified it to print the regular expressions to stderr, then modified glam2_glam2.c to send stdout to a .re file.

ADD REPLY

Login before adding your answer.

Traffic: 2536 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