Skip to contents

This function generates a genetic linkage map visualization using ggplot2. It plots chromosomes as vertical or horizontal lines and displays markers as colored segments along each chromosome using the data structure built in R/qtl. Replaces plotMap which uses base R.

Usage

plotMap_gg(map, horizontal = FALSE, color = NULL)

Arguments

map

cross object representing a genetic map. The output of R/qtl's read.cross(), jittermap() or calc.genoprob()

  • If a cross object, the function extracts the map using pull.map().

horizontal

Logical. If TRUE, the map is plotted with chromosomes arranged horizontally. Default is FALSE (vertical layout).

color

Character. The color for the marker segments. Default is "red" if NULL.

Value

A ggplot2 object displaying the genetic map.

Examples


# Default plot (vertical)
# plotMap_gg(example_map)

# Horizontal plot with custom color
# plotMap_gg(example_map, horizontal = TRUE, color = "blue")