gene_highlights: Add gene highlights to a ggtree object

View source: R/GeneHighlights.R

gene_highlightsR Documentation

Add gene highlights to a ggtree object

Description

This function enhances a 'ggtree' plot by adding highlights for specific genes. It adds both a semi-transparent fan-shaped highlight and a point at the node corresponding to each gene. Colors for each gene can be customized.

Usage

gene_highlights(ggtree_obj, genes_to_highlight, hilight_extend = 18)

Arguments

ggtree_obj

A ggtree object to which the highlights will be added.

genes_to_highlight

A data frame containing genes and their corresponding colors.

hilight_extend

Integer, the extension of the highlight fan in degrees.

Value

A ggtree object with added gene highlights.

Examples

data("gtree", package = "TransProR")

# Define genes and their colors
genes_df <- data.frame(Symble = c("t5", "t9"),
                       color = c("#FF0000", "#0000FF"))

# Add highlights
gtree <- gene_highlights(gtree, genes_to_highlight = genes_df)


TransProR documentation built on April 4, 2025, 3:16 a.m.