Creating and updating templates

Adding new templates

To submit a new template or update an existing one, please create a GitHub issue with the following information:

  1. A RNA 2D JSON Schema file (recommended) - see example.

    Alternatively, you can submit the following:

    1. A FASTA or BPSEQ file with a reference sequence and secondary structure - see FASTA and BPSEQ examples

    2. A Traveler XML file - see example

  2. Description of the new template and any relevant background information.


GitHub currently does not support attaching files with .fasta, .bpseq, or .json extensions so please attach the files as .txt.

Creating templates using RNA 2D JSON Schema files

It is possible to generate new templates using RNA 2D JSON Schema files as input.


  1. Run your sequence through R2DT webserver and click Edit in XRNA

    1. Alternatively, generate a structure using R2DT on the command line and locate the JSON file in the json folder.

    2. Upload JSON file to an interactive editor

  2. Manually edit the layout

  3. Download the edited structure as a new JSON file and save it in the data/new folder

  4. Run the following command: generate-template data/new/<input.json>
  5. The new Traveler template, covariance model, and a fasta file will be generated in the data/local_data folder.

  6. Use the new template: draw --force-template <template_name> <input.fasta> <output_folder>


  1. Run your sequence through R2DT webserver and click Edit in RNAcanvas. Alternatively, open RNAcanvas and click Create new drawing

  2. Edit the drawing and click RNA 2D to export an RNA 2D JSON Schema file

  3. Put the JSON file in any folder accessible to R2DT, for example, data/new

  4. Run generate-template data/new/<template_name.json>

  5. The new Traveler template, covariance model, and a fasta file can found in a new folder data/local_data/template_name, where template_name matches the name of the json file

  6. Use the new template: draw --force-template <template_name> <input.fasta> <output_folder>

Creating templates using FASTA/BPSEQ and Traveler XML files

  1. Place new FASTA or BPSEQ file(s) in the data/new folder

  2. Run generatecm. The command will generate new .cm file(s) with the covariance models

  3. Move the new .cm and .tr files in the destination directory (for example, ribovision-ssu is where all SSU templates submitted by the RiboVision group are stored)

  4. Run generatemodelinfo <destination>/cms to add new models to the list of searched models where <destination> is the same folder as in the step above

  5. Update metadata.tsv file in the destination directory

  6. Run list-models to update a list of all available models

  7. Verify that the templates work as expected by testing on a fasta file with a sequence similar to the template

  8. Run tests and update the model counts in TestCovarianceModelDatabase as needed

Updating Rfam templates

The following procedure should be done after each Rfam release:

  1. Recompute all Rfam templates (takes ~6h) setup-rfam
  2. Run tests

  3. Generate new precomputed library archive

    tar -czvf cms.tar.gz <path/to/new/cms>

    The folder should contain 2 subfolders: crw and rfam.

  4. Update the precomputed library link in Readme

  5. Update a list of available models list-models
  6. ⚠️ Note that the tRNA Rfam Traveler template has been manually edited to match the standard tRNA layout so the automatically generated traveler-template.xml file should be discarded and the current version should be kept.