plotDosage: Draw line plots of allele dosage per marker per sample.

View source: R/PlotFunctions.R

plotDosageR Documentation

Draw line plots of allele dosage per marker per sample.

Description

This function counts a reference allele dosage per marker per sample and draw line plots of them in facets for each chromosome for each sample.

Usage

plotDosage(
  x,
  coord = NULL,
  chr = NULL,
  ind = 1,
  node = "raw",
  showratio = TRUE,
  dot_fill = c("green", "darkblue"),
  size = 0.8,
  alpha = 0.8,
  line_color = "magenta"
)

Arguments

x

A GbsrGenotypeData object.

coord

A vector with two integer specifying the number of rows and columns to draw faceted line plots for chromosomes.

chr

A vector of indexes to specify chromosomes to be drawn.

ind

An index to specify samples to be drawn.

node

Either one of "raw" or "filt" to output raw read data, or filtered read data, respectively.

showratio

If TRUE, draw dots indicating read ratio.

dot_fill

A vector of two strings to indicate the dot colors in the plot. The first and second elements of the vector are set as the colors for the lowest and highest values in the gradient coloring of the dots indicating total read counts par marker.

size

A positive number to indicate the dot size in a plot.

alpha

A positive number in 0-1 to indicate the dot opacity in a plot.

line_color

A string to indicate the line color in the plot.

Value

A ggplot object.

Examples

# Load data in the GDS file and instantiate a [GbsrGenotypeData] object.
gds_fn <- system.file("extdata", "sample.gds", package = "GBScleanR")
gds <- loadGDS(gds_fn)

plotDosage(gds, ind = 1)

# Close the connection to the GDS file
closeGDS(gds)


tomoyukif/GBScleanR documentation built on Oct. 31, 2024, 2:43 a.m.