Skip to contents

Plots the counts of unique haplotype IDs found in each reference range.

Usage

plotHaploCounts(object, ...)

# S4 method for class 'PHGDataSet'
plotHaploCounts(object, gr = NULL, geom = "l")

Arguments

object

a PHGDataSet object

...

Additional arguments, for use in specific methods

gr

A GRanges object specifying a genomic range for filtering the haplotype data. If NULL, the function will plot the data across the entire dataset.

geom

A character string specifying the type of geometric representation for the plot. Accepted values are:

  • "l" for lines (default),

  • "b" for bars,

  • "p" for points.

If an invalid value is provided, the function will raise an error.

Value

A ggplot object visualizing the haplotype counts. When gr is NULL, the plot shows the number of unique haplotypes across reference positions. When gr is provided, the plot is filtered to display haplotype counts within the specified range.

Details

When no genomic range is provided (i.e., gr = NULL), the function plots the number of unique haplotypes across the entire reference genome or dataset. This will default to point geometry regardless of the value provided within the geom parameter. If a genomic range is provided, it filters the data based on overlaps between the reference ranges in the dataset and the query range. In both cases, the resulting plot uses ggplot2 for visualization, and different geometries can be selected via the geom parameter.