Skip to main content

DNAviz 🧬

An simple interactive DNA/RNA sequence visualization tool. Useful to check the structures or binding of complex sequences to ensure the correct pairing.

PyPI version Python versions

Features

  • 🧬 Interactive DNA/RNA sequence visualization
  • 🔄 Real-time base pairing detection
  • 🖱️ Drag-and-drop base manipulation
  • 📏 Dynamic scaling with grid snapping
  • 💾 Save/load visualization states
  • 📸 Export as PNG

Installation

pip install dnaviz

Quick Start

# Basic DNA sequence visualization
dnaviz ATGC GCTA

# RNA sequence with specified directions
dnaviz AUGC GCAU -d 53 -d 35

# Multiple strands
dnaviz ATGC GCTA TACG -d 53 -d 35 -d 53

Interactive Controls

Mouse Controls

  • Click and Drag: Move bases
  • Shift + Click: Select multiple bases
  • Click and Drag Scale Bar: Adjust visualization scale
  • Click and Drag Empty Space: Selection box

Keyboard Shortcuts

  • Arrow Keys: Scroll the view
  • R: Reset selected strand positions
  • Cmd/Ctrl + S: Save current state
  • Shift + Cmd/Ctrl + S: Save as PNG
  • Cmd/Ctrl + L: Load last saved state
  • ESC: Quit

File Management

  • Save files are stored in ~/.dna_visualizer/
  • PNG exports include timestamps
  • State files are saved as JSON with timestamps

Base Pairing Rules

  • A pairs with T (DNA) or U (RNA)
  • G pairs with C
  • Correct pairing is shown in green
  • Incorrect direction pairing is shown in orange
  • Unpaired bases are shown in gray

Examples

Basic DNA Visualization

dnaviz ATGC GCTA

RNA Sequence

dnaviz AUGC GCAU

Multiple Strands with Directions

dnaviz ATGC GCTA TACG -d 53 -d 35 -d 53

JavaScript Version

There is a JavaScript version of the visualizer available in the web_visualizer.html file. This version is not as feature-rich as the Python version, but it can be useful for quick visualizations or for sharing visualizations with others.

To use the JavaScript version, simply open the web_visualizer.html file in your browser. You can then enter sequences and directions, and the visualizer will update in real-time.

Metadata

Release files for dnaviz 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dnaviz 0.2.0
File Size Uploaded
dnaviz-0.2.0.tar.gz 16.8 kB Details

Release files / dnaviz-0.2.0.tar.gz

Download URL dnaviz-0.2.0.tar.gz
Size 16.8 kB
Tags Source
SHA-256 checksum
How to use checksums
e4a724f5dbfd93415c159c0d10c799a7a51e4d4a40d8c5756483884fa24f2ebf
BLAKE2b-256 checksum
How to use checksums
5f26c3eaec427d8b1addf35a08a7cfb135d736a3133f7798dbb09b304a8e4584
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.2

Release history Release notifications | RSS feed

This release

0.2.0 This release

1 release file

0.1.6

1 release file

0.1.5

1 release file

0.1.4

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page