Skip to content

Update Grid Display of a GC Chart Cluster ​

Modify the grid display of specified clusters within a GC chart. This function allows users to adjust the margins, width, and height of the grid for each cluster.

Usage ​

r
GC_grid(
  GC_chart,
  margin = NULL,
  width = NULL,
  height = NULL,
  direction = "column",
  cluster = NULL
)

Arguments ​

ArgumentDescription
GC_chartA GC chart object.
marginA list specifying top, right, bottom, and left margins.
widthNumeric or character. Width of the chart, or with cluster of the selected clusters: a number of pixels, e.g. 600, or a string such as "80%" or "600px".
heightNumeric. Height of the grid.
directionCharacter. Layout direction of the grid, either "column" (default) for vertical or "row" for horizontal.
clusterNumeric or character vector. Clusters in the GC chart to update.

Value ​

Updated GC chart with new grid display settings.

Examples ​

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

# Set Margin of clusters
GC_chart(genes_data, cluster ="cluster", group = "group", height = "200px") %>%
GC_grid(margin = list(left = "50px", right = "0px"))

# Set height of a specific cluster
GC_chart(genes_data, cluster ="cluster", group = "group", height = "200px") %>%
GC_grid(height = "120px", cluster = 2)