Learn R Programming

XYomics (version 0.1.2)

plot_network: Plot a Condition-Specific protein-protein interaction network with DEG Annotations

Description

Visualizes a gene regulatory or protein–protein interaction network for a given cell type and differential expression group. Nodes are sized and colored by degree, and key hub genes are optionally annotated with their barplots of log fold-changes across sexes.

Usage

plot_network(g, cell_type, DEG_type, result_categories)

Value

A `ggplot` object representing the visualized network.

Arguments

g

An `igraph` object representing the gene or protein interaction network.

cell_type

Character string. The cell type label used in the plot title.

DEG_type

Character string. The differential expression category to visualize (e.g., `"sex-dimorphic"`).

result_categories

A `data.frame` or tibble containing at least the columns: `"DEG_Type"`, `"Gene_Symbols"`, `"Male_avg_logFC"`, and `"Female_avg_logFC"`.