A platform to do RNA science

View on GitHub

RNA Science Toolbox

The RNA Science Toolbox provides a Python API (PyRNA) to do RNA science on Linux (mainly Ubuntu) and MacOSX. PyRNA allows you to:

This project is related to the DockeRNA project which provides Docker images containing the RNA algorithms you may need.

You can follow this project on twitter to get updates as they happen.

Basic installation

To use the RNA Science Toolbox, you will need to go through several steps. But don’t be afraid, each step is really easy to follow.

If you don’t care about the details, you can go directly to the instructions copy/paste in a terminal.

We will provide soon a script allowing to fully configure an Ubuntu openstack image with the RNA Science toolbox.


Python environment

You need at first to have a Python distribution installed on your computer. If you don’t have one, we recommend you a distribution like Anaconda.

If you’re using Linux Ubuntu, copy/paste in a terminal:

wget "https://repo.continuum.io/archive/Anaconda2-5.0.1-Linux-x86_64.sh"
chmod u+x ./Anaconda2-5.0.1-Linux-x86_64.sh


You also need the tool Fabric.

If you’re using the Anaconda distribution on Linux Ubuntu/MacOSX, copy/paste in a terminal:

conda install fabric


To install the RNA algorithms, you need first to get a tool named Docker.

If you’re using Linux Ubuntu, copy/paste in a terminal:

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository \
    "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
    $(lsb_release -cs) \
sudo apt-get update
sudo apt-get install docker-ce

In order to run docker as non-root user, you need to add your user to the docker group.

Copy/paste in a terminal:

sudo usermod -a -G docker $USER

You will perhaps need to reboot:

sudo reboot

RNA Science Toolbox dependencies

Python libraries

Once done, download the RNA Science Toolbox and go into its directory. To install its Python dependencies, you can use either the package manager conda (from the Anaconda distribution) or pip.

If you’re using Linux Ubuntu/MacOSX, copy/paste in a terminal:

fab python

To use pip, type:

fab python:manager=pip

RNA algorithms

Each Docker image available contains several algorithms:

If you need more details about these images, check their Web page.

To install these images, copy/paste in a terminal:

fab docker

How to configure your environment?

In the configuration file of your shell (.bashrc, .zshrc,…), add the following lines:

export PATH=$PATH:$TOOLBOX/pyrna:$TOOLBOX/scripts/python:$PATH

If you’re using bash on Linux Ubuntu/MacOSX, copy/paste in a terminal:

cat <<EOT >> $HOME/.bashrc
export TOOLBOX="\$HOME/RNA-Science-Toolbox"
export PATH=\$PATH:\$TOOLBOX/pyrna:\$TOOLBOX/scripts/python:\$PATH


Restart your shell and type:


Your RNA Science Toolbox is fully configured if you get something like:

Recovering entry 1EHZ from Protein Databank...

## 3D annotation ##

List of base-pairs computed with RNAVIEW:

edge1 edge2 orientation  pos1  pos2
0      (     )           c     1    72
1      (     )           c     2    71
2      (     )           c     3    70

Advanced installation

Option #1: RNA 3D modeling

If you’re interested in 3D modeling with the tool Assemble2, you will need to import, annotate and store RNA 3D fragments derived from PDB structures.

To do so, you will need first to install MongoDB on your computer.

If you’re using Linux Ubuntu, copy/paste in a terminal:

fab mongodb

With OSX, you can use homebrew and copy/paste in a terminal:

brew update ; brew install mongodb ; brew services start mongodb

Once MongoDB installed, you need to feed the database with RNA 3D fragments. To do so copy/paste in a terminal:

import_3Ds.py -annotate
import_3Ds.py -annotate -rna3dhub

Be patient, each import takes a while. I recommend you to do these imports in a screen session.

Option #2: IPython configuration

To automatically import the PyRNA API from the IPython REPL, go into the directory $HOME/.ipython/profile_default/startup. Create a file named load_config.py containing the following lines:

from pyrna.db import *
from pyrna.features import *
from pyrna.computations import *
from pyrna.parsers import *
from pyrna.utils import *

Start a new IPython session from the command-line and type directly, without any import:

pdb = PDB()
tertiary_structures = parse_pdb(pdb.get_entry('1EHZ'))
for ts in tertiary_structures:
  print ts.rna.sequence

Option #3: deploy Web Services

The RNA Science Toolbox allows you to give access to some of its functionalities as Web Services. These services are made available through a Web server.


You need to have node.js installed on your computer.

Install the Web server dependencies

From the directory of the RNA Science Toolbox, copy/paste in a terminal:

fab website

Launch the Web server

Copy/paste in a terminal:

cd $TOOLBOX/pyrna

Open your browser at http://localhost:8080

You should get a Web page displaying the load of your server for the last 60 minutes. The chart is updated each minute.

Server Load

You can use a custom hostname and/or port by typing:

cd $TOOLBOX/pyrna
./server.py -h your_hostname_OR_IP_adress -p your_port

Open your browser at http://your_hostname_OR_IP_adress:your_port