A Comprehensive Python Package for RNA Structure Visualization and Analysis
RNAview is a powerful, user-friendly Python library designed for researchers to visualize, analyze, and explore RNA secondary and tertiary structures. It provides seamless integration with established RNA structure prediction tools and includes gold-standard benchmark datasets for validation.
π Google Colab notebook: https://colab.research.google.com/drive/1cPzGUo8tK8F6tX7aTd6WlOMl-yY0iDIi?usp=sharing
RNAview supports radiate and circular layouts for both simple hairpins and complex structures like tRNA.
Visualize RNA structures as arc diagrams - perfect for publications and showing base-pairing patterns clearly. Works seamlessly with hairpins, tRNA, and even complex pseudoknots.
Choose from multiple color schemes including nucleotide-based, ViennaRNA-style, pastel, colorblind-friendly, monochrome, and publication-ready options.
Compare predicted and reference structures with comprehensive accuracy metrics (Sensitivity, PPV, F1 Score, MCC).
Full support for highlighting RNA modifications including m6A, m5C, pseudouridine, and 70+ other modifications.
Create multi-panel publication-ready figures combining different visualization styles and RNA structures.
- π Multiple Visualization Layouts: Radiate, circular, NAView, arc diagrams, and 3D views
- π¨ Customizable Color Schemes: Nucleotide-based, colorblind-friendly, publication-ready
- 𧬠RNA Modifications: Full support for m6A, m5C, pseudouridine, and 70+ other modifications
- π Comprehensive Analysis: Sensitivity, PPV, F1, MCC, and structural distance metrics
- π Tool Integration: ViennaRNA, LinearFold, CONTRAfold, and more
- π Multiple File Formats: CT, BPSEQ, dot-bracket, PDB, mmCIF, FASTA, Stockholm
- π Benchmark Datasets: Curated tRNA, 5S rRNA, and small RNA datasets
pip install rnaviewpip install rnaview[visualization]pip install rnaview[full]git clone https://github.com/kroy3/rnaview.git
cd rnaview
pip install -e .import rnaview as rv
# Create from sequence and dot-bracket notation
rna = rv.RNAStructure(
sequence="GCGCUUAAGCGC",
dotbracket="((((....))))",
name="Simple_hairpin"
)
# Visualize in 2D
fig = rv.plot2d(rna, layout="radiate", color_scheme="nucleotide")
fig.savefig("structure.png")
# Print structure summary
print(rna.summary())import rnaview as rv
# Auto-detect format from extension
rna = rv.load_structure("structure.ct")
rna = rv.load_structure("structure.dbn")
rna = rv.load_structure("structure.pdb")import rnaview as rv
# Predict structure (uses best available method)
sequence = "GCGCUUAAGCGC"
rna = rv.predict_structure(sequence)
# Use specific predictor
rna = rv.predict_structure(sequence, method="viennarna", temperature=37)import rnaview as rv
rna = rv.load_structure("trna.ct")
# Create arc diagram
fig = rv.plot_arc(rna, show_sequence=True, color_scheme="nucleotide")
fig.savefig("trna_arc.png")import rnaview as rv
rna = rv.RNAStructure(
sequence="GCGCUUAAGCGC",
dotbracket="((((....))))"
)
# Add modifications
rna.add_modification(4, rv.Modification.m6A())
rna.add_modification(5, rv.Modification.pseudouridine())
# Visualize with modifications highlighted
fig = rv.plot2d(rna, show_modifications=True)import rnaview as rv
reference = rv.load_structure("reference.ct")
predicted = rv.load_structure("predicted.ct")
# Calculate accuracy metrics
sensitivity = rv.sensitivity(reference, predicted)
ppv = rv.ppv(reference, predicted)
f1 = rv.f1_score(reference, predicted)
mcc = rv.mcc(reference, predicted)
print(f"Sensitivity: {sensitivity:.3f}")
print(f"PPV: {ppv:.3f}")
print(f"F1 Score: {f1:.3f}")
print(f"MCC: {mcc:.3f}")
# Visualize comparison
fig = rv.plot_comparison(reference, predicted)
fig.savefig("comparison.png")| Format | Extension | Read | Write | Description |
|---|---|---|---|---|
| Dot-bracket | .dbn, .db | β | β | Standard secondary structure notation |
| CT | .ct | β | β | Connectivity table format |
| BPSEQ | .bpseq | β | β | Base pair sequence format |
| PDB | .pdb | β | β | 3D structure format |
| mmCIF | .cif | β | β | Macromolecular CIF |
| FASTA | .fasta, .fa | β | β | Sequence format |
| Stockholm | .sto | β | β | Alignment format with structure |
| Tool | Type | Status |
|---|---|---|
| ViennaRNA (RNAfold) | Thermodynamic | β Supported |
| LinearFold | Linear-time | β Supported |
| CONTRAfold | Machine Learning | β Supported |
| Fallback (built-in) | Basic DP | β Always available |
- nucleotide: Standard nucleotide colors (A=red, U=orange, G=green, C=blue)
- varna: ViennaRNA-style coloring
- pastel: Soft pastel colors for presentations
- colorblind: Colorblind-friendly palette
- monochrome: Grayscale for publications
- publication: High-contrast publication-ready colors
Full documentation is available at https://rnaview.readthedocs.io
See also the User Manual for comprehensive guides.
Contributions are welcome! Please see our contributing guidelines.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
If you use RNAview in your research, please cite:
@software{rnaview2025,
title = {RNAview: A Python Package for RNA Structure Visualization and Analysis},
author = {Kushal Raj Roy},
year = {2025},
url = {https://github.com/kroy3/rnaview}
}- ViennaRNA package for thermodynamic calculations
- The RNA research community for valuable feedback
- Contributors and users who help improve RNAview
Made with β€οΈ for the RNA research community





