RNA secondary structure visualization tool with JSON input support.
This tool supports JSON input for custom RNA structure visualization.
| Property | Type | Required | Description |
|---|---|---|---|
nucleotides |
Array | Yes | List of nucleotide objects |
basePairs |
Array | Yes | List of base pair objects |
stackings |
Array | No | List of stacking objects |
drawingAlgorithm |
String | No | Drawing algorithm: NAVIEW, RADIATE, LINEAR, CIRCULAR, or VARNA_VIEW |
stackingArrowPlacement |
String | No | Placement of stacking arrowheads: centered, first-partner, second-partner, both-partners, or opposing-partners |
stackingArrowGap |
Number | No | Distance from each base circle edge to the stacking arrowhead visual center |
strandBreaks |
Array | No | List of zero-based nucleotide indices after which the backbone is discontinuous (last index of each strand except the final one) |
| Property | Type | Required | Description |
|---|---|---|---|
id |
Integer | Yes | Unique identifier |
number |
Integer or String | Yes | Displayed residue identifier. Strings with insertion codes must start with an integer prefix, e.g. 190A |
char |
String | Yes | Nucleotide character (A, C, G, U, T) |
outlineColor |
String | No | Color for outline (name or RGB "R,G,B") |
innerColor |
String | No | Color for inner fill (name or RGB "R,G,B") |
nameColor |
String | No | Color for label (name or RGB "R,G,B") |
number may be provided either as a JSON number like 190 or as a string like "190A".
- The full JSON value is rendered as the visible residue label.
- VARNA keeps its own internal unique numeric numbering for base lookup and pairing logic.
- SVG post-processing uses the leading integer prefix to detect numbering discontinuities and retain every 10th label.
- Residues sharing the same divisible-by-10 prefix, such as
10,10A, and10B, keep only the first label in that prefix block. - The first and last residue labels are always kept.
If a string number does not begin with an integer prefix, insertion-code-specific numbering rules are not applied to that residue.
strandBreaks is an optional array of zero-based indices into the nucleotides array. Each index marks the last nucleotide of a strand; the backbone line between that nucleotide and the next is removed during SVG post-processing, producing a visual strand break.
- Indices are positions in the
nucleotidesarray, notNucleotide.idorNucleotide.numbervalues. - Do not include the last nucleotide of the final strand (there is no following backbone segment to remove).
- When omitted, strand breaks are inferred only from the numbering-discontinuity heuristic (the leading integer prefix of
numbermust jump by something other than0or+1between consecutive nucleotides). - When present, explicit
strandBreaksare honored in addition to the heuristic; the two sources are merged and de-duplicated.
This field is the reliable way to signal strand boundaries when residue numbering is continuous across strands (e.g. PDB structures where chain B continues from chain A's last residue number).
| Property | Type | Required | Description |
|---|---|---|---|
id1 |
Integer | Yes | First nucleotide ID |
id2 |
Integer | Yes | Second nucleotide ID |
edge5 |
String | Yes | 5' edge type: WC, SUGAR, or HOOGSTEEN |
edge3 |
String | Yes | 3' edge type: WC, SUGAR, or HOOGSTEEN |
stericity |
String | Yes | Stericity: CIS or TRANS |
canonical |
Boolean | No | Whether base pair is canonical |
color |
String | No | Color for the bond (name or RGB) |
thickness |
Number | No | Line thickness |
| Property | Type | Required | Description |
|---|---|---|---|
id1 |
Integer | Yes | First nucleotide ID |
id2 |
Integer | Yes | Second nucleotide ID |
color |
String | No | Color for stacking |
thickness |
Number | No | Line thickness |
stackingArrowPlacementcontrols where stacking arrowheads are drawn along the interaction.- Accepted values are
centered,first-partner,second-partner,both-partners, andopposing-partners. - Accepted aliases:
centered:center,middle,midpointfirst-partner:first,near-first,near-first-partnersecond-partner:second,near-second,near-second-partner,last,last-partnerboth-partners:both,both-ends,ends,doubleopposing-partners:opposing,bidirectional,inverse,inverse-both
- Invalid or missing
stackingArrowPlacementvalues fall back tocentered. stackingArrowGapis a positive number in drawing units. It controls the distance from the trimmed base-circle edge to the arrowhead visual center forfirst-partner,second-partner,both-partners, andopposing-partners.- Invalid or missing
stackingArrowGapvalues fall back to the built-in default gap. opposing-partnersis the only mode that breaks the first -> second directionality rule: it draws one arrowhead near the first partner pointing outward toward it, and one near the second partner pointing outward toward it.
{
"drawingAlgorithm": "NAVIEW",
"stackingArrowPlacement": "opposing-partners",
"stackingArrowGap": 8.0,
"nucleotides": [
{ "id": 1, "number": 1, "char": "C" },
{ "id": 2, "number": 2, "char": "A" }
],
"basePairs": [
{
"id1": 1,
"id2": 2,
"edge5": "WC",
"edge3": "WC",
"stericity": "CIS",
"canonical": true
}
],
"stackings": [{ "id1": 1, "id2": 2 }]
}Sample files in the repository:
example.jsonshows standard numeric residue numbering.example-icode.jsonshows mixed numeric and insertion-code residue labels such as10Aand10B.
mvn packagemvn exec:java -Dexec.mainClass="pl.poznan.put.varna.AdvancedDrawer" -Dexec.args="path/to/structure.json"java -jar target/varna-tz-1.5.5.jar path/to/structure.jsonmvn package builds a runnable shaded JAR at target/varna-tz-1.5.5.jar.
The tool will read the JSON file and render the RNA structure.