vaRRI

vaRRI - Visualizing any RNA-RNA interaction

This Tool creates a visualization for any working inter- and intramolecular structure and sequence involving one or two molecules, using FornaC.

Example interaction between the molecule MicF and IpxR, displayed in this paper

Sequence 1 (blue/purple) is the MicF RNA and Sequence 2 (orange/red) is the IpxR RNA. The basepairs forming the interaction are highlighted using an opague red background. The color grading displays predicted accessibilty data starting at 1, completely accessible, to 0, not accessible.
./rna_to_img.py -o=example.svg \
  --sequence="GCCAGUAGCCUUGCUAUUUCAGUGGCGAAUGAUGAUGCAGGU&GCUAUCAUCAUUAACUUUAUUUAU" \
  --structure="...(((((............(((....(((((((((((....&)).))))))))).))))))))..." \
  --startIndex1=67 \
  --accessibility1="RNAplfold" --accessibility2="RNAplfold"

Overview

Dependency Installation

We need to install

# install dependencies
python3 -m pip install playwright==1.57.0
python3 -m playwright install chromium
# check version
python3 -m playwright --version

For structure prediction and accessibility data prediction, vaRRI uses RNAplfold and RNAfold from the ViennaRNA package. Recommended installation using Miniconda

# setup bioconda
conda config --add channels defaults
conda config --add channels bioconda
conda config --add channels conda-forge
conda config --set channel_priority strict
# install viennaRNA package
conda install viennarna

Features

Mandatory Parameters

--structure Specifies the RNA secondary structure in dot-bracket notation. | Notation | Meaning | |----------|---------| | `(` `)` | Base pair | | `[` `]` | Alternative bracket pair | | `<` `>` | Alternative bracket pair | | `{` `}` | Alternative bracket pair | | `.` | Unpaired nucleotide | | `&` | Separator between two molecules (intermolecular interaction) |
intramolecular:

```sh rna_to_img.py \ -u="((...))...." \ -e="NNNNNNNNNNN" ```
intermolecular:

```sh rna_to_img.py \ -u="((...))..<<..&...>>.." \ -e="NNNNNNNNNNNNN&NNNNNNN" ```
Hybrid Input Format (Advanced) The hybrid input format provides a convenient way to specify intermolecular base pairing interactions using position indices instead of dot-bracket notation. **Format:** ``` & ``` Where: - ``: Starting position (index, can be negative, can not be 0) - `|`: Represents a base pair in the intermolecular interaction - `.`: Represents an unpaired position within the interaction region **How it works:** - Both molecules must have the **same number** of `|` characters (representing the same number of base pairs) - Interaction positions are defined relative to your sequence start Index - The tool automatically converts hybrid input to standard dot-bracket notation
Example (simple interaction):
Two sequences with interaction starting at position 5 (seq1) and position 3 (seq2) and each has 3 intermolecular base pairs

```sh ./rna_to_img.py \ -u="5|||..&3|||.." \ -e="NNNNNNNNNNNNN&NNNNNNN" ```
Example (with custom start Index)
Start indexing from position 10 (seq1) and 100 (seq2)
Interaction starts at position 15 (seq1) and 102 (seq2)

```sh rna_to_img.py \ -u="15|||..&102|||.." \ -e="NNNNNNNNNNNNN&NNNNNNN" \ -i1=10 \ -i2=100 ```
Example (negative positions):
start indexing form -10 (seq1) and 1 (seq2)
Interaction starts at position -5 (seq1) and 3 (seq2)

```sh rna_to_img.py \ -u="-5|||..&3|||.." \ -e="NNNNNNNNNNNNN&NNNNNNN" \ -i1=-10 \ -i2=1 ```

**Hybrid vs. Dot-Bracket Comparison:** These two commands are equivalent:
Hybrid format:

```sh rna_to_img.py \ -u="5|||..&3|||" \ -e="NNNNNNNNNNNNNN&NNNNN" ```
Equivalent dot-bracket format:

```sh rna_to_img.py \ -u="....(((......&..))).." \ -e="NNNNNNNNNNNNN&NNNNNNN" ```
</details>
</details>
--sequence Specifies the RNA sequence using IUPAC nucleotide codes (see also --fastafile) | Code | Nucleotide | Code | Nucleotide | |------|-----------|------|-----------| | `A` | Adenosine | `N` | Any nucleotide | | `C` | Cytidine | `W` | Adenosine or Uridine | | `G` | Guanosine | `S` | Cytidine or Guanosine | | `U` | Uridine | `K` | Guanosine or Uridine | | | | `&` | Separator between two molecules |
Example:

```sh rna_to_img.py -u=".((...))." -e="AACGAGUGA" ```
## Optional Parameters
-o</code>/ --output Specifies the output file name and format </summary> | Value | Description | |-------|-------------| | `STDOUT` (default) | Print SVG to standard output | | `filename` | Save as SVG with given name | | `filename.png` | Save as PNG with given name | Examples: ```bash # Output to stdout rna_to_img.py -u="((...))." -e="ACGAGUGA" > output.svg # Save as SVG file rna_to_img.py -u="((...))." -e="ACGAGUGA" -o=structure # Save as PNG file rna_to_img.py -u="((...))." -e="ACGAGUGA" -o=structure.png ``` </details>
-c</code>/ --coloring Defines how nucleotides should be colored </summary> | Option | Description | Example | |--------|-------------|---------| | `loop` | Standard fornac coloring scheme | | | `strand` (default) | Each molecule receives its own color | |
Example:

```sh rna_to_img.py \ -u="((...))..<<..&...>>.." \ -e="NNNNNNNNNNNNN&NNNNNNN" \ -c=strand ```
</details>
-H</code>/ --highlighting Specifies the highlighting mode for intermolecular structures </summary>
Option Example Image
nothing: no sepcial highlighting

```sh rna_to_img.py \ -u="((...))..<<....<<..&..>>...>>.." \ -e="NNNNNNNNNNNNNNNNNNN&NNNNNNNNNNN" \ -H=nothing \ -c=loop ```
basepairs: Highlights only individual intermolecular base pairs

```sh rna_to_img.py \ -u="((...))..<<....<<..&..>>...>>.." \ -e="NNNNNNNNNNNNNNNNNNN&NNNNNNNNNNN" \ -H=basepairs ```
region(default): Highlights entire intermolecular interaction region

```sh rna_to_img.py \ -u="((...))..<<....<<..&..>>...>>.." \ -e="NNNNNNNNNNNNNNNNNNN&NNNNNNNNNNN" \ -H=region ```
</details>
-bH</code>/ --backgroundhighlighting Specifies the background highlighting mode for intermolecular interactions </summary> | Option | Description | |--------|------------| | `nothing` | no background highlighting | | `basepairs` (default) | highlights intermolecular basepair stacking | | `region` | highlights the full intermolecular interaction region | ```sh rna_to_img.py \ --structure="((...))..<<..&...>>.." \ --sequence="NNNNNNNNNNNNN&NNNNNNN" \ -bH=region ``` </details>
-i1</code>/ --startIndex1, -i2/ --startIndex2 Sets the starting index for each molecule </summary> | Parameter | Constraint | |-----------|-----------| | Default | `1` | | Restriction | Cannot be `0` |
Example: Indexing starts with 10

```sh rna_to_img.py \ -u="..((...))." \ -e="AAACGAGUGA" \ -i1=10 ```
Example: Both molecules have different start indicies

```sh rna_to_img.py \ -u="((...))..<<..&...>>.." \ -e="NNNNNNNNNNNNN&NNNNNNN" \ -i1=5 \ -i2=100 ```
</details>
-v</code>/ --verbose Enables detailed logging output for debugging and troubleshooting </summary> ```bash ./rna_to_img.py -u="((...))." -e="ACGAGUGA" -v ``` </details>
-l</code>/ --labelInterval Defines how often labels with indices are displayed </summary> | Option | Description | |-----------|-------------| | n | Shows index labels every *n* nucleotides | | `10` | default | ```sh rna_to_img.py \ -u="((...))....((...))" \ -e="ACGAGUGAACGAGUGA" \ -l=5 ``` </details>
--crop</code>, --crop1, --crop2 Crops sequences around the intermolecular interaction region </summary> | Parameter | Description | | --------- | ---------------------------------- | | `--crop` | Applies cropping to both molecules | | `--crop1` | Crops only the first molecule | | `--crop2` | Crops only the second molecule | ```sh rna_to_img.py \ -u="((...))..<<..&...>>.." \ -e="NNNNNNNNNNNNN&NNNNNNN" \ --crop=5 ``` </details>
--highlightSubseq1</code>, --highlightSubseq2 Highlights specific subsequences </summary> | Parameter | Description | | -------------------- | ------------------------------ | | `--highlightSubseq1` | Subsequences in first molecule | | `--highlightSubseq2` | Subsequences in second molecule | ```sh rna_to_img.py \ -u="((...))..<<..&...>>.." \ -e="NNNNNNNNNNNNN&NNNNNNN" \ --highlightSubseq1="1:2,5:10" ``` </details>
--guBasepairs</code> Controls visualization of G-U base pairs </summary> | Option | Description | | ----------------- | ----------------------------------- | | Enabled (default) | G-U basepairs shown as dashed lines | | Disabled | No special visualization | ```sh rna_to_img.py \ -u="((...))" \ -e="GUGUGUGU" \ --guBasepairs ``` </details>
--fastafile</code> Load one or two sequences from a FASTA file </summary> ```sh rna_to_img.py \ --fastafile=example.fasta \ -u="((...))" ``` </details>
--predictStructure1</code>, --predictStructure2 Enable intramolecular structure prediction </summary> | Flag Option | Description | | ----------------- | ----------------------------------- | | Enabled | Predict intramolecular structure for each molecule. Using RNAfold with constraints: `--structure` given Basepairs | | Disabled (default) | No structure prediction | ```sh rna_to_img.py \ -e="ACGAGUGA" \ --predictStructure1 ``` </details>
--forcefield</code> Activates fornac’s force-directed layout forcefield </summary> ```sh rna_to_img.py \ -u="((...))" \ -e="ACGAGUGA" \ --forcefield=0 ``` </details>
--accessibility1</code>, --accessibility2 Visualize nucleotide accessibility</summary> | Option | Description | | ---------------- | ------------------------------------- | | `None` (default) | No visualization | | `RNAplfold` | Predict accessibility using RNAplfold | | `path/to/file` | Use precomputed lunp file | ```sh rna_to_img.py \ -u="((...))" \ -e="ACGAGUGA" \ --accessibility1="RNAplfold" ``` </details>
--RNAfold</code> Pass custom parameters to RNAfold </summary> ```sh rna_to_img.py \ -e="ACGAGUGA" \ --predictStructure1 \ --RNAfold="-T20" ``` </details>
--RNAplfold</code> Pass custom parameters to RNAplfold </summary> ```sh rna_to_img.py \ -e="ACGAGUGA" \ --accessibility1="RNAplfold" \ --RNAplfold="-T20" ``` </details> ## Usage Examples
Simple Intramolecular Structure
Visualization of a single RNA molecule with one hairpin loop:

```sh rna_to_img.py -u=".((...))." -e="AACGAGUGA" > hairpin.svg ```
Intermolecular Interaction with Distinct Coloring
Two molecules interacting where each molecule has its own color:

```sh rna_to_img.py \ -u="((...))..<<..&...>>.." \ -e="NNNNNNNNNNNNN&NNNNNNN" \ -c=strand \ -o=interaction.svg ```
Custom Indexing
Start numbering from different positions for each molecule:

```sh rna_to_img.py \ -u="((...))..<<..&...>>.." \ -e="NNNNNNNNNNNNN&NNNNNNN" \ -i1=5 -i2=100 \ -o=custom_index.svg ```
Pseudoknot Structure (Simple)
A basic pseudoknot involving two interacting molecules:

```sh rna_to_img.py \ -u="<<<..((..>>>&<<<..))..>>>" \ -e="NNNNNNNNNNN&NNNNNNNNNNNN" \ -c=strand \ -o=pseudoknot_simple.svg ```
Pseudoknot Structure (Complex - Kissing Hairpins)
Two molecules forming a complex kissing hairpin interaction:

```sh rna_to_img.py \ -u="<<<..(((..>>>...<<<..(((..>>>..&<<<..)))..>>>...<<<..)))..>>>.." \ -e="NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN&NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN" \ -c=strand \ -o=kissing_hairpins.svg ```