Home > Cool Tools, Geek stuff > Practical RNA structure visualization with VARNA

Practical RNA structure visualization with VARNA

September 6th, 2009

VARNA (Visualization Applet for RNA) (http://varna.lri.fr/) is a new tool for RNA secondary structure visualization and it has a lot going for it: open source, pretty structure rendering, export to svg/jpg/eps, interactive inspection of structure with change of layout algorithm (linear/circular/radial). And most importantly: it is so simple to use that it is actually practical! If you are a teacher/student in a class covering RNA structure you should really have a closer look at VARNA. As a researcher, it is very easy to store dynamic VARNA-enabled RNA secondary structures on your computer – and in some situations this is really what you want.

If you want to “semi-interactively” inspect the structure of a single RNA sequence you would probably go to one of the many online RNA structure prediction webservers, but if you have more than a couple of sequences this easily gets tedious. I wrote a really small script, rnadraw.rb, that takes the dot-bracket output of the RNAfold program and saves it is a HTML file with an embedded VARNA applet:

#! /usr/bin/ruby
# Read dot-bracket on STDIN, output VARNA HTML applet code
 
l = STDIN.readlines
seq = l.reject{|x| x =~ />/}.first.chomp
dbn = l.last.split(" ").first
 
STDOUT.puts "
<body>
<applet code='VARNA.class'
codebase='http://varna.lri.fr/bin'
archive='VARNA.jar'
width='600' height='600'>
<param name='sequenceDBN'  value='#{seq}' />
<param name='structureDBN' value='#{dbn}' />
</applet>
</body>"

Now, you can fold your favorite RNA sequence and save the output in “VARNA-format” like this:

~> echo "ccccttttgggg" | RNAfold | ruby rnadraw.rb > my_rna_structure.html

When you open the resulting HTML file in your browser the newest version of the VARNA applet code will automatically be loaded and there it is! I have posted an example of the output here: here. This is the human miR-21 precursor and it was generated with this command:

~> curl -s current.mirmaid.org/precursors/hsa-mir-21.fa | RNAfold | ruby rnadraw.rb > hsa-mir-21.html

The first part of the command fetches the sequence of the human miR-21 precursor from miRMaid – which we will cover in a later post.

Share and Enjoy:
  • Facebook
  • Google Bookmarks
  • Digg
  • del.icio.us
  • Slashdot
  • email

anders Cool Tools, Geek stuff ,

  1. No comments yet.
  1. No trackbacks yet.