Has anyone worked with Stockholm Format? Particularly is there any tools out there to generate a stockholm formatted file including the predicted secondary structure?
Ralee comes with scripts that help convert clustal formatted files but I cannot work out how to automate adding RNA secondary structure (or from what package it should be generated).
I took the RNA package from krother and added a wrapper to RNAalifold.
If you'll install my fork you could just write:
from Bio import AlignIO
from Bio import RNA
msa = AlignIO.read(file,format)
ss = RNA.predictStruct(msa,'RNAalifold')
msa.setSS(ss)
AlignIO.write(msa,file,'stockholm')
Of course you'll have to have RNAalifold in your path
hope it will help
The Vienna secondary structure package predicts secondary structures for RNAs, and they will output the ss line at the bottom of the stockholm format (http://www.tbi.univie.ac.at/~ivo/RNA/).
All the models in RFAM contain an SS line, and they can be downloaded in bulk from their ftp site (http://rfam.sanger.ac.uk).
If you have the multiple alignment on one side and the SS line on the other, I haven't found a way to combine them either, other than scripting it myself by adding the lines at the end of the stockholm file.
thanks but how to combine the secondary structure from RNAfold with a multiple sequence alignment to form a stockholm formated file? For my workflow I need a program/script for this: I feel this must have been done before.
I use stockholm format quite a bit as the output from doing alignments with FSA or HMMER3 (confidence values for columns), it is handy for letting you mark up sequences. If you have any scripting experience it is trivial to output valid stockholm format files. A basic file looks a lot like phylip format, just with special mark-up lines that contain data other than sequence.
thanks but how to combine the secondary structure from RNAfold with a multiple sequence alignment to form a stockholm formated file? For my workflow I need a program/script for this: I feel this must have been done before.
No automated method that I know