Learn R Programming

TransProR (version 1.0.2)

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

Value

A ggtree object with added gene highlights.

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.

Examples

Run this code
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)

Run the code above in your browser using DataLab