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 |
|
./rna_to_img.py -o=example.svg \
--sequence="GCCAGUAGCCUUGCUAUUUCAGUGGCGAAUGAUGAUGCAGGU&GCUAUCAUCAUUAACUUUAUUUAU" \
--structure="...(((((............(((....(((((((((((....&)).))))))))).))))))))..." \
--startIndex1=67 \
--accessibility1="RNAplfold" --accessibility2="RNAplfold"
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
--structure Specifies the RNA secondary structure in dot-bracket notation.|
intramolecular:
```sh rna_to_img.py \ -u="((...))...." \ -e="NNNNNNNNNNN" ``` |
|
|
intermolecular:
```sh rna_to_img.py \ -u="((...))..<<..&...>>.." \ -e="NNNNNNNNNNNNN&NNNNNNN" ``` |
|
|
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" ``` |
|
--sequence Specifies the RNA sequence using IUPAC nucleotide codes (see also --fastafile)
|
Example:
```sh rna_to_img.py -u=".((...))." -e="AACGAGUGA" ``` |
|
-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>
-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` |
-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