loadMap: Load genetic map

View source: R/loadMap.R

loadMapR Documentation

Load genetic map

Description

Loads a genetic map from a tab-separated text file, or from the first sheet of an Excel file with extension .xlsx.

Usage

loadMap(path)

Arguments

path

Path to the map file, either as plain text or Excel.

Details

The file should contain columns Marker, Chr and cM (slight variations in column names are allowed). Chromosomes should be positive integers, optionally prefixed by "chr". Positions must be nonnegative numeric values. Both period and comma are accepted as decimal separators.

Value

A data frame with standardised column names and rows sorted by chromosome and position.

Examples

tmp = tempfile(fileext = ".map")
map1 = as.data.frame(norSTR::map50)
write.table(map1, tmp, sep = "\t", quote = FALSE, row.names = FALSE)

map2 = loadMap(tmp)
stopifnot(all.equal(map1, map2))


KLINK documentation built on Aug. 3, 2026, 5:07 p.m.