Layer for Coverage Plot.

geom_coverage(
  data,
  mapping = NULL,
  color = NULL,
  rect.color = NA,
  single.nuc = FALSE,
  plot.type = c("facet", "joint"),
  facet.key = "Type",
  joint.avg = FALSE,
  facet.order = NULL,
  facet.color = NULL,
  facet.y.scale = c("free", "fixed"),
  group.key = "Group",
  range.size = 3,
  range.position = c("in", "out"),
  mark.region = NULL,
  mark.color = "grey",
  mark.alpha = 0.5,
  show.mark.label = TRUE,
  mark.label.size = 4
)

Arguments

data

Track prepared by FormatTrack.

mapping

Set of aesthetic mappings created by aes or aes_. Default: NULL.

color

Track color. Default: NULL (select automatically).

rect.color

The color of every bin. Default: NA.

single.nuc

Logical value, whether to visualize at single nucleotide level (use bar plot). Default: FALSE.

plot.type

The type of the plot, choose from facet (separate plot for every sample) and joint (combine all sample in a single plot). Default: facet.

facet.key

Sample type key to create coverage plot. Used in both facet and joint plot. Default: Type.

joint.avg

Logical value, whether to show average coverage across group.key. Default: FALSE.

facet.order

The order of coverage plot. Default: NULL.

facet.color

The color of sample text. Default: NULL (select automatically).

facet.y.scale

The shared type of y-axis scales across facets, choose from free (facets have different y-axis scales), fixed (facets have same y-axis scales). Default: free.

group.key

Group of samples. Default: NULL.

range.size

The label size of range text, used when range.position is in. Default: 3.

range.position

The position of y axis range, chosen from in (move y axis in the plot) and out (normal y axis). Default: in.

mark.region

Mark region on the plot. Default: NULL.

mark.color

The color of marked region. Default: "grey".

mark.alpha

The alpha of marked region. Default: 0.5.

show.mark.label

Logical value, whether to show mark label (use label column in mark.region). Default: TRUE.

mark.label.size

The label size of mark label. Default: 4.

Value

Layers of ggplot2.

Examples

# library(ggcoverage) # library(utils) # library(ggplot2) # meta.file <- system.file("extdata", "RNA-seq", "meta_info.csv", package = "ggcoverage") # sample.meta <- utils::read.csv(meta.file) # track folder # track.folder <- system.file("extdata", "RNA-seq", package = "ggcoverage") # load bigwig file # track.df <- LoadTrackFile( # track.folder = track.folder, format = "bw", # meta.info = sample.meta # ) # ggplot() + # geom_coverage(data = track.df, color = "auto", mark.region = NULL)