Getting Started with jViz.Rna: A Beginner’s Guide

jViz.Rna Tutorial: From Sequence to Interactive Diagram

Overview

This tutorial shows a concise, step-by-step workflow for converting an RNA sequence into an interactive secondary-structure diagram using jViz.Rna. It assumes you have a working web browser and basic familiarity with RNA sequences. Outputs: an interactive diagram you can inspect, pan, zoom, and export.

1) Prepare the RNA sequence

  • Format: single-line nucleotide sequence (A, U, G, C).
  • Example:

    GGGAAAUCCGGAUACCUUGGAGUACCGGAAAUCC

2) Install or open jViz.Rna

  • Use the hosted web app or include jViz.Rna in your web project (JavaScript import).
  • Typical inclusion (assumes a bundler or module loader):
html

3) Predict secondary structure (dot-bracket)

  • jViz.Rna can accept precomputed dot-bracket notation or integrate with structure predictors (e.g., RNAfold).
  • Example dot-bracket (paired/unpaired):
    (((….(((….)))….)))……
  • If you need prediction offline: run RNAfold or another predictor to generate a dot-bracket string for your sequence.

4) Initialize jViz.Rna with sequence + structure

  • Basic initialization pattern:
js
const seq = “GGGAAAUCCGGAUACCUUGGAGUACCGGAAAUCC”;const dotBracket = “(((…..(((…..)))…..)))……”; // exampleconst container = document.getElementById(‘jviz-container’); const viewer = new jVizRna.Viewer({ container, sequence: seq, structure: dotBracket, theme: ‘light’ // or ‘dark’});viewer.render();

5) Interact with the diagram

  • Pan and zoom: mouse drag + scroll (or touch gestures).
  • Select bases: click to highlight positions and view annotations.
  • Hover: shows nucleotide index, pair partner, and any attached metadata.
  • Toggle labels: show/hide base letters or pair lines via viewer options.

6) Annotate and style

  • Add colored regions, highlight stems/loops, or overlay experimental data (reactivity, conservation):
js
viewer.addAnnotation({ range: [5,12], color: ‘#ffcc00’, label: ‘Loop 1’});viewer.setBaseColors({ 1: ‘#00aaff’, 2: ‘#00aaff’ }); // per-base coloring

7) Export diagrams

  • Export formats typically supported: PNG, SVG, and JSON (for reloading).
js
const pngData = viewer.exportPNG();const svgData = viewer.exportSVG();const state = viewer.exportJSON(); // saves sequence + structure + annotations

8) Advanced features

  • Animated folding transitions between alternative structures.
  • Overlay multiple experimental tracks (SHAPE reactivity).
  • Link out: connect bases to external resources (e.g., sequence positions in a genome viewer).

9) Troubleshooting

  • Misaligned pairs: verify dot-bracket matches sequence length.
  • Missing interactivity: ensure container has visible size (width/height CSS).
  • Performance: for very large RNAs, use simplified render modes or limit label rendering.

Example: Minimal HTML page

html
<!doctype html>