library(rtemis.draw)
Attaching package: 'rtemis.draw'
The following object is masked from 'package:graphics':
Axis
library(rtemis.a3) .:rtemis.a3 0.6.0 🧬 aarch64-apple-darwin23
Attaching package: 'rtemis.draw'
The following object is masked from 'package:graphics':
Axis
.:rtemis.a3 0.6.0 🧬 aarch64-apple-darwin23
draw_a3() shows an amino acid sequence as a continuous, folded path. An A3 object from rtemis.a3 holds the sequence and its annotations together. Use this view to locate sites and regions in sequence context.
Start with a short illustrative peptide. This sequence is used only to explain the plotting API; it does not represent a characterized protein:
Follow the connecting line from residue 1: successive rows reverse direction. Each letter is an amino acid’s one-letter code. Position labels count from one; hover a residue to see its position and full amino acid name. n_per_row controls the wrapping, and position_every controls how frequently positions are labeled.
Annotations can mark single positions or inclusive ranges. Here we add hypothetical features to the same sequence: a candidate motif, a binding site, two phosphorylation sites, and a cleavage position. These are plotting examples, not biological findings:
annotated <- create_A3(
sequence = peptide,
region = list(
Motif = annotation_range(rbind(c(5L, 13L)))
),
site = list(
Binding = annotation_position(18L)
),
ptm = list(
Phosphorylation = annotation_position(c(10L, 32L))
),
processing = list(
Cleavage = annotation_position(22L)
)
)
annotation_chart <- draw_a3(
annotated, n_per_row = 11L, position_every = 5L,
title = "Sites in sequence context"
)
annotation_chartThe motif appears as a colored band. Site outlines, modification markers, and processing triangles distinguish the other annotations. Click a named legend entry to hide or restore its layer; hover a marker for its annotation details. Annotations remain in a vertical column at the upper right, matching rtemislive. The diagram reserves space for the annotation names and keeps their family headings together.
For a longer sequence, choose n_per_row for the intended display width. A smaller value gives fewer residues per row and more rows. The diagram scales its markers and labels to fit; extra height helps when many rows are needed.
Export the same annotated object as an SVG with vector text and marks:
See Exporting visualizations for export formats and Configuration objects for storing reusable chart settings.
draw_protein() adapts sequence strings and named residue positions to the same A3 drawing. Region positions retain gaps between contiguous runs:
Local JSON records and A3 objects are also accepted. Fetch accession records explicitly with rtemis.a3 before drawing; a sequence string is treated as data.