Skip to contents

This function can switch prevention of gene overlap on, adjust the spacing between tracks and alter the styling of specified clusters.

Usage

GC_cluster(
  GC_chart,
  separate_strands = NULL,
  strand_spacing = NULL,
  prevent_gene_overlap = NULL,
  overlap_spacing = NULL,
  cluster = NULL,
  style = list(),
  ...
)

Arguments

GC_chart

The gene chart object to be modified.

separate_strands

Logical, indicating whether to vertically separate forward and reverse genes.

strand_spacing

Numeric, specifies the spacing between genes on different strands. Used only if `separate_strands` is TRUE.

prevent_gene_overlap

Logical, indicating whether to vertically separate overlapping genes.

overlap_spacing

Numeric, specifies the spacing between overlapping genes Used only if `prevent_gene_overlap` is TRUE.

cluster

Optional; used to specify which clusters in the chart should have tooltips.

style

A list of CSS styles to be applied to the gene track. Each element of the list should be a valid CSS property-value pair. For example, list(backgroundColor = "red", color = "white").

...

Additional arguments to be passed to the underlying functions.

Value

Returns the modified gene chart object.

Examples

genes_data <- data.frame(
  start = c(1, 10, 200, 220, 600),
  end = c(10, 150, 180, 400, 400),
  name = c('Gene 1', 'Gene 2', 'Gene 3', 'Gene 4', 'Gene 5'),
  group = c('A', 'A', 'A', 'A', 'A')
)


GC_chart(genes_data, group = "group", height = "150px") %>%
  GC_cluster(separate_strands=TRUE, strand_spacing = 0) %>%
  GC_legend(FALSE)