Creates a horizontal bar chart visualizing the distribution of SnpEff variant annotations, categorized by impact level (HIGH, MODERATE, LOW, MODIFIER). The chart displays the number of variants for each annotation type on a logarithmic scale.

plot_snpEff(file, cores = parallel::detectCores() - 1)

Arguments

file

Character; path to a tab-delimited SnpEff annotation file.

cores

Integer; number of CPU cores to use for parallel processing (default: one less than total cores).

Value

A ggplot2 object with a horizontal bar chart of SnpEff annotations.

Details

This function parses a SnpEff annotation file and counts occurrences of each annotation type. Annotations are categorized by impact level and displayed on a logarithmic scale. The function uses parallel processing to improve performance when handling large annotation files.

The color scheme is based on Wong's colorblind-friendly palette (Wong, B. Points of view: Color blindness. Nat Methods, 2011).

Examples

if (FALSE) { # \dontrun{
# Basic usage
plot_snpEff("path/to/snpeff_annotations.txt.gz")

# Specify number of cores for parallel processing
plot_snpEff("path/to/snpeff_annotations.txt.gz", cores = 4)
} # }