ggideogram: Plot ideogram and annotations on chromosome

View source: R/ggideogram.R

ggideogramR Documentation

Plot ideogram and annotations on chromosome

Description

Plot ideogram and annotations on chromosome. Annotations can be text (with different color/size), point (with different shape/size), or lines (i.e. values for each position).

Usage

ggideogram(
  karyotype_info,
  gff_file = NULL,
  slide_window = 1e+05,
  plot_direction = c("vertical", "horizontal"),
  chrom_display = c("gene_density", "border_only"),
  density_color = c("skyblue", "red"),
  circ_ratio = NULL,
  ann_type = c("none", "text", "shape", "textshape", "line", "multiline", "textline",
    "shapeline", "textshapeline"),
  ann_data = NULL,
  ggfanplot_args = list(htext_direction = c("right", "left"), replusive = 1e+06,
    text_size = 1, text_color = "black", shape_size = 1, shape_color = "skyblue",
    shape_repel = 0.25),
  ann_line_args = list(size = 0.4, color = "black", linetype = "solid")
)

Arguments

karyotype_info

tab-separated file (or a data frame) containing karyotype information, with first column being "Chr", second being "Start", third being "End". File should NOT have header.

gff_file

GFF file, used only when chrom_display = "gene_density"

slide_window

length of each slide window, defaut 100kb

plot_direction

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

chrom_display

method to display chromosome, one of "gene_density" and "border_only"

density_color

when chrom_display = "gene_density", set "low" and "high" color to display gene density (1st: "low", 2nd: "high"), used in scale_fill_gradient

circ_ratio

ratio to make chromosome endtip round, where x and y scale are not the same, change according to plot size

ann_type

type of annotation added to chromosome plot, one of "none", "text", "shape", "textshape", "line", "multiline", "textline", "shapeline", and "textshapeline"

ann_data

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

  • For text type (in ann_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 in ggfanplot_args.

  • 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 in ggfanplot_args.

  • 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.

  • For line type, first column is "Chr", second is "Pos", third is "Value"

  • For multiline type, first column is "Chr", second is "Pos", the rest columns are "Value"s, where "Value"s' name can be changed to any string to match its meaning

  • For textline type, first column is "Chr", second is "Pos", third is "Value", fouth is "Text", fifth is "TextSize", sixth is "TextColor", where 5-6 columns are optional.

  • For shapeline type, first column is "Chr", second is "Pos", third is "Value", fouth is "Shape", fifth is "ShapeSize", sixth is "ShapeColor", where 5-6 columns are optional.

  • For textshapeline type, first column is "Chr", second is "Pos", third is "Value", fouth is "Text", fifth is "Shape", sixth is "TextSize", seventh is "TextColor", eighth is "ShapeSize", nineth is "ShapeColor", where 6-9 columns are optional.

ggfanplot_args

args used in ggfanplot, see ggfanplot()

ann_line_args

args used in geom_path, see ggplot2::geom_path()

Author(s)

Yujie Liu


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