
Plot Distribution of Genes Across Phylostrata
Source:R/plot_distribution_strata.R
plot_distribution_strata.RdCreate a bar plot showing the distribution of genes across phylostrata, with options for showing observed vs. expected ratios.
Usage
plot_distribution_strata(
strata,
selected_gene_ids = names(strata),
as_log_obs_exp = FALSE
)Details
This function visualizes how genes are distributed across different phylostrata. When as_log_obs_exp=FALSE, it shows raw gene counts per stratum. When TRUE, it shows log2 ratios of observed vs. expected gene counts, useful for identifying enrichment or depletion of specific strata in gene sets.
Examples
# Plot raw gene counts by strata
p1 <- plot_distribution_strata(example_phyex_set@strata)
# Plot observed vs expected ratios for selected genes
p2 <- plot_distribution_strata(example_phyex_set@strata,
selected_gene_ids = example_phyex_set@gene_ids[5:20],
as_log_obs_exp = TRUE)
#> Warning: Ignoring unknown parameters: `size`