This function generates a BAF (B-allele frequency) plot for visualizing genomic data. It allows customization of dot size, expected and estimated peaks, centromere positions, and area colors.
plot_baf(
data_sample,
area_single,
ploidy,
dot.size = 1,
add_estimated_peaks = FALSE,
add_expected_peaks = FALSE,
centromeres = NULL,
add_centromeres = FALSE,
colors = FALSE,
font_size = 12
)A ggplot object representing the BAF plot.
A data.frame containing BAF and genomic position information. Must include columns `Chr`, `Position`, and `sample`.
Numeric value defining the area around the expected peak to be considered.
Integer or vector specifying the expected ploidy. If a vector, it must match the number of chromosomes in `data_sample`.
Numeric value for the size of the dots in the plot. Default is 1.
Logical. If TRUE, adds lines for estimated peaks. Default is FALSE.
Logical. If TRUE, adds lines for expected peaks. Default is FALSE.
Named vector defining centromere positions for each chromosome. Names must match chromosome IDs in `data_sample`.
Logical. If TRUE, adds vertical lines at centromere positions. Default is FALSE.
Logical. If TRUE, adds area colors to the plot. Default is FALSE.
Numeric value for the font size of plot labels. Default is 12.