Keep configuration sytanx like:

from rna_tools.rna_tools_config import CPUS_CLUSTER
# since we use export PYTHONPATH=$PYTHONPATH:/home/magnus/src/rna-tools/


    print ('Set up RNA_ROSETTA_RUN_ROOT_DIR_MODELING in .bashrc')


We are using (at least we are moving towards)the Google style docstrings via Napoleon. Napoleon is a Sphinx Extensions that enables Sphinx to parse both NumPy and Google style docstrings - the style recommended by Khan Academy.

Generate docs

At the moment the generation of the docs is quite tricky, because of old dependencies on Python2 and old version of Sphinx. To generate docs locally please switch to Python2 and then run cd docs/; make clean; make html.

It should be updated at some point.

Add a new tool to the package

  1. Create a new folder in rna-tools/rna_tools/tools with your tool. The folder will be seen online after your push at We will walk you through this simple example .

  2. Make sure that there is a simple test as

    python --residue_index_start 1 obj1 test_data/ALN_OBJ1_OBJ2.fa test_data/obj01.pdb

and there is a test_data folder with some test inputs and outputs. See the example.

  1. Add your tool to at the top folder of rna-tools:

    ln -s $curr_dir/rna_tools /tools/<tool folder>/<util script name with .py> $curr_dir/bin/<util script name with .py>
    ln -s $curr_dir/rnatools/utils/renum_pdb_to_aln/ $curr_dir/bin/

This will “install” you script in bin directory of the project so it can be used system-wide.

Run this script to see if there is any error, ./

  1. Add your tool to the documentation. The tool has to be “importable”, so don’t forget to create inside your tool directory. Next, go to rna-tools/docs/source and edit tools.rst. Add, wherever you think your tool will fit, lines like:

    Renumber a pdb file according to alignment
    .. autoprogram::<tool folder>.<tool script name>.get_parser()
       :prog: <utl script name>
    .. automodule::<tool folder>.<tool script name>
       : members:
     Renumber a pdb file according to alignment
     .. autoprogram::
        :prog: renum_pdb_to_aln
     .. automodule::

and run make html in the folder to check if the documentation is compiled without any errors.

If you are using any external library such us scipy, please make sure that they are listed in rna-tools/docs/requirements.txt. If the library is not there, please add it. This file is read by the Read The Docs to compile the documentation online and also by Travis for continuous testing.

You can open the documentation compiled locally under a link link file://<path to rna-tools>/rna-tools/docs/build/html/index.html, e.g. file:///Users/magnus/work/src/rna-tools/docs/build/html/index.html.

  1. The very last step is to add your tool to the main testing script. Edit rna-tools/ and add

     cd ./tools/<tool folder>/
     cd ../..
    cd ./tools/renum_pdb_to_aln/
    cd ../..
  2. Run this main test (./ and see if the tool works as expected.

  3. Now we are ready to push the changes. In the terminal, type:

    $ git pull
    $ git add <files> # or use git gui
    $ git commit -m <desc the tool>
    $ git push

to commit all your changes and push it to the Github repository!


This testing is very, very rough and we are moving to have more test in py.test at some point.