ggvariant 0.2.0
New features
- Added
plot_oncoprint()/plot_waterfall(): a gene-by-sample mutation matrix (the same visualisation under theComplexHeatmap/cBioPortal andGenVisR/maftoolscommunity names, respectively). Genes are ranked by descending number of altered samples; samples are ordered by the memo-sort/cascade algorithm for the characteristic staircase pattern. Multi-hit cells (a gene mutated more than once in one sample) render as a distinct"Multi_Hit"category. Supports an optional clinical annotation track from a sample-metadata data frame. Suggested by Nour-al-dain Marzouka (#N). - Added
plot_tmb(): a per-sample tumour mutational burden bar chart, raw counts or normalised to mutations/Mb. -
read_vcf()’sgvfobjects now have realprint.gvf()andsummary.gvf()methods, showing a compact header and consequence/ sample/chromosome breakdowns instead of a rawdata.framedump.
Bug fixes
-
read_vcf()no longer attaches a variant to a homozygous-reference ("0/0") sample..pivot_samples()’s presence check only excluded literal missing-genotype codes, so every sample was pivoted in as carrying every variant regardless of its actual genotype on any multi-sample VCF. This affected every per-sample dimension ofread_vcf()’s output:plot_lollipop(color_by = "sample"),plot_consequence_summary()’s per-sample bars, and both new sample-aware plots above. Predates this release entirely (present since 0.1.0) (#3). -
plot_variant_spectrum()’scontext/genomearguments andread_vcf()’sinfo_fieldsargument now abort with an informative error instead of being silently ignored. None of the three were actually implemented, despite being documented (#1, #2). - A VCF missing its
#CHROMheader line, or containing a data line with the wrong number of tab-separated fields, now aborts with a clear message instead of failing deep inside on an opaque base-R error. - A nonexistent file path now aborts with a clear message instead of
normalizePath()’s base-R error.
Performance
-
read_vcf()’s.parse_ann_csq()(ANN/CSQ INFO field parsing) is now vectorised over the whole INFO column instead of looping row by row. ~8.75x faster in isolation on a synthetic 100,000-record VCF (8.05s -> 0.92s); fullread_vcf()on the same file drops from 11.62s to 3.68s.
Documentation
- Added a pkgdown site. The introductory vignette was renamed to
ggvariant.Rmdto activate the “Get started” navbar convention, and three new articles (Gallery, interactive plots, customising with ggplot2) live invignettes/articles/rather than the shipped vignettes, per R Packages’ guidance for graphics-heavy content. - Removed stray scratch files (
Mutation 1.pdf,Rplot*.png/.pdf, etc.) that were shipping inside the package tarball and triggering anR CMD checkWARNING and NOTE. - Added
R-CMD-check,test-coverage, andpkgdownGitHub Actions workflows, and fixed the Codecov badge, which pointed at a nonexistentmainbranch. - Test coverage increased from 68.12% to over 92%, including the first tests of malformed/edge-case input and the first
vdiffrvisual regression snapshots.
ggvariant 0.1.0
CRAN release: 2026-02-27
- Initial CRAN release.
-
read_vcf()andcoerce_variants()read VCF files or plain data frames into a tidygvfobject. -
plot_lollipop(),plot_consequence_summary(), andplot_variant_spectrum()provideggplot2-native variant visualizations. -
gv_palette()andtheme_ggvariant()provide built-in colour palettes and a shared plot theme.
