map_to_grid: Subset a map to positions on a grid

View source: R/map_to_grid.R

map_to_gridR Documentation

Subset a map to positions on a grid

Description

Subset a map object to the locations on some grid.

Usage

map_to_grid(map, grid)

Arguments

map

A list of vectors of marker positions.

grid

A list of logical vectors (aligned with map), with TRUE indicating the position is on the grid.

Details

This is generally for the case of a map created with insert_pseudomarkers() with step>0 and stepwidth="fixed", so that the pseudomarkers form a grid along each chromosome.

Value

Same list as input, but subset to just include pseudomarkers along a grid.

See Also

calc_grid(), probs_to_grid()

Examples

grav2 <- read_cross2(system.file("extdata", "grav2.zip", package="qtl2"))
map_w_pmar <- insert_pseudomarkers(grav2$gmap, step=1)
sapply(map_w_pmar, length)
grid <- calc_grid(grav2$gmap, step=1)
map_sub <- map_to_grid(map_w_pmar, grid)
sapply(map_sub, length)

qtl2 documentation built on April 22, 2023, 1:10 a.m.