GC_sequence: Update Sequence Display of a GC Chart Cluster

View source: R/geneviewer.R

GC_sequenceR Documentation

Update Sequence Display of a GC Chart Cluster

Description

Modify the sequence display and break markers of specified clusters within a GC chart.

Usage

GC_sequence(
  GC_chart,
  show = TRUE,
  cluster = NULL,
  y = 50,
  sequenceStyle = list(),
  markerStyle = list(),
  ...
)

Arguments

GC_chart

A GC chart object.

show

Logical, whether to display the sequence (default is TRUE).

cluster

Numeric or character vector specifying clusters to update.

y

Vertical position of the sequence line (default is 50).

sequenceStyle

A list of styling options for the sequence line.

markerStyle

A list of styling options for the sequence break markers.

...

Additional customization arguments for sequence display.

Details

This function allows customization of the sequence line and break markers in a GC chart. It offers options to adjust the sequence line ('sequenceStyle') and break markers ('markerStyle'). The 'y' parameter can be used to set the vertical position of the sequence.

Value

An updated GC chart with modified sequence display settings.

Examples

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)
)

# Basic usage
GC_chart(genes_data, cluster ="cluster", group = "group", height = "200px") %>%
GC_labels("name") %>%
GC_sequence(show = TRUE, y = 50, cluster = NULL)

# Customize sequence and marker styles
GC_chart(genes_data, cluster="cluster", group = "group", height = "200px") %>%
  GC_scale(hidden = TRUE, scale_breaks = TRUE) %>%
  GC_sequence(
    start = NULL,
    end = NULL,
    sequenceStyle = list(
      stroke = "blue",
      strokeWidth = 1
      # Any other CSS style
    ),
    markerStyle = list(
      stroke = "blue",
      strokeWidth = 1,
      gap = 3,
      tiltAmount = 5
      # Any other CSS style
    )
  ) %>%
  GC_legend(FALSE)


geneviewer documentation built on April 12, 2025, 9:12 a.m.