Skip to content

Commit

Permalink
Merge pull request #178 from thackl/ggplot-3.5.0-compatibility
Browse files Browse the repository at this point in the history
Add ggplot 3.5.0 compatibility (guides and layout ggproto)
  • Loading branch information
thackl authored Mar 4, 2024
2 parents f29495a + 0648950 commit 9c1b843
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 21 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: gggenomes
Title: A Grammar of Graphics for Comparative Genomics
Version: 0.9.12.9000
Version: 0.9.13.9000
Authors@R: c(
person("Thomas", "Hackl", email = "[email protected]", role = c("aut", "cre")),
person("Markus J.", "Ankenbrand", email = "[email protected]", role = c("aut")),
Expand All @@ -21,7 +21,7 @@ Roxygen: list(markdown = TRUE)
Remotes: github::thackl/thacklr, bioc::release/rtracklayer
Depends:
R (>= 3.4.2),
ggplot2 (>= 3.4.0),
ggplot2 (>= 3.5.0),
Imports:
vctrs,
rlang,
Expand Down
30 changes: 16 additions & 14 deletions R/gggenomes.R
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
#' Plot genomes, features and synteny maps
#'
#'
#' @description
#' `gggenomes()` initializes a gggenomes-flavored ggplot object.
#' `gggenomes()` initializes a gggenomes-flavored ggplot object.
#' It is used to declare the input data for gggenomes' track system.
#'
#'
#' (*See for more details on the track system, gggenomes vignette or the Details/Arguments section*)
#'
#'
#'
#'
#' @details
#' `gggenomes::gggenomes()` resembles the functionality of `ggplot2::ggplot()`.
#' `gggenomes::gggenomes()` resembles the functionality of `ggplot2::ggplot()`.
#' It is used to construct the initial plot object, and is often followed by "+" to add components to the plot (*e.g. "+ geom_gene()"*).
#'
#'
#' A big difference between the two is that gggenomes has a multi-track setup (*`'seqs'`, `'feats'`, `'genes'` and `'links'`*).
#' `gggenomes()` pre-computes a layout and adds coordinates (`y,x,xend`) to each data frame prior to the actual plot construction.
#' This has some implications for the usage of gggenomes:
#' - **Data frames for tracks have required variables.** These predefined variables are used during import
#' - **Data frames for tracks have required variables.** These predefined variables are used during import
#' to compute x/y coordinates (*see arguments*).
#' - **gggenomes' geoms can often be used without explicit `aes()` mappings** This works because
#' we always know the names of the plot variables ahead of time: they originate from the pre-computed layout,
#' - **gggenomes' geoms can often be used without explicit `aes()` mappings** This works because
#' we always know the names of the plot variables ahead of time: they originate from the pre-computed layout,
#' and we can use that information to set sensible default aesthetic mappings for most cases.
#'
#' @param genes,feats A data.frame, a list of data.frames, or a character vector
Expand Down Expand Up @@ -55,9 +55,9 @@
#' By default subregions of sequences from the first to the last feat/link
#' are generated. Set `infer_start` to 0 to show all sequences from their
#' true beginning.
#' @param adjacent_only Indicates whether links should be created between adjacent sequences/chromosomes only.
#' By default it is set to `adjacent_only = TRUE`. If `FALSE`, links will be created between all sequences
#'
#' @param adjacent_only Indicates whether links should be created between adjacent sequences/chromosomes only.
#' By default it is set to `adjacent_only = TRUE`. If `FALSE`, links will be created between all sequences
#'
#' (*not recommended for large data sets*)
#' @inheritParams layout_seqs
#' @param theme choose a gggenomes default theme, NULL to omit.
Expand Down Expand Up @@ -162,11 +162,13 @@ ggplot.gggenomes_layout <- function(data, mapping = aes(), ...,
data = data,
layers = list(),
scales = ggplot2:::scales_list(),
guides = ggplot2:::guides_list(),
mapping = mapping,
theme = list(),
coordinates = coord_cartesian(default = TRUE),
facet = facet_null(),
plot_env = environment
plot_env = environment,
layout = ggplot2:::ggproto(NULL, Layout)
), class = c("gg", "ggplot"))

p$labels <- ggplot2:::make_labels(mapping)
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@ features in the plot.

## Inspiration

gggenomes is draws inspiration from other brilliant packages, in particular:
* [gggenes](https://github.com/wilkox/gggenes) by [David Wilkins'](https://wilkox.org/)
* [ggtree](https://guangchuangyu.github.io/software/ggtree/) by Guangchuang Yu's
* [ggraph](https://github.com/thomasp85/ggraph) by [Thomas Lin Pedersen's](https://www.data-imaginist.com/about)
gggenomes is draws inspiration from some brilliant packages, in particular:
* [gggenes](https://github.com/wilkox/gggenes) by [David Wilkins](https://wilkox.org/)
* [ggtree](https://guangchuangyu.github.io/software/ggtree/) by Guangchuang Yu
* [ggraph](https://github.com/thomasp85/ggraph) by [Thomas Lin Pedersen](https://www.data-imaginist.com/about)

## Installation

gggenomes is at this point still in an alpha release state, and only
gggenomes is at this point in an alpha release state, and only
available as a developmental package from github.

```R
Expand Down

0 comments on commit 9c1b843

Please sign in to comment.