Skip to contents
Chapters and reference

Module I · Multi-sequence relationships · Section 9 of 16

1.8 Chord: backbone geometry

Download R scriptIncludes preparation and every page step. File examples need the input bundle; preview and save calls are retained.
On this page
R · Example code
library(ggchord)
library(dplyr)
Data preparation and settings (expand)
R · Example code
p_chord_backbone <- ggchord(seq_data = seq_data_example) +
  geom_seq() +
  geom_seq_label() +
  coord_chord()

1 Rotate the plot

R · Example code
p_chord_rotated <- p_chord_backbone + coord_chord(rotation = 90)
view_ggchord(p_chord_rotated, width = 7, height = 7, units = "in")
Chord layout rotated 90 degrees counterclockwise from the default
Chord layout rotated 90 degrees counterclockwise from the default · Open full-resolution figure

rotation sets the counterclockwise angle and defaults to 0°. With rotation = 90, the backbones and labels turn 90° from the default plot. Compare the position of the gaps with the default plot. Rotation can free space on one side for layout while preserving coordinate order within each sequence.

2 Increase the space between backbones

R · Example code
p_chord_gap <- ggchord(seq_data = seq_data_example) +
  geom_seq(seq_gap = c("MT108731.1" = 0.12)) +
  geom_seq_label() +
  coord_chord()
view_ggchord(p_chord_gap, width = 7, height = 7, units = "in")
Wider gaps between adjacent backbones
Wider gaps between adjacent backbones · Open full-resolution figure

seq_gap controls the gap proportion between adjacent backbones. The default is 0.03. This example sets only the gap after MT108731.1 to 0.12. Other gaps retain 0.03. The last sequence’s gap closes the ring. Compare the space between adjacent arcs, then check that the longer sequence still has the longer arc.

3 Radius: move one arc inward

R · Example code
chord_radius <- c("MT118296.1" = 0.72)
p_chord_radius <- ggchord(seq_data = seq_data_example) +
  geom_seq(seq_radius = chord_radius) +
  geom_seq_label() +
  coord_chord()
view_ggchord(p_chord_radius, width = 7, height = 7, units = "in")
Move the MT118296.1 backbone inward
Move the MT118296.1 backbone inward · Open full-resolution figure

The default radius is 1. Three arcs keep it and MT118296.1 uses 0.72. Compare with the default backbones. That arc sits closer to the centre and still ends at about 32,090 bp. Radius is a layout unit. Use the ticks to read sequence length.

4 Curvature: draw a straight backbone

R · Example code
chord_curvature <- c("MT118296.1" = 0)
p_chord_curvature <- ggchord(seq_data = seq_data_example) +
  geom_seq(seq_curvature = chord_curvature) +
  geom_seq_label() +
  coord_chord()
view_ggchord(p_chord_curvature, width = 7, height = 7, units = "in")
Draw MT118296.1 as a straight segment
Draw MT118296.1 as a straight segment · Open full-resolution figure

seq_curvature = 1 draws a standard arc, 0 draws a straight backbone, and negative values bend in the opposite direction. The other three backbones keep the standard arc. To combine radius and curvature, try each setting separately before using both.

Search documentation

↑ ↓ select · Enter open · Esc close; or browse by task. API and functions