Skip to contents

Calculation of all pieces necessary to plot a logo sequence plot

Usage

StatLogo

stat_logo(
  mapping = NULL,
  data = NULL,
  geom = "logo",
  position = "logo",
  show.legend = NA,
  inherit.aes = TRUE,
  width = 0.9,
  na.rm = TRUE,
  ...
)

Format

An object of class StatLogo (inherits from Stat, ggproto, gg) of length 4.

Arguments

mapping

The aesthetic mapping, usually constructed with aes or aes_string. Only needs to be set at the layer level if you are overriding the plot defaults.

data

A layer specific dataset - only needed if you want to override the plot defaults,

geom

The geometric object to use display the data,

position

The position adjustment to use for overlappling points on this layer,

show.legend

Whether to show the legend or not

inherit.aes

Whether to inherit the aes or not

width

maximum width of the letters, defaults to 0.9,

na.rm

Whether to remove NAs or not

...

other arguments passed on to layer. This can include aesthetics whose values you want to set, not map. See layer for more details.

Value

proto object

A proto object

Examples

# See geom_logo for examples
# Generate data
data(sequences)
library(ggplot2)

ggplot(data = ggfortify(sequences, peptide)) +
  geom_logo(aes(x=position, y=bits, label=element,
                group=interaction(position, element)),
            alpha=0.5)