Hi all!
I want to make a plot like these but I can't find any tool that would allow for showing a DNA track on the x-axis:
Both figures are from Gavira et al. 2020 in Leukemia, does anyone have any idea what kind of package or anything they could've used? I couldn't find info even in the supplementary data.
Thanks!
1 answer
Hi!
Those figures look like classic lollipop (or "lollipop-style") mutation diagrams, often used to visualize variant positions along a linear genomic feature (e.g., a gene or exon). Given the context of the Baliñas-Gavira et al. paper on BCL7A mutations in DLBCL, they're likely showing somatic mutations mapped to nucleotide positions within the coding sequence or protein domain—hence the "DNA track" feel on the x-axis (probably genomic coordinates labeled to evoke sequence context, or directly the nt letters if zoomed in).
I couldn't dig up the exact tool from their supplementary methods either (the full supp data seems paywalled, and no explicit mention in the abstract/data avail sections), but based on common practices in cancer genomics papers from ~2020, they might have used a custom ggplot2 setup or something like the lolliplot R package (CRAN), which is tailored for this exact kind of plot: variants as lollipops along GRanges-based features, with flexible x-axis labeling for positions or even sequence-derived ticks.
Quick Recommendation: Use lolliplot Package
It's lightweight, handles VCF/GRanges input for mutations, and lets you customize the x-axis to show DNA sequence letters if needed (via manual tick labels from your sequence string). Install via install.packages("lolliplot").
Here's a minimal example to get you started—assuming you have mutation positions as a GRanges object and a DNA sequence string for the "track":
library(lolliplot)
library(GenomicRanges)
# Example DNA sequence (replace with your BCL7A exon seq, e.g., from BSgenome)
dna_seq <- "ATGGCCATCGATAGCTAGCTAGCT..." # Your full sequence string
seq_length <- nchar(dna_seq)
positions <- seq(1, seq_length, by = 3) # Example mutation positions
# Mutations as GRanges (width=1 for point mutations)
mutations <- GRanges(
seqnames = "BCL7A_exon",
ranges = IRanges(start = positions, width = 1),
mutation_type = sample(c("Missense", "Nonsense"), length(positions), replace = TRUE), # Or your variant types
freq = runif(length(positions), 0, 1) # Optional: frequency for node size/color
)
# Features: the full exon as a single block
feature <- GRanges(
seqnames = "BCL7A_exon",
ranges = IRanges(start = 1, end = seq_length),
fill = "lightblue" # Color the track
)
# Plot: lollipops along the feature
p <- lolliplot(mutations, feature, type = "circle") # Or "pin", "flag" for variety
# Customize x-axis to show DNA letters (subset for readability, e.g., every 10th base)
x_ticks <- seq(1, seq_length, by = 10)
x_labels <- strsplit(dna_seq, "")[[1]][x_ticks] # Extract letters at tick positions
p + scale_x_continuous(breaks = x_ticks, labels = x_labels) +
labs(x = "DNA Sequence Position", y = "Mutation Frequency") +
theme(axis.text.x = element_text(angle = 45, hjust = 1))
# Save or view
ggsave("bcl7a_lollipop.png", p, width = 12, height = 4)
This will give you lollipops popping up from the baseline (your DNA track), with nodes colored/sized by metadata (e.g., mutation type or sample count). If your mutations are from a VCF, pipe in via readVcf() from VariantAnnotation for real data.
Alternatives If That Doesn't Fit
- trackViewer (Bioconductor): Great for multi-layer tracks with lollipops on genomic ranges. Vignette has mutation examples: https://bioconductor.org/packages/trackViewer. Use
lolliplot()function—x-axis is positions by default, but hack labels for seq letters. - g3viz (CRAN): Interactive HTML lollipops for genetic variants (good for exploration). See vignette: https://cran.r-project.org/web/packages/g3viz/vignettes/g3viz.html. Handles protein-level too if you translate to AA.
- Custom ggplot2: If you want full control (and suspect that's what they did), base it on
geom_segment()+geom_point()over a sequence-annotated x-scale. Tons of tutorials, e.g., https://r-graph-gallery.com/lollipop-plot.html.
Cheers,
Kevin
Log in to answer this question.
Honestly, I think it is just a regular dotplot that they edited afterwards
The axis style and font is a dead giveaway. Probably the DNA sequence, points, and the vertical bars from (-4) to (1) are done in R; bu tthe shading, "hotspots" and "protein" tracks were probably added in post.
Yeah, this was my suspicion too. Oh well. Thank you!
ProteinPaint can create similar visualisations.