ggfanplot: Add "fanplot" to chromosome

View source: R/ggfanplot.R

ggfanplotR Documentation

Add "fanplot" to chromosome

Description

Add "fanplot" to chromosome. "fanplot" means repel annotation lines linking between original positions and annotations, named after the fan made by paper due to their similarity in appearance.

Usage

ggfanplot(
  p,
  plot_type = c("text", "shape", "textshape"),
  plot_direction = c("vertical", "horizontal"),
  fan_start = 0.8,
  fan_end = 3,
  tip_length = 0.2,
  ann_data = NULL,
  htext_direction = c("right", "left"),
  replusive = 1e+06,
  text_size = 1,
  text_color = "black",
  shape_size = 1,
  shape_color = "skyblue",
  shape_repel = 0.25,
  ...
)

Arguments

p

a ggplot object

plot_type

type of fanplot annotation, one of "text", "shape", and "textshape"

plot_direction

direction of chromosome, one of "vertical" and "horizontal"

fan_start

"fan" start position

fan_end

"fan" end position

tip_length

"fan" tip length, both sides are the same

ann_data

a data frame containing annotation information, colnames should be set as following:

  • For text type (in plot_type), first column is "Chr", second is "Pos", third is "Text", fouth is "TextSize", fifth is "TextColor", where fouth and fifth column is optional. When "TextSize" and "TextColor" are not given to each annotation, use global options from text_size and text_color.

  • For shape type, first column is "Chr", second is "Pos", third is "Shape", fouth is "ShapeSize", fifth is "ShapeColor", where fouth and fifth column is optional. When "ShapeSize" and "ShapeColor" are not given to each shape, use global options from shape_size and shape_color.

  • For textshape type, first column is "Chr", second is "Pos", third is "Text", fouth is "Shape", fifth is "TextSize", sixth is "TextColor", seventh is "ShapeSize", eighth is "ShapeColor", where 5-8 columns are optional.

htext_direction

from which side to read the text when chromosomes lying down (i.e. plot_direction = "horizontal"), one of "right" and "left"

replusive

replusive of texts or shapes, set according to chr length

text_size

global text size

text_color

global text color

shape_size

global shape size

shape_color

global shape color

shape_repel

shape repulsive from fan end, absolute length against x/y axis

...

currently ignored

Author(s)

Yujie Liu


liuyujie0136/tinyfuncr documentation built on Dec. 13, 2024, 8:49 a.m.