Learn R Programming

geneviewer (version 0.1.10)

GC_trackMouse: Track Mouse Movement in a GC_chart

Description

This function enables or disables mouse tracking on specified clusters within a GC chart. When enabled, the x and y coordinates of the mouse are displayed which can be used to place annotations.

Usage

GC_trackMouse(GC_chart, show = TRUE, cluster = NULL)

Value

Updated GC chart object with mouse tracking settings.

Arguments

GC_chart

A GC chart object to which the annotations will be added.

show

Logical, specifies whether to track the mouse or not.

cluster

Numeric or character vector specifying the clusters to which annotations should be added.

See Also

GC_annotation

Examples

Run this code
genes_data <- data.frame(
  start = c(10, 50, 90, 130, 170, 210),
  end = c(40, 80, 120, 160, 200, 240),
  name = c('Gene 1', 'Gene 2', 'Gene 3', 'Gene 4', 'Gene 5', 'Gene 6'),
  group = c('A', 'A', 'B', 'B', 'A', 'C'),
  cluster = c(1, 1, 1, 2, 2, 2)
)

# Enable mouse tracking
GC_chart(genes_data, cluster = "cluster", group = "group", height = "220px") %>%
GC_trackMouse()

Run the code above in your browser using DataLab