This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Python-friendly tools for RNA secondary structure visualisation & manipulation

I'm looking for Python tools (or tools with Python bindings) for manipulation and visualisation of RNA secondary structures. In principle, I would like to annotate (maybe with colours) some of the bases from 2D structures.

Can you recommend me some solutions?

rna python secondary-structure visualisation

4 answers

forgi is a Python package that allows a lot of flexibility in working with secondary structures. I've found it very useful; also see another answer for hints on loading from FASTA.

Thanks Ryan, that's really good hint! Actually I've found it in meantime :) I cannot find the option to generate the structure images, but I'll do some stats with forgi at least :D

It's not a tool but rather a far starting point for what you're asking. The Vienna package has a script called colorrna.pl which is a small perl script that color the ss.ps file using the dp.ps file (base-pairing probabilities). You can take a look and see how they change the postscript file and enter colors as you will.

Maybe this lib : https://github.com/fjossinet/RNA-Science-Toolbox

Fabrice has continued to update and expand this into his project RNArtist. While it isn't Python based, it will work with Jupyter notebooks. See my update in this Biostarts post here detailing this twitter post detailing using it in a Jupyter notebook served for free via MyBinder.org.

Question here has some good answers: forgi for plotting 2D RNA structure

Log in to answer this question.