density_plot: Plot of marker density along chromosome

View source: R/density_plot.R

density_plotR Documentation

Plot of marker density along chromosome

Description

This is a high-level function to plot marker density along the chromosome. This may help in identifying regions that are poorly covered by markers and is thus helpful for troubleshooting.

Usage

density_plot(snp_data, chr_length = NULL, center_pos = NULL)

Arguments

snp_data

A list comprising at least an element called Markers, a data.frame giving information about a set of markers. See read_hapmap and read_vcf for more information about the structure of snp_data.

chr_length

A numeric of length one. The length of the chromosome (in base pairs). This is used to set the plotting window of the x-axis from 0 to the length of the chromosome. If NULL (default), the plotting window will only cover those markers present in the dataset.

center_pos

A numeric of length one. The position of the center of the gene of interest (in base pairs). This is used to add a red vertical line at gene position. If NULL, no vertical line will be added.

Details

As the output of this function is a graphical object from package ggplot2, it is possible to customize the appearance of the graph and add layers to the graph using the syntax of this package.

Value

A graphical object inheriting from classes gg and ggplot from package ggplot2, which can be either assigned to an object or printed to a graphical device.

Examples

NULL


malemay/HaplotypeMiner documentation built on Feb. 6, 2024, 3:29 a.m.