Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

compare_maps

Compare two marker maps


Description

Compare two marker maps, identifying markers that are only in one of the two maps, or that are in different orders on the two maps.

Usage

compare_maps(map1, map2)

Arguments

map1

A list of numeric vectors; each vector gives marker positions for a single chromosome.

map2

A second map, in the same format as map1.

Value

A data frame containing

  • marker - marker name

  • chr_map1 - chromosome ID on map1

  • pos_map1 - position on map1

  • chr_map2 - chromosome ID on map2

  • pos_map2 - position on map2

Examples

# load some data
iron <- read_cross2( system.file("extdata", "iron.zip", package="qtl2") )
gmap <- iron$gmap
pmap <- iron$pmap

# omit a marker from each map
gmap[[7]] <- gmap[[7]][-3]
pmap[[8]] <- pmap[[8]][-7]
# swap order of a couple of markers on the physical map
names(pmap[[9]])[3:4] <- names(pmap[[9]])[4:3]
# move a marker to a different chromosome
pmap[[10]] <- c(pmap[[10]], pmap[[1]][2])[c(1,3,2)]
pmap[[1]] <- pmap[[1]][-2]

# compare these messed-up maps
compare_maps(gmap, pmap)

qtl2

Quantitative Trait Locus Mapping in Experimental Crosses

v0.24
GPL-3
Authors
Karl W Broman [aut, cre] (<https://orcid.org/0000-0002-4914-6671>), R Core Team [ctb]
Initial release
2020-12-16

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.